lib/popcorn: migrate nitunits to annotations
authorAlexandre Terrasa <alexandre@moz-code.org>
Tue, 6 Jun 2017 05:14:13 +0000 (01:14 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Tue, 15 Aug 2017 18:12:16 +0000 (14:12 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

19 files changed:
lib/popcorn/examples/angular/tests/test_example_angular.nit
lib/popcorn/examples/handlers/tests/test_example_post_handler.nit
lib/popcorn/examples/handlers/tests/test_example_query_string.nit
lib/popcorn/examples/hello_world/tests/test_example_hello.nit
lib/popcorn/examples/middlewares/tests/test_example_advanced_logger.nit
lib/popcorn/examples/middlewares/tests/test_example_html_error_handler.nit
lib/popcorn/examples/middlewares/tests/test_example_simple_error_handler.nit
lib/popcorn/examples/middlewares/tests/test_example_simple_logger.nit
lib/popcorn/examples/routing/tests/test_example_glob_route.nit
lib/popcorn/examples/routing/tests/test_example_param_route.nit
lib/popcorn/examples/routing/tests/test_example_router.nit
lib/popcorn/examples/sessions/tests/test_example_session.nit
lib/popcorn/examples/static_files/tests/test_example_static.nit
lib/popcorn/examples/static_files/tests/test_example_static_default.nit
lib/popcorn/examples/static_files/tests/test_example_static_multiple.nit
lib/popcorn/examples/templates/tests/test_example_templates.nit
lib/popcorn/pop_tests.nit
lib/popcorn/tests/test_pop_routes.nit
lib/popcorn/tests/test_popcorn.nit

index 7c6fa1d..7ca4802 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_angular is test_suite
+module test_example_angular is test
 
 import pop_tests
 import example_angular
 
 class TestExampleAngular
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/counter"
@@ -29,7 +30,7 @@ class TestExampleAngular
                system "curl -s {host}:{port}/not_found" # handled by angular controller
        end
 
-       fun test_example_angular do
+       fun test_example_angular is test do
                var app = new App
                app.use("/counter", new CounterAPI)
                app.use("/*", new StaticHandler(test_path / "../www/", "index.html"))
index a1cbb13..a0dc10f 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_post_handler is test_suite
+module test_example_post_handler is test
 
 import pop_tests
 import example_post_handler
 
 class TestExamplePostHandler
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/ -X POST"
@@ -31,7 +32,7 @@ class TestExamplePostHandler
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_post_handler do
+       fun test_example_post_handler is test do
                var app = new App
                app.use("/", new PostHandler)
                run_test(app)
index db326ea..8909f91 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_query_string is test_suite
+module test_example_query_string is test
 
 import pop_tests
 import example_query_string
 
 class TestExampleQueryString
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
@@ -30,7 +31,7 @@ class TestExampleQueryString
                system "curl -s {host}:{port}/?items=10\\&order=asc"
        end
 
-       fun test_example_query_string do
+       fun test_example_query_string is test do
                var app = new App
                app.use("/", new QueryStringHandler)
                run_test(app)
index 163e624..e206456 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_hello is test_suite
+module test_example_hello is test
 
 import pop_tests
 import example_hello
 
 class TestExampleHello
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}"
@@ -30,7 +31,7 @@ class TestExampleHello
                system "curl -s {host}:{port}/not_found/not_found"
        end
 
-       fun test_example_hello do
+       fun test_example_hello is test do
                var app = new App
                app.use("/", new HelloHandler)
                run_test(app)
index f870136..adfe426 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_advanced_logger is test_suite
+module test_example_advanced_logger is test
 
 import pop_tests
 import example_advanced_logger
 
 class TestExampleAdvancedLogger
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
                system "curl -s {host}:{port}/about"
        end
 
-       fun test_example_advanced_logger do
+       fun test_example_advanced_logger is test do
                var app = new App
                app.use_before("/*", new RequestTimeHandler)
                app.use("/", new AnotherHandler)
index 93912ca..5322bbc 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_html_error_handler is test_suite
+module test_example_html_error_handler is test
 
 import pop_tests
 import example_html_error_handler
 
 class TestExampleHtmlErrorHandler
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
                system "curl -s {host}:{port}/about"
        end
 
-       fun test_example_html_error_handler do
+       fun test_example_html_error_handler is test do
                var app = new App
                app.use("/*", new HtmlErrorHandler)
                run_test(app)
index e45acad..7016f1a 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_simple_error_handler is test_suite
+module test_example_simple_error_handler is test
 
 import pop_tests
 import example_simple_error_handler
 
 class TestExampleSimpleErrorHandler
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
                system "curl -s {host}:{port}/about"
        end
 
-       fun test_example_simple_error_handler do
+       fun test_example_simple_error_handler is test do
                var app = new App
                app.use("/", new SomeHandler)
                app.use("/*", new SimpleErrorHandler)
index b0c41f8..25db274 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_simple_logger is test_suite
+module test_example_simple_logger is test
 
 import pop_tests
 import example_simple_logger
 
 class TestExampleSimpleLogger
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
                system "curl -s {host}:{port}/about"
        end
 
-       fun test_example_simple_logger do
+       fun test_example_simple_logger is test do
                var app = new App
                app.use_before("/*", new SimpleLoggerHandler)
                app.use("/", new MyOtherHandler)
index c258260..e44be2a 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_glob_route is test_suite
+module test_example_glob_route is test
 
 import pop_tests
 import example_glob_route
 
 class TestExampleGlobRoute
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/user/Morriar/item/10"
@@ -32,7 +33,7 @@ class TestExampleGlobRoute
                system "curl -s {host}:{port}/not_found/not_found"
        end
 
-       fun test_example_glob_route do
+       fun test_example_glob_route is test do
                var app = new App
                app.use("/user/:user/item/:item/*", new UserItem)
                run_test(app)
index 52f818a..813eda4 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_param_route is test_suite
+module test_example_param_route is test
 
 import pop_tests
 import example_param_route
 
 class TestExampleParamRoute
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/Morriar"
@@ -30,7 +31,7 @@ class TestExampleParamRoute
                system "curl -s {host}:{port}/not_found/not_found"
        end
 
-       fun test_example_param_route do
+       fun test_example_param_route is test do
                var app = new App
                app.use("/:user", new UserHome)
                run_test(app)
index 55d5ed9..e0c3082 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_router is test_suite
+module test_example_router is test
 
 import pop_tests
 import example_router
 
 class TestExampleRouter
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}"
@@ -33,7 +34,7 @@ class TestExampleRouter
                system "curl -s {host}:{port}/products/not_found"
        end
 
