public DefaultKieCompilationResponseOffProcess(KieCompilationResponse res) { this.kieModuleMetaInfo = res.getKieModuleMetaInfo().orElse(null); this.kieModule = res.getKieModule().orElse(null); this.successful = res.isSuccessful(); this.requestUUID = ((DefaultKieCompilationResponse) res).getRequestUUID(); this.projectClassLoaderStore = Optional.ofNullable(res.getProjectClassLoaderStore()).orElse(Collections.emptyMap()); this.eventsTypeClasses = Optional.ofNullable(res.getEventTypeClasses()).orElse(Collections.emptySet()); this.mavenOutput = Optional.ofNullable(res.getMavenOutput()).orElse(Collections.emptyList()); this.projectDependencies = Optional.ofNullable(res.getDependencies()).orElse(Collections.emptyList()); this.targetContent = Optional.ofNullable(res.getTargetContent()).orElse(Collections.emptyList()); this.workingDir = res.getWorkingDir().map(Object::toString).orElse(""); }
public DefaultHttpCompilationResponse(KieCompilationResponse res) { this.successful = res.isSuccessful(); this.mavenOutput = new ArrayList<>(res.getMavenOutput()); if (res.getWorkingDir().isPresent()) { this.workingDir = res.getWorkingDir().get().toAbsolutePath().toString(); } else { this.workingDir = StringUtils.EMPTY; } this.targetContent = new ArrayList<>(res.getTargetContent()); this.projectDependencies = new ArrayList<>(res.getDependencies()); }
@Test public void buildAndInstallSkipDepsNonExistentProject() throws Exception { AFCompilerService service = new DefaultKieCompilerService(); CompletableFuture<KieCompilationResponse> futureRes = service.buildAndInstall(tmpRoot, mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.FALSE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isFalse(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildRemoteAndSkipDepsNonExistentProject() throws Exception { AFCompilerService service = new DefaultKieCompilerService(); CompletableFuture<KieCompilationResponse> futureRes = service.build(tmpRoot.toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.FALSE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isFalse(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildAndSkipDepsNonExistentProject() throws Exception{ DefaultLocalExecutor executor = new DefaultLocalExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.build(tmpRoot, mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.FALSE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isFalse(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildAndInstallSkipDepsNonExistentProject() throws Exception{ DefaultLocalExecutor executor = new DefaultLocalExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(tmpRoot, mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.FALSE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isFalse(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildAndSkipDepsNonExistentProject() throws Exception { AFCompilerService service = new DefaultKieCompilerService(); CompletableFuture<KieCompilationResponse> futureRes = service.build(tmpRoot, mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.FALSE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isFalse(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildAndSkipDepsNonExistentProject() throws Exception{ DefaultRemoteExecutor executor = new DefaultRemoteExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.build(tmpRoot.toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.FALSE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isFalse(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildRemoteAndInstallSkipDepsNonExistentProject() throws Exception { AFCompilerService service = new DefaultKieCompilerService(); CompletableFuture<KieCompilationResponse> futureRes = service.buildAndInstall(tmpRoot.toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.FALSE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isFalse(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildAndInstallSkipDepsNonExistentProject() throws Exception{ DefaultRemoteExecutor executor = new DefaultRemoteExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(tmpRoot.toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.FALSE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isFalse(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildRemoteAndInstallExistentProject() throws Exception { AFCompilerService service = new DefaultKieCompilerService(); CompletableFuture<KieCompilationResponse> futureRes = service.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath() + "/dummy").toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile()); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isNotEmpty(); assertThat(res.getDependencies().size()).isGreaterThan(0); }
@Test public void buildAndInstallExistentProject() throws Exception { AFCompilerService service = new DefaultKieCompilerService(); CompletableFuture<KieCompilationResponse> futureRes = service.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath() + "/dummy"), mavenRepoPath, TestUtilMaven.getSettingsFile()); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isNotEmpty(); assertThat(res.getDependencies().size()).isGreaterThan(0); }
@Test public void buildAndInstallExistentProject() throws Exception{ DefaultRemoteExecutor executor = new DefaultRemoteExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath()+"/dummy").toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile()); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isNotEmpty(); assertThat(res.getDependencies().size()).isGreaterThan(0); }
@Test public void buildAndInstallExistentProject() throws Exception{ DefaultLocalExecutor executor = new DefaultLocalExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath()+"/dummy"), mavenRepoPath, TestUtilMaven.getSettingsFile()); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isNotEmpty(); assertThat(res.getDependencies().size()).isGreaterThan(0); }
@Test public void buildAndInstallSkipDepsExistentProject() throws Exception{ DefaultLocalExecutor executor = new DefaultLocalExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath()+"/dummy"), mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.TRUE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildAndInstallSkipDepsExistentProject() throws Exception { AFCompilerService service = new DefaultKieCompilerService(); CompletableFuture<KieCompilationResponse> futureRes = service.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath() + "/dummy"), mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.TRUE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildAndInstallSkipDepsExistentProject() throws Exception{ DefaultRemoteExecutor executor = new DefaultRemoteExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath()+"/dummy").toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.TRUE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildRemoteAndInstallSkipDepsExistentProject() throws Exception { AFCompilerService service = new DefaultKieCompilerService(); CompletableFuture<KieCompilationResponse> futureRes = service.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath() + "/dummy").toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.TRUE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isEmpty(); }