Skip to content

Commit

Permalink
First step in fixing JENKINS-19658
Browse files Browse the repository at this point in the history
  • Loading branch information
MadsNielsen committed Mar 5, 2014
1 parent e586cba commit 2a610b3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 0 additions & 3 deletions src/main/java/net/praqma/hudson/notifier/CCUCMNotifier.java
Expand Up @@ -78,9 +78,6 @@ public boolean perform( AbstractBuild<?, ?> build, Launcher launcher, BuildListe

boolean result = true;
out = listener.getLogger();

logger.fine( "BEGINNING NOTIFIER: " + build.getProject().getPublishersList() );

status = new Status();

/* Prepare job variables */
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/praqma/hudson/scm/CCUCMScm.java
Expand Up @@ -367,7 +367,6 @@ public void setAddPostBuild(boolean addPostBuild) {

private boolean checkInput(TaskListener listener) {
PrintStream out = listener.getLogger();

out.println("[" + Config.nameShort + "] Verifying input");

/* Check baseline template */
Expand All @@ -392,6 +391,7 @@ private boolean checkInput(TaskListener listener) {
}
} else {
out.println("[" + Config.nameShort + "] You cannot create a baseline in this mode");
return false;
}
}

Expand Down Expand Up @@ -661,7 +661,7 @@ public PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, La

logger.fine("Let's go!");

/* Check input */
/* Check input */
if (checkInput(listener)) {

printParameters(out);
Expand Down
12 changes: 7 additions & 5 deletions src/test/java/net/praqma/hudson/test/CCUCMRule.java
Expand Up @@ -5,6 +5,7 @@
import hudson.model.Project;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;
import hudson.slaves.DumbSlave;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -336,15 +337,16 @@ public boolean perform( AbstractBuild<?, ?> build, Launcher launcher, BuildListe
}
}

public AbstractBuild<?, ?> buildProject( AbstractProject<?, ?> project, boolean fail ) throws IOException {
return buildProject( project, fail, null );
public AbstractBuild<?, ?> buildProject( AbstractProject<?, ?> project, boolean fail ) throws IOException, Exception {
return buildProject( project, fail, createSlave() );
}

public AbstractBuild<?, ?> buildProject( AbstractProject<?, ?> project, boolean fail, Slave slave ) throws IOException {

if( slave != null ) {
logger.fine( "Running on " + slave );
project.setAssignedNode( slave );
System.out.println( String.format( "[SLAVE-CONFIG] Running on %s", slave.getSelfLabel().getName() ) );
logger.fine( String.format( "Running on %s", slave.getSelfLabel().getName() ) );
project.setAssignedLabel(slave.getSelfLabel());
}

EnableLoggerAction action = null;
Expand All @@ -355,7 +357,7 @@ public boolean perform( AbstractBuild<?, ?> build, Launcher launcher, BuildListe

AbstractBuild<?, ?> build = null;
try {
build = project.scheduleBuild2( 0, new Cause.UserCause(), action ).get();
build = project.scheduleBuild2(0, new Cause.UserCause(), action ).get();
} catch( Exception e ) {
logger.info( "Build failed(" + (fail?"on purpose":"it should not?") + "): " + e.getMessage() );
}
Expand Down
Expand Up @@ -4,6 +4,7 @@
import hudson.model.Project;
import hudson.model.Result;
import hudson.model.Slave;
import hudson.slaves.DumbSlave;
import net.praqma.clearcase.Deliver;
import net.praqma.clearcase.exceptions.ClearCaseException;
import net.praqma.clearcase.test.junit.ClearCaseRule;
Expand Down

0 comments on commit 2a610b3

Please sign in to comment.