本文整理汇总了Java中com.evolveum.midpoint.util.DOMUtil.XSD_STRING属性的典型用法代码示例。如果您正苦于以下问题:Java DOMUtil.XSD_STRING属性的具体用法?Java DOMUtil.XSD_STRING怎么用?Java DOMUtil.XSD_STRING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.evolveum.midpoint.util.DOMUtil
的用法示例。
在下文中一共展示了DOMUtil.XSD_STRING属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testPropertyDeltaMerge20
@Test
public void testPropertyDeltaMerge20() throws Exception {
System.out.println("\n\n===[ testPropertyDeltaMerge20 ]===\n");
// GIVEN
PrismPropertyDefinition propertyDefinition = new PrismPropertyDefinitionImpl(UserType.F_DESCRIPTION,
DOMUtil.XSD_STRING, PrismTestUtil.getPrismContext());
PropertyDelta<String> delta1 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta1.addValueToAdd(new PrismPropertyValue<String>("add1"));
delta1.addValueToDelete(new PrismPropertyValue<String>("del1"));
PropertyDelta<String> delta2 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta2.setValuesToReplace(new PrismPropertyValue<String>("r2x"), new PrismPropertyValue<String>("r2y"));
// WHEN
delta1.merge(delta2);
// THEN
System.out.println("Merged delta:");
System.out.println(delta1.debugDump());
PrismAsserts.assertReplace(delta1, "r2x", "r2y");
PrismAsserts.assertNoAdd(delta1);
PrismAsserts.assertNoDelete(delta1);
}
示例2: repoAddShadowFromFile
protected PrismObject<ShadowType> repoAddShadowFromFile(File file, OperationResult parentResult)
throws SchemaException, ObjectAlreadyExistsException, EncryptionException, IOException {
OperationResult result = parentResult.createSubresult(AbstractIntegrationTest.class.getName()
+ ".repoAddShadowFromFile");
result.addParam("file", file.getPath());
LOGGER.debug("addShadowFromFile: {}", file);
PrismObject<ShadowType> object = prismContext.parseObject(file);
PrismContainer<Containerable> attrCont = object.findContainer(ShadowType.F_ATTRIBUTES);
for (PrismProperty<?> attr: attrCont.getValue().getProperties()) {
if (attr.getDefinition() == null) {
ResourceAttributeDefinition<String> attrDef = new ResourceAttributeDefinitionImpl<>(attr.getElementName(),
DOMUtil.XSD_STRING, prismContext);
attr.setDefinition((PrismPropertyDefinition) attrDef);
}
}
addBasicMetadata(object);
LOGGER.trace("Adding object:\n{}", object.debugDump());
repoAddObject(object, "from file "+file, result);
result.recordSuccess();
return object;
}
示例3: test900EqualsMultivalue
@Test(expectedExceptions = IllegalArgumentException.class) // should fail, as Equals supports single-value right side only
// TODO this should be perhaps checked in EqualFilter
public void test900EqualsMultivalue() throws Exception {
Session session = open();
try {
/*
* ### User: preferredLanguage = 'SK', 'HU'
*/
PrismPropertyDefinitionImpl<String> multivalDef = new PrismPropertyDefinitionImpl<>(UserType.F_PREFERRED_LANGUAGE,
DOMUtil.XSD_STRING, prismContext);
multivalDef.setMaxOccurs(-1);
PrismProperty<String> multivalProperty = multivalDef.instantiate();
multivalProperty.addRealValue("SK");
multivalProperty.addRealValue("HU");
ObjectQuery query = QueryBuilder.queryFor(UserType.class, prismContext)
.item(UserType.F_PREFERRED_LANGUAGE).eq(multivalProperty)
.build();
getInterpretedQuery2(session, UserType.class, query);
// assertEqualsIgnoreWhitespace(expected, real);
} finally {
close(session);
}
}
示例4: testPropertyDeltaMerge02
@Test
public void testPropertyDeltaMerge02() throws Exception {
System.out.println("\n\n===[ testPropertyDeltaMerge02 ]===\n");
// GIVEN
PrismPropertyDefinition propertyDefinition = new PrismPropertyDefinitionImpl(UserType.F_DESCRIPTION,
DOMUtil.XSD_STRING, PrismTestUtil.getPrismContext());
PropertyDelta<String> delta1 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta1.addValueToDelete(new PrismPropertyValue<String>("del1"));
PropertyDelta<String> delta2 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta2.addValueToDelete(new PrismPropertyValue<String>("del2"));
// WHEN
delta1.merge(delta2);
// THEN
System.out.println("Merged delta:");
System.out.println(delta1.debugDump());
PrismAsserts.assertNoReplace(delta1);
PrismAsserts.assertNoAdd(delta1);
PrismAsserts.assertDelete(delta1, "del1", "del2");
}
示例5: testPropertyDeltaMerge11
@Test
public void testPropertyDeltaMerge11() throws Exception {
System.out.println("\n\n===[ testPropertyDeltaMerge11 ]===\n");
// GIVEN
PrismPropertyDefinition propertyDefinition = new PrismPropertyDefinitionImpl(UserType.F_DESCRIPTION,
DOMUtil.XSD_STRING, PrismTestUtil.getPrismContext());
PropertyDelta<String> delta1 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta1.setValuesToReplace(new PrismPropertyValue<String>("r1x"), new PrismPropertyValue<String>("r1y"));
PropertyDelta<String> delta2 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta2.addValueToAdd(new PrismPropertyValue<String>("add2"));
delta2.addValueToDelete(new PrismPropertyValue<String>("r1y"));
// WHEN
delta1.merge(delta2);
// THEN
System.out.println("Merged delta:");
System.out.println(delta1.debugDump());
PrismAsserts.assertReplace(delta1, "r1x", "add2");
PrismAsserts.assertNoAdd(delta1);
PrismAsserts.assertNoDelete(delta1);
}
示例6: test106SearchAccountWithoutResourceSchema
@Test
public void test106SearchAccountWithoutResourceSchema() throws Exception {
TestUtil.displayTestTile(this, "test106SearchAccountWithoutResourceSchema");
// GIVEN
Task task = taskManager.createTaskInstance(TestModelServiceContract.class.getName() + ".test106SearchAccountWithoutResourceSchema");
OperationResult result = task.getResult();
// create weapon attribute definition - NOT SUPPORTED, use only when you know what you're doing!
QName accountObjectClassQName = dummyResourceCtl.getAccountObjectClassQName();
QName weaponQName = dummyResourceCtl.getAttributeWeaponQName();
PrismPropertyDefinition<String> weaponFakeDef = new PrismPropertyDefinitionImpl<>(weaponQName, DOMUtil.XSD_STRING, prismContext);
ObjectQuery q = QueryBuilder.queryFor(ShadowType.class, prismContext)
.item(ShadowType.F_RESOURCE_REF).ref(RESOURCE_DUMMY_OID)
.and().item(ShadowType.F_OBJECT_CLASS).eq(accountObjectClassQName)
.and().item(new ItemPath(ShadowType.F_ATTRIBUTES, weaponQName), weaponFakeDef).eq("rum")
.build();
// WHEN
List<PrismObject<ShadowType>> list = modelService.searchObjects(ShadowType.class, q, null, task, result);
// THEN
display("Accounts", list);
assertEquals("Wrong # of objects returned", 1, list.size());
}
示例7: testPropertyDeltaMerge10
@Test
public void testPropertyDeltaMerge10() throws Exception {
System.out.println("\n\n===[ testPropertyDeltaMerge10 ]===\n");
// GIVEN
PrismPropertyDefinition propertyDefinition = new PrismPropertyDefinitionImpl(UserType.F_DESCRIPTION,
DOMUtil.XSD_STRING, PrismTestUtil.getPrismContext());
PropertyDelta<String> delta1 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta1.setValuesToReplace(new PrismPropertyValue<String>("r1x"), new PrismPropertyValue<String>("r1y"));
PropertyDelta<String> delta2 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta2.addValueToAdd(new PrismPropertyValue<String>("add2"));
// WHEN
delta1.merge(delta2);
// THEN
System.out.println("Merged delta:");
System.out.println(delta1.debugDump());
PrismAsserts.assertReplace(delta1, "r1x", "r1y", "add2");
PrismAsserts.assertNoAdd(delta1);
PrismAsserts.assertNoDelete(delta1);
}
示例8: evaluateExpression
private List<String> evaluateExpression(ExpressionType expressionType, ExpressionVariables expressionVariables,
String shortDesc, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, ExpressionEvaluationException {
QName resultName = new QName(SchemaConstants.NS_C, "result");
PrismPropertyDefinition<String> resultDef = new PrismPropertyDefinitionImpl(resultName, DOMUtil.XSD_STRING, prismContext);
Expression<PrismPropertyValue<String>,PrismPropertyDefinition<String>> expression = expressionFactory.makeExpression(expressionType, resultDef, shortDesc, task, result);
ExpressionEvaluationContext params = new ExpressionEvaluationContext(null, expressionVariables, shortDesc, task, result);
PrismValueDeltaSetTriple<PrismPropertyValue<String>> exprResult;
exprResult = ModelExpressionThreadLocalHolder.evaluateExpressionInContext(expression, params, task, result);
List<String> retval = new ArrayList<String>();
for (PrismPropertyValue<String> item : exprResult.getZeroSet()) {
retval.add(item.getValue());
}
return retval;
}
示例9: testPropertyDeltaMerge01
@Test
public void testPropertyDeltaMerge01() throws Exception {
System.out.println("\n\n===[ testPropertyDeltaMerge01 ]===\n");
// GIVEN
PrismPropertyDefinition propertyDefinition = new PrismPropertyDefinitionImpl(UserType.F_DESCRIPTION,
DOMUtil.XSD_STRING, PrismTestUtil.getPrismContext());
PropertyDelta<String> delta1 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta1.addValueToAdd(new PrismPropertyValue<String>("add1"));
PropertyDelta<String> delta2 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta2.addValueToAdd(new PrismPropertyValue<String>("add2"));
// WHEN
delta1.merge(delta2);
// THEN
System.out.println("Merged delta:");
System.out.println(delta1.debugDump());
PrismAsserts.assertNoReplace(delta1);
PrismAsserts.assertAdd(delta1, "add1", "add2");
PrismAsserts.assertNoDelete(delta1);
}
示例10: convertToScriptOperation
public static ExecuteProvisioningScriptOperation convertToScriptOperation(
ProvisioningScriptType scriptType, String desc, PrismContext prismContext) throws SchemaException {
ExecuteProvisioningScriptOperation scriptOperation = new ExecuteProvisioningScriptOperation();
PrismPropertyDefinition scriptArgumentDefinition = new PrismPropertyDefinitionImpl(
FAKE_SCRIPT_ARGUMENT_NAME, DOMUtil.XSD_STRING, prismContext);
for (ProvisioningScriptArgumentType argument : scriptType.getArgument()) {
ExecuteScriptArgument arg = new ExecuteScriptArgument(argument.getName(),
StaticExpressionUtil.getStaticOutput(argument, scriptArgumentDefinition, desc,
ExpressionReturnMultiplicityType.SINGLE, prismContext));
scriptOperation.getArgument().add(arg);
}
scriptOperation.setLanguage(scriptType.getLanguage());
scriptOperation.setTextCode(scriptType.getCode());
if (scriptType.getHost() != null && scriptType.getHost().equals(ProvisioningScriptHostType.CONNECTOR)) {
scriptOperation.setConnectorHost(true);
scriptOperation.setResourceHost(false);
}
if (scriptType.getHost() == null || scriptType.getHost().equals(ProvisioningScriptHostType.RESOURCE)) {
scriptOperation.setConnectorHost(false);
scriptOperation.setResourceHost(true);
}
scriptOperation.setCriticality(scriptType.getCriticality());
return scriptOperation;
}
示例11: testSummarize01
@Test
public void testSummarize01() throws Exception {
System.out.println("\n\n===[ testSummarize01 ]===\n");
// GIVEN
PrismPropertyDefinition propertyDefinition = new PrismPropertyDefinitionImpl(UserType.F_DESCRIPTION,
DOMUtil.XSD_STRING, PrismTestUtil.getPrismContext());
PropertyDelta<String> delta1 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta1.addValueToAdd(new PrismPropertyValue<String>("add1"));
ObjectDelta<UserType> objectDelta1 = new ObjectDelta<UserType>(UserType.class, ChangeType.MODIFY,
PrismTestUtil.getPrismContext());
objectDelta1.addModification(delta1);
PropertyDelta<String> delta2 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta2.addValueToAdd(new PrismPropertyValue<String>("add2"));
ObjectDelta<UserType> objectDelta2 = new ObjectDelta<UserType>(UserType.class, ChangeType.MODIFY,
PrismTestUtil.getPrismContext());
objectDelta2.addModification(delta2);
// WHEN
ObjectDelta<UserType> sumDelta = ObjectDelta.summarize(objectDelta1, objectDelta2);
// THEN
System.out.println("Summarized delta:");
System.out.println(sumDelta.debugDump());
PrismAsserts.assertModifications(sumDelta, 1);
PropertyDelta<String> modification = (PropertyDelta<String>) sumDelta.getModifications().iterator().next();
PrismAsserts.assertNoReplace(modification);
PrismAsserts.assertAdd(modification, "add1", "add2");
PrismAsserts.assertNoDelete(modification);
}
示例12: testPropertyDeltaMerge04
@Test
public void testPropertyDeltaMerge04() throws Exception {
System.out.println("\n\n===[ testPropertyDeltaMerge04 ]===\n");
// GIVEN
PrismPropertyDefinition propertyDefinition = new PrismPropertyDefinitionImpl(UserType.F_DESCRIPTION,
DOMUtil.XSD_STRING, PrismTestUtil.getPrismContext());
PropertyDelta<String> delta1 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta1.addValueToAdd(new PrismPropertyValue<String>("add1"));
delta1.addValueToDelete(new PrismPropertyValue<String>("del1"));
PropertyDelta<String> delta2 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta2.addValueToAdd(new PrismPropertyValue<String>("add2"));
delta2.addValueToDelete(new PrismPropertyValue<String>("add1"));
// WHEN
delta1.merge(delta2);
// THEN
System.out.println("Merged delta:");
System.out.println(delta1.debugDump());
PrismAsserts.assertNoReplace(delta1);
PrismAsserts.assertAdd(delta1, "add2");
PrismAsserts.assertDelete(delta1, "del1");
}
示例13: testGetManagersOids
@Test
public void testGetManagersOids() throws Exception {
final String TEST_NAME = "testGetManagersOids";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
OperationResult result = new OperationResult(TestModelExpressions.class.getName() + "." + TEST_NAME);
PrismObject<UserType> chef = repositoryService.getObject(UserType.class, CHEF_OID, null, result);
ScriptExpressionEvaluatorType scriptType = parseScriptType("expression-" + TEST_NAME + ".xml");
PrismPropertyDefinition<String> outputDefinition = new PrismPropertyDefinitionImpl<>(PROPERTY_NAME, DOMUtil.XSD_STRING, PrismTestUtil.getPrismContext());
ScriptExpression scriptExpression = scriptExpressionFactory.createScriptExpression(scriptType, outputDefinition, TEST_NAME);
ExpressionVariables variables = new ExpressionVariables();
variables.addVariableDefinition(new QName(SchemaConstants.NS_C, "user"), chef);
// WHEN
List<PrismPropertyValue<String>> scriptOutputs = evaluate(scriptExpression, variables, false, TEST_NAME, null, result);
// THEN
display("Script output", scriptOutputs);
assertEquals("Unexpected number of script outputs", 3, scriptOutputs.size());
Set<String> oids = new HashSet<String>();
oids.add(scriptOutputs.get(0).getValue());
oids.add(scriptOutputs.get(1).getValue());
oids.add(scriptOutputs.get(2).getValue());
Set<String> expectedOids = new HashSet<String>(Arrays.asList(new String[] { CHEESE_OID, CHEESE_JR_OID, LECHUCK_OID }));
assertEquals("Unexpected script output", expectedOids, oids);
}
示例14: testSummarize02
@Test
public void testSummarize02() throws Exception {
System.out.println("\n\n===[ testSummarize02 ]===\n");
// GIVEN
PrismPropertyDefinition propertyDefinition = new PrismPropertyDefinitionImpl(UserType.F_DESCRIPTION,
DOMUtil.XSD_STRING, PrismTestUtil.getPrismContext());
PropertyDelta<String> delta1 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta1.addValueToDelete(new PrismPropertyValue<String>("del1"));
ObjectDelta<UserType> objectDelta1 = new ObjectDelta<UserType>(UserType.class, ChangeType.MODIFY,
PrismTestUtil.getPrismContext());
objectDelta1.addModification(delta1);
PropertyDelta<String> delta2 = new PropertyDelta<String>(propertyDefinition, PrismTestUtil.getPrismContext());
delta2.addValueToDelete(new PrismPropertyValue<String>("del2"));
ObjectDelta<UserType> objectDelta2 = new ObjectDelta<UserType>(UserType.class, ChangeType.MODIFY,
PrismTestUtil.getPrismContext());
objectDelta2.addModification(delta2);
// WHEN
ObjectDelta<UserType> sumDelta = ObjectDelta.summarize(objectDelta1, objectDelta2);
// THEN
System.out.println("Summarized delta:");
System.out.println(sumDelta.debugDump());
PrismAsserts.assertModifications(sumDelta, 1);
PropertyDelta<String> modification = (PropertyDelta<String>) sumDelta.getModifications().iterator().next();
PrismAsserts.assertNoReplace(modification);
PrismAsserts.assertNoAdd(modification);
PrismAsserts.assertDelete(modification, "del1", "del2");
}
示例15: testMatchEqualMultivalue
@Test
public void testMatchEqualMultivalue() throws Exception{
PrismObject user = PrismTestUtil.parseObject(PrismInternalTestUtil.USER_JACK_FILE_XML);
PrismPropertyDefinitionImpl def = new PrismPropertyDefinitionImpl(new QName("indexedString"), DOMUtil.XSD_STRING, PrismTestUtil.getPrismContext());
ObjectFilter filter = QueryBuilder.queryFor(UserType.class, PrismTestUtil.getPrismContext())
.item(new ItemPath(UserType.F_EXTENSION, "indexedString"), def).eq("alpha")
.buildFilter();
boolean match = ObjectQuery.match(user, filter, matchingRuleRegistry);
AssertJUnit.assertTrue("filter does not match object", match);
}