public String addAccount(DummyAccount newAccount) throws ObjectAlreadyExistsException, ConnectException, FileNotFoundException, SchemaViolationException, ConflictException, InterruptedException { if (generateAccountDescriptionOnCreate && newAccount.getAttributeValue(DummyAccount.ATTR_DESCRIPTION_NAME) == null) { newAccount.addAttributeValue(DummyAccount.ATTR_DESCRIPTION_NAME, "Description of " + newAccount.getName()); } return addObject(accounts, newAccount); }
account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Melee Island"); long loot = ACCOUNT_MANCOMB_VALID_FROM_DATE.getTime(); account.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOOT_NAME, loot); String gossip = XmlTypeConverter.createXMLGregorianCalendar(ACCOUNT_MANCOMB_VALID_TO_DATE).toXMLFormat(); account.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, gossip);
account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Melee Island"); long loot = ACCOUNT_MANCOMB_VALID_FROM_DATE.getTime(); account.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOOT_NAME, loot); String gossip = XmlTypeConverter.createXMLGregorianCalendar(ACCOUNT_MANCOMB_VALID_TO_DATE).toXMLFormat(); account.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, gossip);
/** * Make sure that Guybrush has an existing account and that it is properly populated. * We will use this setup in following tests. */ @Test public void test240GuybrushAssignAccountDummyRelative() throws Exception { final String TEST_NAME = "test240GuybrushAssignAccountDummyRelative"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); assumeAssignmentPolicy(AssignmentPolicyEnforcementType.RELATIVE); // WHEN displayWhen(TEST_NAME); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_RELATIVE_OID, null, task, result); // THEN displayThen(TEST_NAME); result.computeStatus(); TestUtil.assertSuccess(result); DummyAccount dummyAccount = assertDummyAccount(RESOURCE_DUMMY_RELATIVE_NAME, USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, true); display("Dummy account after", dummyAccount); dummyAccount.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, "Great Pirate"); }
newAccount.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_SHIP_NAME, "Sea Monkey"); newAccount.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_WEAPON_NAME, "hook"); newAccount.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOOT_NAME, 666); newAccount.setEnabled(true); newAccount.setPassword("parrotMonster");
/** * Make sure that Guybrush has an existing account and that it is properly populated. * We will use this setup in following tests. */ @Test public void test230GuybrushAssignAccountDummy() throws Exception { final String TEST_NAME = "test230GuybrushAssignAccountDummy"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); assumeAssignmentPolicy(AssignmentPolicyEnforcementType.RELATIVE); ObjectDelta<UserType> delta = createAssignmentAssignmentHolderDelta(UserType.class, USER_GUYBRUSH_OID, ROLE_PIRATE_OID, RoleType.COMPLEX_TYPE, null, null, null, true); ModelExecuteOptions options = ModelExecuteOptions.createReconcile(); // WHEN displayWhen(TEST_NAME); modifyUserReplace(USER_GUYBRUSH_OID, ItemPath.create(UserType.F_EXTENSION, PIRACY_WEAPON), task, result, "tongue"); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN displayThen(TEST_NAME); result.computeStatus(); TestUtil.assertSuccess(result); DummyAccount dummyAccount = assertDummyAccount(null, USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, true); display("Dummy account after", dummyAccount); dummyAccount.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, "Great Pirate"); }
DummyAccount newAccount = new DummyAccount(BLACKBEARD_USERNAME); newAccount.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, "Edward Teach"); newAccount.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOOT_NAME, 66666); newAccount.setEnabled(true); newAccount.setPassword("shiverMEtimbers");
@Override public void initSystem(Task initTask, OperationResult initResult) throws Exception { super.initSystem(initTask, initResult); initDummyResource(RESOURCE_DUMMY_PURPLE_NAME, RESOURCE_DUMMY_PURPLE_FILE, RESOURCE_DUMMY_PURPLE_OID, controller -> { controller.extendSchemaPirate(); controller.addAttrDef(controller.getDummyResource().getAccountObjectClass(), DUMMY_ACCOUNT_ATTRIBUTE_MATE_NAME, String.class, false, true); }, initTask, initResult); importObjectFromFile(ACCOUNT_JDOE_FILE); importObjectFromFile(ACCOUNT_CREW_FILE); importObjectFromFile(USER_JDOE_FILE); importObjectFromFile(ROLE_TEST_MATE_FILE); DummyAccount jdoe = new DummyAccount("jdoe"); jdoe.addAttributeValue("privileges", "test-mate"); getDummyResource(RESOURCE_DUMMY_PURPLE_NAME).addAccount(jdoe); DummyPrivilege crew = new DummyPrivilege("test-mate"); getDummyResource(RESOURCE_DUMMY_PURPLE_NAME).addPrivilege(crew); }
jackDummyAccount.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, EXISTING_GOSSIP);
jackDummyAccount.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, EXISTING_GOSSIP);
guybrushDummyAccount.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME, "water"); guybrushDummyAccount.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_QUOTE_NAME, "I want to be a pirate!");
jackDummyAccount.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, EXISTING_GOSSIP);