diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-10-17 11:33:46 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-10-17 11:33:46 +0200 |
commit | 20cef72bd64f76a4b702702d32d54c7020c2249a (patch) | |
tree | bda5d3400a7bf00dfa38e4648a24850c4fe7940f /config-application-package/src/test/java | |
parent | 40a36777c3de343207ed72482ecbbc5f1dc8fe96 (diff) |
Allow subset matches
Diffstat (limited to 'config-application-package/src/test/java')
2 files changed, 37 insertions, 29 deletions
diff --git a/config-application-package/src/test/java/com/yahoo/config/application/HostedOverrideProcessorTest.java b/config-application-package/src/test/java/com/yahoo/config/application/HostedOverrideProcessorTest.java index d01faaaaea9..4c6a3eb3513 100644 --- a/config-application-package/src/test/java/com/yahoo/config/application/HostedOverrideProcessorTest.java +++ b/config-application-package/src/test/java/com/yahoo/config/application/HostedOverrideProcessorTest.java @@ -38,7 +38,7 @@ public class HostedOverrideProcessorTest { @Test - public void testParsingDefault() throws IOException, SAXException, XMLStreamException, ParserConfigurationException, TransformerException { + public void testParsingDefault() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -50,7 +50,7 @@ public class HostedOverrideProcessorTest { } @Test - public void testParsingEnvironmentAndRegion() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingEnvironmentAndRegion() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -62,7 +62,7 @@ public class HostedOverrideProcessorTest { } @Test - public void testParsingEnvironmentAndRegion2() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingEnvironmentAndRegion2() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -74,7 +74,7 @@ public class HostedOverrideProcessorTest { } @Test - public void testParsingEnvironmentAndRegion3() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingEnvironmentAndRegion3() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -86,7 +86,7 @@ public class HostedOverrideProcessorTest { } @Test - public void testParsingEnvironmentUnknownRegion() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingEnvironmentUnknownRegion() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -98,7 +98,7 @@ public class HostedOverrideProcessorTest { } @Test - public void testParsingEnvironmentNoRegion() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingEnvironmentNoRegion() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -110,7 +110,7 @@ public class HostedOverrideProcessorTest { } @Test - public void testParsingUnknownEnvironment() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingUnknownEnvironment() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -122,7 +122,7 @@ public class HostedOverrideProcessorTest { } @Test - public void testParsingUnknownEnvironmentUnknownRegion() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingUnknownEnvironmentUnknownRegion() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -134,7 +134,7 @@ public class HostedOverrideProcessorTest { } @Test - public void testParsingInheritEnvironment() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingInheritEnvironment() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + diff --git a/config-application-package/src/test/java/com/yahoo/config/application/OverrideProcessorTest.java b/config-application-package/src/test/java/com/yahoo/config/application/OverrideProcessorTest.java index 32a1c4f847f..62e6671120b 100644 --- a/config-application-package/src/test/java/com/yahoo/config/application/OverrideProcessorTest.java +++ b/config-application-package/src/test/java/com/yahoo/config/application/OverrideProcessorTest.java @@ -34,7 +34,7 @@ public class OverrideProcessorTest { " </admin>" + " <content id=\"foo\" version=\"1.0\">" + " <redundancy>1</redundancy>" + - " <documents>" + + " <documents deploy:environment='staging prod'>" + " <document mode='index' type='music'/>\n" + " <document type='music2' mode='index' />\n" + " <document deploy:environment='prod' deploy:region='us-east-3' mode='index' type='music'/>\n" + @@ -42,6 +42,10 @@ public class OverrideProcessorTest { " <document deploy:environment='prod' mode='index' type='music3'/>\n" + " <document deploy:environment='prod' deploy:region='us-west' mode='index' type='music4'/>\n" + " </documents>" + + " <documents>" + + " <document mode='store-only' type='music'/>\n" + + " <document type='music2' mode='streaming' />\n" + + " </documents>" + " <nodes>" + " <node distribution-key=\"0\" hostalias=\"node0\"/>" + " </nodes>" + @@ -73,7 +77,7 @@ public class OverrideProcessorTest { @Test - public void testParsingDefault() throws IOException, SAXException, XMLStreamException, ParserConfigurationException, TransformerException { + public void testParsingDefault() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + " <admin version=\"2.0\">" + @@ -82,8 +86,8 @@ public class OverrideProcessorTest { " <content id=\"foo\" version=\"1.0\">" + " <redundancy>1</redundancy>" + " <documents>" + - " <document mode=\"index\" type=\"music\"/>" + - " <document mode=\"index\" type=\"music2\"/>" + + " <document mode=\"store-only\" type=\"music\"/>" + + " <document mode=\"streaming\" type=\"music2\"/>" + " </documents>" + " <nodes>" + " <node distribution-key=\"0\" hostalias=\"node0\"/>" + @@ -101,7 +105,7 @@ public class OverrideProcessorTest { } @Test - public void testParsingEnvironmentAndRegion() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingEnvironmentAndRegion() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -133,7 +137,7 @@ public class OverrideProcessorTest { } @Test - public void testParsingEnvironmentUnknownRegion() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingEnvironmentUnknownRegion() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -143,7 +147,9 @@ public class OverrideProcessorTest { " <content id=\"foo\" version=\"1.0\">" + " <redundancy>1</redundancy>" + " <documents>" + - " <document mode=\"index\" type=\"music3\"/>" + + " <document mode='index' type='music'/>\n" + + " <document type='music2' mode='index' />\n" + + " <document mode='index' type='music3'/>" + " </documents>" + " <nodes>" + " <node distribution-key=\"0\" hostalias=\"node0\"/>" + @@ -164,7 +170,7 @@ public class OverrideProcessorTest { } @Test - public void testParsingEnvironmentNoRegion() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingEnvironmentNoRegion() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -174,7 +180,9 @@ public class OverrideProcessorTest { " <content id=\"foo\" version=\"1.0\">" + " <redundancy>1</redundancy>" + " <documents>" + - " <document mode=\"index\" type=\"music3\"/>" + + " <document mode='index' type='music'/>\n" + + " <document type='music2' mode='index' />\n" + + " <document mode='index' type='music3'/>" + " </documents>" + " <nodes>" + " <node distribution-key=\"0\" hostalias=\"node0\"/>" + @@ -195,7 +203,7 @@ public class OverrideProcessorTest { } @Test - public void testParsingUnknownEnvironment() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingDevEnvironment() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -205,8 +213,8 @@ public class OverrideProcessorTest { " <content id=\"foo\" version=\"1.0\">" + " <redundancy>1</redundancy>" + " <documents>" + - " <document mode=\"index\" type=\"music\"/>" + - " <document mode=\"index\" type=\"music2\"/>" + + " <document mode=\"store-only\" type=\"music\"/>" + + " <document mode=\"streaming\" type=\"music2\"/>" + " </documents>" + " <nodes>" + " <node distribution-key=\"0\" hostalias=\"node0\"/>" + @@ -224,7 +232,7 @@ public class OverrideProcessorTest { } @Test - public void testParsingUnknownEnvironmentUnknownRegion() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingTestEnvironmentUnknownRegion() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -234,8 +242,8 @@ public class OverrideProcessorTest { " <content id=\"foo\" version=\"1.0\">" + " <redundancy>1</redundancy>" + " <documents>" + - " <document mode=\"index\" type=\"music\"/>" + - " <document mode=\"index\" type=\"music2\"/>" + + " <document mode=\"store-only\" type=\"music\"/>" + + " <document mode=\"streaming\" type=\"music2\"/>" + " </documents>" + " <nodes>" + " <node distribution-key=\"0\" hostalias=\"node0\"/>" + @@ -253,7 +261,7 @@ public class OverrideProcessorTest { } @Test - public void testParsingInheritEnvironment() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingInheritEnvironment() throws TransformerException { String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + @@ -263,8 +271,8 @@ public class OverrideProcessorTest { " <content id=\"foo\" version=\"1.0\">" + " <redundancy>1</redundancy>" + " <documents>" + - " <document mode=\"index\" type=\"music\"/>" + - " <document mode=\"index\" type=\"music2\"/>" + + " <document mode='index' type='music'/>\n" + + " <document type='music2' mode='index' />\n" + " </documents>" + " <nodes>" + // node1 is specified for us-west but does not match because region overrides implies environment=prod @@ -284,7 +292,7 @@ public class OverrideProcessorTest { } @Test(expected = IllegalArgumentException.class) - public void testParsingDifferentEnvInParentAndChild() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingDifferentEnvInParentAndChild() throws TransformerException { String in = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + " <admin deploy:environment=\"prod\" version=\"2.0\">" + @@ -296,7 +304,7 @@ public class OverrideProcessorTest { } @Test(expected = IllegalArgumentException.class) - public void testParsingDifferentRegionInParentAndChild() throws ParserConfigurationException, IOException, SAXException, TransformerException { + public void testParsingDifferentRegionInParentAndChild() throws TransformerException { String in = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" + "<services xmlns:deploy=\"vespa\" xmlns:preprocess=\"?\" version=\"1.0\">" + " <admin deploy:region=\"us-west\" version=\"2.0\">" + |