dion 2003/08/31 21:26:33
Modified: src/test/java/org/apache/maven/plugin PluginManagerTest.java
Log:
Add a deletePlugin method to call at the start and end of tests
Revision Changes Path
1.9 +20 -0
maven/src/test/java/org/apache/maven/plugin/PluginManagerTest.java
Index: PluginManagerTest.java
===================================================================
RCS file:
/home/cvs/maven/src/test/java/org/apache/maven/plugin/PluginManagerTest.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- PluginManagerTest.java 1 Sep 2003 01:48:25 -0000 1.8
+++ PluginManagerTest.java 1 Sep 2003 04:26:33 -0000 1.9
@@ -188,10 +188,12 @@
*/
public void testInstall() throws Exception
{
+ deletePlugin("maven-java-plugin-1.3.jar");
installPlugin("maven-java-plugin-1.3.jar");
assertTrue("java plugin is not loaded properly",
pluginManager.getGoalNames().contains("java:compile"));
+ deletePlugin("maven-java-plugin-1.3.jar");
}
/**
@@ -201,6 +203,7 @@
*/
public void testInstallTwice() throws Exception
{
+ deletePlugin("maven-java-plugin-1.3.jar");
installPlugin("maven-java-plugin-1.3.jar");
assertTrue("java plugin is not loaded properly",
@@ -210,6 +213,7 @@
assertTrue("java plugin is not loaded properly",
pluginManager.getGoalNames().contains("java:compile"));
+ deletePlugin("maven-java-plugin-1.3.jar");
}
/**
@@ -219,12 +223,14 @@
*/
public void testUpgrade() throws Exception
{
+ deletePlugin("maven-clean-plugin-1.2-SNAPSHOT.jar");
installPlugin("maven-clean-plugin-1.2-SNAPSHOT.jar");
assertTrue("upgraded clean plugin is not loaded properly",
pluginManager.getGoalNames().contains("clean:other"));
//assertFalse("original clean plugin is not removed properly",
//pluginManager.getGoalNames().contains("clean:original"));
+ deletePlugin("maven-clean-plugin-1.2-SNAPSHOT.jar");
}
/**
@@ -253,5 +259,19 @@
pluginManager.initialize();
File pluginToInstall = new File(basedir + SOURCE_BASE + name);
pluginManager.installPlugin(project, pluginToInstall);
+ }
+
+ /**
+ * delete a plugin
+ * @param name the file name of the plugin to install relative to the source
base
+ * @throws Exception when any error occurs
+ */
+ private void deletePlugin(String name) throws Exception
+ {
+ File pluginToInstall = new File(basedir + SOURCE_BASE + name);
+ if (pluginToInstall.exists())
+ {
+ pluginToInstall.delete();
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]