KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > settings > SettingsUtilsTest


1 package org.apache.maven.settings;
2
3 import java.util.List JavaDoc;
4
5 import junit.framework.TestCase;
6
7 public class SettingsUtilsTest
8     extends TestCase
9 {
10
11     public void testShouldAppendRecessivePluginGroupIds()
12     {
13         Settings dominant = new Settings();
14         dominant.addPluginGroup( "org.apache.maven.plugins" );
15         dominant.addPluginGroup( "org.codehaus.modello" );
16         
17         dominant.setRuntimeInfo(new RuntimeInfo(dominant));
18
19         Settings recessive = new Settings();
20         recessive.addPluginGroup( "org.codehaus.plexus" );
21
22         recessive.setRuntimeInfo(new RuntimeInfo(recessive));
23
24         SettingsUtils.merge( dominant, recessive, Settings.GLOBAL_LEVEL );
25
26         List JavaDoc pluginGroups = dominant.getPluginGroups();
27
28         assertNotNull( pluginGroups );
29         assertEquals( 3, pluginGroups.size() );
30         assertEquals( "org.apache.maven.plugins", pluginGroups.get( 0 ) );
31         assertEquals( "org.codehaus.modello", pluginGroups.get( 1 ) );
32         assertEquals( "org.codehaus.plexus", pluginGroups.get( 2 ) );
33     }
34
35 }
36
Popular Tags