Skip to content
Permalink
Browse files

Fixed JENKINS-21068, implemented better error message

  • Loading branch information
MadsNielsen authored and inky84 committed Dec 18, 2013
1 parent 47ce865 commit 8e6412f3a0573e2ede3f3b5e0494629cb59a7a45
Showing with 143 additions and 334 deletions.
  1. +13 −28 pom.xml
  2. +3 −8 src/main/java/net/praqma/jenkins/configrotator/AbstractConfigurationComponent.java
  3. +1 −2 src/main/java/net/praqma/jenkins/configrotator/AbstractConfigurationRotatorSCM.java
  4. +1 −12 src/main/java/net/praqma/jenkins/configrotator/ConfigurationRotator.java
  5. +1 −2 src/main/java/net/praqma/jenkins/configrotator/ConfigurationRotatorBuildAction.java
  6. +1 −4 src/main/java/net/praqma/jenkins/configrotator/ConfigurationRotatorFeedAction.java
  7. +37 −36 src/main/java/net/praqma/jenkins/configrotator/ConfigurationRotatorProjectAction.java
  8. +29 −34 src/main/java/net/praqma/jenkins/configrotator/ConfigurationRotatorReport.java
  9. +2 −4 src/main/java/net/praqma/jenkins/configrotator/ConfigurationRotatorRunListener.java
  10. +0 −1 src/main/java/net/praqma/jenkins/configrotator/scm/ConfigRotatorChangeLogEntry.java
  11. +1 −3 src/main/java/net/praqma/jenkins/configrotator/scm/ConfigRotatorChangeLogSet.java
  12. +1 −2 src/main/java/net/praqma/jenkins/configrotator/scm/ConfigRotatorVersion.java
  13. +9 −15 src/main/java/net/praqma/jenkins/configrotator/scm/clearcaseucm/ClearCaseUCM.java
  14. +9 −34 src/main/java/net/praqma/jenkins/configrotator/scm/clearcaseucm/ClearCaseUCMConfiguration.java
  15. +1 −7 ...in/java/net/praqma/jenkins/configrotator/scm/clearcaseucm/ClearCaseUCMConfigurationComponent.java
  16. +1 −5 src/main/java/net/praqma/jenkins/configrotator/scm/clearcaseucm/EndView.java
  17. +6 −0 src/main/java/net/praqma/jenkins/configrotator/scm/clearcaseucm/GetConfiguration.java
  18. +0 −1 src/main/java/net/praqma/jenkins/configrotator/scm/clearcaseucm/PrepareWorkspace.java
  19. +0 −2 src/main/java/net/praqma/jenkins/configrotator/scm/git/Git.java
  20. +0 −1 src/main/java/net/praqma/jenkins/configrotator/scm/git/GitConfigurationComponent.java
  21. +27 −30 src/main/java/net/praqma/jenkins/configrotator/scm/git/GitTarget.java
  22. +0 −2 src/main/java/net/praqma/jenkins/configrotator/scm/git/ResolveChangeLog.java
  23. +0 −1 src/main/java/net/praqma/jenkins/configrotator/scm/git/ResolveConfigurationComponent.java
  24. +0 −1 src/test/java/net/praqma/jenkins/configrotator/functional/ModelTest.java
  25. +0 −26 ...java/net/praqma/jenkins/configrotator/functional/scm/clearcase/ClearCaseUCMConfigurationTest.java
  26. +0 −73 src/test/java/net/praqma/jenkins/configrotator/functional/scm/clearcase/ConfigTest.java
41 pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.484</version>
<version>1.509</version>
</parent>

<groupId>net.praqma</groupId>
@@ -28,20 +28,14 @@
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.11</version>
</dependency>
</dependencies>
<version>2.16</version>
</plugin>
</plugins>

@@ -50,7 +44,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<version>2.16</version>
</plugin>
</plugins>
</pluginManagement>
@@ -86,7 +80,6 @@
<profiles>
<profile>
<id>static</id>
<!-- Skip tests for static analysis -->
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
@@ -113,7 +106,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.10</version>
<version>2.11</version>
<configuration>
<enableRulesSummary>false</enableRulesSummary>
</configuration>
@@ -147,21 +140,6 @@
</execution>
</executions>
</plugin>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javancss-maven-plugin</artifactId>
@@ -404,6 +382,13 @@
</scm>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>net.praqma</groupId>
<artifactId>praqmajutils</artifactId>
@@ -438,13 +423,13 @@
<version>2.3.1.201302201838-r</version>
</dependency>


<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
@@ -42,13 +42,7 @@ public boolean isFixed() {

public abstract String prettyPrint();


/*
*
* Feed specifics
*
*/

@Override
public File getFeedFile( File path ) {
return new File( path, ConfigurationRotatorReport.urlTtransform( getComponentName() ) + ".xml" );
}
@@ -61,7 +55,8 @@ public Feed getFeed( File feedFile, String url, Date updated ) throws FeedExcept

return feed;
}