-       fun test_example_router do
+       fun test_example_router is test do
                var user_router = new Router
                user_router.use("/*", new UserLogger)
                user_router.use("/", new UserHomepage)
index 6310171..91a6e8f 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_session is test_suite
+module test_example_session is test
 
 import pop_tests
 import example_session
 
 class TestExampleSession
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
@@ -30,7 +31,7 @@ class TestExampleSession
                system "curl -s {host}:{port}/products/not_found"
        end
 
-       fun test_example_session do
+       fun test_example_session is test do
                var app = new App
                app.use("/*", new SessionInit)
                app.use("/", new AppLogin)
index a1c26a9..b65bcd6 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_static is test_suite
+module test_example_static is test
 
 import pop_tests
 import example_static
 
 class TestExampleStatic
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/css/style.css"
@@ -32,7 +33,7 @@ class TestExampleStatic
                system "curl -s {host}:{port}/not_found.nit"
        end
 
-       fun test_example_static do
+       fun test_example_static is test do
                var app = new App
                app.use("/", new StaticHandler(test_path / "../public/"))
                run_test(app)
index 30ef93e..3f9ce22 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_static_default is test_suite
+module test_example_static_default is test
 
 import pop_tests
 import example_static_default
 
 class TestExampleStaticDefault
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/css/style.css"
@@ -32,7 +33,7 @@ class TestExampleStaticDefault
                system "curl -s {host}:{port}/not_found.nit"
        end
 
-       fun test_example_static_default do
+       fun test_example_static_default is test do
                var app = new App
                app.use("/", new StaticHandler(test_path / "../public/", "default.html"))
                run_test(app)
index 42fc7df..3d4d2d9 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_static_multiple is test_suite
+module test_example_static_multiple is test
 
 import pop_tests
 import example_static_multiple
 
 class TestExampleStaticMultiple
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/css/style.css"
@@ -36,7 +37,7 @@ class TestExampleStaticMultiple
                system "curl -s {host}:{port}/not_found.nit"
        end
 
