From ad91aaf81aa7fddba016262f1c8001d479a76be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 24 Apr 2013 20:28:44 +0200 Subject: [PATCH] Reorganize the http test suite --- test/http_SUITE.erl | 28 +++++++++---------- .../http_body_qs.erl} | 2 +- .../http_chunked.erl} | 2 +- .../http_echo_body.erl} | 2 +- .../http_errors.erl} | 2 +- test/{ => http_SUITE_data}/http_handler.erl | 0 .../http_init_shutdown.erl} | 2 +- .../http_long_polling.erl} | 2 +- .../http_loop_recv.erl} | 2 +- .../http_loop_timeout.erl} | 2 +- .../http_multipart.erl} | 2 +- .../http_set_resp.erl} | 2 +- .../http_stream_body.erl} | 2 +- .../rest_empty_resource.erl | 0 test/{ => http_SUITE_data}/rest_expires.erl | 0 .../rest_forbidden_resource.erl | 0 .../rest_missing_callbacks.erl | 0 .../rest_nodelete_resource.erl | 0 test/{ => http_SUITE_data}/rest_param_all.erl | 0 .../rest_patch_resource.erl | 0 .../rest_resource_etags.erl | 0 .../rest_simple_resource.erl | 0 22 files changed, 25 insertions(+), 25 deletions(-) rename test/{http_handler_body_qs.erl => http_SUITE_data/http_body_qs.erl} (97%) rename test/{chunked_handler.erl => http_SUITE_data/http_chunked.erl} (94%) rename test/{http_handler_echo_body.erl => http_SUITE_data/http_echo_body.erl} (97%) rename test/{http_handler_errors.erl => http_SUITE_data/http_errors.erl} (97%) rename test/{ => http_SUITE_data}/http_handler.erl (100%) rename test/{http_handler_init_shutdown.erl => http_SUITE_data/http_init_shutdown.erl} (92%) rename test/{http_handler_long_polling.erl => http_SUITE_data/http_long_polling.erl} (94%) rename test/{http_handler_loop_recv.erl => http_SUITE_data/http_loop_recv.erl} (93%) rename test/{http_handler_loop_timeout.erl => http_SUITE_data/http_loop_timeout.erl} (91%) rename test/{http_handler_multipart.erl => http_SUITE_data/http_multipart.erl} (96%) rename test/{http_handler_set_resp.erl => http_SUITE_data/http_set_resp.erl} (96%) rename test/{http_handler_stream_body.erl => http_SUITE_data/http_stream_body.erl} (96%) rename test/{ => http_SUITE_data}/rest_empty_resource.erl (100%) rename test/{ => http_SUITE_data}/rest_expires.erl (100%) rename test/{ => http_SUITE_data}/rest_forbidden_resource.erl (100%) rename test/{ => http_SUITE_data}/rest_missing_callbacks.erl (100%) rename test/{ => http_SUITE_data}/rest_nodelete_resource.erl (100%) rename test/{ => http_SUITE_data}/rest_param_all.erl (100%) rename test/{ => http_SUITE_data}/rest_patch_resource.erl (100%) rename test/{ => http_SUITE_data}/rest_resource_etags.erl (100%) rename test/{ => http_SUITE_data}/rest_simple_resource.erl (100%) diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl index be366e21..5cc63f18 100644 --- a/test/http_SUITE.erl +++ b/test/http_SUITE.erl @@ -319,21 +319,21 @@ end_per_group(Name, _) -> init_dispatch(Config) -> cowboy_router:compile([ {"localhost", [ - {"/chunked_response", chunked_handler, []}, - {"/init_shutdown", http_handler_init_shutdown, []}, - {"/long_polling", http_handler_long_polling, []}, + {"/chunked_response", http_chunked, []}, + {"/init_shutdown", http_init_shutdown, []}, + {"/long_polling", http_long_polling, []}, {"/headers/dupe", http_handler, [{headers, [{<<"connection">>, <<"close">>}]}]}, - {"/set_resp/header", http_handler_set_resp, + {"/set_resp/header", http_set_resp, [{headers, [{<<"vary">>, <<"Accept">>}]}]}, - {"/set_resp/overwrite", http_handler_set_resp, + {"/set_resp/overwrite", http_set_resp, [{headers, [{<<"server">>, <<"DesireDrive/1.0">>}]}]}, - {"/set_resp/body", http_handler_set_resp, + {"/set_resp/body", http_set_resp, [{body, <<"A flameless dance does not equal a cycle">>}]}, - {"/stream_body/set_resp", http_handler_stream_body, + {"/stream_body/set_resp", http_stream_body, [{reply, set_resp}, {body, <<"stream_body_set_resp">>}]}, {"/stream_body/set_resp_close", - http_handler_stream_body, [ + http_stream_body, [ {reply, set_resp_close}, {body, <<"stream_body_set_resp_close">>}]}, {"/static/[...]", cowboy_static, @@ -343,7 +343,7 @@ init_dispatch(Config) -> [{directory, ?config(static_dir, Config)}, {mimetypes, {fun(Path, data) when is_binary(Path) -> [<<"text/html">>] end, data}}]}, - {"/handler_errors", http_handler_errors, []}, + {"/handler_errors", http_errors, []}, {"/static_attribute_etag/[...]", cowboy_static, [{directory, ?config(static_dir, Config)}, {etag, {attributes, [filepath, filesize, inode, mtime]}}]}, @@ -354,9 +354,9 @@ init_dispatch(Config) -> [{directory, ?config(static_dir, Config)}, {mimetypes, [{<<".css">>, [<<"text/css">>]}]}, {file, <<"test_file.css">>}]}, - {"/multipart", http_handler_multipart, []}, - {"/echo/body", http_handler_echo_body, []}, - {"/echo/body_qs", http_handler_body_qs, []}, + {"/multipart", http_multipart, []}, + {"/echo/body", http_echo_body, []}, + {"/echo/body_qs", http_body_qs, []}, {"/param_all", rest_param_all, []}, {"/bad_accept", rest_simple_resource, []}, {"/bad_content_type", rest_patch_resource, []}, @@ -370,8 +370,8 @@ init_dispatch(Config) -> {"/resetags", rest_resource_etags, []}, {"/rest_expires", rest_expires, []}, {"/rest_empty_resource", rest_empty_resource, []}, - {"/loop_recv", http_handler_loop_recv, []}, - {"/loop_timeout", http_handler_loop_timeout, []}, + {"/loop_recv", http_loop_recv, []}, + {"/loop_timeout", http_loop_timeout, []}, {"/", http_handler, []} ]} ]). diff --git a/test/http_handler_body_qs.erl b/test/http_SUITE_data/http_body_qs.erl similarity index 97% rename from test/http_handler_body_qs.erl rename to test/http_SUITE_data/http_body_qs.erl index 306f4dcb..2280981e 100644 --- a/test/http_handler_body_qs.erl +++ b/test/http_SUITE_data/http_body_qs.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(http_handler_body_qs). +-module(http_body_qs). -behaviour(cowboy_http_handler). -export([init/3, handle/2, terminate/3]). diff --git a/test/chunked_handler.erl b/test/http_SUITE_data/http_chunked.erl similarity index 94% rename from test/chunked_handler.erl rename to test/http_SUITE_data/http_chunked.erl index e486afe8..447c0f66 100644 --- a/test/chunked_handler.erl +++ b/test/http_SUITE_data/http_chunked.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(chunked_handler). +-module(http_chunked). -behaviour(cowboy_http_handler). -export([init/3, handle/2, terminate/3]). diff --git a/test/http_handler_echo_body.erl b/test/http_SUITE_data/http_echo_body.erl similarity index 97% rename from test/http_handler_echo_body.erl rename to test/http_SUITE_data/http_echo_body.erl index 4b9e765b..014e05ab 100644 --- a/test/http_handler_echo_body.erl +++ b/test/http_SUITE_data/http_echo_body.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(http_handler_echo_body). +-module(http_echo_body). -behaviour(cowboy_http_handler). -export([init/3, handle/2, terminate/3]). diff --git a/test/http_handler_errors.erl b/test/http_SUITE_data/http_errors.erl similarity index 97% rename from test/http_handler_errors.erl rename to test/http_SUITE_data/http_errors.erl index 2d1066c8..88313620 100644 --- a/test/http_handler_errors.erl +++ b/test/http_SUITE_data/http_errors.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(http_handler_errors). +-module(http_errors). -behaviour(cowboy_http_handler). -export([init/3, handle/2, terminate/3]). diff --git a/test/http_handler.erl b/test/http_SUITE_data/http_handler.erl similarity index 100% rename from test/http_handler.erl rename to test/http_SUITE_data/http_handler.erl diff --git a/test/http_handler_init_shutdown.erl b/test/http_SUITE_data/http_init_shutdown.erl similarity index 92% rename from test/http_handler_init_shutdown.erl rename to test/http_SUITE_data/http_init_shutdown.erl index fd01983b..14455697 100644 --- a/test/http_handler_init_shutdown.erl +++ b/test/http_SUITE_data/http_init_shutdown.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(http_handler_init_shutdown). +-module(http_init_shutdown). -behaviour(cowboy_http_handler). -export([init/3, handle/2, terminate/3]). diff --git a/test/http_handler_long_polling.erl b/test/http_SUITE_data/http_long_polling.erl similarity index 94% rename from test/http_handler_long_polling.erl rename to test/http_SUITE_data/http_long_polling.erl index e8cf610a..ad4e66e4 100644 --- a/test/http_handler_long_polling.erl +++ b/test/http_SUITE_data/http_long_polling.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(http_handler_long_polling). +-module(http_long_polling). -behaviour(cowboy_http_handler). -export([init/3, handle/2, info/3, terminate/3]). diff --git a/test/http_handler_loop_recv.erl b/test/http_SUITE_data/http_loop_recv.erl similarity index 93% rename from test/http_handler_loop_recv.erl rename to test/http_SUITE_data/http_loop_recv.erl index 4d0a3212..d0577f04 100644 --- a/test/http_handler_loop_recv.erl +++ b/test/http_SUITE_data/http_loop_recv.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(http_handler_loop_recv). +-module(http_loop_recv). -behaviour(cowboy_loop_handler). -export([init/3, info/3, terminate/3]). diff --git a/test/http_handler_loop_timeout.erl b/test/http_SUITE_data/http_loop_timeout.erl similarity index 91% rename from test/http_handler_loop_timeout.erl rename to test/http_SUITE_data/http_loop_timeout.erl index 0155b1e2..dd3472c5 100644 --- a/test/http_handler_loop_timeout.erl +++ b/test/http_SUITE_data/http_loop_timeout.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(http_handler_loop_timeout). +-module(http_loop_timeout). -behaviour(cowboy_loop_handler). -export([init/3, info/3, terminate/3]). diff --git a/test/http_handler_multipart.erl b/test/http_SUITE_data/http_multipart.erl similarity index 96% rename from test/http_handler_multipart.erl rename to test/http_SUITE_data/http_multipart.erl index 8209535d..c94739ff 100644 --- a/test/http_handler_multipart.erl +++ b/test/http_SUITE_data/http_multipart.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(http_handler_multipart). +-module(http_multipart). -behaviour(cowboy_http_handler). -export([init/3, handle/2, terminate/3]). diff --git a/test/http_handler_set_resp.erl b/test/http_SUITE_data/http_set_resp.erl similarity index 96% rename from test/http_handler_set_resp.erl rename to test/http_SUITE_data/http_set_resp.erl index d00d72a1..821cc1de 100644 --- a/test/http_handler_set_resp.erl +++ b/test/http_SUITE_data/http_set_resp.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(http_handler_set_resp). +-module(http_set_resp). -behaviour(cowboy_http_handler). -export([init/3, handle/2, terminate/3]). diff --git a/test/http_handler_stream_body.erl b/test/http_SUITE_data/http_stream_body.erl similarity index 96% rename from test/http_handler_stream_body.erl rename to test/http_SUITE_data/http_stream_body.erl index 5e42fa77..4f456566 100644 --- a/test/http_handler_stream_body.erl +++ b/test/http_SUITE_data/http_stream_body.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(http_handler_stream_body). +-module(http_stream_body). -behaviour(cowboy_http_handler). -export([init/3, handle/2, terminate/3]). diff --git a/test/rest_empty_resource.erl b/test/http_SUITE_data/rest_empty_resource.erl similarity index 100% rename from test/rest_empty_resource.erl rename to test/http_SUITE_data/rest_empty_resource.erl diff --git a/test/rest_expires.erl b/test/http_SUITE_data/rest_expires.erl similarity index 100% rename from test/rest_expires.erl rename to test/http_SUITE_data/rest_expires.erl diff --git a/test/rest_forbidden_resource.erl b/test/http_SUITE_data/rest_forbidden_resource.erl similarity index 100% rename from test/rest_forbidden_resource.erl rename to test/http_SUITE_data/rest_forbidden_resource.erl diff --git a/test/rest_missing_callbacks.erl b/test/http_SUITE_data/rest_missing_callbacks.erl similarity index 100% rename from test/rest_missing_callbacks.erl rename to test/http_SUITE_data/rest_missing_callbacks.erl diff --git a/test/rest_nodelete_resource.erl b/test/http_SUITE_data/rest_nodelete_resource.erl similarity index 100% rename from test/rest_nodelete_resource.erl rename to test/http_SUITE_data/rest_nodelete_resource.erl diff --git a/test/rest_param_all.erl b/test/http_SUITE_data/rest_param_all.erl similarity index 100% rename from test/rest_param_all.erl rename to test/http_SUITE_data/rest_param_all.erl diff --git a/test/rest_patch_resource.erl b/test/http_SUITE_data/rest_patch_resource.erl similarity index 100% rename from test/rest_patch_resource.erl rename to test/http_SUITE_data/rest_patch_resource.erl diff --git a/test/rest_resource_etags.erl b/test/http_SUITE_data/rest_resource_etags.erl similarity index 100% rename from test/rest_resource_etags.erl rename to test/http_SUITE_data/rest_resource_etags.erl diff --git a/test/rest_simple_resource.erl b/test/http_SUITE_data/rest_simple_resource.erl similarity index 100% rename from test/rest_simple_resource.erl rename to test/http_SUITE_data/rest_simple_resource.erl