@Test public void should_create_a_new_arquillian_properties() throws IOException { ArquillianChameleonConfigurationGenerator arquillianChameleonConfigurationGenerator = new ArquillianChameleonConfigurationGenerator(); final Path generateArquillianProperties = arquillianChameleonConfigurationGenerator.generateNewArquillianProperties(GenericTest.class); assertThat(generateArquillianProperties) .hasFileName("arquillian.properties") .exists(); Properties properties = new Properties(); properties.load(new FileReader(generateArquillianProperties.toFile())); assertThat(properties) .contains(entry("arq.container.chameleon.configuration.chameleonTarget", "tomcat:7.0.0:managed")); }
public Path generateNewArquillianProperties(Class<?> testClass) throws IOException { final ChameleonTargetConfiguration chameleonTargetConfiguration = findChameleonTargetConfiguration(testClass); if (chameleonTargetConfiguration != null) { final Properties containerDefinitionAsProperties = chameleonTargetConfiguration.getContainerDefinitionAsProperties(); final Path tempDirectory = Files.createTempDirectory("chameleonContainer"); final Path arquillianPath = tempDirectory.resolve(ARQUILLIAN_PROPERTIES); containerDefinitionAsProperties.store(new FileWriter(arquillianPath.toFile()), ""); return arquillianPath; } return null; }
ArquillianChameleonConfigurationGenerator { public Path generateNewArquillianProperties(Class<?> testClass) throws IOException { final ChameleonTargetConfiguration chameleonTargetConfiguration = findChameleonTargetConfiguration(testClass); if (chameleonTargetConfiguration != null) { final Properties containerDefinitionAsProperties = chameleonTargetConfiguration.getContainerDefinitionAsProperties(); final Path tempDirectory = Files.createTempDirectory("chameleonContainer"); final Path arquillianPath = tempDirectory.resolve(ARQUILLIAN_PROPERTIES); containerDefinitionAsProperties.store(new FileWriter(arquillianPath.toFile()), ""); return arquillianPath; } return null; } }
ArquillianChameleonConfigurationGenerator { public Path generateNewArquillianProperties(Class<?> testClass) throws IOException { final ChameleonTargetConfiguration chameleonTargetConfiguration = findChameleonTargetConfiguration(testClass); if (chameleonTargetConfiguration != null) { final Properties containerDefinitionAsProperties = chameleonTargetConfiguration.getContainerDefinitionAsProperties(); final Path tempDirectory = Files.createTempDirectory("chameleonContainer"); final Path arquillianPath = tempDirectory.resolve(ARQUILLIAN_PROPERTIES); containerDefinitionAsProperties.store(new FileWriter(arquillianPath.toFile()), ""); return arquillianPath; } return null; }  }
ArquillianChameleonConfigurationGenerator { public Path generateNewArquillianProperties(Class<?> testClass) throws IOException { final ChameleonTargetConfiguration chameleonTargetConfiguration = findChameleonTargetConfiguration(testClass); if (chameleonTargetConfiguration != null) { final Properties containerDefinitionAsProperties = chameleonTargetConfiguration.getContainerDefinitionAsProperties(); final Path tempDirectory = Files.createTempDirectory("chameleonContainer"); final Path arquillianPath = tempDirectory.resolve(ARQUILLIAN_PROPERTIES); containerDefinitionAsProperties.store(new FileWriter(arquillianPath.toFile()), ""); return arquillianPath; } return null; }  Path generateNewArquillianProperties(Class<?> testClass); Path generateNewArquillianXml(Class<?> testClass); Path generateAppendedArquillianXml(Class<?> testClass, InputStream originalArquillianXml); }
ArquillianChameleonConfigurationGenerator { public Path generateNewArquillianProperties(Class<?> testClass) throws IOException { final ChameleonTargetConfiguration chameleonTargetConfiguration = findChameleonTargetConfiguration(testClass); if (chameleonTargetConfiguration != null) { final Properties containerDefinitionAsProperties = chameleonTargetConfiguration.getContainerDefinitionAsProperties(); final Path tempDirectory = Files.createTempDirectory("chameleonContainer"); final Path arquillianPath = tempDirectory.resolve(ARQUILLIAN_PROPERTIES); containerDefinitionAsProperties.store(new FileWriter(arquillianPath.toFile()), ""); return arquillianPath; } return null; }  Path generateNewArquillianProperties(Class<?> testClass); Path generateNewArquillianXml(Class<?> testClass); Path generateAppendedArquillianXml(Class<?> testClass, InputStream originalArquillianXml);  }