-       fun test_example_static_multiple do
+       fun test_example_static_multiple is test do
                var app = new App
                app.use("/", new StaticHandler(test_path / "../public/"))
                app.use("/", new StaticHandler(test_path / "../files/"))
index 3334320..fb88bf1 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_templates is test_suite
+module test_example_templates is test
 
 import pop_tests
 intrude import example_templates
 
 class TestExampleTemplate
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_template do
+       fun test_example_template is test do
                var app = new App
                app.use("/", new MyTemplateHandler)
                run_test(app)
@@ -35,12 +36,13 @@ end
 
 class TestExampleTemplateString
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_template_string do
+       fun test_example_template_string is test do
                var app = new App
                app.use("/", new MyTemplateStringHandler)
                run_test(app)
@@ -49,12 +51,13 @@ end
 
 class TestExampleTemplateFile
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_template_file do
+       fun test_example_template_file is test do
                var app = new App
                var handler = new MyTemplateFileHandler
                handler.tpl_file = test_path / "../example_template.tpl"
@@ -65,12 +68,13 @@ end
 
 class TestExampleTemplatePug
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_template_pug do
+       fun test_example_template_pug is test do
                var app = new App
                app.use("/", new MyTemplatePugHandler)
                run_test(app)
@@ -79,12 +83,13 @@ end
 
 class TestExampleTemplatePugFile
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_template_pug_file do
+       fun test_example_template_pug_file is test do
                var app = new App
                var handler = new MyTemplatePugFileHandler
                handler.pug_file = test_path / "../example_template.pug"
index 6c5985d..5d89e59 100644 (file)
 # Here we use `curl` to access some URI on the app.
 #
 # ~~~nitish
-# module test_example_hello is test_suite
+# module test_example_hello is test
 #
 # import pop_tests
 # import example_hello
 #
 # class TestExampleHello
 #      super TestPopcorn
+#      test
 #
-#      fun test_example_hello do
+#      fun example_hello is test do
 #              var app = new App
 #              app.use("/", new HelloHandler)
 #              run_test(app)
@@ -68,7 +69,6 @@
 # See `examples/hello_world` for the complete example.
 module pop_tests
 
-import test_suite
 import popcorn
 import pthreads
 
@@ -123,7 +123,6 @@ end
 
 # TestSuite for Popcorn blackbox testing.
 class TestPopcorn
-       super TestSuite
 
        # Host used to run App.
        var host: String = test_host
index 9ad37a5..9c81cce 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_pop_routes is test_suite
+module test_pop_routes is test
 
 import pop_routes
-import test_suite
 
 class TestAppRoute
-       super TestSuite
+       test
 
-       fun test_root_match_only_one_uri do
+       fun test_root_match_only_one_uri is test do
                var r = new AppRoute("/")
                assert r.match("")
                assert r.match("/")
                assert not r.match("/user")
        end
 
-       fun test_strict_route_match_only_one_uri do
+       fun test_strict_route_match_only_one_uri is test do
                var r = new AppRoute("/user")
                assert not r.match("/")
                assert r.match("/user")
@@ -40,9 +39,9 @@ class TestAppRoute
 end
 
 class TestAppParamRoute
-       super TestSuite
+       test
 
-       fun test_param_route_match_good_uri_params_1 do
+       fun test_param_route_match_good_uri_params_1 is test do
                var r = new AppParamRoute("/:id")
                assert not r.match("/")
                assert r.match("/user")
@@ -50,7 +49,7 @@ class TestAppParamRoute
                assert not r.match("/user/10")
        end
 
-       fun test_param_route_match_good_uri_params_2 do
+       fun test_param_route_match_good_uri_params_2 is test do
                var r = new AppParamRoute("/user/:id")
                assert not r.match("/")
                assert not r.match("/user")
@@ -60,7 +59,7 @@ class TestAppParamRoute
                assert not r.match("/user/10/profile")
        end
 
-       fun test_param_route_match_good_uri_params_3 do
+       fun test_param_route_match_good_uri_params_3 is test do
                var r = new AppParamRoute("/user/:id/profile")
                assert not r.match("/")
                assert not r.match("/user")
