Search in sources :

Example 16 with MetadataType

use of org.geotoolkit.ows.xml.v200.MetadataType in project midpoint by Evolveum.

the class AbstractModelIntegrationTest method assertModifyMetadata.

protected <O extends ObjectType> void assertModifyMetadata(PrismObject<O> object, XMLGregorianCalendar start, XMLGregorianCalendar end) {
    MetadataType metadataType = object.asObjectable().getMetadata();
    PrismObject<UserType> defaultActor = getDefaultActor();
    assertMetadata(object.toString(), metadataType, false, false, start, end, defaultActor == null ? null : defaultActor.getOid(), DEFAULT_CHANNEL);
}
Also used : MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)

Example 17 with MetadataType

use of org.geotoolkit.ows.xml.v200.MetadataType in project midpoint by Evolveum.

the class AbstractModelIntegrationTest method assertPasswordMetadata.

protected void assertPasswordMetadata(PrismObject<UserType> user, QName credentialType, boolean create, XMLGregorianCalendar start, XMLGregorianCalendar end, String actorOid, String channel) {
    PrismContainer<MetadataType> metadataContainer = user.findContainer(new ItemPath(UserType.F_CREDENTIALS, credentialType, PasswordType.F_METADATA));
    assertNotNull("No password metadata in " + user, metadataContainer);
    MetadataType metadataType = metadataContainer.getValue().asContainerable();
    assertMetadata("password metadata in " + user, metadataType, create, false, start, end, actorOid, channel);
}
Also used : MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType) ItemPath(com.evolveum.midpoint.prism.path.ItemPath)

Example 18 with MetadataType

use of org.geotoolkit.ows.xml.v200.MetadataType in project midpoint by Evolveum.

the class AbstractModelIntegrationTest method assertPasswordMetadata.

@Deprecated
protected void assertPasswordMetadata(PrismObject<UserType> user, boolean create, XMLGregorianCalendar start, XMLGregorianCalendar end, String actorOid, String channel) {
    PrismContainer<MetadataType> metadataContainer = user.findContainer(new ItemPath(UserType.F_CREDENTIALS, CredentialsType.F_PASSWORD, PasswordType.F_METADATA));
    assertNotNull("No password metadata in " + user, metadataContainer);
    MetadataType metadataType = metadataContainer.getValue().asContainerable();
    assertMetadata("password metadata in " + user, metadataType, create, false, start, end, actorOid, channel);
}
Also used : MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType) ItemPath(com.evolveum.midpoint.prism.path.ItemPath)

Example 19 with MetadataType

use of org.geotoolkit.ows.xml.v200.MetadataType in project midpoint by Evolveum.

the class TestDiffEquals method testAssignmentEquals.

@Test
public void testAssignmentEquals() throws Exception {
    System.out.println("\n\n===[ testAssignmentEquals ]===\n");
    PrismContext prismContext = PrismTestUtil.getPrismContext();
    AssignmentType a1a = new AssignmentType();
    prismContext.adopt(a1a);
    a1a.setDescription("descr1");
    AssignmentType a2 = new AssignmentType();
    prismContext.adopt(a2);
    a2.setDescription("descr2");
    AssignmentType a1b = new AssignmentType();
    prismContext.adopt(a1b);
    a1b.setDescription("descr1");
    AssignmentType a1m = new AssignmentType();
    prismContext.adopt(a1m);
    a1m.setDescription("descr1");
    MetadataType metadata1m = new MetadataType();
    metadata1m.setCreateTimestamp(XmlTypeConverter.createXMLGregorianCalendar(System.currentTimeMillis()));
    a1m.setMetadata(metadata1m);
    AssignmentType a1e = new AssignmentType();
    prismContext.adopt(a1e);
    a1e.setDescription("descr1");
    ActivationType activation1e = new ActivationType();
    activation1e.setEffectiveStatus(ActivationStatusType.ENABLED);
    a1e.setActivation(activation1e);
    // WHEN
    assertFalse(a1a.equals(a2));
    assertFalse(a1b.equals(a2));
    assertFalse(a1m.equals(a2));
    assertFalse(a1e.equals(a2));
    assertFalse(a2.equals(a1a));
    assertFalse(a2.equals(a1b));
    assertFalse(a2.equals(a1m));
    assertFalse(a2.equals(a1e));
    assertTrue(a1a.equals(a1a));
    assertTrue(a1b.equals(a1b));
    assertTrue(a1m.equals(a1m));
    assertTrue(a1e.equals(a1e));
    assertTrue(a2.equals(a2));
    assertTrue(a1a.equals(a1b));
    assertTrue(a1b.equals(a1a));
    assertTrue(a1a.equals(a1m));
    assertTrue(a1b.equals(a1m));
    assertTrue(a1m.equals(a1a));
    assertTrue(a1m.equals(a1b));
    assertTrue(a1m.equals(a1e));
    assertTrue(a1a.equals(a1e));
    assertTrue(a1b.equals(a1e));
    assertTrue(a1e.equals(a1a));
    assertTrue(a1e.equals(a1b));
    assertTrue(a1e.equals(a1m));
}
Also used : PrismContext(com.evolveum.midpoint.prism.PrismContext) ActivationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType) AssignmentType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType) MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType) Test(org.testng.annotations.Test)

