}
}
public void testSecondaryType() throws Exception
{
Type type = m_secondary;
assertTrue( "version", type.getInfo().getVersion().toString().equals( "2.4.0" ) );
assertTrue( "name", type.getInfo().getName().equals( "secondary-component" ) );
CategoryDescriptor[] loggers = type.getCategories();
if( loggers.length == 1 )
{
CategoryDescriptor logger = loggers[0];
if( !logger.getName().equals( "system" ) )
{
assertTrue( "Logger name is not system", false );
throw new Exception( "Logger name is not system" );
}
}
else
{
assertTrue( "Loggers length != 1", false );
throw new Exception( "Loggers length != 1" );
}
DependencyDescriptor[] dependencies = type.getDependencies();
if( dependencies.length == 1 )
{
DependencyDescriptor dep = dependencies[0];
if( !dep.getReference().getClassname().equals( PRIMARY_S ) )
{
assertTrue( "dependency classname", false );
throw new Exception( "Dependency name is incorrect" );
}
if( !dep.getReference().getVersion().toString().equals( "1.3.0" ) )
{
assertTrue( "dependency version: " + dep.getReference().getVersion(), false );
throw new Exception( "Dependency version is incorrect" );
}
if( !dep.getKey().equals( "primary" ) )
{
assertTrue( "dependency role : " + dep.getKey(), false );
throw new Exception( "Dependency role name is incortrect" );
}
}
else
{
throw new Exception( "Dependency length != 1" );
}
//
// test if the service descriptor is valid
//
ServiceDescriptor[] services = type.getServices();
if( services.length == 1 )
{
ServiceDescriptor dep = services[0];
if( !dep.getReference().getClassname().equals( SECONDARY_S ) )
{