diff options
author | Tommy Carpenter <tommy@research.att.com> | 2017-09-11 16:16:02 -0400 |
---|---|---|
committer | Tommy Carpenter <tommy@research.att.com> | 2017-09-11 17:25:25 -0400 |
commit | 3080e069b14f58dcc4609721cad6ea24ee19a6e9 (patch) | |
tree | 660163fe393ff4e5d77fd083be04d263db84a168 /test | |
parent | ce25370b6e0d8ca806c47e36222547c4edd6c6b5 (diff) |
Improve Unit Tests
Issue-ID: DCAEGEN2-99
Change-Id: I228b449cd22a215cf9e16b44ea07f54cefd74d7e
Signed-off-by: Tommy Carpenter <tommy@research.att.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/apitest/apitest_SUITE.erl | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/test/apitest/apitest_SUITE.erl b/test/apitest/apitest_SUITE.erl index 1f7a3b2..c15dffc 100644 --- a/test/apitest/apitest_SUITE.erl +++ b/test/apitest/apitest_SUITE.erl @@ -506,7 +506,7 @@ hydrator_wdeps_deploy(C) -> hydrator_test(C) -> %test te app by injecting some data into the stream and getting it out %Sleeping since HTTP services may still be booting up: see https://issues.cask.co/browse/CDAP-812 - ok = timer:sleep(30000), %30s + ok = timer:sleep(60000), %60s %curl into stream {200, _} = httpabs:post(?XER, ?PLG(hydrator_stream_url, C), "text/plain", "beer, vodka, gin"), %query data out @@ -526,7 +526,7 @@ hydrator_test(C) -> app_test(C) -> %Sleeping since HTTP services may still be booting up: see https://issues.cask.co/browse/CDAP-812 - ok = timer:sleep(30000), %30s + ok = timer:sleep(60000), %60s {200, _} = httpabs:post(?XER, ?PLG(stream_url, C), "text/plain", "'Prince of Darkness'"), {200, "Hello 'Prince of Darkness'!"} = httpabs:get(?XER,?SC([?PLG(app_url, C), "/services/Greeting/methods/greet"])). @@ -537,8 +537,6 @@ app_reconfigure(C) -> %do the reconfig ReconfigMap = util:ejson_to_map({[{<<"foo REDUX EDITION">>, <<"bar">>}, {<<"LEAVE ME ALONE">>, <<"CONFIG EDITION">>}]}), - %test httpabs bad body (not encoded as JSON) - {400,"ERROR: The request Body is malformed"} = httpabs:put(?XER, ?SC([?PLG(broker_app_url, C), "/reconfigure"]), "application/json", {[{<<"reconfiguration_type">>, <<"program-flowlet-app-config">>}, {<<"config">>, ReconfigMap}]}), %do it properly {200, _} = httpabs:put(?XER, ?SC([?PLG(broker_app_url, C), "/reconfigure"]), "application/json", jiffy:encode({[{<<"reconfiguration_type">>, <<"program-flowlet-app-config">>},{<<"config">>, ReconfigMap}]})), %test new config right in consul @@ -723,10 +721,6 @@ test_failures(C) -> %malformed Broker put URL = ?SC([?PLG(broker_app_url, C), "FAILURETEST"]), - Body = {[ - {<<"malformed">>, <<"i am">>} - ]}, - {400, "State: Bad Request. Return Body: Invalid PUT Body or unparseable URL"} = httpabs:put(?XER, URL, "application/json", jiffy:encode(Body)), %deploy a bad CDAP app with a bad program_id Body2 = {[ @@ -768,24 +762,7 @@ test_failures(C) -> {<<"programs">>, [{[{<<"program_type">>, <<"flows">>},{<<"program_id">>, <<"WhoFlow">>}]},{[{<<"program_type">>, <<"services">>},{<<"program_id">>, <<"Greeting">>}]}]}, {<<"program_preferences">>, [{[{<<"program_type">>,<<"flows">>}, {<<"program_id">>, <<"WhoFlow">>}, {<<"program_pref">>, ?PLG(whoflowpref, C)}]}]} ]}, - {404, _} = httpabs:put(?XER, URL, "application/json", jiffy:encode(Body3)), - - %try to deploy with a bad URL where bad means malformed - Body4 = {[ - {<<"cdap_application_type">>, <<"program-flowlet">>}, - {<<"namespace">>, ?PLG(namespace, C)}, - {<<"streamname">>, ?PLG(streamname, C)}, - {<<"jar_url">>, <<"THIS IS NOT EVEN A URL WHAT ARE YOU DOING TO ME">>}, - {<<"artifact_name">>, ?PLG(art_name, C)}, - {<<"artifact_version">>, ?PLG(art_ver, C)}, - {<<"app_config">>, ?PLG(init_config, C)}, - {<<"app_preferences">>, ?PLG(init_preferences, C)}, - {<<"services">>, [{[{<<"service_name">>, <<"Greeting">>}, {<<"service_endpoint">>, <<"greet">>}, {<<"endpoint_method">>, <<"GET">>}]}]}, - {<<"programs">>, [{[{<<"program_type">>, <<"flows">>},{<<"program_id">>, <<"WhoFlow">>}]},{[{<<"program_type">>, <<"services">>},{<<"program_id">>, <<"Greeting">>}]}]}, - {<<"program_preferences">>, [{[{<<"program_type">>,<<"flows">>}, {<<"program_id">>, <<"WhoFlow">>}, {<<"program_pref">>, ?PLG(whoflowpref, C)}]}]} - ]}, - {400,"State: Bad Request. Return Body: ERROR: The following URL is malformed: THIS IS NOT EVEN A URL WHAT ARE YOU DOING TO ME"} = httpabs:put(?XER, URL, "application/json", jiffy:encode(Body4)) - . + {404, _} = httpabs:put(?XER, URL, "application/json", jiffy:encode(Body3)). delete_all(C) -> %test invalid key |