use of com.helger.xsds.peppol.smp1.ObjectFactory in project cxf by apache.
the class RMSoapOutInterceptorTest method setUpOutbound.
private void setUpOutbound() {
ObjectFactory factory = new ObjectFactory();
s1 = factory.createSequenceType();
Identifier sid = factory.createIdentifier();
sid.setValue("sequence1");
s1.setIdentifier(sid);
s1.setMessageNumber(ONE);
s2 = factory.createSequenceType();
sid = factory.createIdentifier();
sid.setValue("sequence2");
s2.setIdentifier(sid);
s2.setMessageNumber(TEN);
ack1 = factory.createSequenceAcknowledgement();
SequenceAcknowledgement.AcknowledgementRange r = factory.createSequenceAcknowledgementAcknowledgementRange();
r.setLower(ONE);
r.setUpper(ONE);
ack1.getAcknowledgementRange().add(r);
ack1.setIdentifier(s1.getIdentifier());
ack2 = factory.createSequenceAcknowledgement();
r = factory.createSequenceAcknowledgementAcknowledgementRange();
r.setLower(ONE);
r.setUpper(TEN);
ack2.getAcknowledgementRange().add(r);
ack2.setIdentifier(s2.getIdentifier());
ar1 = factory.createAckRequestedType();
ar1.setIdentifier(s1.getIdentifier());
ar2 = factory.createAckRequestedType();
ar2.setIdentifier(s2.getIdentifier());
}
use of com.helger.xsds.peppol.smp1.ObjectFactory in project cxf by apache.
the class AbstractTypeTestClient2 method testChoiceWithSubstitutionGroupAbstract.
@Test
public void testChoiceWithSubstitutionGroupAbstract() throws Exception {
if (!shouldRunTest("ChoiceWithSubstitutionGroupAbstract")) {
return;
}
SgDerivedTypeB derivedB = new SgDerivedTypeB();
derivedB.setVarInt(new BigInteger("32"));
derivedB.setVarString("foo");
SgDerivedTypeC derivedC = new SgDerivedTypeC();
derivedC.setVarInt(new BigInteger("32"));
derivedC.setVarFloat(3.14f);
ObjectFactory objectFactory = new ObjectFactory();
JAXBElement<? extends SgBaseTypeA> elementB = objectFactory.createSg03DerivedElementB(derivedB);
JAXBElement<? extends SgBaseTypeA> elementC = objectFactory.createSg03DerivedElementC(derivedC);
ChoiceWithSubstitutionGroupAbstract x = new ChoiceWithSubstitutionGroupAbstract();
x.setSg03AbstractBaseElementA(elementC);
ChoiceWithSubstitutionGroupAbstract yOrig = new ChoiceWithSubstitutionGroupAbstract();
yOrig.setSg03AbstractBaseElementA(elementB);
Holder<ChoiceWithSubstitutionGroupAbstract> y = new Holder<>(yOrig);
Holder<ChoiceWithSubstitutionGroupAbstract> z = new Holder<>();
ChoiceWithSubstitutionGroupAbstract ret;
if (testDocLiteral) {
ret = docClient.testChoiceWithSubstitutionGroupAbstract(x, y, z);
} else if (testXMLBinding) {
ret = xmlClient.testChoiceWithSubstitutionGroupAbstract(x, y, z);
} else {
ret = rpcClient.testChoiceWithSubstitutionGroupAbstract(x, y, z);
}
if (!perfTestOnly) {
assertTrue("testChoiceWithSubstitutionGroupAbstract(): Incorrect value for inout param", equals(x, y.value));
assertTrue("testChoiceWithSubstitutionGroupAbstract(): Incorrect value for out param", equals(yOrig, z.value));
assertTrue("testChoiceWithSubstitutionGroupAbstract(): Incorrect return value", equals(x, ret));
}
}
use of com.helger.xsds.peppol.smp1.ObjectFactory in project cxf by apache.
the class AbstractTypeTestClient2 method testStructWithSubstitutionGroupAbstract.
@Test
public void testStructWithSubstitutionGroupAbstract() throws Exception {
if (!shouldRunTest("StructWithSubstitutionGroupAbstract")) {
return;
}
SgDerivedTypeB derivedB = new SgDerivedTypeB();
derivedB.setVarInt(new BigInteger("32"));
derivedB.setVarString("foo");
ObjectFactory objectFactory = new ObjectFactory();
JAXBElement<SgDerivedTypeB> elementB = objectFactory.createSg03DerivedElementB(derivedB);
SgDerivedTypeC derivedC = new SgDerivedTypeC();
derivedC.setVarInt(new BigInteger("32"));
derivedC.setVarFloat(3.14f);
JAXBElement<SgDerivedTypeC> elementC = objectFactory.createSg03DerivedElementC(derivedC);
StructWithSubstitutionGroupAbstract x = new StructWithSubstitutionGroupAbstract();
x.setSg03AbstractBaseElementA(elementC);
StructWithSubstitutionGroupAbstract yOrig = new StructWithSubstitutionGroupAbstract();
yOrig.setSg03AbstractBaseElementA(elementB);
Holder<StructWithSubstitutionGroupAbstract> y = new Holder<>(yOrig);
Holder<StructWithSubstitutionGroupAbstract> z = new Holder<>();
StructWithSubstitutionGroupAbstract ret;
if (testDocLiteral) {
ret = docClient.testStructWithSubstitutionGroupAbstract(x, y, z);
} else if (testXMLBinding) {
ret = xmlClient.testStructWithSubstitutionGroupAbstract(x, y, z);
} else {
ret = rpcClient.testStructWithSubstitutionGroupAbstract(x, y, z);
}
if (!perfTestOnly) {
assertTrue("testStructWithSubstitutionGroupAbstract(): Incorrect value for inout param", equals(x, y.value));
assertTrue("testStructWithSubstitutionGroupAbstract(): Incorrect value for out param", equals(yOrig, z.value));
assertTrue("testStructWithSubstitutionGroupAbstract(): Incorrect return value", equals(x, ret));
}
}
use of com.helger.xsds.peppol.smp1.ObjectFactory in project cxf by apache.
the class AbstractTypeTestClient2 method testStructWithSubstitutionGroupNil.
@Test
public void testStructWithSubstitutionGroupNil() throws Exception {
if (!shouldRunTest("StructWithSubstitutionGroupNil")) {
return;
}
StructWithSubstitutionGroupNil x = new StructWithSubstitutionGroupNil();
ObjectFactory objectFactory = new ObjectFactory();
JAXBElement<? extends SgBaseTypeA> element = objectFactory.createSg04NillableBaseElementA(null);
x.setSg04NillableBaseElementA(element);
StructWithSubstitutionGroupNil yOrig = new StructWithSubstitutionGroupNil();
element = objectFactory.createSg04NillableBaseElementA(null);
yOrig.setSg04NillableBaseElementA(element);
Holder<StructWithSubstitutionGroupNil> y = new Holder<>(yOrig);
Holder<StructWithSubstitutionGroupNil> z = new Holder<>();
StructWithSubstitutionGroupNil ret;
if (testDocLiteral) {
ret = docClient.testStructWithSubstitutionGroupNil(x, y, z);
} else if (testXMLBinding) {
ret = xmlClient.testStructWithSubstitutionGroupNil(x, y, z);
} else {
ret = rpcClient.testStructWithSubstitutionGroupNil(x, y, z);
}
if (!perfTestOnly) {
assertTrue("testStructWithSubstitutionGroupNil(): Incorrect value for inout param", equals(x, y.value));
assertTrue("testStructWithSubstitutionGroupNil(): Incorrect value for out param", equals(yOrig, z.value));
assertTrue("testStructWithSubstitutionGroupNil(): Incorrect return value", equals(x, ret));
}
}
use of com.helger.xsds.peppol.smp1.ObjectFactory in project midpoint by Evolveum.
the class ConsistencyTest method test511AssignAccountMorgan.
/**
* assign account to the user morgan. Account with the same 'uid' (not dn, nut other secondary identifier already exists)
* account should be linked to the user.
* @throws Exception
*/
@Test
public void test511AssignAccountMorgan() throws Exception {
final String TEST_NAME = "test511AssignAccountMorgan";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
openDJController.assumeRunning();
Task task = taskManager.createTaskInstance(ConsistencyTest.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
dummyAuditService.clear();
//prepare new OU in opendj
Entry entry = openDJController.addEntryFromLdifFile(LDIF_CREATE_USERS_OU_FILENAME);
PrismObject<UserType> user = repositoryService.getObject(UserType.class, USER_MORGAN_OID, null, result);
display("User Morgan: ", user);
PrismReference linkRef = user.findReference(UserType.F_LINK_REF);
ExpressionType expression = new ExpressionType();
ObjectFactory of = new ObjectFactory();
RawType raw = new RawType(new PrimitiveXNode("uid=morgan,ou=users,dc=example,dc=com"), prismContext);
JAXBElement val = of.createValue(raw);
expression.getExpressionEvaluator().add(val);
MappingType mapping = new MappingType();
mapping.setExpression(expression);
ResourceAttributeDefinitionType attrDefType = new ResourceAttributeDefinitionType();
attrDefType.setRef(new ItemPathType(new ItemPath(getOpenDjSecondaryIdentifierQName())));
attrDefType.setOutbound(mapping);
ConstructionType construction = new ConstructionType();
construction.getAttribute().add(attrDefType);
construction.setResourceRef(ObjectTypeUtil.createObjectRef(resourceTypeOpenDjrepo));
AssignmentType assignment = new AssignmentType();
assignment.setConstruction(construction);
ObjectDelta<UserType> userDelta = ObjectDelta.createModificationAddContainer(UserType.class, USER_MORGAN_OID, UserType.F_ASSIGNMENT, prismContext, assignment.asPrismContainerValue());
Collection<ObjectDelta<? extends ObjectType>> deltas = MiscSchemaUtil.createCollection(userDelta);
// WHEN
TestUtil.displayWhen(TEST_NAME);
modelService.executeChanges(deltas, null, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
// assertEquals("Expected handled error but got: " + result.getStatus(), OperationResultStatus.HANDLED_ERROR, result.getStatus());
PrismObject<UserType> userMorgan = modelService.getObject(UserType.class, USER_MORGAN_OID, null, task, result);
display("User morgan after", userMorgan);
UserType userMorganType = userMorgan.asObjectable();
assertEquals("Unexpected number of accountRefs", 1, userMorganType.getLinkRef().size());
String accountOid = userMorganType.getLinkRef().iterator().next().getOid();
// Check shadow
PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result);
assertShadowRepo(accountShadow, accountOid, "uid=morgan,ou=people,dc=example,dc=com", resourceTypeOpenDjrepo, RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS);
// Check account
PrismObject<ShadowType> accountModel = modelService.getObject(ShadowType.class, accountOid, null, task, result);
assertShadowModel(accountModel, accountOid, "uid=morgan,ou=people,dc=example,dc=com", resourceTypeOpenDjrepo, RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS);
ResourceAttribute attributes = ShadowUtil.getAttribute(accountModel, new QName(resourceTypeOpenDjrepo.getNamespace(), "uid"));
assertEquals("morgan", attributes.getAnyRealValue());
// TODO: check OpenDJ Account
}
Aggregations