use of javax.xml.datatype.XMLGregorianCalendar in project midpoint by Evolveum.
the class ImportTest method assertMetadata.
private <O extends ObjectType> void assertMetadata(O objectType, XMLGregorianCalendar startTime, XMLGregorianCalendar endTime) {
MetadataType metadata = objectType.getMetadata();
assertNotNull("No metadata in " + objectType, metadata);
XMLGregorianCalendar createTimestamp = metadata.getCreateTimestamp();
assertNotNull("No createTimestamp in metadata of " + objectType, createTimestamp);
TestUtil.assertBetween("Wrong createTimestamp in metadata of " + objectType, startTime, endTime, createTimestamp);
assertEquals("Wrong channel in metadata of " + objectType, SchemaConstants.CHANNEL_OBJECT_IMPORT_URI, metadata.getCreateChannel());
}
use of javax.xml.datatype.XMLGregorianCalendar in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertEnableTimestampFocus.
protected void assertEnableTimestampFocus(PrismObject<? extends FocusType> focus, XMLGregorianCalendar startTime, XMLGregorianCalendar endTime) {
XMLGregorianCalendar userDisableTimestamp = focus.asObjectable().getActivation().getEnableTimestamp();
TestUtil.assertBetween("Wrong user enableTimestamp in " + focus, startTime, endTime, userDisableTimestamp);
}
use of javax.xml.datatype.XMLGregorianCalendar in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertTrigger.
protected <O extends ObjectType> void assertTrigger(PrismObject<O> object, String handlerUri, XMLGregorianCalendar mid, long tolerance) throws ObjectNotFoundException, SchemaException {
XMLGregorianCalendar start = XmlTypeConverter.addMillis(mid, -tolerance);
XMLGregorianCalendar end = XmlTypeConverter.addMillis(mid, tolerance);
for (TriggerType trigger : object.asObjectable().getTrigger()) {
if (handlerUri.equals(trigger.getHandlerUri()) && MiscUtil.isBetween(trigger.getTimestamp(), start, end)) {
return;
}
}
AssertJUnit.fail("Expected that " + object + " will have a trigger but it has not");
}
use of javax.xml.datatype.XMLGregorianCalendar in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertDisableTimestampFocus.
protected void assertDisableTimestampFocus(PrismObject<? extends FocusType> focus, XMLGregorianCalendar startTime, XMLGregorianCalendar endTime) {
XMLGregorianCalendar userDisableTimestamp = focus.asObjectable().getActivation().getDisableTimestamp();
TestUtil.assertBetween("Wrong user disableTimestamp in " + focus, startTime, endTime, userDisableTimestamp);
}
use of javax.xml.datatype.XMLGregorianCalendar in project midpoint by Evolveum.
the class TestDummy method test109ModifiedAccountCleanup.
/**
* Clean up after caching tests so we won't break subsequent tests.
* MID-3481
*/
@Test
public void test109ModifiedAccountCleanup() throws Exception {
final String TEST_NAME = "test109ModifiedAccountCleanup";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
OperationResult result = new OperationResult(TestDummy.class.getName() + "." + TEST_NAME);
rememberShadowFetchOperationCount();
DummyAccount accountWill = getDummyAccountAssert(transformNameFromResource(ACCOUNT_WILL_USERNAME), willIcfUid);
// Modify this back so won't break subsequent tests
accountWill.replaceAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_SHIP_NAME, "Flying Dutchman");
accountWill.replaceAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME);
accountWill.setEnabled(true);
XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar();
// WHEN
PrismObject<ShadowType> shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, null, null, result);
// THEN
result.computeStatus();
display("getObject result", result);
TestUtil.assertSuccess(result);
assertShadowFetchOperationCountIncrement(1);
XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar();
display("Retrieved account shadow", shadow);
assertNotNull("No dummy account", shadow);
checkAccountWill(shadow, result, startTs, endTs);
PrismObject<ShadowType> shadowRepo = repositoryService.getObject(ShadowType.class, ACCOUNT_WILL_OID, null, result);
checkRepoAccountShadowWill(shadowRepo, startTs, endTs);
checkConsistency(shadow);
assertCachingMetadata(shadow, false, startTs, endTs);
assertSteadyResource();
}
Aggregations