@Test public void should_create_a_new_arquillian_xml() throws IOException, TransformerException { ArquillianChameleonConfigurationGenerator arquillianChameleonConfigurationGenerator = new ArquillianChameleonConfigurationGenerator(); final Path generatedConfigurationFile = arquillianChameleonConfigurationGenerator.generateNewArquillianXml(GenericTest.class); assertThat(generatedConfigurationFile) .hasFileName(ArquillianChameleonConfigurationGenerator.ARQUILLIAN_XML) .exists(); final XmlPath xmlPath = new XmlPath(generatedConfigurationFile.toUri()) .setRoot("arquillian"); final String target = xmlPath .getString("container.configuration.property.find{it.@name == 'chameleonTarget'}"); assertThat(target) .isNotNull() .isEqualTo("tomcat:7.0.0:managed"); final String a = xmlPath .getString("container.configuration.property.find{it.@name == 'a'}"); assertThat(a) .isNotNull() .isEqualTo("b"); }
public Path generateNewArquillianXml(Class<?> testClass) throws IOException, TransformerException { final ChameleonTargetConfiguration chameleonTargetConfiguration = findChameleonTargetConfiguration(testClass); if (chameleonTargetConfiguration != null) { final Node containerDefinition = chameleonTargetConfiguration.getContainerDefinitionAsXml(); Document arquillianConfigurationDocument = DomManipulation.createDocumentFromTemplate(); return generate(arquillianConfigurationDocument, containerDefinition, ARQUILLIAN_XML); } return null; }
ArquillianChameleonConfigurationGenerator { public Path generateNewArquillianXml(Class<?> testClass) throws IOException, TransformerException { final ChameleonTargetConfiguration chameleonTargetConfiguration = findChameleonTargetConfiguration(testClass); if (chameleonTargetConfiguration != null) { final Node containerDefinition = chameleonTargetConfiguration.getContainerDefinitionAsXml(); Document arquillianConfigurationDocument = DomManipulation.createDocumentFromTemplate(); return generate(arquillianConfigurationDocument, containerDefinition, ARQUILLIAN_XML); } return null; } }
ArquillianChameleonConfigurationGenerator { public Path generateNewArquillianXml(Class<?> testClass) throws IOException, TransformerException { final ChameleonTargetConfiguration chameleonTargetConfiguration = findChameleonTargetConfiguration(testClass); if (chameleonTargetConfiguration != null) { final Node containerDefinition = chameleonTargetConfiguration.getContainerDefinitionAsXml(); Document arquillianConfigurationDocument = DomManipulation.createDocumentFromTemplate(); return generate(arquillianConfigurationDocument, containerDefinition, ARQUILLIAN_XML); } return null; }  }
ArquillianChameleonConfigurationGenerator { public Path generateNewArquillianXml(Class<?> testClass) throws IOException, TransformerException { final ChameleonTargetConfiguration chameleonTargetConfiguration = findChameleonTargetConfiguration(testClass); if (chameleonTargetConfiguration != null) { final Node containerDefinition = chameleonTargetConfiguration.getContainerDefinitionAsXml(); Document arquillianConfigurationDocument = DomManipulation.createDocumentFromTemplate(); return generate(arquillianConfigurationDocument, containerDefinition, ARQUILLIAN_XML); } return null; }  Path generateNewArquillianProperties(Class<?> testClass); Path generateNewArquillianXml(Class<?> testClass); Path generateAppendedArquillianXml(Class<?> testClass, InputStream originalArquillianXml); }
ArquillianChameleonConfigurationGenerator { public Path generateNewArquillianXml(Class<?> testClass) throws IOException, TransformerException { final ChameleonTargetConfiguration chameleonTargetConfiguration = findChameleonTargetConfiguration(testClass); if (chameleonTargetConfiguration != null) { final Node containerDefinition = chameleonTargetConfiguration.getContainerDefinitionAsXml(); Document arquillianConfigurationDocument = DomManipulation.createDocumentFromTemplate(); return generate(arquillianConfigurationDocument, containerDefinition, ARQUILLIAN_XML); } return null; }  Path generateNewArquillianProperties(Class<?> testClass); Path generateNewArquillianXml(Class<?> testClass); Path generateAppendedArquillianXml(Class<?> testClass, InputStream originalArquillianXml);  }