@Override protected Properties useOverridePropertiesWithPropertiesComponent() { try { ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration(); ProjectGenerator projectGenerator = new ProjectGenerator(configuration, new ResourceManager()); return projectGenerator.generateApplicationProperties(newIntegration()); } catch (IOException e) { Assertions.fail("Unable to generate integration properties", e); } return null; }
protected static void generate(Path destination, Integration integration, ProjectGeneratorConfiguration generatorConfiguration, TestResourceManager resourceManager) throws IOException { final IntegrationProjectGenerator generator = new ProjectGenerator(generatorConfiguration, resourceManager,TestConstants.MAVEN_PROPERTIES); try (InputStream is = generator.generate(integration)) { try (TarArchiveInputStream tis = new TarArchiveInputStream(is)) { TarArchiveEntry tarEntry = tis.getNextTarEntry(); // tarIn is a TarArchiveInputStream while (tarEntry != null) { // create a file with the same name as the tarEntry File destPath = new File(destination.toFile(), tarEntry.getName()); if (tarEntry.isDirectory()) { destPath.mkdirs(); } else { destPath.getParentFile().mkdirs(); destPath.createNewFile(); try(BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(destPath))) { IOUtils.copy(tis, bout); } } tarEntry = tis.getNextTarEntry(); } } }; } }
protected Path generate(IntegrationDeployment deployment, ProjectGeneratorConfiguration generatorConfiguration) throws IOException { final IntegrationResourceManager resourceManager = new TestResourceManager(); final IntegrationProjectGenerator generator = new ProjectGenerator(generatorConfiguration, resourceManager); try (InputStream is = generator.generate(deployment)) { Path ret = testFolder.newFolder("integration-project").toPath(); try (TarArchiveInputStream tis = new TarArchiveInputStream(is)) { TarArchiveEntry tarEntry = tis.getNextTarEntry(); // tarIn is a TarArchiveInputStream while (tarEntry != null) { // create a file with the same name as the tarEntry File destPath = new File(ret.toFile(), tarEntry.getName()); if (tarEntry.isDirectory()) { destPath.mkdirs(); } else { destPath.getParentFile().mkdirs(); destPath.createNewFile(); try(BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(destPath))) { IOUtils.copy(tis, bout); } } tarEntry = tis.getNextTarEntry(); } } return ret; } }
@Override protected Properties useOverridePropertiesWithPropertiesComponent() { try { ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration(); ProjectGenerator projectGenerator = new ProjectGenerator(configuration, new ResourceManager(), new MavenProperties()); return projectGenerator.generateApplicationProperties(newIntegration()); } catch (IOException e) { Assertions.fail("Unable to generate integration properties", e); } return null; }
ProjectGenerator generator = new ProjectGenerator(configuration, resourceManager, TestConstants.MAVEN_PROPERTIES); Integration integration = new Integration.Builder() .createFrom(resourceManager.newIntegration(s1, s2))