diff options
author | Harald Musum <musum@verizonmedia.com> | 2019-05-27 22:09:11 +0200 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2019-05-27 22:46:51 +0200 |
commit | 8f4b3521f99ca1197d903177a28245205e52e722 (patch) | |
tree | baed28cee53819e539dbbc7e526699c0f01a0ee0 /application | |
parent | 83d0d125433ab8a4e7dbc40cd21d2188d95961d8 (diff) |
Ignore deployment.xml in some contexts (e.g. unit tests)
Diffstat (limited to 'application')
3 files changed, 25 insertions, 8 deletions
diff --git a/application/src/test/app-packages/athenz-in-deployment-xml/deployment.xml b/application/src/test/app-packages/athenz-in-deployment-xml/deployment.xml new file mode 100644 index 00000000000..261ce9b89a8 --- /dev/null +++ b/application/src/test/app-packages/athenz-in-deployment-xml/deployment.xml @@ -0,0 +1,7 @@ +<deployment version="1.0" athenz-domain="foo" athenz-service="bar"> + <test /> + <staging /> + <prod> + <region active="true">us-west-1</region> + </prod> +</deployment> diff --git a/application/src/test/app-packages/athenz-in-deployment-xml/services.xml b/application/src/test/app-packages/athenz-in-deployment-xml/services.xml new file mode 100644 index 00000000000..b7962bcbcc9 --- /dev/null +++ b/application/src/test/app-packages/athenz-in-deployment-xml/services.xml @@ -0,0 +1,5 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<container version='1.0'> + <search/> +</container> diff --git a/application/src/test/java/com/yahoo/application/ApplicationTest.java b/application/src/test/java/com/yahoo/application/ApplicationTest.java index 7b4f39b6ac4..3227b579832 100644 --- a/application/src/test/java/com/yahoo/application/ApplicationTest.java +++ b/application/src/test/java/com/yahoo/application/ApplicationTest.java @@ -22,12 +22,10 @@ import com.yahoo.jdisc.handler.RequestHandler; import com.yahoo.search.Query; import com.yahoo.search.Result; import com.yahoo.search.handler.SearchHandler; -import static com.yahoo.vespa.defaults.Defaults.getDefaults; import org.apache.commons.io.IOUtils; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; -import org.junit.Ignore; import org.junit.Test; import java.io.BufferedReader; @@ -38,13 +36,12 @@ import java.net.ConnectException; import java.net.ServerSocket; import java.util.Map; +import static com.yahoo.vespa.defaults.Defaults.getDefaults; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static com.yahoo.application.container.JDiscTest.getListenPort; - /** * @author bratseth */ @@ -52,7 +49,7 @@ import static com.yahoo.application.container.JDiscTest.getListenPort; public class ApplicationTest { @Test - public void minimal_application_can_be_constructed() throws Exception { + public void minimal_application_can_be_constructed() { try (Application application = Application.fromServicesXml("<jdisc version=\"1.0\"/>", Networking.disable)) { Application unused = application; } @@ -60,7 +57,7 @@ public class ApplicationTest { /** Tests that an application with search chains referencing a content cluster can be constructed. */ @Test - public void container_and_referenced_content() throws Exception { + public void container_and_referenced_content() { try (Application application = Application.fromApplicationPackage(new File("src/test/app-packages/withcontent"), Networking.disable)) { Result result = application.getJDisc("default").search().process(new ComponentSpecification("default"), @@ -294,7 +291,7 @@ public class ApplicationTest { } @Test - public void file_distribution() throws Exception { + public void file_distribution() { try (Application application = Application.fromApplicationPackage(new File("src/test/app-packages/filedistribution/"), Networking.disable)) { // Deployment succeeded Application unused = application; @@ -359,6 +356,14 @@ public class ApplicationTest { } } + @Test + public void athenz_in_deployment_xml() { + try (Application application = Application.fromApplicationPackage(new File("src/test/app-packages/athenz-in-deployment-xml/"), Networking.disable)) { + // Deployment succeeded + Application unused = application; + } + } + private static int getFreePort() throws IOException { try (ServerSocket socket = new ServerSocket(0)) { socket.setReuseAddress(true); @@ -373,7 +378,7 @@ public class ApplicationTest { } @Test - public void application_with_access_control_can_be_constructed() throws Exception { + public void application_with_access_control_can_be_constructed() { try (Application application = Application.fromServicesXml(servicesXmlWithAccessControl(), Networking.disable)) { Application unused = application; } |