diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-09-28 16:04:55 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-09-28 16:04:55 +0200 |
commit | 9192aa0bad75c648ebfe52b3d8fb310b084f076a (patch) | |
tree | 823545108eafc454342f1969361b8f99e49681d6 /vespaclient-container-plugin | |
parent | 25fa21e679ab3a20a15f602f17d4a42de0fafb07 (diff) |
Correct dependencies by moving document-api test to vespaclient-container-plugin
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r-- | vespaclient-container-plugin/pom.xml | 2 | ||||
-rw-r--r-- | vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentApiApplicationtest.java | 23 | ||||
-rw-r--r-- | vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java | 20 | ||||
-rw-r--r-- | vespaclient-container-plugin/src/test/rest-api-application/services.xml (renamed from vespaclient-container-plugin/src/test/application/services.xml) | 0 |
4 files changed, 33 insertions, 12 deletions
diff --git a/vespaclient-container-plugin/pom.xml b/vespaclient-container-plugin/pom.xml index 4ef26498718..422565f55ae 100644 --- a/vespaclient-container-plugin/pom.xml +++ b/vespaclient-container-plugin/pom.xml @@ -77,14 +77,12 @@ <version>1.8.4</version> <scope>test</scope> </dependency> - <!-- <dependency> <groupId>com.yahoo.vespa</groupId> <artifactId>application</artifactId> <version>${project.version}</version> <scope>test</scope> </dependency> - --> </dependencies> <build> <plugins> diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentApiApplicationtest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentApiApplicationtest.java new file mode 100644 index 00000000000..42ec41bd107 --- /dev/null +++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentApiApplicationtest.java @@ -0,0 +1,23 @@ +package com.yahoo.document.restapi; + +import com.yahoo.application.Application; +import com.yahoo.application.Networking; +import org.junit.Test; + +/** + * @author bratseth + */ +public class DocumentApiApplicationTest { + + /** Test that it is possible to instantiate an Application with a document-api */ + @Test + public void application_with_document_api() { + String services = + "<container version='1.0'>" + + " <document-api/>" + + "</container>"; + try (Application application = Application.fromServicesXml(services, Networking.enable)) { + } + } + +} diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java index ddd17ae71ec..95a48ab41fe 100644 --- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java +++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java @@ -1,9 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document.restapi.resource; -//import com.yahoo.application.Application; -//import com.yahoo.application.Networking; -//import com.yahoo.application.container.handler.Request; +import com.yahoo.application.Application; +import com.yahoo.application.Networking; +import com.yahoo.application.container.handler.Request; import com.yahoo.container.Container; import com.yahoo.jdisc.http.server.jetty.JettyHttpServer; import org.apache.http.HttpEntity; @@ -33,12 +33,12 @@ import static org.hamcrest.core.StringStartsWith.startsWith; import static org.junit.Assert.assertThat; public class RestApiTest { - /* + Application application; @Before public void setup() throws Exception { - application = Application.fromApplicationPackage(Paths.get("src/test/application"), Networking.enable); + application = Application.fromApplicationPackage(Paths.get("src/test/rest-api-application"), Networking.enable); } @After @@ -250,7 +250,7 @@ public class RestApiTest { public void testbasicEncodingV2() throws Exception { Request request = new Request("http://localhost:" + getFirstListenPort() + get_enc_test_uri_v2); HttpGet get = new HttpGet(request.getUri()); - final String rest = doRest(get); + String rest = doRest(get); assertThat(rest, containsString(get_enc_response_part1_v2)); assertThat(rest, containsString(get_enc_response_part2)); } @@ -265,7 +265,7 @@ public class RestApiTest { public void testbasicVisit() throws Exception { Request request = new Request("http://localhost:" + getFirstListenPort() + visit_test_uri); HttpGet get = new HttpGet(request.getUri()); - final String rest = doRest(get); + String rest = doRest(get); assertThat(rest, containsString(visit_response_part1)); assertThat(rest, containsString(visit_response_part2)); assertThat(rest, containsString(visit_response_part3)); @@ -277,9 +277,9 @@ public class RestApiTest { @Test public void testBadVisit() throws Exception { - final Request request = new Request("http://localhost:" + getFirstListenPort() + visit_test_bad_uri); + Request request = new Request("http://localhost:" + getFirstListenPort() + visit_test_bad_uri); HttpGet get = new HttpGet(request.getUri()); - final String rest = doRest(get); + String rest = doRest(get); assertThat(rest, containsString(visit_test_bad_response)); } @@ -296,5 +296,5 @@ public class RestApiTest { (JettyHttpServer) Container.get().getServerProviderRegistry().allComponents().get(0); return Integer.toString(serverProvider.getListenPort()); } -*/ + } diff --git a/vespaclient-container-plugin/src/test/application/services.xml b/vespaclient-container-plugin/src/test/rest-api-application/services.xml index df178e109c3..df178e109c3 100644 --- a/vespaclient-container-plugin/src/test/application/services.xml +++ b/vespaclient-container-plugin/src/test/rest-api-application/services.xml |