Skip to content
Permalink
Browse files

[JENKINS-17230] Added wipe workspace test

  • Loading branch information
wolfgarnet committed Apr 11, 2013
1 parent e3e8252 commit 325e8361f30f3f3f31deb71bc2d9d66b9a5df624
@@ -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;
@@ -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();

0 comments on commit 325e836

Please sign in to comment.
You can’t perform that action at this time.