@Override public String debugDump(int indent) { StringBuilder sb = new StringBuilder(); SchemaDebugUtil.indentDebugDump(sb, indent); sb.append("Property modification operation:\n"); sb.append(propertyDelta.debugDump(indent + 1)); return sb.toString(); }
private String dumpEntry(int indent, Serializable value) { if (value instanceof Element) { Element element = (Element) value; if (SchemaConstants.C_VALUE.equals(DOMUtil.getQName(element))) { try { String cvalue = null; if (value == null) { cvalue = "null"; } else if (value instanceof Element) { cvalue = SchemaDebugUtil.prettyPrint(XmlTypeConverter.toJavaValue((Element) value)); } else { cvalue = SchemaDebugUtil.prettyPrint(value); } return DebugUtil.fixIndentInMultiline(indent, INDENT_STRING, cvalue); } catch (Exception e) { return DebugUtil.fixIndentInMultiline( indent, INDENT_STRING, "value: " + element.getTextContent()); } } } return DebugUtil.fixIndentInMultiline( indent, INDENT_STRING, SchemaDebugUtil.prettyPrint(value)); }
@Test public void testFetchChanges() throws Exception { TestUtil.displayTestTile(this, "testFetchChanges"); OperationResult result = new OperationResult(this.getClass().getName() + ".testFetchChanges"); ObjectClassComplexTypeDefinition accountDefinition = resourceSchema.findDefaultObjectClassDefinition(ShadowKindType.ACCOUNT); PrismProperty lastToken = cc.fetchCurrentToken(accountDefinition, result); System.out.println("Property:"); System.out.println(SchemaDebugUtil.prettyPrint(lastToken)); System.out.println("token " + lastToken.toString()); List<Change<ShadowType>> changes = cc.fetchChanges(accountDefinition, lastToken, null, result); AssertJUnit.assertEquals(0, changes.size()); }
@Test public void test200FetchChanges() throws Exception { final String TEST_NAME = "test200FetchChanges"; TestUtil.displayTestTile(this, TEST_NAME); OperationResult result = new OperationResult(this.getClass().getName() + "." + TEST_NAME); ObjectClassComplexTypeDefinition accountDefinition = resourceSchema.findObjectClassDefinition( ProvisioningTestUtil.OBJECT_CLASS_INETORGPERSON_NAME); PrismProperty<Integer> lastToken = cc.fetchCurrentToken(accountDefinition, result); System.out.println("Property:"); System.out.println(SchemaDebugUtil.prettyPrint(lastToken)); System.out.println("token " + lastToken.toString()); assertNotNull("No last token", lastToken); assertNotNull("No last token value", lastToken.getRealValue()); List<Change<ShadowType>> changes = cc.fetchChanges(accountDefinition, lastToken, null, result); AssertJUnit.assertEquals(0, changes.size()); }