forked from Praqma/config-rotator-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fixed JENKINS-17229] Updated to baseline list
- Loading branch information
1 parent
15ad9e5
commit 8a4a016
Showing
4 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/main/java/net/praqma/jenkins/configrotator/scm/clearcaseucm/NextBaseline.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package net.praqma.jenkins.configrotator.scm.clearcaseucm; | ||
|
||
import hudson.FilePath; | ||
import hudson.remoting.VirtualChannel; | ||
import net.praqma.clearcase.exceptions.UnableToInitializeEntityException; | ||
import net.praqma.clearcase.exceptions.UnableToListBaselinesException; | ||
import net.praqma.clearcase.ucm.entities.Baseline; | ||
import net.praqma.clearcase.ucm.entities.Component; | ||
import net.praqma.clearcase.ucm.entities.Project; | ||
import net.praqma.clearcase.ucm.entities.Stream; | ||
import net.praqma.clearcase.ucm.utils.BaselineList; | ||
import net.praqma.clearcase.ucm.utils.filters.AfterBaseline; | ||
import net.praqma.clearcase.ucm.utils.filters.NoDeliver; | ||
import net.praqma.clearcase.ucm.utils.filters.NoLabels; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
/** | ||
* @author cwolfgang | ||
*/ | ||
public class NextBaseline implements FilePath.FileCallable<Baseline> { | ||
|
||
private Stream stream; | ||
private Component component; | ||
private Project.PromotionLevel level; | ||
private Baseline offset; | ||
|
||
public NextBaseline( Stream stream, Component component, Project.PromotionLevel level, Baseline offset ) { | ||
this.stream = stream; | ||
this.component = component; | ||
this.level = level; | ||
this.offset = offset; | ||
} | ||
|
||
@Override | ||
public Baseline invoke( File f, VirtualChannel channel ) throws IOException, InterruptedException { | ||
BaselineList list = new BaselineList( stream, component, level ). | ||
addFilter( new AfterBaseline( offset ) ). | ||
addFilter( new NoDeliver() ). | ||
addFilter( new NoLabels() ). | ||
setSorting( new BaselineList.AscendingDateSort() ). | ||
load(). | ||
setLimit( 1 ); | ||
|
||
try { | ||
list.apply(); | ||
return list.get( 0 ); | ||
} catch( Exception e ) { | ||
throw new IOException( e ); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/test/java/net/praqma/jenkins/configrotator/ClearCaseUCMBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.praqma.jenkins.configrotator; | ||
|
||
import net.praqma.jenkins.configrotator.scm.clearcaseucm.ClearCaseUCM; | ||
|
||
/** | ||
* @author cwolfgang | ||
*/ | ||
public class ClearCaseUCMBuilder { | ||
|
||
private ClearCaseUCM ccucm; | ||
private String pvob; | ||
|
||
public ClearCaseUCMBuilder( String pvob ) { | ||
ccucm = new ClearCaseUCM( pvob ); | ||
this.pvob = pvob; | ||
} | ||
|
||
public ClearCaseUCMBuilder addBuilder() { | ||
//ccucm. | ||
|
||
return this; | ||
} | ||
|
||
} |