dion 2003/08/13 01:53:27
Modified: src/test/java/org/apache/maven/plugin Tag: MAVEN_RC1_STABLE
PluginManagerTest.java
Added: src/test/java/org/apache/maven/plugin/maven.home/plugins
Tag: MAVEN_RC1_STABLE
maven-clean-plugin-1.1-SNAPSHOT.jar
Log:
More flesh before the testing starts
Revision Changes Path
No revision
No revision
1.1.2.1 +18 -0
maven/src/test/java/org/apache/maven/plugin/maven.home/plugins/Attic/maven-clean-plugin-1.1-SNAPSHOT.jar
<<Binary file>>
No revision
No revision
1.2.2.2 +33 -6
maven/src/test/java/org/apache/maven/plugin/Attic/PluginManagerTest.java
Index: PluginManagerTest.java
===================================================================
RCS file:
/home/cvs/maven/src/test/java/org/apache/maven/plugin/Attic/PluginManagerTest.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -r1.2.2.1 -r1.2.2.2
--- PluginManagerTest.java 13 Aug 2003 07:13:43 -0000 1.2.2.1
+++ PluginManagerTest.java 13 Aug 2003 08:53:27 -0000 1.2.2.2
@@ -55,6 +55,8 @@
*/
import java.io.File;
+import org.apache.commons.io.FileUtils;
+import org.apache.maven.MavenConstants;
import org.apache.maven.MavenSession;
import org.apache.maven.MavenUtils;
import org.apache.maven.jelly.MavenJellyContext;
@@ -70,9 +72,16 @@
{
/** instance being tested */
- PluginManager pluginManager = null;
+ private PluginManager pluginManager = null;
+
/** project to test with */
- Project project = null;
+ private Project project = null;
+
+ /** directory for fake data */
+ private static String FAKE_BASE = "/target/PluginManagerTest/";
+
+ /** source base */
+ private static String SOURCE_BASE = "/src/test/java/org/apache/maven/plugin";
/**
* Constructor for PluginManagerTest.
@@ -90,6 +99,20 @@
assertNotNull(basedir);
MavenJellyContext context = MavenUtils.createContext( new File(
System.getProperty("user.dir") ) );
assertNotNull(context);
+ // 1) need to fake out maven home, so that the unpacked plugin dir in the
test
+ // directory
+ String fakeHome = basedir + SOURCE_BASE + "maven.home";
+ context.setVariable(MavenConstants.MAVEN_HOME, fakeHome);
+ // 1) need to fake out maven home local
+ String fakeHomeLocal = basedir + FAKE_BASE + "maven.home.local";
+ new File(fakeHomeLocal).mkdirs();
+ context.setVariable(MavenConstants.MAVEN_HOME_LOCAL, fakeHomeLocal);
+ // 2) Need to fake out unpacked plugins dir so that the plugins are
+ // unpacked locally in the test directory
+ String fakeUnpackedPlugins = basedir + FAKE_BASE +
"maven.plugin.unpacked.dir";
+ new File(fakeUnpackedPlugins).mkdirs();
+ context.setVariable(MavenConstants.MAVEN_UNPACKED_PLUGINS_DIR,
fakeUnpackedPlugins);
+
MavenSession mavenSession = new MavenSession();
mavenSession.setRootContext( context );
File projectFile = new File(basedir +
"/src/test/touchstone-build/project.xml");
@@ -98,14 +121,18 @@
project = MavenUtils.getProject(projectFile, context);
assertNotNull(project);
pluginManager = mavenSession.getPluginManager();
- // 1) need to fake out maven home, so that the unpacked plugin dir in the
test
- // directory
- // 2) Need to fake out maven home local so that the plugins are unpacked
locally
- // in the test directory
// 2) need to fake out the maven.repo.remote so that it downloads from the
test
// directory
}
+ public void tearDown() throws Exception
+ {
+ // clean up directories
+ String basedir = System.getProperty("basedir");
+ String fake = basedir + FAKE_BASE;
+ // delete it
+ FileUtils.deleteDirectory(fake);
+ }
public void testXXX()
{
assertNotNull(pluginManager);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]