1 package org.apache.maven.plugin;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import java.io.File;
22 import java.io.FileInputStream;
23 import java.io.FileNotFoundException;
24 import java.io.IOException;
25
26 import junit.framework.TestCase;
27
28 import org.apache.maven.MavenException;
29
30 /**
31 * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
32 * @version $Id: PluginCacheManagerTest.java,v 1.1 2002/12/31 07:10:06 jvanzyl
33 * Exp $
34 */
35 public class PluginCacheManagerTest
36 extends TestCase
37 {
38 private static String PLUGIN_SCRIPT = System.getProperty( "basedir" )
39 + "/src/test/java/org/apache/maven/plugin/plugin.jelly";
40
41 /**
42 * Constructor.
43 *
44 * @param name Name of the test.
45 */
46 public PluginCacheManagerTest( String name )
47 {
48 super( name );
49 }
50
51 /**
52 * Test the plugin cache builder.
53 */
54 public void testPluginGraphBuilder()
55 throws FileNotFoundException, IOException, MavenException
56 {
57 PluginCacheManager pgb = new PluginCacheManager();
58 JellyScriptHousing housing = new JellyScriptHousing( new File( PLUGIN_SCRIPT ).getParentFile(), null );
59 FileInputStream fis = new FileInputStream( new File( PLUGIN_SCRIPT ) );
60 housing.parse( pgb, PLUGIN_SCRIPT, fis );
61 fis.close();
62
63 assertEquals( "Generate docs in APT format>xdoc:generate-from-pom", pgb.getGoalCache()
64 .getProperty( "apt:generate" ) );
65
66 assertEquals( "plugin", pgb.getPluginCache().getProperty( "apt:generate" ) );
67
68 assertEquals( "plugin", pgb.getDynaTagLibCache().getProperty( "aptdoc" ) );
69
70 assertEquals( "plugin", pgb.getCallbackCache().getProperty( "xdoc:transform.pre" ) );
71
72 assertEquals( "plugin", pgb.getCallbackCache().getProperty( "foo.post" ) );
73 }
74 }