dion 2003/08/27 23:25:47
Modified: src/test/java/org/apache/maven/plugin PluginManagerTest.java
Log:
Remove unused code.
Checkstyle
Revision Changes Path
1.5 +16 -17
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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PluginManagerTest.java 28 Aug 2003 05:42:03 -0000 1.4
+++ PluginManagerTest.java 28 Aug 2003 06:25:47 -0000 1.5
@@ -92,9 +92,6 @@
/** base directory */
private String basedir;
- /** plugin to install */
- private File pluginToInstall;
-
/** fake maven.home */
private String fakeHome;
@@ -109,47 +106,47 @@
/**
* Set up the test case
- * @throws
+ * @throws Exception when any error occurs
*/
public void setUp() throws Exception
{
super.setUp();
basedir = System.getProperty("basedir");
assertNotNull(basedir);
+ // 1) need to fake out maven home, so that the unpacked plugin dir in the
test
+ // directory
fakeHome = basedir + SOURCE_BASE + "maven.home";
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
+ // 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);
-
+
+ // setup maven session
MavenSession mavenSession = new MavenSession();
mavenSession.setRootContext( context );
File projectFile = new File(basedir +
"/src/test/touchstone-build/project.xml");
+
+ // set the project being run
MavenSession.setRootDescriptorFile( projectFile );
project = MavenUtils.getProject(projectFile, context);
assertNotNull(project);
pluginManager = mavenSession.getPluginManager();
- // 2) need to fake out the maven.repo.remote so that it downloads from the
test
- // directory
- pluginToInstall = new File(basedir + SOURCE_BASE +
"maven-java-plugin-1.3.jar");
// fake forehead up
Forehead.getInstance().config(new FileInputStream(basedir + SOURCE_BASE +
"forehead.conf"));
}
/**
* Delete the fake directory
+ * @throws Exception when any error occurs
*/
public void tearDown() throws Exception
{
@@ -164,12 +161,13 @@
}
catch (IOException e)
{
- // ignore
+ // ignore
}
}
-
+
/**
* Make sure the plugin manager has loaded the plugins from the directory
specified
+ * @throws Exception when any error occurs
*/
public void testLoading() throws Exception
{
@@ -181,6 +179,7 @@
/**
* Make sure the plugin manager can install a plugin
+ * @throws Exception when any error occurs
*/
public void testInstall() throws Exception
{
@@ -188,9 +187,9 @@
pluginManager.initialize();
File pluginToInstall = new File(basedir + SOURCE_BASE +
"maven-java-plugin-1.3.jar");
pluginManager.installPlugin(project, pluginToInstall);
-
- assertTrue("java plugin is not loaded properly",
+
+ assertTrue("java plugin is not loaded properly",
pluginManager.getGoalNames().contains("java:compile"));
}
-
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]