@Test public void testPrismConsistency() throws Exception { System.out.println("===[ testPrismConsistency ]==="); // GIVEN PrismContext ctx = getPrismContext(); PrismObjectDefinition<UserType> userDefinition = ctx.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(UserType.class); // WHEN PrismObject<UserType> user = userDefinition.instantiate(); user.setOid("12345"); // THEN System.out.println("User:"); System.out.println(user.debugDump()); System.out.println("Checking consistency, 1st time."); user.checkConsistence(); UserType userType = user.getValue().getValue(); System.out.println("Checking consistency, 2nd time - after getValue().getValue()."); user.checkConsistence(); System.out.println("OK."); }
@Test public void test010CycleCronLoose() throws Exception { final String TEST_NAME = "test010CycleCronLoose"; final OperationResult result = createResult(TEST_NAME, LOGGER); addObjectFromFile(taskFilename(TEST_NAME)); waitForTaskProgress(taskOid(TEST_NAME), result, 15000, 2000, 2); // Check task status Task task = getTask(taskOid(TEST_NAME), result); AssertJUnit.assertNotNull(task); System.out.println(task.debugDump()); TaskType t = repositoryService.getObject(TaskType.class, taskOid(TEST_NAME), null, result).getValue().getValue(); System.out.println(ObjectTypeUtil.dump(t)); AssertJUnit.assertEquals(TaskExecutionStatus.RUNNABLE, task.getExecutionStatus()); // .. and last run should not be zero AssertJUnit.assertNotNull(task.getLastRunStartTimestamp()); assertFalse(task.getLastRunStartTimestamp() == 0); AssertJUnit.assertNotNull(task.getLastRunFinishTimestamp()); assertFalse(task.getLastRunFinishTimestamp() == 0); // The progress should be at least 2 as the task has run at least twice AssertJUnit.assertTrue("Task has not been executed at least twice", task.getProgress() >= 2); // Test for presence of a result. It should be there and it should // indicate success assertSuccessOrInProgress(task); // Suspend the task (in order to keep logs clean), without much waiting taskManager.suspendTaskQuietly(task, 100, result); }
System.out.println(ObjectTypeUtil.dump(o.getValue().getValue()));
System.out.println(ObjectTypeUtil.dump(o.getValue().getValue()));
System.out.println(ObjectTypeUtil.dump(o.getValue().getValue()));