You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2002/11/25 12:36:22 UTC
cvs commit: avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/profile ProfileManagerTestCase.java
mcconnell 2002/11/25 03:36:22
Modified: assembly/src/test/org/apache/avalon/assembly/profile
ProfileManagerTestCase.java
Log:
Added test case for registration of an extension handler profile and retrival
using an stage descriptor.
Revision Changes Path
1.2 +31 -1 avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/profile/ProfileManagerTestCase.java
Index: ProfileManagerTestCase.java
===================================================================
RCS file: /home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/profile/ProfileManagerTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ProfileManagerTestCase.java 24 Nov 2002 12:50:46 -0000 1.1
+++ ProfileManagerTestCase.java 25 Nov 2002 11:36:22 -0000 1.2
@@ -66,7 +66,7 @@
}
}
- public void testProfileRegistrationAndRetrival() throws Exception
+ public void testClassicProfileRegistrationAndRetrival() throws Exception
{
final String classname = "org.apache.avalon.playground.BasicComponent";
@@ -97,6 +97,36 @@
assertTrue( false );
}
}
+
+ public void testExtensionProfileRegistrationAndRetrival() throws Exception
+ {
+ final String classname = "org.apache.avalon.playground.ExploitationManager";
+
+ ReferenceDescriptor reference =
+ new ReferenceDescriptor( "org.apache.avalon.playground.Exploitable" );
+
+ StageDescriptor stage = new StageDescriptor( reference );
+
+ try
+ {
+ Type type = m_types.createType( classname );
+ Profile[] profiles = m_manager.loadProfiles( type );
+ for( int i=0; i<profiles.length; i++ )
+ {
+ m_manager.addProfile( profiles[i] );
+ }
+
+ Profile[] candidates = m_manager.getProfiles( stage );
+ assertTrue( candidates.length > 0 );
+ }
+ catch( Throwable e )
+ {
+ System.out.println("failure to resolve extension handler profile for : " + ref );
+ e.printStackTrace();
+ assertTrue( false );
+ }
+ }
+
protected void tearDown() throws Exception
{
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>