Search in sources :

Example 6 with GenericObjectType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType in project midpoint by Evolveum.

the class TestParseGenericObject method testParseGenericDom.

@Test
public void testParseGenericDom() throws SchemaException, DatatypeConfigurationException {
    System.out.println("===[ testParseGenericDom ]===");
    // GIVEN
    PrismContext prismContext = PrismTestUtil.getPrismContext();
    Document document = DOMUtil.parseFile(GENERIC_FILE);
    Element resourceElement = DOMUtil.getFirstChildElement(document);
    // WHEN
    PrismObject<GenericObjectType> generic = prismContext.parserFor(resourceElement).parse();
    // THEN
    System.out.println("Parsed generic object:");
    System.out.println(generic.debugDump());
    assertGenericObject(generic);
}
Also used : GenericObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType) JAXBElement(javax.xml.bind.JAXBElement) Element(org.w3c.dom.Element) Document(org.w3c.dom.Document) Test(org.testng.annotations.Test)

Example 7 with GenericObjectType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType in project midpoint by Evolveum.

the class TestParseGenericObject method testPrismParseJaxbObjectType.

/**
	 * The definition should be set properly even if the declared type is ObjectType. The Prism should determine
	 * the actual type.
	 * @throws DatatypeConfigurationException 
	 */
@Deprecated
@Test(enabled = false)
public void testPrismParseJaxbObjectType() throws JAXBException, SchemaException, SAXException, IOException, DatatypeConfigurationException {
    System.out.println("===[ testPrismParseJaxbObjectType ]===");
    // GIVEN
    PrismContext prismContext = PrismTestUtil.getPrismContext();
    JaxbTestUtil jaxbProcessor = JaxbTestUtil.getInstance();
    // WHEN
    GenericObjectType genericType = jaxbProcessor.unmarshalObject(GENERIC_FILE, GenericObjectType.class);
    // THEN
    assertGenericObject(genericType.asPrismObject());
}
Also used : GenericObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType) JaxbTestUtil(com.evolveum.midpoint.prism.util.JaxbTestUtil) Test(org.testng.annotations.Test)

Example 8 with GenericObjectType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType in project midpoint by Evolveum.

the class TestParseGenericObject method testPrismParseJaxb.

@Deprecated
@Test(enabled = false)
public void testPrismParseJaxb() throws JAXBException, SchemaException, SAXException, IOException, DatatypeConfigurationException {
    System.out.println("===[ testPrismParseJaxb ]===");
    // GIVEN
    PrismContext prismContext = PrismTestUtil.getPrismContext();
    JaxbTestUtil jaxbProcessor = JaxbTestUtil.getInstance();
    // WHEN
    GenericObjectType genericType = jaxbProcessor.unmarshalObject(GENERIC_FILE, GenericObjectType.class);
    // THEN
    assertGenericObject(genericType.asPrismObject());
}
Also used : GenericObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType) JaxbTestUtil(com.evolveum.midpoint.prism.util.JaxbTestUtil) Test(org.testng.annotations.Test)

Example 9 with GenericObjectType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType in project midpoint by Evolveum.

the class TestParseGenericObject method testPrismParseJaxbElementObjectType.

/**
	 * Parsing in form of JAXBELement, with declared ObjectType
	 * @throws DatatypeConfigurationException 
	 */
@Deprecated
@Test(enabled = false)
public void testPrismParseJaxbElementObjectType() throws JAXBException, SchemaException, SAXException, IOException, DatatypeConfigurationException {
    System.out.println("===[ testPrismParseJaxbElementObjectType ]===");
    // GIVEN
    PrismContext prismContext = PrismTestUtil.getPrismContext();
    JaxbTestUtil jaxbProcessor = JaxbTestUtil.getInstance();
    // WHEN
    JAXBElement<GenericObjectType> jaxbElement = jaxbProcessor.unmarshalElement(GENERIC_FILE, GenericObjectType.class);
    GenericObjectType genericType = jaxbElement.getValue();
    // THEN
    assertGenericObject(genericType.asPrismObject());
}
Also used : GenericObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType) JaxbTestUtil(com.evolveum.midpoint.prism.util.JaxbTestUtil) Test(org.testng.annotations.Test)

Aggregations

GenericObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType)9 Test (org.testng.annotations.Test)7 JaxbTestUtil (com.evolveum.midpoint.prism.util.JaxbTestUtil)4 ExtensionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ExtensionType)2 JAXBElement (javax.xml.bind.JAXBElement)1 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)1 QName (javax.xml.namespace.QName)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1