Skip to content

Commit

Permalink
[JENKINS-17067] Added test on remote
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgarnet committed Mar 7, 2013
1 parent b01029f commit 7fd7416
Showing 1 changed file with 15 additions and 16 deletions.
Expand Up @@ -4,7 +4,9 @@
import java.util.logging.Level;

import hudson.model.*;
import hudson.model.labels.LabelAtom;
import net.praqma.hudson.test.BaseTestClass;
import net.praqma.hudson.test.SystemValidator;
import net.praqma.util.test.junit.LoggingRule;
import org.junit.ClassRule;
import org.junit.Rule;
Expand Down Expand Up @@ -41,12 +43,18 @@ public class Story06 extends BaseTestClass {
private static Logger logger = Logger.getLogger();

@Test
@TestDescription( title = "Story 6", text = "New baseline, bl1, on dev stream, poll on childs. Deliver in progress, forced cancelled", configurations = { "Force deliver = true" } )
public void story06() throws Exception {
run( null );
@TestDescription( title = "Story 6", text = "New baseline, bl1, on dev stream, poll on childs. Deliver in progress", configurations = { "Force deliver = true" } )
public void story06_1() throws Exception {
differentStream( null );
}

public void run( Slave slave ) throws Exception{
@Test
@TestDescription( title = "Story 6", text = "New baseline, bl1, on dev stream, poll on childs. Deliver in progress", configurations = { "Force deliver = true", "Remote" } )
public void story06_2() throws Exception {
differentStream( jenkins.createSlave( new LabelAtom( "ClearCaseSlave" ) ) );
}

public void differentStream( Slave slave ) throws Exception{

/* First build to create a view */
AbstractBuild<?, ?> firstbuild = jenkins.initiateBuild( ccenv.getUniqueName(), "child", "_System@" + ccenv.getPVob(), "one_int@" + ccenv.getPVob(), false, false, false, false, true, true );
Expand Down Expand Up @@ -80,18 +88,9 @@ public void run( Slave slave ) throws Exception{

AbstractBuild<?, ?> build = jenkins.buildProject( firstbuild.getProject(), false, slave );


/* Build validation */
assertTrue( build.getResult().isBetterOrEqualTo( Result.SUCCESS ) );

/* Expected build baseline */
Baseline buildBaseline = jenkins.getBuildBaseline( build );
assertEquals( bl2, buildBaseline );
assertEquals( PromotionLevel.BUILT, buildBaseline.getPromotionLevel( true ) );

/* Created baseline */
Baseline createdBaseline = jenkins.getCreatedBaseline( build );
assertNotNull( createdBaseline );
/* Validate */
SystemValidator validator = new SystemValidator( build );
validator.validateBuild( Result.SUCCESS ).validateBuiltBaseline( PromotionLevel.BUILT, bl2, false ).validateCreatedBaseline( true ).validate();
}


Expand Down

0 comments on commit 7fd7416

Please sign in to comment.