dion 2003/08/27 23:39:11 Modified: src/test/java/org/apache/maven/plugin PluginManagerTest.java Log: add a test to make sure that installed plug-ins take precedence over those that already exist. Revision Changes Path 1.6 +25 -4 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.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- PluginManagerTest.java 28 Aug 2003 06:25:47 -0000 1.5 +++ PluginManagerTest.java 28 Aug 2003 06:39:11 -0000 1.6 @@ -183,13 +183,34 @@ */ public void testInstall() throws Exception { - assertNotNull(pluginManager); - pluginManager.initialize(); - File pluginToInstall = new File(basedir + SOURCE_BASE + "maven-java-plugin-1.3.jar"); - pluginManager.installPlugin(project, pluginToInstall); + installPlugin("maven-java-plugin-1.3.jar"); assertTrue("java plugin is not loaded properly", pluginManager.getGoalNames().contains("java:compile")); } + /** + * Make sure the plugin manager can upgrade a plugin + * @throws Exception when any error occurs + */ + public void testUpgrade() throws Exception + { + installPlugin("maven-clean-plugin-1.2-SNAPSHOT.jar"); + + assertTrue("upgraded clean plugin is not loaded properly", + pluginManager.getGoalNames().contains("clean:other")); + } + + /** + * install 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 installPlugin(String name) throws Exception + { + assertNotNull(pluginManager); + pluginManager.initialize(); + File pluginToInstall = new File(basedir + SOURCE_BASE + name); + pluginManager.installPlugin(project, pluginToInstall); + } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]