### Question:
EarMavenArchiver extends MavenArchiver { protected String generateClassPathEntry( String classPathPrefix ) { final StringBuilder classpath = new StringBuilder(); for ( final EarModule earModule : earModules ) { if ( !earModule.isExcluded() ) { classpath.append( classPathPrefix ).append( earModule.getUri() ).append( " " ); } } return classpath.toString().trim(); } EarMavenArchiver( List<EarModule> earModules ); Manifest getManifest( MavenProject project, MavenArchiveConfiguration config ); Manifest getManifest( MavenSession session, MavenProject project, MavenArchiveConfiguration config ); static final String CLASS_PATH_KEY; }### Answer:
@Test public void testSimpleEjbModule() { final List<EarModule> modules = new ArrayList<EarModule>(); final EarModule module = new EjbModule( createArtifact( "foo", "ejb" ) ); setUri( module, "foo-1.0.jar" ); modules.add( module ); final EarMavenArchiver archiver = new EarMavenArchiver( modules ); assertEquals( "foo-1.0.jar", archiver.generateClassPathEntry( "" ) ); }
@Test public void testSimpleJarModuleWithCustomBundleDir() { final List<EarModule> modules = new ArrayList<EarModule>(); final EarModule module = new EjbModule( createArtifact( "foo", "jar" ) ); setUri( module, "libs/foo-1.0.jar" ); modules.add( module ); final EarMavenArchiver archiver = new EarMavenArchiver( modules ); assertEquals( "libs/foo-1.0.jar", archiver.generateClassPathEntry( "" ) ); }
@Test public void testTwoModules() { final List<EarModule> modules = new ArrayList<EarModule>(); final EarModule module = new EjbModule( createArtifact( "foo", "ejb" ) ); setUri( module, "foo-1.0.jar" ); modules.add( module ); final EarModule module2 = new EjbModule( createArtifact( "bar", "war" ) ); setUri( module2, "bar-2.0.1.war" ); modules.add( module2 ); final EarMavenArchiver archiver = new EarMavenArchiver( modules ); assertEquals( "foo-1.0.jar bar-2.0.1.war", archiver.generateClassPathEntry( "" ) ); }