Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-14436] Showing only one version per file
  • Loading branch information
wolfgarnet committed Jul 15, 2012
1 parent 0aa861d commit 7254714
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
@@ -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();
}


}
43 changes: 43 additions & 0 deletions src/test/resources/setup-story12.xml
@@ -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>

0 comments on commit 7254714

Please sign in to comment.