Example 20 with MetadataType

use of org.geotoolkit.ows.xml.v200.MetadataType in project midpoint by Evolveum.

the class TestDiffEquals method testAssignmentHashcode.

@Test
public void testAssignmentHashcode() throws Exception {
    LOGGER.info("\n\n===[ testAssignmentHashcode ]===\n");
    System.out.println("\n\n===[ testAssignmentHashcode ]===\n");
    PrismContext prismContext = PrismTestUtil.getPrismContext();
    AssignmentType a1a = new AssignmentType();
    prismContext.adopt(a1a);
    a1a.setDescription("descr1");
    AssignmentType a2 = new AssignmentType();
    prismContext.adopt(a2);
    a2.setDescription("descr2");
    AssignmentType a1b = new AssignmentType();
    prismContext.adopt(a1b);
    a1b.setDescription("descr1");
    AssignmentType a1m = new AssignmentType();
    prismContext.adopt(a1m);
    a1m.setDescription("descr1");
    MetadataType metadata1m = new MetadataType();
    metadata1m.setCreateTimestamp(XmlTypeConverter.createXMLGregorianCalendar(System.currentTimeMillis()));
    a1m.setMetadata(metadata1m);
    AssignmentType a1e = new AssignmentType();
    prismContext.adopt(a1e);
    a1e.setDescription("descr1");
    ActivationType activation1e = new ActivationType();
    activation1e.setEffectiveStatus(ActivationStatusType.ENABLED);
    a1e.setActivation(activation1e);
    // WHEN
    assertFalse(a1a.hashCode() == a2.hashCode());
    assertFalse(a1b.hashCode() == a2.hashCode());
    assertFalse(a1m.hashCode() == a2.hashCode());
    assertFalse(a1e.hashCode() == a2.hashCode());
    assertFalse(a2.hashCode() == a1a.hashCode());
    assertFalse(a2.hashCode() == a1b.hashCode());
    assertFalse(a2.hashCode() == a1m.hashCode());
    assertFalse(a2.hashCode() == a1e.hashCode());
    assertTrue(a1a.hashCode() == a1a.hashCode());
    assertTrue(a1b.hashCode() == a1b.hashCode());
    assertTrue(a1m.hashCode() == a1m.hashCode());
    assertTrue(a1e.hashCode() == a1e.hashCode());
    assertTrue(a2.hashCode() == a2.hashCode());
    assertTrue(a1a.hashCode() == a1b.hashCode());
    assertTrue(a1b.hashCode() == a1a.hashCode());
    assertTrue(a1a.hashCode() == a1m.hashCode());
    assertTrue(a1b.hashCode() == a1m.hashCode());
    assertTrue(a1m.hashCode() == a1a.hashCode());
    assertTrue(a1m.hashCode() == a1b.hashCode());
    assertTrue(a1m.hashCode() == a1e.hashCode());
    assertTrue(a1a.hashCode() == a1e.hashCode());
    assertTrue(a1b.hashCode() == a1e.hashCode());
    assertTrue(a1e.hashCode() == a1a.hashCode());
    assertTrue(a1e.hashCode() == a1b.hashCode());
    assertTrue(a1e.hashCode() == a1m.hashCode());
}
Also used : PrismContext(com.evolveum.midpoint.prism.PrismContext) ActivationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType) AssignmentType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType) MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType) Test(org.testng.annotations.Test)

Aggregations

MetadataType (com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType)30 ActivationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType)7 AssignmentType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)6 ConstructionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConstructionType)4 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)3 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)3 PrismContainerDefinition (com.evolveum.midpoint.prism.PrismContainerDefinition)2 PrismContext (com.evolveum.midpoint.prism.PrismContext)2 PrismReferenceDefinition (com.evolveum.midpoint.prism.PrismReferenceDefinition)2 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)2 ProtectedStringType (com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType)2 List (java.util.List)2 Duration (javax.xml.datatype.Duration)2 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2 MetadataType (org.openarchives.oai._2.MetadataType)2 Test (org.testng.annotations.Test)2 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 PrismContainerValue (com.evolveum.midpoint.prism.PrismContainerValue)1 ContainerDelta (com.evolveum.midpoint.prism.delta.ContainerDelta)1 ItemDelta (com.evolveum.midpoint.prism.delta.ItemDelta)1