@Override
public Entry getFeedEntry( AbstractBuild<?, ?> build, Date updated ) {
ConfigurationRotatorBuildAction action = build.getAction( ConfigurationRotatorBuildAction.class );
AbstractConfiguration configuration = action.getConfigurationWithOutCast();
@@ -206,8 +206,7 @@ public void printConfiguration(PrintStream out, AbstractConfiguration cfg) {
* @throws IOException
* @throws ConfigurationRotatorException
* @throws InterruptedException
*/
//public abstract void writeChangeLog( File changeLogFile, BuildListener listener, AbstractBuild<?, ?> build ) throws IOException, ConfigurationRotatorException, InterruptedException;
*/
public abstract AbstractConfigurationRotatorSCM.ChangeLogWriter getChangeLogWriter(File changeLogFile, BuildListener listener, AbstractBuild<?, ?> build);

public abstract class ChangeLogWriter<C extends AbstractConfigurationComponent, T extends AbstractConfiguration<C>> {
@@ -40,19 +40,9 @@
private static Logger logger = Logger.getLogger( ConfigurationRotator.class.getName() );

public enum ResultType {

/*
* Tested and configuration is compatible
*/
COMPATIBLE,

/*
* Tested and configuration is NOT compatible
*/
INCOMPATIBLE,

FAILED,

/*
* The tests failed and was unable to determine compatibility
*/
@@ -164,8 +154,7 @@ public boolean checkout( AbstractBuild<?, ?> build, Launcher launcher, FilePath

}
} catch( Exception e ) {
logger.log( Level.SEVERE, "Unable to create configuration", e );
e.printStackTrace( out );
logger.log( Level.SEVERE, "Unable to create configuration", e );
DiedBecauseAction da = new DiedBecauseAction( e.getMessage(), DiedBecauseAction.Die.die );
build.addAction( da );
throw new AbortException( e.getMessage() );
@@ -32,8 +32,7 @@ public ConfigurationRotatorBuildAction( AbstractBuild<?, ?> build, Class<? exten
public void doReset( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
SCM scm = build.getProject().getScm();
if( scm instanceof ConfigurationRotator ) {
((ConfigurationRotator)scm).setConfigurationByAction( build.getProject(), this );
//rsp.forwardToPreviousPage( req. );
((ConfigurationRotator)scm).setConfigurationByAction( build.getProject(), this );
rsp.sendRedirect( "../../" );
} else {
rsp.sendError( StaplerResponse.SC_BAD_REQUEST, "Not a Configuration Rotator job" );
@@ -17,9 +17,7 @@
import java.util.logging.Logger;

public abstract class ConfigurationRotatorFeedAction implements Action {

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


@Override
public String getIconFileName() {
return null;
@@ -74,7 +72,6 @@ public String getFeedTitle( File feed ) {
return list;
}


public void doFeed( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
String component = req.getParameter( "component" );
File file = new File( new File( ConfigurationRotator.getFeedPath(), getComponentName() ), component + ".xml" );
@@ -7,48 +7,49 @@
import java.util.ArrayList;

public class ConfigurationRotatorProjectAction implements ProminentProjectAction {
private final AbstractProject<?, ?> project;

public ConfigurationRotatorProjectAction( AbstractProject<?, ?> project ) {
this.project = project;
}

@Override
public String getIconFileName() {
return "/plugin/config-rotator/images/rotate.png";
}

@Override
public String getDisplayName() {
return "Config Rotator";
}

@Override
public String getUrlName() {
return "config-rotator";
}

private final AbstractProject<?, ?> project;

public ConfigurationRotatorProjectAction(AbstractProject<?, ?> project) {
this.project = project;
}

@Override
public String getIconFileName() {
return "/plugin/config-rotator/images/rotate.png";
}

@Override
public String getDisplayName() {
return "Config Rotator";
}

@Override
public String getUrlName() {
return "config-rotator";
}

/**
* New method extracts the latest builds.
*
* @param number
* @return
* @return
*/
public ArrayList<ConfigurationRotatorBuildAction> getLastActions(int number) {
SCM scm = project.getScm();
if( scm instanceof ConfigurationRotator ) {
return ((ConfigurationRotator)scm).getAcrs().getLastResults( project, null, number );
} else {
return null;
}
if (scm instanceof ConfigurationRotator) {
return ((ConfigurationRotator) scm).getAcrs().getLastResults(project, null, number);
} else {
return null;
}
}

public ConfigurationRotatorBuildAction getLastAction() {
SCM scm = project.getScm();
if (scm instanceof ConfigurationRotator) {
return ((ConfigurationRotator) scm).getAcrs().getLastResult(project, null);
} else {
return null;
}
}

public ConfigurationRotatorBuildAction getLastAction() {
SCM scm = project.getScm();
if( scm instanceof ConfigurationRotator ) {
return ((ConfigurationRotator)scm).getAcrs().getLastResult( project, null );
} else {
return null;
}
}

}

0 comments on commit 8e6412f

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