Search in sources :

Example 1 with JaxbTestUtil

use of com.evolveum.midpoint.prism.util.JaxbTestUtil in project midpoint by Evolveum.

the class TestParseGenericObject method testPrismParseJaxbElement.

/**
	 * Parsing in form of JAXBELement
	 * @throws DatatypeConfigurationException 
	 */
@Deprecated
@Test(enabled = false)
public void testPrismParseJaxbElement() throws JAXBException, SchemaException, SAXException, IOException, DatatypeConfigurationException {
    System.out.println("===[ testPrismParseJaxbElement ]===");
    // 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)

Example 2 with JaxbTestUtil

use of com.evolveum.midpoint.prism.util.JaxbTestUtil in project midpoint by Evolveum.

the class TestParseTask method testPrismParseJaxb.

@Deprecated
@Test(enabled = false)
public void testPrismParseJaxb() throws JAXBException, SchemaException, SAXException, IOException {
    System.out.println("===[ testPrismParseJaxb ]===");
    // GIVEN
    PrismContext prismContext = getPrismContext();
    JaxbTestUtil jaxbProcessor = JaxbTestUtil.getInstance();
    // WHEN
    TaskType taskType = jaxbProcessor.unmarshalObject(TASK_FILE, TaskType.class);
    // THEN
    System.out.println("Parsed task:");
    System.out.println(taskType.asPrismObject().debugDump());
    assertTask(taskType.asPrismObject());
}
Also used : JaxbTestUtil(com.evolveum.midpoint.prism.util.JaxbTestUtil) PrismTestUtil.getPrismContext(com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext) Test(org.testng.annotations.Test)

Example 3 with JaxbTestUtil

use of com.evolveum.midpoint.prism.util.JaxbTestUtil in project midpoint by Evolveum.

the class TestParseTask method testPrismParseJaxbElement.

/**
	 * Parsing in form of JAXBELement
	 */
@Deprecated
@Test(enabled = false)
public void testPrismParseJaxbElement() throws JAXBException, SchemaException, SAXException, IOException {
    System.out.println("===[ testPrismParseJaxbElement ]===");
    // GIVEN
    PrismContext prismContext = getPrismContext();
    JaxbTestUtil jaxbProcessor = JaxbTestUtil.getInstance();
    // WHEN
    JAXBElement<TaskType> jaxbElement = jaxbProcessor.unmarshalElement(TASK_FILE, TaskType.class);
    TaskType taskType = jaxbElement.getValue();
    // THEN
    System.out.println("Parsed task:");
    System.out.println(taskType.asPrismObject().debugDump());
    assertTask(taskType.asPrismObject());
}
Also used : JaxbTestUtil(com.evolveum.midpoint.prism.util.JaxbTestUtil) PrismTestUtil.getPrismContext(com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext) Test(org.testng.annotations.Test)

Example 4 with JaxbTestUtil

use of com.evolveum.midpoint.prism.util.JaxbTestUtil in project midpoint by Evolveum.

the class TestParseTask method testPrismParseJaxbElementObjectType.

/**
	 * Parsing in form of JAXBELement, with declared ObjectType
	 */
@Deprecated
@Test(enabled = false)
public void testPrismParseJaxbElementObjectType() throws JAXBException, SchemaException, SAXException, IOException {
    System.out.println("===[ testPrismParseJaxbElementObjectType ]===");
    // GIVEN
    PrismContext prismContext = getPrismContext();
    JaxbTestUtil jaxbProcessor = JaxbTestUtil.getInstance();
    // WHEN
    JAXBElement<TaskType> jaxbElement = jaxbProcessor.unmarshalElement(TASK_FILE, TaskType.class);
    TaskType taskType = jaxbElement.getValue();
    // THEN
    System.out.println("Parsed task:");
    System.out.println(taskType.asPrismObject().debugDump());
    assertTask(taskType.asPrismObject());
}
Also used : JaxbTestUtil(com.evolveum.midpoint.prism.util.JaxbTestUtil) PrismTestUtil.getPrismContext(com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext) Test(org.testng.annotations.Test)

Example 5 with JaxbTestUtil

use of com.evolveum.midpoint.prism.util.JaxbTestUtil 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)

Aggregations

JaxbTestUtil (com.evolveum.midpoint.prism.util.JaxbTestUtil)8 Test (org.testng.annotations.Test)8 PrismTestUtil.getPrismContext (com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext)4 GenericObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType)4