0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 04:30:25 +00:00

Reorganize the http test suite

This commit is contained in:
Loïc Hoguin 2013-04-24 20:28:44 +02:00
parent 282e532ba9
commit ad91aaf81a
22 changed files with 25 additions and 25 deletions

View file

@ -319,21 +319,21 @@ end_per_group(Name, _) ->
init_dispatch(Config) -> init_dispatch(Config) ->
cowboy_router:compile([ cowboy_router:compile([
{"localhost", [ {"localhost", [
{"/chunked_response", chunked_handler, []}, {"/chunked_response", http_chunked, []},
{"/init_shutdown", http_handler_init_shutdown, []}, {"/init_shutdown", http_init_shutdown, []},
{"/long_polling", http_handler_long_polling, []}, {"/long_polling", http_long_polling, []},
{"/headers/dupe", http_handler, {"/headers/dupe", http_handler,
[{headers, [{<<"connection">>, <<"close">>}]}]}, [{headers, [{<<"connection">>, <<"close">>}]}]},
{"/set_resp/header", http_handler_set_resp, {"/set_resp/header", http_set_resp,
[{headers, [{<<"vary">>, <<"Accept">>}]}]}, [{headers, [{<<"vary">>, <<"Accept">>}]}]},
{"/set_resp/overwrite", http_handler_set_resp, {"/set_resp/overwrite", http_set_resp,
[{headers, [{<<"server">>, <<"DesireDrive/1.0">>}]}]}, [{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">>}]}, [{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">>}]}, [{reply, set_resp}, {body, <<"stream_body_set_resp">>}]},
{"/stream_body/set_resp_close", {"/stream_body/set_resp_close",
http_handler_stream_body, [ http_stream_body, [
{reply, set_resp_close}, {reply, set_resp_close},
{body, <<"stream_body_set_resp_close">>}]}, {body, <<"stream_body_set_resp_close">>}]},
{"/static/[...]", cowboy_static, {"/static/[...]", cowboy_static,
@ -343,7 +343,7 @@ init_dispatch(Config) ->
[{directory, ?config(static_dir, Config)}, [{directory, ?config(static_dir, Config)},
{mimetypes, {fun(Path, data) when is_binary(Path) -> {mimetypes, {fun(Path, data) when is_binary(Path) ->
[<<"text/html">>] end, data}}]}, [<<"text/html">>] end, data}}]},
{"/handler_errors", http_handler_errors, []}, {"/handler_errors", http_errors, []},
{"/static_attribute_etag/[...]", cowboy_static, {"/static_attribute_etag/[...]", cowboy_static,
[{directory, ?config(static_dir, Config)}, [{directory, ?config(static_dir, Config)},
{etag, {attributes, [filepath, filesize, inode, mtime]}}]}, {etag, {attributes, [filepath, filesize, inode, mtime]}}]},
@ -354,9 +354,9 @@ init_dispatch(Config) ->
[{directory, ?config(static_dir, Config)}, [{directory, ?config(static_dir, Config)},
{mimetypes, [{<<".css">>, [<<"text/css">>]}]}, {mimetypes, [{<<".css">>, [<<"text/css">>]}]},
{file, <<"test_file.css">>}]}, {file, <<"test_file.css">>}]},
{"/multipart", http_handler_multipart, []}, {"/multipart", http_multipart, []},
{"/echo/body", http_handler_echo_body, []}, {"/echo/body", http_echo_body, []},
{"/echo/body_qs", http_handler_body_qs, []}, {"/echo/body_qs", http_body_qs, []},
{"/param_all", rest_param_all, []}, {"/param_all", rest_param_all, []},
{"/bad_accept", rest_simple_resource, []}, {"/bad_accept", rest_simple_resource, []},
{"/bad_content_type", rest_patch_resource, []}, {"/bad_content_type", rest_patch_resource, []},
@ -370,8 +370,8 @@ init_dispatch(Config) ->
{"/resetags", rest_resource_etags, []}, {"/resetags", rest_resource_etags, []},
{"/rest_expires", rest_expires, []}, {"/rest_expires", rest_expires, []},
{"/rest_empty_resource", rest_empty_resource, []}, {"/rest_empty_resource", rest_empty_resource, []},
{"/loop_recv", http_handler_loop_recv, []}, {"/loop_recv", http_loop_recv, []},
{"/loop_timeout", http_handler_loop_timeout, []}, {"/loop_timeout", http_loop_timeout, []},
{"/", http_handler, []} {"/", http_handler, []}
]} ]}
]). ]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% 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). -behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]). -export([init/3, handle/2, terminate/3]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% Feel free to use, reuse and abuse the code in this file.
-module(chunked_handler). -module(http_chunked).
-behaviour(cowboy_http_handler). -behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]). -export([init/3, handle/2, terminate/3]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% 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). -behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]). -export([init/3, handle/2, terminate/3]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% Feel free to use, reuse and abuse the code in this file.
-module(http_handler_errors). -module(http_errors).
-behaviour(cowboy_http_handler). -behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]). -export([init/3, handle/2, terminate/3]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% 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). -behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]). -export([init/3, handle/2, terminate/3]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% 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). -behaviour(cowboy_http_handler).
-export([init/3, handle/2, info/3, terminate/3]). -export([init/3, handle/2, info/3, terminate/3]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% 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). -behaviour(cowboy_loop_handler).
-export([init/3, info/3, terminate/3]). -export([init/3, info/3, terminate/3]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% 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). -behaviour(cowboy_loop_handler).
-export([init/3, info/3, terminate/3]). -export([init/3, info/3, terminate/3]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% Feel free to use, reuse and abuse the code in this file.
-module(http_handler_multipart). -module(http_multipart).
-behaviour(cowboy_http_handler). -behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]). -export([init/3, handle/2, terminate/3]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% 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). -behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]). -export([init/3, handle/2, terminate/3]).

View file

@ -1,6 +1,6 @@
%% Feel free to use, reuse and abuse the code in this file. %% 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). -behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]). -export([init/3, handle/2, terminate/3]).