public void testPropertyManager ()
{
System.setProperty("com.arjuna.common.util.propertyservice.verbosePropertyManager", "ON");
PropertyManager corepm = PropertyManagerFactory.getPropertyManager("test.core", "core");
try
{
corepm.load(XMLFilePlugin.class.getName(), "jbossesb-test-properties.xml");
}
catch (Exception e)
{
log.error(e);
fail(e.toString());
}
assertEquals(corepm.getProperty(Environment.JNDI_SERVER_CONTEXT_FACTORY), "foobar");
assertEquals(corepm.getProperty(Environment.OBJECT_STORE_CONFIG_FILE), "file:config.xml");
try
{
assertEquals(corepm.getProperty(Environment.SMTP_HOST), "thishost");
fail();
}
catch (ComparisonFailure ex)
{
}
catch (Exception ex)
{
fail(ex.toString());
}
PropertyManager transportpm = PropertyManagerFactory.getPropertyManager("test.transports", "transports");
try
{
transportpm.load(XMLFilePlugin.class.getName(), "jbossesb-test-properties.xml");
}
catch (Exception e)
{
log.error(e);
fail(e.toString());
}
assertEquals(transportpm.getProperty(Environment.JNDI_SERVER_CONTEXT_FACTORY), "foobar");
assertEquals(transportpm.getProperty(Environment.SMTP_HOST), "thishost");
}