public class SetPropertyTest
{
public static void main(String[] args)
{
PropertyManager arjunaPM = PropertyManagerFactory.getPropertyManager( "test-property-manager", "Arjuna" );
PropertyManager txojPM = PropertyManagerFactory.getPropertyManager( "test-property-manager", "TXOJ" );
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("Test");
arjunaPM.setProperty("com.arjuna.ats.arjuna.Test", "OverriddenInCode");
value = txojPM.getProperty("com.arjuna.ats.arjuna.Test");
System.out.println("Value["+(++count)+"] :"+value);
passed &= value.equals("Overridden");
value = arjunaPM.getProperty("com.arjuna.ats.arjuna.Test");
System.out.println("Value["+(++count)+"] :"+value);