{
// Initialize new POJO
String bindName = "org.jboss.ejb3.TestBind" + UUID.randomUUID();
String oldValue = "oldValue";
SimplePojo pojo = new SimplePojo();
pojo.setProperty(oldValue);
// Bind
Ejb3RegistrarLocator.locateRegistrar().bind(bindName, pojo);
// Lookup
SimplePojo retrieved = (SimplePojo) Ejb3RegistrarLocator.locateRegistrar().lookup(bindName);
// Ensure set value is intact
TestCase.assertEquals(
"Property value set before placing in Registry was not equal to property value obtained from registry",
oldValue, retrieved.getProperty());
// Invoke to change property value
String newValue = "newValue";
Ejb3RegistrarLocator.locateRegistrar().invoke(bindName, "setProperty", new String[]
{newValue}, new String[]
{String.class.getName()});
// Ensure the value has changed
TestCase.assertEquals("Invocation did not have affect on retrived instance from Registry", newValue, retrieved
.getProperty());
}