Search in sources :

Example 1 with Operation

use of org.eclipse.persistence.internal.xr.Operation in project eclipselink by eclipse-ee4j.

the class ObjectTableTypeTestSuite method getPersonTypeTable.

@Test
public void getPersonTypeTable() {
    Invocation invocation = new Invocation("GetPersonTypeTable");
    Operation op = xrService.getOperation(invocation.getName());
    Object result = op.invoke(xrService, invocation);
    assertNotNull("result is null", result);
    Document doc = xmlPlatform.createDocument();
    XMLMarshaller marshaller = xrService.getXMLContext().createMarshaller();
    marshaller.marshal(result, doc);
    Document controlDoc = xmlParser.parse(new StringReader(RESULT_XML));
    assertTrue("Expected:\n" + documentToString(controlDoc) + "\nActual:\n" + documentToString(doc), comparer.isNodeEqual(controlDoc, doc));
}
Also used : Invocation(org.eclipse.persistence.internal.xr.Invocation) XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) StringReader(java.io.StringReader) Operation(org.eclipse.persistence.internal.xr.Operation) Document(org.w3c.dom.Document) Test(org.junit.Test)

Example 2 with Operation

use of org.eclipse.persistence.internal.xr.Operation in project eclipselink by eclipse-ee4j.

the class ObjectTableTypeTestSuite method getPersonTypeTable2.

@Test
public void getPersonTypeTable2() {
    Invocation invocation = new Invocation("GetPersonTypeTable2");
    Operation op = xrService.getOperation(invocation.getName());
    Object result = op.invoke(xrService, invocation);
    assertNotNull("result is null", result);
    Document doc = xmlPlatform.createDocument();
    XMLMarshaller marshaller = xrService.getXMLContext().createMarshaller();
    marshaller.marshal(result, doc);
    Document controlDoc = xmlParser.parse(new StringReader(RESULT_XML));
    assertTrue("Expected:\n" + documentToString(controlDoc) + "\nActual:\n" + documentToString(doc), comparer.isNodeEqual(controlDoc, doc));
}
Also used : Invocation(org.eclipse.persistence.internal.xr.Invocation) XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) StringReader(java.io.StringReader) Operation(org.eclipse.persistence.internal.xr.Operation) Document(org.w3c.dom.Document) Test(org.junit.Test)

Example 3 with Operation

use of org.eclipse.persistence.internal.xr.Operation in project eclipselink by eclipse-ee4j.

the class ObjectTableTypeTestSuite method createGroupTypeTest.

@Test
public void createGroupTypeTest() {
    Invocation invocation = new Invocation("CreateGroupType");
    invocation.setParameter("GNAME", "MyNewGroup");
    Operation op = xrService.getOperation(invocation.getName());
    Object result = op.invoke(xrService, invocation);
    assertNotNull("result is null", result);
    Document doc = xmlPlatform.createDocument();
    XMLMarshaller marshaller = xrService.getXMLContext().createMarshaller();
    marshaller.marshal(result, doc);
    Document controlDoc = xmlParser.parse(new StringReader(NEW_ETABLE_OUTPUT2_XML));
    assertTrue("Expected:\n" + documentToString(controlDoc) + "\nActual:\n" + documentToString(doc), comparer.isNodeEqual(controlDoc, doc));
}
Also used : Invocation(org.eclipse.persistence.internal.xr.Invocation) XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) StringReader(java.io.StringReader) Operation(org.eclipse.persistence.internal.xr.Operation) Document(org.w3c.dom.Document) Test(org.junit.Test)

Example 4 with Operation

use of org.eclipse.persistence.internal.xr.Operation in project eclipselink by eclipse-ee4j.

the class ObjectTableTypeTestSuite method getJobsTest.

@Test
public void getJobsTest() {
    Invocation invocation = new Invocation("GetJobsTest");
    Operation op = xrService.getOperation(invocation.getName());
    Object result = op.invoke(xrService, invocation);
    assertNotNull("result is null", result);
    Document doc = xmlPlatform.createDocument();
    XMLMarshaller marshaller = xrService.getXMLContext().createMarshaller();
    marshaller.marshal(result, doc);
    Document controlDoc = xmlParser.parse(new StringReader(COLJOBS_XML));
    assertTrue("Expected:\n" + documentToString(controlDoc) + "\nActual:\n" + documentToString(doc), comparer.isNodeEqual(controlDoc, doc));
}
Also used : Invocation(org.eclipse.persistence.internal.xr.Invocation) XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) StringReader(java.io.StringReader) Operation(org.eclipse.persistence.internal.xr.Operation) Document(org.w3c.dom.Document) Test(org.junit.Test)

Example 5 with Operation

use of org.eclipse.persistence.internal.xr.Operation in project eclipselink by eclipse-ee4j.

the class ObjectTableTypeTestSuite method getJobTest.

@Test
public void getJobTest() {
    Invocation invocation = new Invocation("GetJobTest");
    invocation.setParameter("p_job_id", "3");
    Operation op = xrService.getOperation(invocation.getName());
    Object result = op.invoke(xrService, invocation);
    assertNotNull("result is null", result);
    Document doc = xmlPlatform.createDocument();
    XMLMarshaller marshaller = xrService.getXMLContext().createMarshaller();
    marshaller.marshal(result, doc);
    Document controlDoc = xmlParser.parse(new StringReader(TJOBS_XML));
    assertTrue("Expected:\n" + documentToString(controlDoc) + "\nActual:\n" + documentToString(doc), comparer.isNodeEqual(controlDoc, doc));
}
Also used : Invocation(org.eclipse.persistence.internal.xr.Invocation) XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) StringReader(java.io.StringReader) Operation(org.eclipse.persistence.internal.xr.Operation) Document(org.w3c.dom.Document) Test(org.junit.Test)

Aggregations

Operation (org.eclipse.persistence.internal.xr.Operation)225 Invocation (org.eclipse.persistence.internal.xr.Invocation)220 Test (org.junit.Test)218 StringReader (java.io.StringReader)216 XMLMarshaller (org.eclipse.persistence.oxm.XMLMarshaller)216 Document (org.w3c.dom.Document)214 XMLUnmarshaller (org.eclipse.persistence.oxm.XMLUnmarshaller)94 Vector (java.util.Vector)19 Element (org.w3c.dom.Element)13 DataHandler (jakarta.activation.DataHandler)4 QName (javax.xml.namespace.QName)4 AbstractSession (org.eclipse.persistence.internal.sessions.AbstractSession)4 QueryOperation (org.eclipse.persistence.internal.xr.QueryOperation)4 ValueObject (org.eclipse.persistence.internal.xr.ValueObject)4 XRDynamicEntity (org.eclipse.persistence.internal.xr.XRDynamicEntity)4 XMLDescriptor (org.eclipse.persistence.oxm.XMLDescriptor)4 InputSource (org.xml.sax.InputSource)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 IOException (java.io.IOException)3 BigDecimal (java.math.BigDecimal)3