当前位置: 首页>>代码示例>>Java>>正文


Java DOMUtil.XSD_STRING属性代码示例

本文整理汇总了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);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:26,代码来源:TestDelta.java

示例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;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:25,代码来源:AbstractIntegrationTest.java

示例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);
        }
    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:26,代码来源:QueryInterpreter2Test.java

示例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");
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:25,代码来源:TestDelta.java

示例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);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:26,代码来源:TestDelta.java

示例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());
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:26,代码来源:TestModelServiceContract.java

示例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);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:25,代码来源:TestDelta.java

示例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;
  }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:18,代码来源:BaseHelper.java

示例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);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:25,代码来源:TestDelta.java

示例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;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:30,代码来源:ProvisioningUtil.java

示例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);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:33,代码来源:TestDelta.java

示例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");
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:27,代码来源:TestDelta.java

示例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);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:29,代码来源:TestModelExpressions.java

示例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");
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:33,代码来源:TestDelta.java

示例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);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:10,代码来源:TestObjectQuery.java


注:本文中的com.evolveum.midpoint.util.DOMUtil.XSD_STRING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。