Skip to content

Commit

Permalink
[fix for JENKINS-18279] Updated core + added test
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgarnet committed Aug 6, 2013
1 parent fc1694d commit bd1e8b5
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -445,7 +445,7 @@
<dependency>
<groupId>net.praqma</groupId>
<artifactId>cool</artifactId>
<version>0.6.15</version>
<version>0.6.16</version>
<type>jar</type>
</dependency>

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/net/praqma/hudson/test/SystemValidator.java
Expand Up @@ -268,14 +268,14 @@ public SystemValidator addElementToPathCheck( FilePath path, Element element ) {
private void doCheckPaths() throws IOException, InterruptedException {
for( FilePath path : pathsToCheck.keySet() ) {
List<Element> elements = pathsToCheck.get( path );
logger.info( "Checking " + path );
logger.fine( "Checking " + path );

for( Element element : elements ) {
if( element.mustExist ) {
logger.info( "Path must have " + element );
logger.fine( "Path must have " + element );
assertTrue( "The path " + path + " does not have " + element, new FilePath( path, element.element ).exists() );
} else {
logger.info( "Path must NOT have " + element );
logger.fine( "Path must NOT have " + element );
assertFalse( "The path " + path + " does have " + element, new FilePath( path, element.element ).exists() );
}
}
Expand Down
@@ -0,0 +1,60 @@
package net.praqma.hudson.test.integration.userstories;

import hudson.FilePath;
import hudson.model.AbstractBuild;
import hudson.model.FreeStyleProject;
import hudson.model.Project;
import hudson.model.Result;
import net.praqma.clearcase.test.annotations.ClearCaseUniqueVobName;
import net.praqma.clearcase.test.junit.ClearCaseRule;
import net.praqma.hudson.test.BaseTestClass;
import net.praqma.hudson.test.CCUCMRule;
import net.praqma.hudson.test.SystemValidator;
import net.praqma.util.test.junit.DescriptionRule;
import net.praqma.util.test.junit.TestDescription;
import org.junit.Rule;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

/**
* @author cwolfgang
*/
public class JENKINS18279 extends BaseTestClass {

private static Logger logger = Logger.getLogger( JENKINS18279.class.getName() );

@Rule
public static ClearCaseRule ccenv = new ClearCaseRule( "JENKINS-18279" );

@Rule
public static DescriptionRule desc = new DescriptionRule();

@Test
@TestDescription( title = "JENKINS-18279", text = "Testing the swipe function. UPDT's must remain as non-view private files." )
public void jenkins18279() throws Exception {
Project project = new CCUCMRule.ProjectCreator( "JENKINS-18279", "_System@" + ccenv.getPVob(), "one_int@" + ccenv.getPVob() ).setSwipe( true ).getProject();

/* I need a first build */
jenkins.getProjectBuilder( project ).build();

FilePath path = new FilePath( project.getLastBuiltOn().getWorkspaceFor( (FreeStyleProject)project ), "view/" );
FilePath[] names = path.list( "*.updt" );

listPath( path );

AbstractBuild build1 = jenkins.getProjectBuilder( project ).build();

SystemValidator validator = new SystemValidator( build1 ).validateBuild( Result.SUCCESS );

for( FilePath n : names ) {
validator.addElementToPathCheck( path, new SystemValidator.Element( n.getName(), true ) );
}

validator.validate();
}


}

0 comments on commit bd1e8b5

Please sign in to comment.