}
public void testDynamicRestrictedChangeRequest() throws MarshallerException, IOException
{
XMLUnmarshaller unmarshaller = new XMLUnmarshaller(new InvocationContext(Repository.getMetadata()));
SchemeParser parser = new SchemeParser(new InvocationContext(Repository.getMetadata())
.getMachine().getGlobalEnvironment());
StringReader reader = new StringReader("<User-Change-Request xmlns=\"" + XML.NS_URI_TNS
+ "\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><objects x" + "si:type=\"User\"><"
+ XML.BASE_PREFIX + "oid>10e8359492f25f4be49109b9979e684ff3</" + XML.BASE_PREFIX
+ "oid><" + XML.BASE_PREFIX + "event>welcome</" + XML.BASE_PREFIX
+ "event><fullName>fullname</fullName></objects><attributes>(password)</" + "attributes></User-Change-Request>");
XMLChangeRequest changeRequest = (XMLChangeRequest)unmarshaller.deserialize(reader);
MockServer server = new MockServer();
changeRequest.invoke(server);
Request request = server.getRequest();
Request.Invocation action = request.getInvocation(0);
assertEquals(1, request.getInvocationCount());
assertEquals("User", request.getObject(0).getClassName());
assertEquals("welcome", request.getObject(0).getEventName());
assertEquals(OID.fromBinary(Binary.parse("10e8359492f25f4be49109b9979e684ff3")),
request.getObject(0).getOID());
assertEquals(1, request.getObject(0).getValueCount());
assertEquals("fullname", request.getObject(0).findValue("fullName"));
assertEquals(0, request.getFilterCount());
assertNull(action.getEventName());
assertEquals(parser.parse(new StringReader("(password)"), null), action.getAttributes());
assertEquals("User", changeRequest.getMetaclass().getName());
}