Permalink
Browse files

Merge branch 'dr-remove-mochiweb-app'

  • Loading branch information...
2 parents 3af91fb + 044e70b commit 195a9bcd8c7aa8e97b4e53383477913486c2dd6b David Reid committed Apr 12, 2011
Showing with 4 additions and 98 deletions.
  1. +0 −1 src/mochiweb.app.src
  2. +4 −29 src/mochiweb.erl
  3. +0 −27 src/mochiweb_app.erl
  4. +0 −41 src/mochiweb_sup.erl
View
@@ -4,6 +4,5 @@
{vsn, "2.0.0"},
{modules, []},
{registered, []},
- {mod, {mochiweb_app, []}},
{env, []},
{applications, [kernel, stdlib, crypto, inets]}]}.
View
@@ -6,23 +6,9 @@
-module(mochiweb).
-author('bob@mochimedia.com').
--export([start/0, stop/0]).
-export([new_request/1, new_response/1]).
-export([all_loaded/0, all_loaded/1, reload/0]).
-%% @spec start() -> ok
-%% @doc Start the MochiWeb server.
-start() ->
- ensure_started(crypto),
- application:start(mochiweb).
-
-%% @spec stop() -> ok
-%% @doc Stop the MochiWeb server.
-stop() ->
- Res = application:stop(mochiweb),
- application:stop(crypto),
- Res.
-
reload() ->
[c:l(Module) || Module <- all_loaded()].
@@ -78,17 +64,6 @@ new_response({Request, Code, Headers}) ->
Code,
mochiweb_headers:make(Headers)).
-%% Internal API
-
-ensure_started(App) ->
- case application:start(App) of
- ok ->
- ok;
- {error, {already_started, App}} ->
- ok
- end.
-
-
%%
%% Tests
%%
@@ -138,11 +113,11 @@ multiple_https_GET_test() ->
do_GET(ssl, 3).
hundred_http_GET_test_() -> % note the underscore
- {timeout, ?LARGE_TIMEOUT,
+ {timeout, ?LARGE_TIMEOUT,
fun() -> ?assertEqual(ok, do_GET(plain,100)) end}.
hundred_https_GET_test_() -> % note the underscore
- {timeout, ?LARGE_TIMEOUT,
+ {timeout, ?LARGE_TIMEOUT,
fun() -> ?assertEqual(ok, do_GET(ssl,100)) end}.
single_128_http_POST_test() ->
@@ -170,11 +145,11 @@ multiple_100K_https_POST_test() ->
do_POST(ssl, 102400, 3).
hundred_128_http_POST_test_() -> % note the underscore
- {timeout, ?LARGE_TIMEOUT,
+ {timeout, ?LARGE_TIMEOUT,
fun() -> ?assertEqual(ok, do_POST(plain, 128, 100)) end}.
hundred_128_https_POST_test_() -> % note the underscore
- {timeout, ?LARGE_TIMEOUT,
+ {timeout, ?LARGE_TIMEOUT,
fun() -> ?assertEqual(ok, do_POST(ssl, 128, 100)) end}.
do_GET(Transport, Times) ->
View
@@ -1,27 +0,0 @@
-%% @author Bob Ippolito <bob@mochimedia.com>
-%% @copyright 2007 Mochi Media, Inc.
-
-%% @doc Callbacks for the mochiweb application.
-
--module(mochiweb_app).
--author('bob@mochimedia.com').
-
--behaviour(application).
--export([start/2,stop/1]).
-
-%% @spec start(_Type, _StartArgs) -> ServerRet
-%% @doc application start callback for mochiweb.
-start(_Type, _StartArgs) ->
- mochiweb_sup:start_link().
-
-%% @spec stop(_State) -> ServerRet
-%% @doc application stop callback for mochiweb.
-stop(_State) ->
- ok.
-
-%%
-%% Tests
-%%
--ifdef(TEST).
--include_lib("eunit/include/eunit.hrl").
--endif.
View
@@ -1,41 +0,0 @@
-%% @author Bob Ippolito <bob@mochimedia.com>
-%% @copyright 2007 Mochi Media, Inc.
-
-%% @doc Supervisor for the mochiweb application.
-
--module(mochiweb_sup).
--author('bob@mochimedia.com').
-
--behaviour(supervisor).
-
-%% External exports
--export([start_link/0, upgrade/0]).
-
-%% supervisor callbacks
--export([init/1]).
-
-%% @spec start_link() -> ServerRet
-%% @doc API for starting the supervisor.
-start_link() ->
- supervisor:start_link({local, ?MODULE}, ?MODULE, []).
-
-%% @spec upgrade() -> ok
-%% @doc Add processes if necessary.
-upgrade() ->
- {ok, {_, Specs}} = init([]),
- lists:foreach(fun(S) -> supervisor:start_child(?MODULE, S) end, Specs),
- ok.
-
-%% @spec init([]) -> SupervisorTree
-%% @doc supervisor callback, ensures yaws is in embedded mode and then
-%% returns the supervisor tree.
-init([]) ->
- Processes = [],
- {ok, {{one_for_one, 10, 10}, Processes}}.
-
-%%
-%% Tests
-%%
--ifdef(TEST).
--include_lib("eunit/include/eunit.hrl").
--endif.

0 comments on commit 195a9bc

Please sign in to comment.