Skip to content

Commit

Permalink
Added testcase for [JENKINS-16499]
Browse files Browse the repository at this point in the history
  • Loading branch information
kutzi authored and jglick committed Oct 4, 2013
1 parent 1632211 commit 4c5f193
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/src/test/java/hudson/maven/MavenProjectTest.java
Expand Up @@ -23,13 +23,16 @@
*/
package hudson.maven;

import hudson.model.AbstractProject;
import hudson.model.Item;
import hudson.model.Result;
import hudson.tasks.Maven.MavenInstallation;
import hudson.tasks.Shell;

import java.io.File;

import jenkins.model.Jenkins;

import org.junit.Assert;
import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.ExtractResourceSCM;
Expand All @@ -41,13 +44,24 @@
* @author huybrechts
*/
public class MavenProjectTest extends HudsonTestCase {


public void testOnMaster() throws Exception {
MavenModuleSet project = createSimpleProject();
project.setGoals("validate");

buildAndAssertSuccess(project);
}

@Bug(16499)
public void testCopyFromExistingMavenProject() throws Exception {
MavenModuleSet project = createSimpleProject();
project.setGoals("abcdefg");

MavenModuleSet copy = (MavenModuleSet) Jenkins.getInstance().copy((AbstractProject<?, ?>)project, "copy" + System.currentTimeMillis());
assertNotNull("Copied project must not be null", copy);
assertEquals(project.getGoals(), copy.getGoals());
}

private MavenModuleSet createSimpleProject() throws Exception {
return createProject("/simple-projects.zip");
Expand Down

0 comments on commit 4c5f193

Please sign in to comment.