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.
- Loading branch information
1 parent
5e0af3f
commit b4282c3
Showing
4 changed files
with
125 additions
and
26 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
56 changes: 56 additions & 0 deletions
56
src/test/java/net/praqma/hudson/test/integration/userstories/JENKINS14806.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,56 @@ | ||
package net.praqma.hudson.test.integration.userstories; | ||
|
||
import org.junit.ClassRule; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.mockito.Mockito; | ||
import org.powermock.api.mockito.PowerMockito; | ||
import org.powermock.modules.junit4.PowerMockRunner; | ||
|
||
import hudson.model.AbstractBuild; | ||
import hudson.model.AbstractProject; | ||
import hudson.model.FreeStyleProject; | ||
import hudson.model.Result; | ||
import net.praqma.clearcase.ucm.entities.Baseline; | ||
import net.praqma.clearcase.ucm.entities.Project.PromotionLevel; | ||
import net.praqma.hudson.scm.CCUCMScm; | ||
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; | ||
|
||
@RunWith( PowerMockRunner.class ) | ||
public class JENKINS14806 { | ||
|
||
@ClassRule | ||
public static CCUCMRule jenkins = new CCUCMRule(); | ||
|
||
@Rule | ||
public static ClearCaseRule ccenv = new ClearCaseRule( "JENKINS-14806", "setup-JENKINS-14806.xml" ); | ||
|
||
@Rule | ||
public static DescriptionRule desc = new DescriptionRule(); | ||
|
||
@Test | ||
@TestDescription( title = "JENKINS-14806", text = "Multisite polling finds the same baseline times", configurations = { "ClearCase multisite = true" } ) | ||
public void jenkins13944() throws Exception { | ||
|
||
CCUCMScm ccucm = jenkins.getCCUCM( "child", "_System@" + ccenv.getPVob(), "one_int@" + ccenv.getPVob(), "INITIAL", false, false, false, false, true, "[project]_[date]_[time]" ); | ||
CCUCMScm ccucmspy = Mockito.spy( ccucm ); | ||
|
||
/* Behaviour */ | ||
PowerMockito.doReturn( true ).when( ccucmspy ).getMultisitePolling(); | ||
|
||
FreeStyleProject project = jenkins.createProject( ccenv.getUniqueName(), ccucmspy ); | ||
|
||
/* First build to create a view */ | ||
AbstractBuild<?, ?> build = jenkins.buildProject( project, false ); | ||
Baseline baseline = ccenv.context.baselines.get( "model-1" ); | ||
new SystemValidator( build ).validateBuild( Result.SUCCESS ).validateBuiltBaseline( PromotionLevel.BUILT, baseline, false ).validate(); | ||
} | ||
|
||
|
||
} |
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,30 @@ | ||
<ccenvs xmlns:xi="http://www.w3.org/2001/XInclude"> | ||
<xi:include href="src/test/resources/setup-basic.xml"/> | ||
<xi:include href="src/test/resources/setup-jenkins-project.xml"/> | ||
|
||
<ccenv name="JENKINS 14806"> | ||
|
||
<context mvfs="m:\" linux="/view" view="${name}_one_dev" 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 --> | ||
<checkout comment="" file="Model/model.h" /> | ||
<content file="Model/model.h" content="#2" /> | ||
<checkin file="Model/model.h" /> | ||
<baseline name="model-2" label="full" comment="" component="_System" pvob="${pvobname}" /> | ||
|
||
<!-- Third --> | ||
<checkout comment="" file="Model/model.h" /> | ||
<content file="Model/model.h" content="#3" /> | ||
<checkin file="Model/model.h" /> | ||
<baseline name="model-3" label="full" comment="" component="_System" pvob="${pvobname}" /> | ||
|
||
</ccenv> | ||
</ccenvs> |