{
return;//not an R5 CA
}
String pid = COMPONENT_NAME;
theConfig.put(TARGETED_PID, pid);
Configuration config = configure( pid );
config.setBundleLocation( REGION );
String pidSN = pid + "|simplecomponent2";
theConfig.put(TARGETED_PID, pidSN);
Configuration configSN = configure( pidSN );
configSN.setBundleLocation( REGION );
String pidSNV = pidSN + "|0.0.12";
theConfig.put(TARGETED_PID, pidSNV);
Configuration configSNV = configure( pidSNV );
configSNV.setBundleLocation( REGION );
String pidSNVL = pidSNV + "|bundleLocation";
theConfig.put(TARGETED_PID, pidSNVL);
Configuration configSNVL = configure( pidSNVL );
configSNVL.setBundleLocation( REGION );
delay();
//Add more and more specific components to check that they pick up the appropriate configuration
Set<ComponentConfigurationDTO> known = new HashSet<ComponentConfigurationDTO>();
final ComponentConfigurationDTO component = findComponentConfigurationByName( COMPONENT_NAME, ComponentConfigurationDTO.ACTIVE );
known.add( component );
TestCase.assertNotNull( SimpleComponent.INSTANCE );
SimpleComponent sc = SimpleComponent.INSTANCE;
TestCase.assertEquals( pid, sc.getProperty( TARGETED_PID ) );
Bundle bSN = installBundle( descriptorFile, COMPONENT_PACKAGE, "simplecomponent2", "0.0.11", null );
bSN.start();
findComponentConfigurationByName( bSN, pid, ComponentConfigurationDTO.ACTIVE );
SimpleComponent scSN = SimpleComponent.INSTANCE;
TestCase.assertEquals( pidSN, scSN.getProperty( TARGETED_PID ) );
Bundle bSNV = installBundle( descriptorFile, COMPONENT_PACKAGE, "simplecomponent2", "0.0.12", null );
bSNV.start();
findComponentConfigurationByName( bSNV, pid, ComponentConfigurationDTO.ACTIVE );
SimpleComponent scSNV = SimpleComponent.INSTANCE;
TestCase.assertEquals( pidSNV, scSNV.getProperty( TARGETED_PID ) );
Bundle bSNVL = installBundle( descriptorFile, COMPONENT_PACKAGE, "simplecomponent2", "0.0.12", "bundleLocation" );
bSNVL.start();
findComponentConfigurationsByName( bSNVL, pid, ComponentConfigurationDTO.ACTIVE );
SimpleComponent scSNVL = SimpleComponent.INSTANCE;
TestCase.assertEquals( pidSNVL, scSNVL.getProperty( TARGETED_PID ) );
//remove configurations to check that the components now use the less specific configurations.
configSNVL.delete();
delay();
findComponentConfigurationsByName( bSNVL, pid, ComponentConfigurationDTO.ACTIVE );
TestCase.assertEquals( pidSNV, scSNVL.getProperty( TARGETED_PID ) );
configSNV.delete();