{
public static void main(String[] args)
{
System.setProperty("com.arjuna.ats.arjuna.Test","SysOverride");
PropertyManager arjunaPM = PropertyManagerFactory.getPropertyManager( "test-property-manager", "Arjuna" );
PropertyManager txojPM = PropertyManagerFactory.getPropertyManager( "test-property-manager", "TXOJ" );
PropertyManager orbPM = PropertyManagerFactory.getPropertyManager( "test-property-manager", "ORB Portability" );
try
{
arjunaPM.load(XMLFilePlugin.class.getName(), "test-product.xml");
}
catch (Exception e)
{
e.printStackTrace(); //To change body of catch statement use Options | File Templates.
}
boolean passed = true;
int count = 0;
String value = arjunaPM.getProperty("com.arjuna.ats.arjuna.Test");
System.out.println("Value["+(++count)+"] :"+value);
passed &= value.equals("SysOverride");
value = txojPM.getProperty("com.arjuna.ats.arjuna.Test");
System.out.println("Value["+(++count)+"] :"+value);
passed &= value.equals("SysOverride");
value = arjunaPM.getProperty("com.arjuna.ats.txoj.Test");
System.out.println("Value["+(++count)+"] :"+value);
passed &= ( value == null );
value = txojPM.getProperty("com.arjuna.ats.txoj.Test");
System.out.println("Value["+(++count)+"] :"+value);
passed &= value.equals("Test2");
value = orbPM.getProperty("com.arjuna.ats.txoj.Test");
System.out.println("Value["+(++count)+"] :"+value);
passed &= ( value == null );
value = orbPM.getProperty("com.arjuna.orbportability.Test");
System.out.println("Value["+(++count)+"] :"+value);
passed &= value.equals("Test3");
System.out.println( passed ? "Passed" : "Failed" );
}