Search in sources :

Example 1 with Invocation

use of org.eclipse.persistence.internal.xr.Invocation 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 Invocation

use of org.eclipse.persistence.internal.xr.Invocation 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 Invocation

use of org.eclipse.persistence.internal.xr.Invocation 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 Invocation

use of org.eclipse.persistence.internal.xr.Invocation 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 Invocation

use of org.eclipse.persistence.internal.xr.Invocation 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

Invocation (org.eclipse.persistence.internal.xr.Invocation)220 Operation (org.eclipse.persistence.internal.xr.Operation)220 Test (org.junit.Test)218 StringReader (java.io.StringReader)216 XMLMarshaller (org.eclipse.persistence.oxm.XMLMarshaller)215 Document (org.w3c.dom.Document)214 XMLUnmarshaller (org.eclipse.persistence.oxm.XMLUnmarshaller)94 Vector (java.util.Vector)18 Element (org.w3c.dom.Element)13 ValueObject (org.eclipse.persistence.internal.xr.ValueObject)4 XRDynamicEntity (org.eclipse.persistence.internal.xr.XRDynamicEntity)4 InputSource (org.xml.sax.InputSource)4 DataHandler (jakarta.activation.DataHandler)3 BigDecimal (java.math.BigDecimal)3 NonSynchronizedVector (org.eclipse.persistence.internal.helper.NonSynchronizedVector)3 AbstractSession (org.eclipse.persistence.internal.sessions.AbstractSession)3 XRDynamicEntity_CollectionWrapper (org.eclipse.persistence.internal.xr.XRDynamicEntity_CollectionWrapper)3 SOAPBodyElement (jakarta.xml.soap.SOAPBodyElement)2 SOAPElement (jakarta.xml.soap.SOAPElement)2 SOAPException (jakarta.xml.soap.SOAPException)2