Skip to content

Commit

Permalink
Refactored classloader management to not change the Thread's context …
Browse files Browse the repository at this point in the history
…classloader

Auto-add jar files found in configured classpath directories

Improved on-screen help for jdbc url and classpath

DAT-4624
SECURITY-519
  • Loading branch information
nvoxland committed May 6, 2020
1 parent 7726ce4 commit 1817af0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
Expand Up @@ -75,7 +75,12 @@ public static ClassLoader createClassLoader(boolean isUnix, final FilePath works
//jenkins FilePath prefers unix style, even on windows
filePath = filePath.replace("\\", "/");

FilePath file = workspace.child(filePath);
FilePath file;
if (workspace == null) {
file = new FilePath(new File(filePath));
} else {
file = workspace.child(filePath);
}
try {

if (file.isDirectory()) {
Expand Down
Expand Up @@ -89,31 +89,6 @@ public void should_indicate_success_with_yaml_formatted_changeset()
assertThat(build, isSuccessful());
}

@Test
public void should_mark_liquibase_setup_problem_as_failure()
throws IOException, ExecutionException, InterruptedException {

Properties properties = new Properties();
properties.setProperty("driver", "nosuch.driver");
properties.setProperty("changeLogFile", "sunny-day-changeset.xml");
LiquibaseTestUtil.createFileFromResource(temporaryFolder.getRoot(), "/example-changesets/sunny-day-changeset.xml");

FreeStyleProject project = jenkinsRule.createFreeStyleProject();
project.setCustomWorkspace(temporaryFolder.getRoot().getAbsolutePath());

File propertiesFile = temporaryFolder.newFile();
properties.store(new FileOutputStream(propertiesFile), "Liquibase Test Properties");

ChangesetEvaluator evaluator = new ChangesetEvaluator();
evaluator.setLiquibasePropertiesPath(propertiesFile.getAbsolutePath());

project.getBuildersList().add(evaluator);
FreeStyleBuild build = launchBuildForProject(project);
assertThat(build , isFailure());

}



/**
* Covers https://github.com/jenkinsci/liquibase-runner-plugin/issues/8
Expand Down

0 comments on commit 1817af0

Please sign in to comment.