Skip to content

Commit

Permalink
[JENKINS-17230] Added wipe workspace test
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgarnet committed Apr 11, 2013
1 parent e3e8252 commit 325e836
Showing 1 changed file with 27 additions and 0 deletions.
Expand Up @@ -25,6 +25,7 @@
import org.junit.rules.RuleChain;
import org.junit.rules.TestRule;

import javax.servlet.ServletException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -87,6 +88,32 @@ public void removeTarget() throws IOException, ExecutionException, InterruptedEx
}


@Test
public void wipedWorkspace() throws IOException, ExecutionException, InterruptedException, ServletException {
ProjectBuilder builder = new ProjectBuilder( new ClearCaseUCM( ccenv.getPVob() ) ).setName( "wiped-workspace" );
ConfigRotatorProject project = builder.getProject();
project.addTarget( new ClearCaseUCMTarget( "model-1@" + ccenv.getPVob() + ", INITIAL, false" ) ).
addTarget( new ClearCaseUCMTarget( "client-1@" + ccenv.getPVob() + ", INITIAL, false" ) );

AbstractBuild<?, ?> build = crrule.buildProject( project.getJenkinsProject(), false, null );

project.getJenkinsProject().doDoWipeOutWorkspace();

/* Do the second build */
AbstractBuild<?, ?> build2 = crrule.buildProject( project.getJenkinsProject(), false, null );

FilePath path = new FilePath( project.getJenkinsProject().getLastBuiltOn().getWorkspaceFor( (FreeStyleProject)project.getJenkinsProject() ), "view/" + ccenv.getUniqueName() );

/* Verify second build */
SystemValidator<ClearCaseUCMTarget> val2 = new SystemValidator<ClearCaseUCMTarget>( build2 );
val2.checkExpectedResult( Result.SUCCESS ).
checkCompatability( true ).
addElementToPathCheck( path, new SystemValidator.Element( "Model", true ) ).
addElementToPathCheck( path, new SystemValidator.Element( "Clientapp", true ) ).
validate();
}


@Test
public void testView() throws IOException, ClearCaseException, InterruptedException {
File path = createTempPath();
Expand Down

0 comments on commit 325e836

Please sign in to comment.