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
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#define img_width 70
|
|
2
|
+
#define img_height 34
|
|
3
|
+
static unsigned short img_bits[] = {
|
|
4
|
+
0xffff, 0xffff, 0xffff, 0xffff, 0x003f, 0xffff, 0xffff, 0xffff, 0xffff,
|
|
5
|
+
0x003f, 0xffff, 0xffff, 0xffff, 0xffff, 0x003f, 0xffff, 0xffff, 0xffff,
|
|
6
|
+
0xffff, 0x003f, 0xffff, 0xffff, 0xffff, 0xffff, 0x003f, 0xffff, 0xffff,
|
|
7
|
+
0xffff, 0xffff, 0x003f, 0x7ebf, 0xfd1f, 0xffeb, 0xffaf, 0x003f, 0x001f,
|
|
8
|
+
0xf80a, 0x1fc0, 0x8206, 0x003f, 0x000f, 0x7004, 0x1f80, 0x8000, 0x003f,
|
|
9
|
+
0x000f, 0x2000, 0x0f81, 0x0004, 0x003f, 0x002f, 0x0040, 0x1f86, 0x0008,
|
|
10
|
+
0x003e, 0x017f, 0x00e0, 0x3aad, 0x0638, 0x003e, 0x07ff, 0x01f8, 0x381e,
|
|
11
|
+
0x0e00, 0x003f, 0x0fff, 0x03f0, 0x703c, 0x0d04, 0x003e, 0x0fff, 0x07f0,
|
|
12
|
+
0x3814, 0x1700, 0x003e, 0x0fff, 0x07f0, 0x7014, 0x0a00, 0x003e, 0x0fff,
|
|
13
|
+
0x07f0, 0x2010, 0x0000, 0x003e, 0x0fff, 0x0fe0, 0x0000, 0x0001, 0x003e,
|
|
14
|
+
0x07ff, 0x47c0, 0x0080, 0x0001, 0x003e, 0x0f1f, 0xe780, 0x8180, 0x02c3,
|
|
15
|
+
0x003e, 0x070f, 0xf100, 0xc0c1, 0x1fc3, 0x003e, 0x0c0f, 0xe001, 0xc3c3,
|
|
16
|
+
0x1fc7, 0x003c, 0x800f, 0xf802, 0xe3e1, 0x1fe7, 0x003c, 0xc03f, 0xf807,
|
|
17
|
+
0xe3e7, 0x3fe7, 0x003e, 0xfabf, 0xff5f, 0xffff, 0xffff, 0x003f, 0xffff,
|
|
18
|
+
0xffff, 0xffff, 0xffff, 0x003f, 0xffff, 0xffff, 0xffff, 0xffff, 0x003f,
|
|
19
|
+
0xffff, 0xffff, 0xffff, 0xffff, 0x003f, 0xffff, 0xffff, 0xffff, 0xffff,
|
|
20
|
+
0x003f, 0xffff, 0xffff, 0xffff, 0xffff, 0x003f, 0xffff, 0xffff, 0xffff,
|
|
21
|
+
0xffff, 0x003f, 0xffff, 0xffff, 0xffff, 0xffff, 0x003f, 0xffff, 0xffff,
|
|
22
|
+
0xffff, 0xffff, 0x003f, 0xffff, 0xffff, 0xffff, 0xffff, 0x003f };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require 'external/test_support'
|
|
3
|
+
IWATestSupport.set_src_dir
|
|
4
|
+
require 'iowa/KeyValueCoding'
|
|
5
|
+
|
|
6
|
+
class TC_KeyValueCoding < Test::Unit::TestCase
|
|
7
|
+
|
|
8
|
+
Obj = Struct.new('Obj', :foo, :bar)
|
|
9
|
+
|
|
10
|
+
@@testdir = IWATestSupport.test_dir(__FILE__)
|
|
11
|
+
def setup
|
|
12
|
+
Dir.chdir(@@testdir)
|
|
13
|
+
IWATestSupport.announce(:keyvaluecoding,"Iowa::KeyValueCoding")
|
|
14
|
+
@obj = Obj.new(Obj.new(Obj.new('a')),7)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def test_takeValueForKey
|
|
18
|
+
assert_nothing_raised("Failed while calling takeValueForKey") do
|
|
19
|
+
@obj.takeValueForKey(7,"bar")
|
|
20
|
+
end
|
|
21
|
+
assert_equal(@obj.valueForKey("bar"),7,"Failed while calling valueForKey")
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def test_valueForKeyPath
|
|
25
|
+
assert_nothing_raised("Failed while calling valueForKeyPath") do
|
|
26
|
+
@obj.takeValueForKeyPath("a","foo.foo")
|
|
27
|
+
end
|
|
28
|
+
assert_equal(@obj.valueForKeyPath("foo.foo"),"a","Failed while calling valueForKeyPath")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def test_existsKeyPath?
|
|
32
|
+
assert(@obj.existsKeyPath?('foo.foo.bar'),"existsKeyPath? failed.")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
data/test/TC_LRUCache.rb
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require 'external/test_support'
|
|
3
|
+
IWATestSupport.set_src_dir
|
|
4
|
+
require 'iowa/caches/LRUCache'
|
|
5
|
+
|
|
6
|
+
class TC_LRUCache < Test::Unit::TestCase
|
|
7
|
+
@cache
|
|
8
|
+
@@testdir = IWATestSupport.test_dir(__FILE__)
|
|
9
|
+
def setup
|
|
10
|
+
Dir.chdir(@@testdir)
|
|
11
|
+
IWATestSupport.announce(:lrucache,"Iowa::Caches::LRUCache")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_creation
|
|
16
|
+
assert_nothing_raised("Failed while creating an Iowa::Caches::LRUCache object") do
|
|
17
|
+
@cache = Iowa::Caches::LRUCache.new({:maxsize => 12})
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def test_cache_size
|
|
22
|
+
s = nil
|
|
23
|
+
assert_nothing_raised do
|
|
24
|
+
@cache = Iowa::Caches::LRUCache.new({:maxsize => 12})
|
|
25
|
+
(1..14).each {|n| @cache[n] = n}
|
|
26
|
+
s = @cache.size
|
|
27
|
+
end
|
|
28
|
+
assert_equal(12,s,"The expected size (12) did not match the returned size (#{s}).")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def test_cache_size2
|
|
32
|
+
s = nil
|
|
33
|
+
assert_nothing_raised do
|
|
34
|
+
@cache = Iowa::Caches::LRUCache.new({:maxsize => 12})
|
|
35
|
+
(1..14).each {|n| @cache[n] = n}
|
|
36
|
+
@cache.maxsize=3
|
|
37
|
+
s = @cache.size
|
|
38
|
+
end
|
|
39
|
+
assert_equal(3,s,"The cache size does not appear to to have change as expected; want size of 3, have size of #{s}.")
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def test_values
|
|
43
|
+
s = nil
|
|
44
|
+
assert_nothing_raised do
|
|
45
|
+
@cache = Iowa::Caches::LRUCache.new({:maxsize => 3})
|
|
46
|
+
@cache['a'] = 1
|
|
47
|
+
@cache['b'] = 2
|
|
48
|
+
@cache['c'] = 3
|
|
49
|
+
s = @cache['b']
|
|
50
|
+
end
|
|
51
|
+
assert_equal(2,s,"The value retrieved from the cache (#{s}) did not match what was expected (2).")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def test_expire1
|
|
55
|
+
s = nil
|
|
56
|
+
assert_nothing_raised do
|
|
57
|
+
@cache = Iowa::Caches::LRUCache.new({:maxsize => 3})
|
|
58
|
+
@cache['a'] = 1
|
|
59
|
+
@cache['b'] = 2
|
|
60
|
+
@cache['c'] = 3
|
|
61
|
+
s = @cache['b']
|
|
62
|
+
@cache['d'] = 4
|
|
63
|
+
s = true
|
|
64
|
+
s = false if @cache.include? 'a'
|
|
65
|
+
end
|
|
66
|
+
assert_equal(true,s,"Key 'a' should have fallen out of the cache. It did not.")
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def test_expire2
|
|
70
|
+
s = nil
|
|
71
|
+
assert_nothing_raised do
|
|
72
|
+
@cache = Iowa::Caches::LRUCache.new({:maxsize => 3})
|
|
73
|
+
@cache['a'] = 1
|
|
74
|
+
@cache['b'] = 2
|
|
75
|
+
@cache['c'] = 3
|
|
76
|
+
s = @cache['b']
|
|
77
|
+
@cache['d'] = 4
|
|
78
|
+
s = false
|
|
79
|
+
s = true if @cache.include? 'b'
|
|
80
|
+
end
|
|
81
|
+
assert_equal(true,s,"Key 'b' appears to have fallen out of the cache. It should not have.")
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def test_expire3
|
|
85
|
+
@cache = nil
|
|
86
|
+
assert_nothing_raised do
|
|
87
|
+
@cache = Iowa::Caches::LRUCache.new({:ttl => 3})
|
|
88
|
+
@cache['a'] = 1
|
|
89
|
+
@cache['b'] = 2
|
|
90
|
+
@cache['c'] = 3
|
|
91
|
+
sleep 2
|
|
92
|
+
@cache.ttl = 1
|
|
93
|
+
end
|
|
94
|
+
assert_equal([],@cache.queue,"There seems to be have been a problem with expiration via TTL timeout.")
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Method specific tests here.
|
|
98
|
+
|
|
99
|
+
def test__set
|
|
100
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
101
|
+
assert_equal(1,@cache['a'] = 1,"Failure while testing []=")
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def test__get
|
|
105
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
106
|
+
@cache['a'] = 123
|
|
107
|
+
assert_equal(123,@cache['a'],"Failure while testing []")
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def test__include?
|
|
111
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
112
|
+
@cache['a'] = 1
|
|
113
|
+
@cache['b'] = 2
|
|
114
|
+
@cache['c'] = 3
|
|
115
|
+
assert(@cache.include?('a'),"Failure while testing include?()")
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def test__empty?
|
|
119
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
120
|
+
assert(@cache.empty?,"Failure while testing empty?()")
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def test__delete
|
|
124
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
125
|
+
@cache['a'] = 1
|
|
126
|
+
@cache['b'] = 2
|
|
127
|
+
assert_nothing_raised do
|
|
128
|
+
@cache.delete('a')
|
|
129
|
+
end
|
|
130
|
+
assert_equal(['b'],@cache.queue,"Failure while testing delete()")
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def test__first1
|
|
134
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
135
|
+
@cache.push 1
|
|
136
|
+
@cache.push 2
|
|
137
|
+
@cache.push 3
|
|
138
|
+
assert_equal(1,@cache.first,"Failure while testing first()")
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def test__first2
|
|
142
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
143
|
+
@cache['a'] = 1
|
|
144
|
+
@cache['b'] = 2
|
|
145
|
+
@cache['c'] = 3
|
|
146
|
+
assert_equal(3,@cache.first,"Failure while testing first()")
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def test__last1
|
|
150
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
151
|
+
@cache.push 1
|
|
152
|
+
@cache.push 2
|
|
153
|
+
@cache.push 3
|
|
154
|
+
assert_equal(3,@cache.last,"Failure while testing last()")
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def test__last2
|
|
158
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
159
|
+
@cache['a'] = 1
|
|
160
|
+
@cache['b'] = 2
|
|
161
|
+
@cache['c'] = 3
|
|
162
|
+
assert_equal(1,@cache.last,"Failure while testing last()")
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def test__shift
|
|
166
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
167
|
+
@cache.push 1
|
|
168
|
+
@cache.push 2
|
|
169
|
+
@cache.push 3
|
|
170
|
+
assert_equal(1,@cache.shift,"Failure while testing shift()")
|
|
171
|
+
assert_equal([2,3],@cache.queue,"Failure while testing shift()")
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def test__pop
|
|
175
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
176
|
+
@cache.push 1
|
|
177
|
+
@cache.push 2
|
|
178
|
+
@cache.push 3
|
|
179
|
+
assert_equal(3,@cache.pop,"Faulure while testing shift()")
|
|
180
|
+
assert_equal([1,2],@cache.queue,"Failure while testing shift()")
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
def test__push
|
|
184
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
185
|
+
@cache.push 1
|
|
186
|
+
@cache.push 2
|
|
187
|
+
@cache.push 3
|
|
188
|
+
assert_equal([1,2,3],@cache.queue,"Failure while testing push()")
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def test__queue
|
|
192
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
193
|
+
@cache.push 1
|
|
194
|
+
@cache.push 2
|
|
195
|
+
@cache.push 3
|
|
196
|
+
assert_equal([1,2,3],@cache.queue,"Failure while testing queue()")
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
def test__to_a
|
|
200
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
201
|
+
@cache.push 1
|
|
202
|
+
@cache.push 2
|
|
203
|
+
@cache.push 3
|
|
204
|
+
assert_equal([1,2,3],@cache.to_a,"Failure while testing queue()")
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
def test__length
|
|
208
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
209
|
+
@cache.push 1
|
|
210
|
+
@cache.push 2
|
|
211
|
+
@cache.push 3
|
|
212
|
+
assert_equal(3,@cache.length,"Failure while testing length()")
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
def test__each
|
|
216
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
217
|
+
@cache['a'] = 1
|
|
218
|
+
@cache['b'] = 2
|
|
219
|
+
@cache['c'] = 3
|
|
220
|
+
t = ''
|
|
221
|
+
s = 0
|
|
222
|
+
assert_nothing_raised do
|
|
223
|
+
@cache.each do |k,v|
|
|
224
|
+
t << k
|
|
225
|
+
s += v
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
assert_equal('cba',t,"Failure while testing each()")
|
|
229
|
+
assert_equal(6,s,"Failure while testing each()")
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
def test__maxsize
|
|
233
|
+
@cache = Iowa::Caches::LRUCache.new({:maxsize => 3})
|
|
234
|
+
assert_equal(3,@cache.maxsize,"Failure while testing maxsize()")
|
|
235
|
+
@cache.push 1
|
|
236
|
+
@cache.push 2
|
|
237
|
+
@cache.push 3
|
|
238
|
+
@cache.push 4
|
|
239
|
+
assert_equal(3,@cache.length,"Failure while testing maxsize()")
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
def test__maxsize_set
|
|
243
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
244
|
+
assert_nothing_raised do
|
|
245
|
+
@cache.maxsize = 4
|
|
246
|
+
end
|
|
247
|
+
assert_equal(4,@cache.maxsize,"Failure while testing maxsize=()")
|
|
248
|
+
@cache.push 1
|
|
249
|
+
@cache.push 2
|
|
250
|
+
@cache.push 3
|
|
251
|
+
@cache.push 4
|
|
252
|
+
@cache.push 5
|
|
253
|
+
assert_equal(4,@cache.size,"Failure while testing maxsize=()")
|
|
254
|
+
assert_nothing_raised do
|
|
255
|
+
@cache.maxsize = 2
|
|
256
|
+
end
|
|
257
|
+
assert_equal(2,@cache.queue.length,"Failure while testing maxsize=()")
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def test__ttl
|
|
261
|
+
@cache = Iowa::Caches::LRUCache.new(:ttl => 3)
|
|
262
|
+
@cache.push 1
|
|
263
|
+
@cache.push 2
|
|
264
|
+
@cache.push 3
|
|
265
|
+
assert_equal(3,@cache.ttl,"Failure while testing ttl()")
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
def test__ttl_set
|
|
269
|
+
@cache = Iowa::Caches::LRUCache.new
|
|
270
|
+
assert_nothing_raised do
|
|
271
|
+
@cache.ttl = 10
|
|
272
|
+
end
|
|
273
|
+
@cache.push 1
|
|
274
|
+
@cache.push 2
|
|
275
|
+
@cache.push 3
|
|
276
|
+
assert_equal(10,@cache.ttl,"Failure while testing ttl=()")
|
|
277
|
+
sleep 2
|
|
278
|
+
assert_nothing_raised do
|
|
279
|
+
@cache.ttl = 1
|
|
280
|
+
end
|
|
281
|
+
assert_equal(0,@cache.length,"Failure while testing ttl=()")
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
def test__add_finalizer
|
|
285
|
+
@cache = Iowa::Caches::LRUCache.new({:maxsize => 2})
|
|
286
|
+
@dest = []
|
|
287
|
+
assert_nothing_raised do
|
|
288
|
+
@cache.add_finalizer(@dest) {|key,obj,dest| dest << key; dest << obj}
|
|
289
|
+
end
|
|
290
|
+
@cache.push 1
|
|
291
|
+
@cache.push 2
|
|
292
|
+
@cache.push 3
|
|
293
|
+
assert_equal([3,3],@dest,"Failure while testing add_finalizer/finalizers.")
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require 'external/test_support'
|
|
2
|
+
IWATestSupport.set_src_dir
|
|
3
|
+
require 'test/unit'
|
|
4
|
+
require 'iowa/LinkedList'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TC_LinkedList < Test::Unit::TestCase
|
|
8
|
+
@cache
|
|
9
|
+
|
|
10
|
+
@@testdir = IWATestSupport.test_dir(__FILE__)
|
|
11
|
+
def setup
|
|
12
|
+
Dir.chdir(@@testdir)
|
|
13
|
+
IWATestSupport.announce(:linkedlist,"Iowa::LinkedList")
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def test_all
|
|
17
|
+
ll = nil
|
|
18
|
+
assert_nothing_raised('Failed while creating an Iowa::LinkedList object.') { ll = Iowa::LinkedList.new }
|
|
19
|
+
assert_kind_of(Iowa::LinkedList,ll,'Strangely, the created object does not appear to be an Iowa::LinkedList.')
|
|
20
|
+
|
|
21
|
+
assert_nothing_raised('Failed while pushing a value onto the linked list.') { ll.push 'a' }
|
|
22
|
+
ll.push 'b'
|
|
23
|
+
assert_nothing_raised('Failed while assigning a key/value to the linked list.') { ll['c'] = 3 }
|
|
24
|
+
assert_equal(3,ll.first, 'First element in the linked list appears to be the wrong one.')
|
|
25
|
+
assert_equal('b',ll.last, 'Last element in the linked list appears to be the wrong one.')
|
|
26
|
+
assert_nothing_raised('Failed while unshifting a value onto the linked list.') { ll.unshift 'd' }
|
|
27
|
+
assert_equal('d',ll.first, 'The prior unshift apparently failed.')
|
|
28
|
+
assert_equal('a',ll['a'], 'Accessing an element by key failed.')
|
|
29
|
+
assert_equal(4,ll.length, 'The length of the linked list appears to be incorrect.')
|
|
30
|
+
d = nil
|
|
31
|
+
assert_nothing_raised('Failed while deleting an element from the middle of the list.') { d = ll.delete('a') }
|
|
32
|
+
assert_equal('a',d, 'The prior delete returned the wrong value for the deleted object.')
|
|
33
|
+
assert_equal(3,ll.length, 'The length of the linked list appears to be incorrect following the prior deletion.')
|
|
34
|
+
assert_nothing_raised('Failed while popping an element from the end of the list.') { d = ll.pop }
|
|
35
|
+
assert_equal('b',d, 'The prior pop returned the wrong value.')
|
|
36
|
+
assert_equal(2,ll.length, 'The length of the linked list appears to be incorrect following the prior pop.')
|
|
37
|
+
assert_equal(['d','c'],ll.queue, 'The queue of keys for the list is incorrect.')
|
|
38
|
+
assert_equal(['d',3],ll.to_a, 'Converting the list to an array (of values) seems to have failed.')
|
|
39
|
+
expected = [['c',3],['d','d']]
|
|
40
|
+
ll.each do |k,v|
|
|
41
|
+
e = expected.pop
|
|
42
|
+
assert_equal(e,[k,v], 'While iterates over the list via each(), the value from this iteration is not what was expected.')
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
data/test/TC_Lockfile.rb
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require 'external/test_support'
|
|
3
|
+
IWATestSupport.set_src_dir
|
|
4
|
+
require 'iowa/Lockfile'
|
|
5
|
+
require 'tmpdir'
|
|
6
|
+
require 'fileutils'
|
|
7
|
+
|
|
8
|
+
class TC_Lockfile < Test::Unit::TestCase
|
|
9
|
+
@@disclaimer = false
|
|
10
|
+
def make_tmp_path; "#{Dir::tmpdir}/tc_diskcache.#{Time.now.to_i}#{rand}.lck"; end
|
|
11
|
+
|
|
12
|
+
@@testdir = IWATestSupport.test_dir(__FILE__)
|
|
13
|
+
def setup
|
|
14
|
+
Dir.chdir(@@testdir)
|
|
15
|
+
IWATestSupport.announce(:lockfile,"Iowa::Lockfile")
|
|
16
|
+
puts "Be advised that if you are on certain OSes, such\nas Windows XP, the lockfile tests using link() will fail.\nThis is expected." unless @@disclaimer
|
|
17
|
+
@@disclaimer = true
|
|
18
|
+
assert_nothing_raised("setup failed") do
|
|
19
|
+
@count = 0
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def thread_a
|
|
24
|
+
puts "\nEntering thread A."
|
|
25
|
+
@lockfile.lock do
|
|
26
|
+
puts "#{Time.now.asctime}: Thread A acquired lock."
|
|
27
|
+
sleep 3
|
|
28
|
+
puts "#{Time.now.asctime}: Thread A releasing lock."
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def thread_b
|
|
33
|
+
puts "Entering thread B."
|
|
34
|
+
@lockfile.lock do
|
|
35
|
+
puts "#{Time.now.asctime}: Thread B acquiring lock."
|
|
36
|
+
sleep 1
|
|
37
|
+
puts "#{Time.now.asctime}: Thread B releasing lock."
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def thread_c
|
|
42
|
+
puts "Entering thread C."
|
|
43
|
+
@lockfile.lock do
|
|
44
|
+
puts "#{Time.now.asctime}: Thread C acquiring lock."
|
|
45
|
+
sleep 1
|
|
46
|
+
puts "#{Time.now.asctime}: Thread C releasing lock."
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def do_test
|
|
51
|
+
tl = []
|
|
52
|
+
tl.push Thread.new {thread_a}
|
|
53
|
+
sleep 1
|
|
54
|
+
tl.push Thread.new {thread_b}
|
|
55
|
+
tl.push Thread.new {thread_c}
|
|
56
|
+
tl.each {|t| t.join}
|
|
57
|
+
sleep 1
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def hammer
|
|
61
|
+
1.upto(3000) do |x|
|
|
62
|
+
@lockfile.lock do
|
|
63
|
+
@count += 1
|
|
64
|
+
if x % 100 == 0
|
|
65
|
+
print '.'
|
|
66
|
+
$stdout.flush
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Tests go here.
|
|
73
|
+
|
|
74
|
+
def test_a_link_method
|
|
75
|
+
assert_nothing_raised("Failed while testing link() method. On certain OSes (WinXP), this is expected.") do
|
|
76
|
+
@lockfile = Iowa::Lockfile.new(make_tmp_path,{:use_flock => false})
|
|
77
|
+
do_test
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def test_a_flock_method
|
|
82
|
+
assert_nothing_raised("Failed while testing flock method.") do
|
|
83
|
+
@lockfile = Iowa::Lockfile.new(make_tmp_path,{:use_flock => true})
|
|
84
|
+
do_test
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def test_a_autoselect_method
|
|
89
|
+
assert_nothing_raised("Failed while testing method autodetect.") do
|
|
90
|
+
@lockfile = Iowa::Lockfile.new(make_tmp_path)
|
|
91
|
+
do_test
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def test_hammer_lockfile
|
|
96
|
+
assert_nothing_raised("Failed on lock #{@count} while hammering lockfile.") do
|
|
97
|
+
@lockfile = Iowa::Lockfile.new(make_tmp_path)
|
|
98
|
+
tl = []
|
|
99
|
+
tl.push Thread.new {hammer}
|
|
100
|
+
tl.push Thread.new {hammer}
|
|
101
|
+
tl.each {|t| t.join}
|
|
102
|
+
sleep 1
|
|
103
|
+
assert_equal(6000,@count,"The final count (#{@count}) was not what was expected (60000). Locking error may be responsible.")
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|