forked from eficode/ClearCaseUCMPlugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[JENKINS-14436] Showing only one version per file
- Loading branch information
1 parent
0aa861d
commit 7254714
Showing
2 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
src/test/java/net/praqma/hudson/test/integration/userstories/Story12.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,51 @@ | ||
package net.praqma.hudson.test.integration.userstories; | ||
|
||
import org.junit.ClassRule; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
import hudson.model.AbstractBuild; | ||
import hudson.model.Result; | ||
import hudson.scm.ChangeLogSet; | ||
import hudson.scm.ChangeLogSet.Entry; | ||
import net.praqma.clearcase.ucm.entities.Baseline; | ||
import net.praqma.clearcase.ucm.entities.Project.PromotionLevel; | ||
import net.praqma.hudson.test.CCUCMRule; | ||
import net.praqma.hudson.test.SystemValidator; | ||
import net.praqma.junit.DescriptionRule; | ||
import net.praqma.junit.TestDescription; | ||
|
||
import net.praqma.clearcase.test.junit.ClearCaseRule; | ||
|
||
public class Story12 { | ||
|
||
@ClassRule | ||
public static CCUCMRule jenkins = new CCUCMRule(); | ||
|
||
@Rule | ||
public static ClearCaseRule ccenv = new ClearCaseRule( "ccucm-story12", "setup-story12.xml" ); | ||
|
||
@Rule | ||
public static DescriptionRule desc = new DescriptionRule(); | ||
|
||
@Test | ||
@TestDescription( title = "Story 12, JENKINS-14436", text = "Not all versions, only the latest are shown" ) | ||
public void story12() throws Exception { | ||
|
||
/* First build to create a view */ | ||
AbstractBuild<?, ?> firstbuild = jenkins.initiateBuild( ccenv.getUniqueName(), "self", "_System@" + ccenv.getPVob(), "one_int@" + ccenv.getPVob(), false, false, false, false, false, false ); | ||
|
||
/* Validate first build */ | ||
Baseline baseline = ccenv.context.baselines.get( "model-1" ); | ||
new SystemValidator( firstbuild ).validateBuild( Result.SUCCESS ).validateBuiltBaseline( PromotionLevel.BUILT, baseline, false ).validate(); | ||
|
||
AbstractBuild<?, ?> build = jenkins.buildProject( firstbuild.getProject(), false ); | ||
|
||
Baseline baseline2 = ccenv.context.baselines.get( "model-2" ); | ||
new SystemValidator( build ).validateBuild( Result.SUCCESS ).validateBuiltBaseline( PromotionLevel.BUILT, baseline2, false ).validate(); | ||
|
||
ChangeLogSet<? extends Entry> chlog = build.getChangeSet(); | ||
} | ||
|
||
|
||
} |
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,43 @@ | ||
<ccenvs xmlns:xi="http://www.w3.org/2001/XInclude"> | ||
<xi:include href="src/test/resources/setup-basic.xml"/> | ||
|
||
<ccenv name="story 12"> | ||
|
||
<context mvfs="m:\" linux="/view" view="${name}_one_int" vob="${vobname}"/> | ||
|
||
<activity comment="" headline="Adding initial files into components" in="one_int" name="initial_files" pvob="${pvobname}" /> | ||
|
||
<setactivity activity="initial_files" pvob="${pvobname}" /> | ||
|
||
<!-- Add element --> | ||
<add file="Model/model.h" content="#1" /> | ||
|
||
<baseline name="model-1" label="full" comment="" component="_System" pvob="${pvobname}" /> | ||
|
||
<!-- Second checkin --> | ||
<checkout comment="" file="Model/model.h" /> | ||
|
||
<content file="Model/model.h" content="#2" /> | ||
|
||
<checkin file="Model/model.h" /> | ||
|
||
<!-- Third checkin --> | ||
<checkout comment="" file="Model/model.h" /> | ||
|
||
<content file="Model/model.h" content="#3" /> | ||
|
||
<checkin file="Model/model.h" /> | ||
|
||
<!-- Fourth checkin --> | ||
<checkout comment="" file="Model/model.h" /> | ||
|
||
<content file="Model/model.h" content="#4" /> | ||
|
||
<checkin file="Model/model.h" /> | ||
|
||
<!-- Baselined --> | ||
<baseline name="model-2" label="full" comment="" component="_System" pvob="${pvobname}" /> | ||
|
||
|
||
</ccenv> | ||
</ccenvs> |