@@ -73,7 +72,7 @@ class TestAppParamRoute
                assert not r.match("/user/10/foo")
        end
 
-       fun test_param_route_match_good_uri_params_4 do
+       fun test_param_route_match_good_uri_params_4 is test do
                var r = new AppParamRoute("/:id/:foo")
                assert not r.match("/")
                assert not r.match("/user")
@@ -83,7 +82,7 @@ class TestAppParamRoute
                assert not r.match("/user/10/10")
        end
 
-       fun test_param_route_match_good_uri_params_5 do
+       fun test_param_route_match_good_uri_params_5 is test do
                var r = new AppParamRoute("/user/:id/:foo")
                assert not r.match("/")
                assert not r.match("/user")
@@ -94,7 +93,7 @@ class TestAppParamRoute
                assert not r.match("/user/10/10/profile")
        end
 
-       fun test_param_route_match_good_uri_params_6 do
+       fun test_param_route_match_good_uri_params_6 is test do
                var r = new AppParamRoute("/user/:id/settings/:foo")
                assert not r.match("/")
                assert not r.match("/user")
@@ -110,30 +109,30 @@ class TestAppParamRoute
 end
 
 class TestRouteMatching
-       super TestSuite
+       test
 
-       fun test_glob_route_match_good_uri_prefix1 do
+       fun test_glob_route_match_good_uri_prefix1 is test do
                var r = new AppGlobRoute("/*")
                assert r.match("/")
                assert r.match("/user")
                assert r.match("/user/10")
        end
 
-       fun test_glob_route_match_good_uri_prefix2 do
+       fun test_glob_route_match_good_uri_prefix2 is test do
                var r = new AppGlobRoute("/user/*")
                assert not r.match("/")
                assert r.match("/user")
                assert r.match("/user/10")
        end
 
-       fun test_glob_route_match_good_uri_prefix3 do
+       fun test_glob_route_match_good_uri_prefix3 is test do
                var r = new AppGlobRoute("/user*")
                assert not r.match("/")
                assert r.match("/user")
                assert r.match("/user/10")
        end
 
-       fun test_glob_route_work_with_parameters_1 do
+       fun test_glob_route_work_with_parameters_1 is test do
                var r = new AppGlobRoute("/:id/*")
                assert not r.match("/")
                assert r.match("/user")
@@ -141,14 +140,14 @@ class TestRouteMatching
                assert r.match("/user/10/profile")
        end
 
-       fun test_glob_route_work_with_parameters_2 do
+       fun test_glob_route_work_with_parameters_2 is test do
                var r = new AppGlobRoute("/:id*")
                assert not r.match("/")
                assert r.match("/user")
                assert r.match("/user/10")
        end
 
-       fun test_glob_route_work_with_parameters_3 do
+       fun test_glob_route_work_with_parameters_3 is test do
                var r = new AppGlobRoute("/user/:id/*")
                assert not r.match("/")
                assert not r.match("/user")
@@ -156,7 +155,7 @@ class TestRouteMatching
                assert r.match("/user/10/profile")
        end
 
-       fun test_glob_route_work_with_parameters_4 do
+       fun test_glob_route_work_with_parameters_4 is test do
                var r = new AppGlobRoute("/user/:id*")
                assert not r.match("/")
                assert not r.match("/user")
index 108eb7a..d2daed4 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_popcorn is test_suite
+module test_popcorn is test
 
 import pop_tests
 import popcorn
@@ -29,6 +29,7 @@ end
 
 class TestPopcornRouter
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}"
@@ -44,7 +45,7 @@ class TestPopcornRouter
                system "curl -s {host}:{port}/products/not_found"
        end
 
-       fun test_router do
+       fun test_router is test do
                var app = new App
                app.use("/", new TestHandler("/"))
                app.use("/about", new TestHandler("/about"))
@@ -65,6 +66,7 @@ end
 
 class TestPopcornRoutes
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}"
@@ -84,7 +86,7 @@ class TestPopcornRoutes
                system "curl -s {host}:{port}/user/id/not_found"
        end
 
-       fun test_routes do
+       fun test_routes is test do
                var app = new App
                app.use("/", new TestHandler("/"))
                app.use("/user", new TestHandler("/user"))