@Override
public boolean checkout(AbstractBuild<?, ?> build, Launcher launcher, FilePath workspace, BuildListener listener, File changelogFile) throws IOException, InterruptedException {
return innerScm.checkout(new FilePath(changelogFile), getRevisionStateFileFileForBuild(build), workspace);
} @Override
public ChangeLogParser createChangeLogParser() {
return new ChangeLogParser() {
@SuppressWarnings("rawtypes")
@Override
public ChangeLogSet<? extends Entry> parse(AbstractBuild build, File changelogFile) throws IOException {
return new HanaChangeLogSet(build, innerScm.parseChangeLog(changelogFile));
}
};
}
private final transient DatabaseInnerSCM innerScm;
@DataBoundConstructor
public DatabaseSCM(String connection, String objectFilter, boolean shouldDownloadContent, RepositoryBrowser<HanaChangeLogSet.Entry> browser) {
this.connection = connection;
this.objectFilter = objectFilter;
this.shouldDownloadContent = shouldDownloadContent;
this.browser = browser;
Repository repository = new SQLRepository(new SQLConnectionProviderImpl());
ObjectFilter[] filters = new ObjectFilterParser().parseMultiple(this.objectFilter);
this.innerScm = new DatabaseInnerSCM(repository, filters, shouldDownloadContent);
}So from the code I don't see how this could become null when going through the constructor.
Does the Jenkins framework have any other way to assign the field than using the data-bound constructor?
Best regards
Jens
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/1c092fb3-893d-4526-80a5-4e68d1136f76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/fef93382-7f77-43a9-8071-32ba0810066f%40googlegroups.com.
@Test
public void givenJobCreatedFromXml_shouldWork() throws Exception {
createInMemoDB("MYDB");
FreeStyleProject project1 = createProjectWithScmForNamedConnection("project1", "MYDB");
InputStream xmlConfig = new FileInputStream(project1.getConfigFile().getFile());
FreeStyleProject project2 = (FreeStyleProject) j.hudson.createProjectFromXML("project2", xmlConfig);
triggerBuildAndAssert(project2, Result.SUCCESS);}