@Test public void productionSpecWithDuplicateRegions() { StringReader r = new StringReader( "<deployment>" + " <instance id='default'>" + " <prod>" + " <region active='true'>us-west-1</region>" + " <parallel>" + " <region active='true'>us-west-1</region>" + " <region active='true'>us-central-1</region>" + " <region active='true'>us-east-3</region>" + " </parallel>" + " </prod>" + " </instance>" + "</deployment>" ); try { DeploymentSpec.fromXml(r); fail("Expected exception"); } catch (IllegalArgumentException e) { assertEquals("prod.us-west-1 is listed twice in deployment.xml", e.getMessage()); } }
public static DeploymentSpec fromXml(Reader reader) { return new DeploymentSpecXmlReader().read(reader); }
DeploymentSpec { public static DeploymentSpec fromXml(Reader reader) { return new DeploymentSpecXmlReader().read(reader); } }
DeploymentSpec { public static DeploymentSpec fromXml(Reader reader) { return new DeploymentSpecXmlReader().read(reader); } DeploymentSpec(List<Step> steps,
                          Optional<Integer> majorVersion,
                          Optional<AthenzDomain> athenzDomain,
                          Optional<AthenzService> athenzService,
                          String xmlForm); }
DeploymentSpec { public static DeploymentSpec fromXml(Reader reader) { return new DeploymentSpecXmlReader().read(reader); } DeploymentSpec(List<Step> steps,
                          Optional<Integer> majorVersion,
                          Optional<AthenzDomain> athenzDomain,
                          Optional<AthenzService> athenzService,
                          String xmlForm); Optional<Integer> majorVersion(); List<Step> steps(); Optional<AthenzDomain> athenzDomain(); Optional<AthenzService> athenzService(); String xmlForm(); Optional<DeploymentInstanceSpec> instance(InstanceName name); DeploymentInstanceSpec requireInstance(String name); DeploymentInstanceSpec requireInstance(InstanceName name); List<InstanceName> instanceNames(); List<DeploymentInstanceSpec> instances(); static DeploymentSpec fromXml(Reader reader); static DeploymentSpec fromXml(String xmlForm); static DeploymentSpec fromXml(String xmlForm, boolean validate); static String toMessageString(Throwable t); @Override boolean equals(Object o); @Override int hashCode(); }
DeploymentSpec { public static DeploymentSpec fromXml(Reader reader) { return new DeploymentSpecXmlReader().read(reader); } DeploymentSpec(List<Step> steps,
                          Optional<Integer> majorVersion,
                          Optional<AthenzDomain> athenzDomain,
                          Optional<AthenzService> athenzService,
                          String xmlForm); Optional<Integer> majorVersion(); List<Step> steps(); Optional<AthenzDomain> athenzDomain(); Optional<AthenzService> athenzService(); String xmlForm(); Optional<DeploymentInstanceSpec> instance(InstanceName name); DeploymentInstanceSpec requireInstance(String name); DeploymentInstanceSpec requireInstance(InstanceName name); List<InstanceName> instanceNames(); List<DeploymentInstanceSpec> instances(); static DeploymentSpec fromXml(Reader reader); static DeploymentSpec fromXml(String xmlForm); static DeploymentSpec fromXml(String xmlForm, boolean validate); static String toMessageString(Throwable t); @Override boolean equals(Object o); @Override int hashCode(); static final DeploymentSpec empty; }