diff options
Diffstat (limited to 'config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java b/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java index d4e521ebd13..0334b3c867b 100644 --- a/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java +++ b/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java @@ -21,6 +21,7 @@ import com.yahoo.vespa.model.VespaModel; import com.yahoo.vespa.model.search.SearchDefinition; import org.json.JSONException; import org.junit.After; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -203,6 +204,28 @@ public class ApplicationDeployTest { assertThat(getSearchDefinitions(app).size(), is(6)); } + @Test + public void testThatAppWithDeploymentXmlIsValid() throws IOException { + File tmpDir = Files.createTempDir(); + IOUtils.copyDirectory(new File(TESTDIR, "app1"), tmpDir); + createAppPkg(tmpDir.getAbsolutePath()); + } + + @Ignore // TODO: Enable when code in ApplicationPackageXmlFilesValidator does validation of deployment.xml + @Test(expected = IllegalArgumentException.class) + public void testThatAppWithIllegalDeploymentXmlIsNotValid() throws IOException { + File tmpDir = Files.createTempDir(); + IOUtils.copyDirectory(new File(TESTDIR, "app_invalid_deployment_xml"), tmpDir); + createAppPkg(tmpDir.getAbsolutePath()); + } + + @Test + public void testThatAppWithIllegalEmptyProdRegion() throws IOException { + File tmpDir = Files.createTempDir(); + IOUtils.copyDirectory(new File(TESTDIR, "empty_prod_region_in_deployment_xml"), tmpDir); + createAppPkg(tmpDir.getAbsolutePath()); + } + private List<SearchDefinition> getSearchDefinitions(FilesApplicationPackage app) { return new DeployState.Builder().applicationPackage(app).build().getSearchDefinitions(); } |