use of org.eclipse.persistence.oxm.XMLContext in project eclipselink by eclipse-ee4j.
the class NojiTestSet method writeToXml.
@Test
public void writeToXml() {
// (x out binary_integer, y in varchar)
PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
call.setProcedureName("noji");
call.addNamedOutputArgument("X", OraclePLSQLTypes.BinaryInteger);
call.addNamedArgument("Y", JDBCTypes.VARCHAR_TYPE, 40);
DataReadQuery query = new DataReadQuery();
query.setCall(call);
query.addArgument("Y", String.class);
project.getDescriptor(Empty.class).getQueryManager().addQuery("Noji", query);
Project projectToXml = project.clone();
// trim off login 'cause it changes under test - this way, a comparison
// can be done to a control document
projectToXml.setDatasourceLogin(null);
XMLContext context = new XMLContext(workbenchXMLProject);
XMLMarshaller marshaller = context.createMarshaller();
Document doc = marshaller.objectToXML(projectToXml);
Document controlDoc = xmlParser.parse(new StringReader(NOJI_PROJECT_XML));
assertTrue("control document not same as instance document", comparer.isNodeEqual(controlDoc, doc));
}
use of org.eclipse.persistence.oxm.XMLContext in project eclipselink by eclipse-ee4j.
the class jiNiNijiTestSet method writeToXml.
@Test
public void writeToXml() {
// (x in varchar, y in binary_integer, z in boolean, aa in number)
PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
call.setProcedureName("jiNiNiji");
call.addNamedArgument("X", JDBCTypes.VARCHAR_TYPE, 20);
call.addNamedArgument("Y", OraclePLSQLTypes.BinaryInteger);
call.addNamedArgument("Z", OraclePLSQLTypes.PLSQLBoolean);
call.addNamedArgument("AA", JDBCTypes.NUMERIC_TYPE, 20, 2);
DataModifyQuery query = new DataModifyQuery();
query.addArgument("X", String.class);
query.addArgument("Y", Integer.class);
query.addArgument("Z", Integer.class);
query.addArgument("AA", BigDecimal.class);
query.setCall(call);
project.getDescriptor(Empty.class).getQueryManager().addQuery("jiNiNiji", query);
Project projectToXml = project.clone();
// trim off login 'cause it changes under test - this way, a comparison
// can be done to a control document
projectToXml.setDatasourceLogin(null);
XMLContext context = new XMLContext(workbenchXMLProject);
XMLMarshaller marshaller = context.createMarshaller();
Document doc = marshaller.objectToXML(projectToXml);
Document controlDoc = xmlParser.parse(new StringReader(JININIJI_PROJECT_XML));
assertTrue("control document not same as instance document", comparer.isNodeEqual(controlDoc, doc));
}
use of org.eclipse.persistence.oxm.XMLContext in project eclipselink by eclipse-ee4j.
the class jiNiTestSet method writeToXml.
@Test
public void writeToXml() {
// (x in varchar, y in boolean)
PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
call.setProcedureName("jini");
call.addNamedArgument("X", JDBCTypes.VARCHAR_TYPE, 20);
call.addNamedArgument("Y", OraclePLSQLTypes.PLSQLBoolean);
DataModifyQuery query = new DataModifyQuery();
query.addArgument("X", String.class);
query.addArgument("Y", Integer.class);
query.setCall(call);
project.getDescriptor(Empty.class).getQueryManager().addQuery("jiNi", query);
Project projectToXml = project.clone();
// trim off login 'cause it changes under test - this way, a comparison
// can be done to a control document
projectToXml.setDatasourceLogin(null);
XMLContext context = new XMLContext(workbenchXMLProject);
XMLMarshaller marshaller = context.createMarshaller();
Document doc = marshaller.objectToXML(projectToXml);
Document controlDoc = xmlParser.parse(new StringReader(JINI_PROJECT_XML));
assertTrue("control document not same as instance document", comparer.isNodeEqual(controlDoc, doc));
}
use of org.eclipse.persistence.oxm.XMLContext in project eclipselink by eclipse-ee4j.
the class jiNijiTestSet method writeToXml.
@Test
public void writeToXml() {
// (x in varchar, y in boolean, z in number)
PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
call.setProcedureName("jiniji");
call.addNamedArgument("X", JDBCTypes.VARCHAR_TYPE, 20);
call.addNamedArgument("Y", OraclePLSQLTypes.PLSQLBoolean);
call.addNamedArgument("Z", JDBCTypes.NUMERIC_TYPE, 10, 2);
DataModifyQuery query = new DataModifyQuery();
query.addArgument("X", String.class);
query.addArgument("Y", Integer.class);
query.addArgument("Z", BigDecimal.class);
query.setCall(call);
project.getDescriptor(Empty.class).getQueryManager().addQuery("jiNiji", query);
Project projectToXml = project.clone();
// trim off login 'cause it changes under test - this way, a comparison
// can be done to a control document
projectToXml.setDatasourceLogin(null);
XMLContext context = new XMLContext(workbenchXMLProject);
XMLMarshaller marshaller = context.createMarshaller();
Document doc = marshaller.objectToXML(projectToXml);
Document controlDoc = xmlParser.parse(new StringReader(JINIJI_PROJECT_XML));
assertTrue("control document not same as instance document", comparer.isNodeEqual(controlDoc, doc));
}
use of org.eclipse.persistence.oxm.XMLContext in project eclipselink by eclipse-ee4j.
the class jiNioTestSet method writeToXml.
@Test
public void writeToXml() {
// (X IN VARCHAR2, Y IN OUT BOOLEAN);
PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
call.setProcedureName("jiNio");
call.addNamedArgument("X", JDBCTypes.VARCHAR_TYPE, 20);
call.addNamedInOutputArgument("Y", OraclePLSQLTypes.PLSQLBoolean);
DataReadQuery query = new DataReadQuery();
query.addArgument("X", String.class);
query.addArgument("Y", Integer.class);
query.setCall(call);
query.setCall(call);
project.getDescriptor(Empty.class).getQueryManager().addQuery("jiNio", query);
Project projectToXml = project.clone();
// trim off login 'cause it changes under test - this way, a comparison
// can be done to a control document
projectToXml.setDatasourceLogin(null);
XMLContext context = new XMLContext(workbenchXMLProject);
XMLMarshaller marshaller = context.createMarshaller();
Document doc = marshaller.objectToXML(projectToXml);
Document controlDoc = xmlParser.parse(new StringReader(JINIO_PROJECT_XML));
assertTrue("control document not same as instance document", comparer.isNodeEqual(controlDoc, doc));
}
Aggregations