public void testUpdateResourcePropertiesCallback() throws ResourceException, ResourceContextException, XmlException
{
String newValue = "99";
m_resourceContext = new SushiResourceContext();
SushiPlate plate = new SushiPlate();
SushiCallback callback = new SushiCallback( plate );
//setup callback on resource prop
SushiResource resource = (SushiResource) m_resourceContext.getResource();
ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
resourceProp.setCallback( callback );
SetResourcePropertiesProvider set_provider = new SetResourcePropertiesProvider( m_resourceContext );
UpdateDocument updateDoc = UpdateDocument.Factory.newInstance();
UpdateType update = updateDoc.addNewUpdate();
XmlObject xmlObject =
XmlObject.Factory.parse( "<foo:Ebi xmlns:foo=\"http://ws.apache.org/resource/properties/test/sushi\">"
+ newValue + "</foo:Ebi>" );
XmlBeanUtils.addChildElement( update, xmlObject );
set_provider.updateResourceProperty( updateDoc.getUpdate() );
assertPropHasOneElemWithGivenValue( SushiPropertyQNames.EBI, newValue );
assertTrue( callback.updateWasInvoked() );
}