mirror of
https://github.com/Alfresco/alfresco-sdk.git
synced 2025-08-07 17:49:34 +00:00
-- fixed changes and announcement email
-- minor fixes on repo -- preparing 1.0.0 release -- completed testing of repo against 3.2r git-svn-id: http://maven-alfresco-archetypes.googlecode.com/svn/trunk@241 04253f4f-3451-0410-a141-5562f1e59037
This commit is contained in:
@@ -1,104 +0,0 @@
|
||||
package com.sourcesense.maven.plugins.test;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
||||
import com.sourcesense.maven.StripMojo;
|
||||
|
||||
public class StripTest extends org.apache.maven.plugin.testing.AbstractMojoTestCase {
|
||||
|
||||
File testPom;
|
||||
MavenProject project = new MavenProject();
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
// required for mojo lookups to work
|
||||
super.setUp();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* tests the proper discovery and configuration of the mojo
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void testMojoDefaultEnvironment() throws Exception {
|
||||
testPom = new File( getBasedir(), "target/test-classes/snapshot-pom.xml" );
|
||||
StripMojo mojo = (StripMojo) lookupMojo ("strip", testPom );
|
||||
assertNotNull( mojo );
|
||||
|
||||
}
|
||||
|
||||
public void testSnapshotVersion() throws Exception {
|
||||
testPom = new File( getBasedir(), "target/test-classes/snapshot-pom.xml" );
|
||||
StripMojo mojo = (StripMojo) lookupMojo ("strip", testPom );
|
||||
setVariableValueToObject(mojo, "version", "3.0.0-SNAPSHOT");
|
||||
setVariableValueToObject(mojo, "project", project);
|
||||
try {
|
||||
mojo.execute();
|
||||
} catch (MojoExecutionException e) {
|
||||
fail("Mojo execution exception" + e);
|
||||
}
|
||||
assertEquals("3.0.0", mojo.getProject().getProperties().getProperty(
|
||||
mojo.getPropertyName()));
|
||||
}
|
||||
|
||||
public void testReleaseCandidateVersion() throws Exception {
|
||||
testPom = new File( getBasedir(), "target/test-classes/relcandidate-pom.xml" );
|
||||
StripMojo mojo = (StripMojo) lookupMojo ("strip", testPom );
|
||||
setVariableValueToObject(mojo, "version", "3.0.0-RC1");
|
||||
setVariableValueToObject(mojo, "project", project);
|
||||
try {
|
||||
mojo.execute();
|
||||
} catch (MojoExecutionException e) {
|
||||
fail("Mojo execution exception" + e);
|
||||
}
|
||||
assertEquals("3.0.0", mojo.getProject().getProperties().getProperty(
|
||||
mojo.getPropertyName()));
|
||||
}
|
||||
|
||||
public void testIdempotent() throws Exception {
|
||||
testPom = new File( getBasedir(), "target/test-classes/snapshot-pom.xml" );
|
||||
StripMojo mojo = (StripMojo) lookupMojo ("strip", testPom );
|
||||
setVariableValueToObject(mojo, "version", "3.0.0");
|
||||
setVariableValueToObject(mojo, "project", project);
|
||||
try {
|
||||
mojo.execute();
|
||||
} catch (MojoExecutionException e) {
|
||||
fail("Mojo execution exception" + e);
|
||||
}
|
||||
assertEquals("3.0.0", mojo.getProject().getProperties().getProperty(
|
||||
mojo.getPropertyName()));
|
||||
}
|
||||
|
||||
public void testUnderscore() throws Exception {
|
||||
testPom = new File( getBasedir(), "target/test-classes/underscore-pom.xml" );
|
||||
StripMojo mojo = (StripMojo) lookupMojo ("strip", testPom );
|
||||
setVariableValueToObject(mojo, "version", "3.0.0_RC1");
|
||||
setVariableValueToObject(mojo, "project", project);
|
||||
try {
|
||||
mojo.execute();
|
||||
} catch (MojoExecutionException e) {
|
||||
fail("Mojo execution exception" + e);
|
||||
}
|
||||
assertEquals("3.0.0", mojo.getProject().getProperties().getProperty(
|
||||
mojo.getPropertyName()));
|
||||
}
|
||||
|
||||
public void testCustomPropName() throws Exception {
|
||||
testPom = new File( getBasedir(), "target/test-classes/customprop-pom.xml" );
|
||||
StripMojo mojo = (StripMojo) lookupMojo ("strip", testPom );
|
||||
setVariableValueToObject(mojo, "version", "3.0.0-RC1");
|
||||
setVariableValueToObject(mojo, "project", project);
|
||||
try {
|
||||
mojo.execute();
|
||||
} catch (MojoExecutionException e) {
|
||||
fail("Mojo execution exception" + e);
|
||||
}
|
||||
assertEquals("3.0.0", mojo.getProject().getProperties().getProperty(
|
||||
"foobar"));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user