IOWA 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CONTRIBUTORS +14 -0
- data/README.md +23 -0
- data/RELEASE_NOTES +77 -0
- data/ToDo +21 -0
- data/components/CRUDList/CRUDList.html +13 -0
- data/components/CRUDList/CRUDList.iwa +136 -0
- data/components/Content/Content.html +0 -0
- data/components/Content/Content.iwa +143 -0
- data/components/Content/example/README +9 -0
- data/components/Content/example/cgi/iowa.cgi +10 -0
- data/components/Content/example/demo.rb +30 -0
- data/components/Content/example/doc/index.html +7 -0
- data/components/Content/example/iowa/Content.html +1 -0
- data/components/Content/example/iowa/Content.iwa +1 -0
- data/components/Content/example/iowa/Main.html +6 -0
- data/components/Content/example/iowa/Main.iwa +3 -0
- data/components/Content/example/iowa/_content/body +7 -0
- data/components/Content/example/iowa/_content/body2 +3 -0
- data/components/Content/example/iowa/_content/title +2 -0
- data/components/Content/example/iowa/app.cnf +8 -0
- data/components/Content/example/iowa/app.rb +8 -0
- data/components/Content/example/webrick.rb +38 -0
- data/components/Include/Include.html +1 -0
- data/components/Include/Include.iwa +30 -0
- data/components/Include/readme +5 -0
- data/components/JumpTo/JumpTo.html +8 -0
- data/components/JumpTo/JumpTo.iwa +8 -0
- data/components/JumpTo/readme +6 -0
- data/doc/Architecture.txt +6 -0
- data/doc/History.txt +33 -0
- data/doc/StandardDispatcher.txt +19 -0
- data/examples/blog/README +1 -0
- data/examples/hello_world/README +17 -0
- data/examples/hello_world/htdocs/hello_world_html.html +24 -0
- data/examples/hello_world/htdocs/hello_world_ruby.html +41 -0
- data/examples/hello_world/iowa/HelloWorld.html +14 -0
- data/examples/hello_world/iowa/HelloWorld.iwa +31 -0
- data/examples/hello_world/iowa/Index.html +16 -0
- data/examples/hello_world/iowa/Index.iwa +5 -0
- data/examples/hello_world/iowa/iowa_hello_world.cnf +19 -0
- data/examples/hello_world/iowa/iowa_hello_world.rb +5 -0
- data/examples/hello_world/iowa/mapfile.cnf +6 -0
- data/examples/hw1/iowa/Main.html +1 -0
- data/examples/hw1/iowa/README +9 -0
- data/examples/hw1/iowa/hw.rb +4 -0
- data/examples/hw2/iowa/Main.html +10 -0
- data/examples/hw2/iowa/Main.iwa +7 -0
- data/examples/hw2/iowa/README +16 -0
- data/examples/hw2/iowa/hw.rb +4 -0
- data/examples/hw3/iowa/Main.html +11 -0
- data/examples/hw3/iowa/Main.iwa +7 -0
- data/examples/hw3/iowa/README +22 -0
- data/examples/hw3/iowa/hw.rb +4 -0
- data/examples/hw4/iowa/Greetings.html +10 -0
- data/examples/hw4/iowa/Greetings.iwa +9 -0
- data/examples/hw4/iowa/Main.html +12 -0
- data/examples/hw4/iowa/Main.iwa +10 -0
- data/examples/hw4/iowa/README +28 -0
- data/examples/hw4/iowa/hw.rb +4 -0
- data/examples/hw5/iowa/Footer.html +2 -0
- data/examples/hw5/iowa/Greetings.html +4 -0
- data/examples/hw5/iowa/Greetings.iwa +12 -0
- data/examples/hw5/iowa/Header.html +6 -0
- data/examples/hw5/iowa/Main.html +12 -0
- data/examples/hw5/iowa/Main.iwa +13 -0
- data/examples/hw5/iowa/README +16 -0
- data/examples/hw5/iowa/hw.rb +4 -0
- data/examples/template_server/iowa/Content.iwa +121 -0
- data/examples/template_server/iowa/Content.view +0 -0
- data/examples/template_server/iowa/DBContentDispatcher.rb +112 -0
- data/examples/template_server/iowa/DBContentPage.html +3 -0
- data/examples/template_server/iowa/DBContentPage.iwa +85 -0
- data/examples/template_server/iowa/app.cnf +13 -0
- data/examples/template_server/iowa/app.rb +5 -0
- data/ext/Classifier/classifier.c +256 -0
- data/ext/Classifier/ext_help.h +14 -0
- data/ext/Classifier/extconf.rb +5 -0
- data/ext/Classifier/tst.h +40 -0
- data/ext/Classifier/tst_cleanup.c +24 -0
- data/ext/Classifier/tst_delete.c +146 -0
- data/ext/Classifier/tst_grow_node_free_list.c +38 -0
- data/ext/Classifier/tst_init.c +41 -0
- data/ext/Classifier/tst_insert.c +192 -0
- data/ext/Classifier/tst_search.c +68 -0
- data/ext/http11/README +11 -0
- data/ext/http11/ext_help.h +15 -0
- data/ext/http11/extconf.rb +5 -0
- data/ext/http11/http11.c +534 -0
- data/ext/http11/http11.c.dif +422 -0
- data/ext/http11/http11_parser.c +1243 -0
- data/ext/http11/http11_parser.c.dif +193 -0
- data/ext/http11/http11_parser.h +49 -0
- data/ext/http11/http11_parser.h.dif +20 -0
- data/ext/http11/http11_parser.rl +192 -0
- data/ext/httpmachine/Makefile +149 -0
- data/ext/httpmachine/extconf.rb +33 -0
- data/ext/httpmachine/http.cpp +430 -0
- data/ext/httpmachine/http.h +156 -0
- data/ext/httpmachine/rubyhttp.cpp +165 -0
- data/external/mime-types/LICENCE +18 -0
- data/external/mime-types/README +46 -0
- data/external/mime-types/doc/classes/MIME.html +120 -0
- data/external/mime-types/doc/classes/MIME/InvalidContentType.html +119 -0
- data/external/mime-types/doc/classes/MIME/Type.html +866 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000010.html +22 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000011.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000012.html +19 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000013.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000014.html +26 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000015.html +33 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000016.html +27 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000017.html +35 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000018.html +34 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000019.html +24 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000020.html +38 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000021.html +22 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000022.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000023.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000024.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000025.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000026.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000027.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000028.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000029.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000030.html +19 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000031.html +26 -0
- data/external/mime-types/doc/classes/MIME/Types.html +459 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000001.html +19 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000002.html +32 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000003.html +21 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000004.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000005.html +26 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000006.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000007.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000008.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000009.html +18 -0
- data/external/mime-types/doc/created.rid +1 -0
- data/external/mime-types/doc/files/ChangeLog.html +320 -0
- data/external/mime-types/doc/files/README.html +145 -0
- data/external/mime-types/doc/files/lib/mime/types_rb.html +101 -0
- data/external/mime-types/doc/fr_class_index.html +30 -0
- data/external/mime-types/doc/fr_file_index.html +29 -0
- data/external/mime-types/doc/fr_method_index.html +57 -0
- data/external/mime-types/doc/index.html +24 -0
- data/external/mime-types/doc/rdoc-style.css +208 -0
- data/external/mime-types/lib/mime/types.rb +1558 -0
- data/external/package.rb +672 -0
- data/external/test_support.rb +95 -0
- data/external/tmail/README +7 -0
- data/external/tmail/tmail.rb +4 -0
- data/external/tmail/tmail/address.rb +222 -0
- data/external/tmail/tmail/base64.rb +52 -0
- data/external/tmail/tmail/compat.rb +39 -0
- data/external/tmail/tmail/config.rb +50 -0
- data/external/tmail/tmail/encode.rb +447 -0
- data/external/tmail/tmail/header.rb +895 -0
- data/external/tmail/tmail/info.rb +14 -0
- data/external/tmail/tmail/loader.rb +1 -0
- data/external/tmail/tmail/mail.rb +869 -0
- data/external/tmail/tmail/mailbox.rb +386 -0
- data/external/tmail/tmail/mbox.rb +1 -0
- data/external/tmail/tmail/net.rb +260 -0
- data/external/tmail/tmail/obsolete.rb +123 -0
- data/external/tmail/tmail/parser.rb +1475 -0
- data/external/tmail/tmail/parser.y +372 -0
- data/external/tmail/tmail/port.rb +356 -0
- data/external/tmail/tmail/scanner.rb +17 -0
- data/external/tmail/tmail/scanner_r.rb +243 -0
- data/external/tmail/tmail/stringio.rb +256 -0
- data/external/tmail/tmail/textutils.rb +197 -0
- data/external/tmail/tmail/tmail.rb +1 -0
- data/external/tmail/tmail/utils.rb +23 -0
- data/external/win32-process/README +133 -0
- data/external/win32-process/lib/win32/process.rb +561 -0
- data/external/windows-pr/README +145 -0
- data/external/windows-pr/doc/conversion_guide.txt +25 -0
- data/external/windows-pr/lib/windows/clipboard.rb +72 -0
- data/external/windows-pr/lib/windows/console.rb +323 -0
- data/external/windows-pr/lib/windows/device_io.rb +88 -0
- data/external/windows-pr/lib/windows/directory.rb +80 -0
- data/external/windows-pr/lib/windows/error.rb +313 -0
- data/external/windows-pr/lib/windows/eventlog.rb +120 -0
- data/external/windows-pr/lib/windows/file.rb +349 -0
- data/external/windows-pr/lib/windows/filesystem.rb +16 -0
- data/external/windows-pr/lib/windows/handle.rb +31 -0
- data/external/windows-pr/lib/windows/library.rb +76 -0
- data/external/windows-pr/lib/windows/limits.rb +13 -0
- data/external/windows-pr/lib/windows/memory.rb +117 -0
- data/external/windows-pr/lib/windows/msvcrt/buffer.rb +48 -0
- data/external/windows-pr/lib/windows/msvcrt/file.rb +18 -0
- data/external/windows-pr/lib/windows/msvcrt/string.rb +46 -0
- data/external/windows-pr/lib/windows/national.rb +557 -0
- data/external/windows-pr/lib/windows/path.rb +296 -0
- data/external/windows-pr/lib/windows/pipe.rb +77 -0
- data/external/windows-pr/lib/windows/process.rb +171 -0
- data/external/windows-pr/lib/windows/registry.rb +238 -0
- data/external/windows-pr/lib/windows/security.rb +89 -0
- data/external/windows-pr/lib/windows/service.rb +183 -0
- data/external/windows-pr/lib/windows/shell.rb +88 -0
- data/external/windows-pr/lib/windows/sound.rb +52 -0
- data/external/windows-pr/lib/windows/synchronize.rb +161 -0
- data/external/windows-pr/lib/windows/system_info.rb +70 -0
- data/external/windows-pr/lib/windows/unicode.rb +138 -0
- data/external/windows-pr/lib/windows/window.rb +22 -0
- data/iowa.gemspec +45 -0
- data/microprojects/DiskCache/LICENSE +28 -0
- data/microprojects/DiskCache/README +17 -0
- data/microprojects/DiskCache/external/package.rb +608 -0
- data/microprojects/DiskCache/external/test_support.rb +8 -0
- data/microprojects/DiskCache/setup.rb +22 -0
- data/microprojects/DiskCache/src/iowa/Association.rb +67 -0
- data/microprojects/DiskCache/src/iowa/Constants.rb +159 -0
- data/microprojects/DiskCache/src/iowa/DiskStore.rb +377 -0
- data/microprojects/DiskCache/src/iowa/Hash.rb +63 -0
- data/microprojects/DiskCache/src/iowa/Lockfile.rb +575 -0
- data/microprojects/DiskCache/src/iowa/Mutex.rb +142 -0
- data/microprojects/DiskCache/src/iowa/caches/DiskCache.rb +605 -0
- data/microprojects/DiskCache/src/iowa/caches/LRUCache.rb +287 -0
- data/microprojects/DiskCache/test/TC_DiskCache.rb +218 -0
- data/microprojects/LRUCache/LICENSE +28 -0
- data/microprojects/LRUCache/README +13 -0
- data/microprojects/LRUCache/external/package.rb +608 -0
- data/microprojects/LRUCache/external/test_support.rb +8 -0
- data/microprojects/LRUCache/setup.rb +22 -0
- data/microprojects/LRUCache/src/iowa/Association.rb +57 -0
- data/microprojects/LRUCache/src/iowa/Constants.rb +159 -0
- data/microprojects/LRUCache/src/iowa/Hash.rb +63 -0
- data/microprojects/LRUCache/src/iowa/Mutex.rb +129 -0
- data/microprojects/LRUCache/src/iowa/caches/LRUCache.rb +287 -0
- data/microprojects/LRUCache/test/TC_LRUCache.rb +65 -0
- data/microprojects/LinkedList/LICENSE +28 -0
- data/microprojects/LinkedList/README +13 -0
- data/microprojects/LinkedList/external/package.rb +608 -0
- data/microprojects/LinkedList/external/test_support.rb +8 -0
- data/microprojects/LinkedList/setup.rb +22 -0
- data/microprojects/LinkedList/src/iowa/LinkedList.rb +165 -0
- data/microprojects/LinkedList/test/TC_LinkedList.rb +42 -0
- data/microprojects/README +8 -0
- data/setup.rb +116 -0
- data/share/iowa/app_skeleton/Main.html +8 -0
- data/share/iowa/app_skeleton/Main.iwa +15 -0
- data/share/iowa/app_skeleton/app.cnf +48 -0
- data/share/iowa/app_skeleton/app.rb +58 -0
- data/share/iowa/app_skeleton/models/model.rb +49 -0
- data/src/ihc.rb +223 -0
- data/src/iowa.cgi +29 -0
- data/src/iowa.rb +637 -0
- data/src/iowa/AbstractCache.rb +96 -0
- data/src/iowa/AcceptLanguage.rb +76 -0
- data/src/iowa/Application.rb +928 -0
- data/src/iowa/ApplicationStats.rb +72 -0
- data/src/iowa/Association.rb +67 -0
- data/src/iowa/BindingsParser.rb +62 -0
- data/src/iowa/Breakpoint.rb +273 -0
- data/src/iowa/CSS.rb +564 -0
- data/src/iowa/Client.rb +192 -0
- data/src/iowa/Component.rb +405 -0
- data/src/iowa/ComponentProxy.rb +26 -0
- data/src/iowa/Config.rb +21 -0
- data/src/iowa/Constants.rb +226 -0
- data/src/iowa/Context.rb +218 -0
- data/src/iowa/ContextLogger.rb +16 -0
- data/src/iowa/DbPool.rb +222 -0
- data/src/iowa/DetachedComponent.rb +18 -0
- data/src/iowa/Dispatcher.rb +27 -0
- data/src/iowa/DynamicElements.rb +471 -0
- data/src/iowa/Element.rb +100 -0
- data/src/iowa/Email.rb +287 -0
- data/src/iowa/Extensions/AllExtensions.rb +4 -0
- data/src/iowa/Extensions/Class.rb +94 -0
- data/src/iowa/Extensions/Date.rb +88 -0
- data/src/iowa/Extensions/DateTime.rb +88 -0
- data/src/iowa/Extensions/Hash.rb +22 -0
- data/src/iowa/Extensions/Kernel.rb +6 -0
- data/src/iowa/Extensions/Numeric.rb +47 -0
- data/src/iowa/Extensions/Object.rb +11 -0
- data/src/iowa/Extensions/String.rb +60 -0
- data/src/iowa/Extensions/Time.rb +89 -0
- data/src/iowa/Extensions/TimeExtensions.rb +6 -0
- data/src/iowa/Form.rb +368 -0
- data/src/iowa/Hash.rb +85 -0
- data/src/iowa/ISAAC.rb +175 -0
- data/src/iowa/ImageSize.rb +279 -0
- data/src/iowa/IowaComponentMixins.rb +7 -0
- data/src/iowa/JSON-lexer.rb +296 -0
- data/src/iowa/JSON-objects.rb +201 -0
- data/src/iowa/KeyValueCoding.rb +91 -0
- data/src/iowa/LinkedList.rb +175 -0
- data/src/iowa/Loader.rb +22 -0
- data/src/iowa/Lockfile.rb +575 -0
- data/src/iowa/Logger.rb +74 -0
- data/src/iowa/Monkey.rb +20 -0
- data/src/iowa/Mutex.rb +142 -0
- data/src/iowa/Policy.rb +70 -0
- data/src/iowa/Pool.rb +243 -0
- data/src/iowa/PrettyException.rb +1091 -0
- data/src/iowa/Request.rb +244 -0
- data/src/iowa/Response.rb +133 -0
- data/src/iowa/Session.rb +354 -0
- data/src/iowa/SessionStats.rb +78 -0
- data/src/iowa/String.rb +65 -0
- data/src/iowa/Tag.rb +101 -0
- data/src/iowa/TemplateParser.rb +236 -0
- data/src/iowa/Util.rb +314 -0
- data/src/iowa/Webcache.rb +122 -0
- data/src/iowa/caches/BiLevelCache.rb +65 -0
- data/src/iowa/caches/ClassLimitedCache.rb +67 -0
- data/src/iowa/caches/DiskCache.rb +609 -0
- data/src/iowa/caches/DiskStore.rb +380 -0
- data/src/iowa/caches/LRUCache-alternative.rb +155 -0
- data/src/iowa/caches/LRUCache.rb +290 -0
- data/src/iowa/caches/SimpleLRUCache.rb +112 -0
- data/src/iowa/dispatchers/StandardDispatcher.rb +396 -0
- data/src/iowa/dispatchers/StandardDispatcherWithClassifier.rb +93 -0
- data/src/iowa/js/iowa_jsonrpc.js +381 -0
- data/src/iowa/js/jsonrpc.js +187 -0
- data/src/iowa/js/jsonrpc_async.js +261 -0
- data/src/iowa/loaders/DiskLoader.rb +50 -0
- data/src/iowa/loggers/Analogger.rb +54 -0
- data/src/iowa/loggers/AsyncLogger.rb +54 -0
- data/src/iowa/loggers/BitBucket.rb +38 -0
- data/src/iowa/loggers/Log4R.rb +13 -0
- data/src/iowa/loggers/Log4rLogger.rb +48 -0
- data/src/iowa/loggers/Logger.rb +29 -0
- data/src/iowa/loggers/RubyLogger.rb +9 -0
- data/src/iowa/pools/DBConnectionPool.rb +53 -0
- data/src/iowa/request/Apache.rb +90 -0
- data/src/iowa/request/EMHybrid.rb +59 -0
- data/src/iowa/request/ENV.rb +80 -0
- data/src/iowa/request/FCGI.rb +68 -0
- data/src/iowa/request/HTTPMachine.rb +75 -0
- data/src/iowa/request/Mongrel.rb +68 -0
- data/src/iowa/request/WEBrick.rb +48 -0
- data/src/iowa/version.rb +3 -0
- data/src/iowa/webrick/HTTPServer.rb +43 -0
- data/src/iowa/webrick/WEBrickServlet.rb +28 -0
- data/src/iowa_fcgi_handler.rb +101 -0
- data/src/iowa_httpmachine.rb +141 -0
- data/src/iowa_hybrid.rb +193 -0
- data/src/iowa_hybrid_cluster.rb +231 -0
- data/src/iowa_mongrel.rb +136 -0
- data/src/iowa_webrick.rb +194 -0
- data/src/iowa_webrick_legacy.rb +104 -0
- data/src/mod_iowa.rb +104 -0
- data/tcss.rb +61 -0
- data/test/README.windows +12 -0
- data/test/TC_AcceptLanguage.rb +61 -0
- data/test/TC_AppConfig.rb +43 -0
- data/test/TC_AppConfig/cgi/iowa.cgi +7 -0
- data/test/TC_AppConfig/doc/index.html +1 -0
- data/test/TC_AppConfig/iowa/Main.html +4 -0
- data/test/TC_AppConfig/iowa/Main.iwa +17 -0
- data/test/TC_AppConfig/iowa/README +1 -0
- data/test/TC_AppConfig/iowa/app.cnf +19 -0
- data/test/TC_AppConfig/iowa/app.rb +8 -0
- data/test/TC_AppConfig/webrick.rb +38 -0
- data/test/TC_Association.rb +29 -0
- data/test/TC_BiLevelCache.rb +71 -0
- data/test/TC_CGI_Adaptor.rb +55 -0
- data/test/TC_CGI_Adaptor/cgi/iowa.cgi +7 -0
- data/test/TC_CGI_Adaptor/doc/index.html +1 -0
- data/test/TC_CGI_Adaptor/iowa/Main.html +8 -0
- data/test/TC_CGI_Adaptor/iowa/Main.iwa +14 -0
- data/test/TC_CGI_Adaptor/iowa/README +1 -0
- data/test/TC_CGI_Adaptor/iowa/app.cnf +8 -0
- data/test/TC_CGI_Adaptor/iowa/app.rb +8 -0
- data/test/TC_CGI_Adaptor/webrick.rb +38 -0
- data/test/TC_CSS.rb +660 -0
- data/test/TC_ClassLimitedCache.rb +89 -0
- data/test/TC_Classifier.rb +80 -0
- data/test/TC_DbPool.rb +127 -0
- data/test/TC_DiskCache.rb +218 -0
- data/test/TC_Hybrid.rb +58 -0
- data/test/TC_Hybrid/doc/thing.txt +1 -0
- data/test/TC_Hybrid/iowa/Main.html +3 -0
- data/test/TC_Hybrid/iowa/Main.iwa +7 -0
- data/test/TC_Hybrid/iowa/NewPage.html +1 -0
- data/test/TC_Hybrid/iowa/NewPage.iwa +5 -0
- data/test/TC_Hybrid/iowa/app.cnf +10 -0
- data/test/TC_Hybrid/iowa/app.rb +5 -0
- data/test/TC_IOWAFunctions/doc/Ajax1.html +1 -0
- data/test/TC_IOWAFunctions/doc/Ajax1.iwa +1 -0
- data/test/TC_IOWAFunctions/doc/index.html +1 -0
- data/test/TC_IOWAFunctions/doc/js/dojo.js +9686 -0
- data/test/TC_IOWAFunctions/iowa/Ajax1.html +40 -0
- data/test/TC_IOWAFunctions/iowa/Ajax1.iwa +23 -0
- data/test/TC_IOWAFunctions/iowa/AjaxWidget.iwa +19 -0
- data/test/TC_IOWAFunctions/iowa/AjaxWidget.view +22 -0
- data/test/TC_IOWAFunctions/iowa/DanielTest.html +9 -0
- data/test/TC_IOWAFunctions/iowa/DanielTest.iwa +10 -0
- data/test/TC_IOWAFunctions/iowa/IntervalWidget.html +1 -0
- data/test/TC_IOWAFunctions/iowa/IntervalWidget.iwa +14 -0
- data/test/TC_IOWAFunctions/iowa/Main.html +1 -0
- data/test/TC_IOWAFunctions/iowa/NestedRepeat1.html +12 -0
- data/test/TC_IOWAFunctions/iowa/NestedRepeat1.iwa +24 -0
- data/test/TC_IOWAFunctions/iowa/RPCResponse.iwa +7 -0
- data/test/TC_IOWAFunctions/iowa/RPCResponse.view +1 -0
- data/test/TC_IOWAFunctions/iowa/Repeat1.iwa +31 -0
- data/test/TC_IOWAFunctions/iowa/Repeat1.view +9 -0
- data/test/TC_IOWAFunctions/iowa/Repeat2.iwa +32 -0
- data/test/TC_IOWAFunctions/iowa/Repeat2.view +11 -0
- data/test/TC_IOWAFunctions/iowa/Repeat3.iwa +44 -0
- data/test/TC_IOWAFunctions/iowa/Repeat3.view +18 -0
- data/test/TC_IOWAFunctions/iowa/TesCon.html +1 -0
- data/test/TC_IOWAFunctions/iowa/TesCon.iwa +5 -0
- data/test/TC_IOWAFunctions/iowa/app.cnf +19 -0
- data/test/TC_IOWAFunctions/iowa/app.rb +9 -0
- data/test/TC_IOWAFunctions/iowa/mapfile.cnf +8 -0
- data/test/TC_ISAAC.rb +52 -0
- data/test/TC_ImageSize.rb +84 -0
- data/test/TC_ImageSize/img.bmp +0 -0
- data/test/TC_ImageSize/img.gif +0 -0
- data/test/TC_ImageSize/img.jpg +0 -0
- data/test/TC_ImageSize/img.pcx +0 -0
- data/test/TC_ImageSize/img.pgm +7144 -0
- data/test/TC_ImageSize/img.png +0 -0
- data/test/TC_ImageSize/img.ppm +0 -0
- data/test/TC_ImageSize/img.psd +0 -0
- data/test/TC_ImageSize/img.tiff +0 -0
- data/test/TC_ImageSize/img.xbm +22 -0
- data/test/TC_KeyValueCoding.rb +35 -0
- data/test/TC_LRUCache.rb +296 -0
- data/test/TC_LinkedList.rb +46 -0
- data/test/TC_Lockfile.rb +106 -0
- data/test/TC_Minimal.rb +45 -0
- data/test/TC_Minimal/app.cnf +8 -0
- data/test/TC_Minimal/cgi-bin/iowa.cgi +11 -0
- data/test/TC_Minimal/doc/index.html +1 -0
- data/test/TC_Minimal/iowa/Main.html +1 -0
- data/test/TC_Minimal/iowa/README +1 -0
- data/test/TC_Minimal/iowa/app.rb +3 -0
- data/test/TC_Minimal/webrick.rb +38 -0
- data/test/TC_Mongrel.rb +58 -0
- data/test/TC_Mongrel/doc/thing.txt +1 -0
- data/test/TC_Mongrel/iowa/Main.html +3 -0
- data/test/TC_Mongrel/iowa/Main.iwa +7 -0
- data/test/TC_Mongrel/iowa/NewPage.html +1 -0
- data/test/TC_Mongrel/iowa/NewPage.iwa +5 -0
- data/test/TC_Mongrel/iowa/app.cnf +10 -0
- data/test/TC_Mongrel/iowa/app.rb +5 -0
- data/test/TC_NoSubclass.rb +56 -0
- data/test/TC_NoSubclass/cgi/iowa.cgi +7 -0
- data/test/TC_NoSubclass/doc/index.html +1 -0
- data/test/TC_NoSubclass/iowa/Main.html +8 -0
- data/test/TC_NoSubclass/iowa/Main.iwa +14 -0
- data/test/TC_NoSubclass/iowa/README +1 -0
- data/test/TC_NoSubclass/iowa/app.cnf +8 -0
- data/test/TC_NoSubclass/iowa/app.rb +5 -0
- data/test/TC_NoSubclass/webrick.rb +38 -0
- data/test/TC_Pool.rb +139 -0
- data/test/TC_RenderedCache/doc/thing.txt +1 -0
- data/test/TC_RenderedCache/iowa/BigPage.html +1 -0
- data/test/TC_RenderedCache/iowa/BigPage.iwa +12 -0
- data/test/TC_RenderedCache/iowa/Main.html +3 -0
- data/test/TC_RenderedCache/iowa/Main.iwa +7 -0
- data/test/TC_RenderedCache/iowa/NewPage.html +1 -0
- data/test/TC_RenderedCache/iowa/NewPage.iwa +11 -0
- data/test/TC_RenderedCache/iowa/app.cnf +13 -0
- data/test/TC_RenderedCache/iowa/app.rb +5 -0
- data/test/TC_RenderedCache/iowa/mapfile.map +4 -0
- data/test/TC_ResourceURL.rb +73 -0
- data/test/TC_ResourceURL/iowa/Main.html +2 -0
- data/test/TC_ResourceURL/iowa/Main.iwa +10 -0
- data/test/TC_ResourceURL/iowa/app.cnf +10 -0
- data/test/TC_ResourceURL/iowa/app.rb +5 -0
- data/test/TC_SimpleDetached.rb +41 -0
- data/test/TC_StandardDispatcher.rb +362 -0
- data/test/TC_StandardDispatcherWithClassifier.rb +358 -0
- data/test/TC_String.rb +24 -0
- data/test/TC_Tag.rb +41 -0
- data/test/TC_Webrick.rb +56 -0
- data/test/TC_Webrick/doc/thing.txt +1 -0
- data/test/TC_Webrick/iowa/Main.html +3 -0
- data/test/TC_Webrick/iowa/Main.iwa +7 -0
- data/test/TC_Webrick/iowa/NewPage.html +1 -0
- data/test/TC_Webrick/iowa/NewPage.iwa +5 -0
- data/test/TC_Webrick/iowa/app.cnf +10 -0
- data/test/TC_Webrick/iowa/app.rb +5 -0
- data/test/tc_template.rb +15 -0
- data/test/tests.conf +19 -0
- data/utils/CVS/Entries +3 -0
- data/utils/CVS/Repository +1 -0
- data/utils/CVS/Root +1 -0
- data/utils/QuickCert-1.0.2.tar.gz +0 -0
- data/utils/QuickCert-1.0.2/InstalledFiles +7 -0
- data/utils/QuickCert-1.0.2/MANIFEST +10 -0
- data/utils/QuickCert-1.0.2/Makefile +15 -0
- data/utils/QuickCert-1.0.2/README +56 -0
- data/utils/QuickCert-1.0.2/bin/QuickCert +355 -0
- data/utils/QuickCert-1.0.2/config.save +12 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/README +60 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_c.rb +26 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_s.rb +35 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/qc_config +21 -0
- data/utils/QuickCert-1.0.2/lib/QuickCert/defaults.rb +28 -0
- data/utils/QuickCert-1.0.2/setup.rb +1312 -0
- data/utils/iowa_apps +422 -0
- data/utils/smtp_sink.rb +9 -0
- data/utils/startup_template.cnf +27 -0
- data/utils/startup_template.rb +73 -0
- metadata +551 -0
data/tcss.rb
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
require 'iowa/CSS'
|
|
2
|
+
|
|
3
|
+
a = Iowa::CSS.new
|
|
4
|
+
b = <<ECSS
|
|
5
|
+
Media.screen {
|
|
6
|
+
h1 {
|
|
7
|
+
color 'blue'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
head_2 = h2 {
|
|
11
|
+
color 'green'
|
|
12
|
+
font_weight 'italic'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
Id.content {
|
|
16
|
+
Class.foo {
|
|
17
|
+
border 3.px
|
|
18
|
+
color head_2.color
|
|
19
|
+
}
|
|
20
|
+
font_face 'verdana'
|
|
21
|
+
table {
|
|
22
|
+
width 100
|
|
23
|
+
Class.special {
|
|
24
|
+
background_color 'grey'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
p {
|
|
30
|
+
quote {
|
|
31
|
+
font_style 'italic'
|
|
32
|
+
color 'green'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
p {
|
|
37
|
+
universal {
|
|
38
|
+
quote {
|
|
39
|
+
z = font {
|
|
40
|
+
style 'italic'
|
|
41
|
+
weight 'bold'
|
|
42
|
+
}
|
|
43
|
+
color 'green'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
universal {
|
|
49
|
+
Class.smaller {font_size 85.pct}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
p { p {
|
|
53
|
+
font {
|
|
54
|
+
size 10.pt + 2
|
|
55
|
+
}}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
ECSS
|
|
59
|
+
a.parse b
|
|
60
|
+
puts a
|
|
61
|
+
puts "done"
|
data/test/README.windows
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
To run the TC_AppConfig, TC_CGI_Adaptor, and TC_NoSubclass tests on Windows machines,
|
|
2
|
+
the win32/process library must be installed.
|
|
3
|
+
|
|
4
|
+
This can be found on Rubyforge at http://rubyforge.org/projects/win32utils.
|
|
5
|
+
|
|
6
|
+
If you use rubygems, it can be installed with:
|
|
7
|
+
|
|
8
|
+
gem install win32-process
|
|
9
|
+
|
|
10
|
+
If you do not have them installed, the IOWA installed will detect this and install
|
|
11
|
+
versions bundled in the distribution.
|
|
12
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require 'external/test_support'
|
|
3
|
+
require 'iowa/AcceptLanguage'
|
|
4
|
+
require 'benchmark'
|
|
5
|
+
|
|
6
|
+
class TC_AcceptLanguage < Test::Unit::TestCase
|
|
7
|
+
|
|
8
|
+
def setup_al(al)
|
|
9
|
+
al['en-us'] = 'EN-US'
|
|
10
|
+
al['en'] = 'EN'
|
|
11
|
+
al['es'] = 'ES'
|
|
12
|
+
al['es-es'] = 'ES-ES'
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def setup
|
|
16
|
+
IWATestSupport.announce(:acceptlanguage,"Accept Language Parser")
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def test_a
|
|
20
|
+
al = nil
|
|
21
|
+
assert_nothing_raised("Error creating an AcceptLanguage object.") do
|
|
22
|
+
al = Iowa::AcceptLanguage.new
|
|
23
|
+
end
|
|
24
|
+
assert_nothing_raised("Error assigning to an AcceptLanguage object.") do
|
|
25
|
+
setup_al(al)
|
|
26
|
+
end
|
|
27
|
+
assert_equal(['en','en-us','es','es-es'],al.languages.sort,"The list of accepted languages does not match what was expected.")
|
|
28
|
+
|
|
29
|
+
l = 'es-es,es;q=0.8,en-us;q=0.5,en;q=0.3'
|
|
30
|
+
assert_equal('ES-ES',al.match(l))
|
|
31
|
+
|
|
32
|
+
m = 'es-mx,es;q=0.8,en-us;q=0.5,en;q=0.3'
|
|
33
|
+
assert_equal('ES',al.match(m))
|
|
34
|
+
|
|
35
|
+
n = 'en-us,es;q=0.1'
|
|
36
|
+
assert_equal('EN-US',al.match(n))
|
|
37
|
+
|
|
38
|
+
o = 'en-gb,en;q=0.3'
|
|
39
|
+
assert_equal('EN',al.match(o))
|
|
40
|
+
|
|
41
|
+
p = 'en-gb'
|
|
42
|
+
assert_equal('EN',al.match(p))
|
|
43
|
+
|
|
44
|
+
puts "\nBenchmarking AcceptLanguage..."
|
|
45
|
+
Benchmark.benchmark do |bm|
|
|
46
|
+
bm.report do
|
|
47
|
+
20000.times do
|
|
48
|
+
al.match(l)
|
|
49
|
+
al.match(m)
|
|
50
|
+
al.match(n)
|
|
51
|
+
al.match(o)
|
|
52
|
+
al.match(p)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require 'external/test_support'
|
|
3
|
+
IWATestSupport.set_src_dir
|
|
4
|
+
require 'rbconfig'
|
|
5
|
+
require 'net/http'
|
|
6
|
+
|
|
7
|
+
class TC_AppConfig < Test::Unit::TestCase
|
|
8
|
+
|
|
9
|
+
@@testdir = IWATestSupport.test_dir(__FILE__)
|
|
10
|
+
def setup
|
|
11
|
+
Dir.chdir(@@testdir)
|
|
12
|
+
IWATestSupport.announce(:appconfig,"Iowa App Configuration")
|
|
13
|
+
|
|
14
|
+
ruby = File.join(::Config::CONFIG['bindir'],::Config::CONFIG['ruby_install_name'])
|
|
15
|
+
ruby << ::Config::CONFIG['EXEEXT']
|
|
16
|
+
|
|
17
|
+
assert_nothing_raised("setup failed") do
|
|
18
|
+
@iowa_pid = IWATestSupport::create_process(:dir => 'TC_AppConfig/iowa',
|
|
19
|
+
:cmd => [ruby,'-I../../../src','app.rb'])
|
|
20
|
+
sleep 1
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def teardown
|
|
25
|
+
Process.kill "SIGKILL",@iowa_pid
|
|
26
|
+
Process.wait @iowa_pid
|
|
27
|
+
sleep 1
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def get_url(hostname,port,url)
|
|
31
|
+
Net::HTTP.start(hostname,port) {|http| http.get(url)}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def testGetConfig
|
|
35
|
+
assert_nothing_raised("Error trying to send request to iowa app via CGI adaptor.") do
|
|
36
|
+
response = get_url('127.0.0.1','47990','/cgi/iowa.cgi')
|
|
37
|
+
puts response.body
|
|
38
|
+
assert(response.body =~ /"maxsize"=>200/, "The response returned from the iowa app has a malformed sessioncache entry.")
|
|
39
|
+
assert(response.body =~ /Policy: Iowa::Policy/, "The response returned indicates that the Policy setting was not handled correctly.")
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
test
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class Main < Iowa::Component
|
|
2
|
+
def config
|
|
3
|
+
Iowa.config.inspect
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
def scache
|
|
7
|
+
Iowa.app.class.SessionCache.class.name
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def dispatcher
|
|
11
|
+
Iowa.app.class.Dispatcher.class.name
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def policy
|
|
15
|
+
Iowa.app.class.Policy.class.name
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This is a minimal app for testing purposes.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
socket:
|
|
2
|
+
hostname: 127.0.0.1
|
|
3
|
+
port: 47990
|
|
4
|
+
logging:
|
|
5
|
+
class: Logger
|
|
6
|
+
basedir: ../log
|
|
7
|
+
minlevel: 0
|
|
8
|
+
maxsize: 10000000
|
|
9
|
+
maxage: 86400
|
|
10
|
+
application:
|
|
11
|
+
daemonize: false
|
|
12
|
+
sessioncache:
|
|
13
|
+
class: LRUCache
|
|
14
|
+
maxsize: 200
|
|
15
|
+
ttl: 3600
|
|
16
|
+
dispatcher:
|
|
17
|
+
class: iowa/Dispatcher
|
|
18
|
+
policy:
|
|
19
|
+
class: iowa/Policy
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require 'rbconfig'
|
|
2
|
+
require 'webrick'
|
|
3
|
+
|
|
4
|
+
class HTTPServer < WEBrick::HTTPServer
|
|
5
|
+
|
|
6
|
+
def service(req,res)
|
|
7
|
+
if req.unparsed_uri == "*"
|
|
8
|
+
if req.request_method == "OPTIONS"
|
|
9
|
+
do_OPTIONS(req, res)
|
|
10
|
+
raise ::HTTPStatus::OK
|
|
11
|
+
end
|
|
12
|
+
raise ::HTTPStatus::NotFound, "`#{req.unparsed_uri}' not found."
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
servlet = options = script_name = path_info = nil
|
|
16
|
+
servlet, options, script_name, path_info = search_servlet(req.path)
|
|
17
|
+
|
|
18
|
+
raise ::HTTPStatus::NotFound, "`#{req.path}' not found." unless servlet
|
|
19
|
+
req.script_name = script_name
|
|
20
|
+
req.path_info = path_info
|
|
21
|
+
si = servlet.get_instance(self, *options)
|
|
22
|
+
@logger.debug(format("%s is invoked.", si.class.name))
|
|
23
|
+
si.service(req, res)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
ruby = File.join(::Config::CONFIG['bindir'],::Config::CONFIG['ruby_install_name'])
|
|
29
|
+
ruby << ::Config::CONFIG['EXEEXT']
|
|
30
|
+
|
|
31
|
+
server = HTTPServer.new(
|
|
32
|
+
:Port => 47990,
|
|
33
|
+
:DocumentRoot => 'doc',
|
|
34
|
+
:CGIInterpreter => ruby)
|
|
35
|
+
|
|
36
|
+
file_handler_options = {:HandlerTable => Hash.new(WEBrick::HTTPServlet::CGIHandler)}
|
|
37
|
+
server.mount('/cgi', WEBrick::HTTPServlet::FileHandler, File.join(Dir.getwd,'cgi'), file_handler_options)
|
|
38
|
+
server.start
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#require 'rubygems'
|
|
2
|
+
require 'test/unit'
|
|
3
|
+
require 'external/test_support'
|
|
4
|
+
require 'iowa/Association'
|
|
5
|
+
|
|
6
|
+
class TC_CSS < Test::Unit::TestCase
|
|
7
|
+
def setup
|
|
8
|
+
IWATestSupport.announce(:association,"Associations")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def test_association
|
|
12
|
+
association = nil
|
|
13
|
+
assert_nothing_raised { association = Iowa::Association.new('thing') }
|
|
14
|
+
assert_equal('thing',association.association)
|
|
15
|
+
assert(association.test(1),"test() should always return true for Iowa::Association.")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def test_literal_association
|
|
19
|
+
association = nil
|
|
20
|
+
assert_nothing_raised { association = Iowa::LiteralAssociation.new('foo') }
|
|
21
|
+
assert_equal('foo',association.get)
|
|
22
|
+
assert_nothing_raised { association.set(1,Proc.new { 7 }) }
|
|
23
|
+
assert_equal(7,association.get)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def test_path_association
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require 'external/test_support'
|
|
3
|
+
IWATestSupport.set_src_dir
|
|
4
|
+
require 'iowa/caches/BiLevelCache'
|
|
5
|
+
require 'tmpdir'
|
|
6
|
+
require 'fileutils'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TC_BiLevelCache < Test::Unit::TestCase
|
|
10
|
+
def make_tmpdir_path; FileUtils.mkdir("#{Dir::tmpdir}/tc_bilevelcache.#{Time.now.to_i}#{rand}").first; end
|
|
11
|
+
@@testdir = IWATestSupport.test_dir(__FILE__)
|
|
12
|
+
def setup
|
|
13
|
+
Dir.chdir(@@testdir)
|
|
14
|
+
IWATestSupport.announce(:bilevelcache, "Iowa::Caches::BiLevelCache")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def test_creation
|
|
18
|
+
tmpdir = make_tmpdir_path
|
|
19
|
+
assert_nothing_raised("Failed while creating an Iowa::Caches::BiLevelCache object") do
|
|
20
|
+
@cache = Iowa::Caches::BiLevelCache.new({:maxsize => 12}, {:directory => tmpdir, :maxsize => 12})
|
|
21
|
+
end
|
|
22
|
+
ensure
|
|
23
|
+
FileUtils.rm_rf(tmpdir) if tmpdir.to_s != '' and tmpdir.to_s != '/'
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def test_cache_size
|
|
27
|
+
tmpdir = make_tmpdir_path
|
|
28
|
+
@cache = Iowa::Caches::BiLevelCache.new({:maxsize => 12}, {:directory => tmpdir, :maxsize => 12})
|
|
29
|
+
(1..14).each {|n| @cache[n] = n}
|
|
30
|
+
s = @cache.size
|
|
31
|
+
l2s = @cache.l2.size
|
|
32
|
+
assert_equal(12,s,"The expected size (12) did not match the returned size (#{s}) of the level one cache.")
|
|
33
|
+
assert_equal(2,l2s,"The expected size (2) did not match the returned size (#{l2s}) of the level two cache.")
|
|
34
|
+
ensure
|
|
35
|
+
FileUtils.rm_rf(tmpdir) if tmpdir.to_s != '' and tmpdir.to_s != '/'
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def test_cache_size2
|
|
39
|
+
tmpdir = make_tmpdir_path
|
|
40
|
+
@cache = Iowa::Caches::BiLevelCache.new({:maxsize => 12}, {:directory => tmpdir, :maxsize => 12})
|
|
41
|
+
(1..14).each {|n| @cache[n] = n}
|
|
42
|
+
@cache.size=3
|
|
43
|
+
s = @cache.size
|
|
44
|
+
@cache.l2.size=3
|
|
45
|
+
l2s = @cache.l2.size
|
|
46
|
+
assert_equal(3,s,"The level one cache size does not appear to to have change as expected; want size of 3, have size of #{s}.")
|
|
47
|
+
assert_equal(3,l2s,"The level two cache size does not appear to to have change as expected; want size of 3, have size of #{l2s}.")
|
|
48
|
+
FileUtils.rm_rf(tmpdir) if tmpdir.to_s != '' and tmpdir.to_s != '/'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def test_values
|
|
52
|
+
tmpdir = make_tmpdir_path
|
|
53
|
+
@cache = Iowa::Caches::BiLevelCache.new({:maxsize => 3}, {:directory => tmpdir, :maxsize => 3})
|
|
54
|
+
(1..6).each {|n| @cache[n] = n}
|
|
55
|
+
s = @cache[6]
|
|
56
|
+
l2s = @cache[2]
|
|
57
|
+
assert_equal(6,s,"The value retrieved from the cache (from L1 cache) (#{s}) did not match what was expected (6).")
|
|
58
|
+
assert_equal(2,l2s,"The value retrieved from the cache (from L2 cache) (#{s}) did not match what was expected (2).")
|
|
59
|
+
FileUtils.rm_rf(tmpdir)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def test_expire1
|
|
63
|
+
tmpdir = make_tmpdir_path
|
|
64
|
+
@cache = Iowa::Caches::BiLevelCache.new({:maxsize => 3}, {:directory => tmpdir, :maxsize => 3})
|
|
65
|
+
(1..8).each {|n| @cache[n] = n}
|
|
66
|
+
assert_equal(false,@cache.include?(1),"Key 1 should have fallen out of the cache. It did not.")
|
|
67
|
+
assert_equal(true,@cache.include?(3),"Key 3 should not have expired from the cache. It did.")
|
|
68
|
+
FileUtils.rm_rf(tmpdir)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require 'external/test_support'
|
|
3
|
+
IWATestSupport.set_src_dir
|
|
4
|
+
require 'rbconfig'
|
|
5
|
+
require 'net/http'
|
|
6
|
+
|
|
7
|
+
class TC_CGI_Adaptor < Test::Unit::TestCase
|
|
8
|
+
|
|
9
|
+
@@testdir = IWATestSupport.test_dir(__FILE__)
|
|
10
|
+
def setup
|
|
11
|
+
Dir.chdir(@@testdir)
|
|
12
|
+
IWATestSupport.announce(:cgiadaptor,"Simple CGI Based App")
|
|
13
|
+
ruby = File.join(::Config::CONFIG['bindir'],::Config::CONFIG['ruby_install_name'])
|
|
14
|
+
ruby << ::Config::CONFIG['EXEEXT']
|
|
15
|
+
|
|
16
|
+
assert_nothing_raised("setup failed") do
|
|
17
|
+
@iowa_pid = IWATestSupport::create_process(:dir => 'TC_CGI_Adaptor/iowa',
|
|
18
|
+
:cmd => [ruby,'-I../../../src','app.rb'])
|
|
19
|
+
sleep 1
|
|
20
|
+
@wb_pid = IWATestSupport::create_process(:dir => 'TC_CGI_Adaptor',
|
|
21
|
+
:cmd => [ruby,'-I../../../src','webrick.rb'])
|
|
22
|
+
sleep 1
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def teardown
|
|
27
|
+
Process.kill 'SIGKILL',@iowa_pid
|
|
28
|
+
Process.wait @iowa_pid
|
|
29
|
+
Process.kill 'SIGKILL',@wb_pid
|
|
30
|
+
Process.wait @wb_pid
|
|
31
|
+
sleep 1
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def get_url(hostname,port,url)
|
|
35
|
+
Net::HTTP.start(hostname,port) {|http| http.get(url)}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def testBasicGet
|
|
39
|
+
assert_nothing_raised("Error trying to send request to iowa app via CGI adaptor.") do
|
|
40
|
+
response = get_url('127.0.0.1','47990','/cgi/iowa.cgi')
|
|
41
|
+
assert(response.body =~ /The Time Is/,"The response returned from the iowa app is not what was expected.")
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def testFollowLink
|
|
46
|
+
assert_nothing_raised("Error trying to send request to iowa app via CGI adaptor.") do
|
|
47
|
+
response = get_url('127.0.0.1','47990','/cgi/iowa.cgi')
|
|
48
|
+
response.body =~ /127.0.0.1:47990([^"]+)/m
|
|
49
|
+
nextlink = $1
|
|
50
|
+
response2 = get_url('127.0.0.1','47990',nextlink)
|
|
51
|
+
assert(response2.body =~ /The count is 2/,"The response returned from the iowa app is not what was expected.\nResponse: #{response2.body}")
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
end
|