use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall in project eclipselink by eclipse-ee4j.
the class Ni6TestSet method writeToXml.
@Test
public void writeToXml() {
// (y in natural)
PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
call.setProcedureName("natural_in_test");
call.addNamedArgument("Y", OraclePLSQLTypes.Natural);
DataModifyQuery query = new DataModifyQuery();
query.addArgument("Y", Integer.class);
query.setCall(call);
project.getDescriptor(Empty.class).getQueryManager().addQuery("Ni6", 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(NI6_PROJECT_XML));
assertTrue("control document not same as instance document", comparer.isNodeEqual(controlDoc, doc));
}
use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall in project eclipselink by eclipse-ee4j.
the class Ni5TestSet method writeToXml.
@Test
public void writeToXml() {
// (y in int)
PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
call.setProcedureName("int_in_test");
call.addNamedArgument("Y", OraclePLSQLTypes.Int);
DataModifyQuery query = new DataModifyQuery();
query.addArgument("Y", Integer.class);
query.setCall(call);
project.getDescriptor(Empty.class).getQueryManager().addQuery("Ni5", 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(NI5_PROJECT_XML));
assertTrue("control document not same as instance document", comparer.isNodeEqual(controlDoc, doc));
}
use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall in project eclipselink by eclipse-ee4j.
the class Ni9TestSet method writeToXml.
@Test
public void writeToXml() {
// (y in positiven)
PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
call.setProcedureName("positiven_in_test");
call.addNamedArgument("Y", OraclePLSQLTypes.PositiveN);
DataModifyQuery query = new DataModifyQuery();
query.addArgument("Y", Integer.class);
query.setCall(call);
project.getDescriptor(Empty.class).getQueryManager().addQuery("Ni9", 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(NI9_PROJECT_XML));
assertTrue("control document not same as instance document", comparer.isNodeEqual(controlDoc, doc));
}
use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall in project eclipselink by eclipse-ee4j.
the class NijiTestSet method writeToXml.
@Test
public void writeToXml() {
// (x in boolean, y in varchar)
PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
call.setProcedureName("niji");
call.addNamedArgument("X", OraclePLSQLTypes.PLSQLBoolean);
call.addNamedArgument("Y", JDBCTypes.VARCHAR_TYPE, 40);
DataModifyQuery query = new DataModifyQuery();
query.addArgument("X", Integer.class);
query.addArgument("Y", String.class);
query.setCall(call);
project.getDescriptor(Empty.class).getQueryManager().addQuery("Niji", 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(NIJI_PROJECT_XML));
assertTrue("control document not same as instance document", comparer.isNodeEqual(controlDoc, doc));
}
use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall in project eclipselink by eclipse-ee4j.
the class PLSQLrecordWithCompatibleTypeInOutTestSet method writeToXml.
@Test
public void writeToXml() {
PLSQLrecord r1 = new PLSQLrecord();
r1.setTypeName("emp%ROWTYPE");
r1.setCompatibleType("EMP_TYPE");
r1.addField("EMPNO", JDBCTypes.NUMERIC_TYPE, 4, 0);
r1.addField("ENAME", JDBCTypes.VARCHAR_TYPE, 10);
r1.addField("JOB", JDBCTypes.VARCHAR_TYPE, 9);
r1.addField("MGR", JDBCTypes.NUMERIC_TYPE, 4, 0);
r1.addField("HIREDATE", JDBCTypes.DATE_TYPE);
r1.addField("SAL", JDBCTypes.FLOAT_TYPE, 7, 2);
r1.addField("COMM", JDBCTypes.NUMERIC_TYPE, 7, 2);
r1.addField("DEPTNO", JDBCTypes.NUMERIC_TYPE, 2, 0);
// PROCEDURE REC_TEST_INOUT(Z IN OUT EMP%ROWTYPE)
PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
call.setProcedureName("REC_TEST_INOUT");
call.addNamedInOutputArgument("Z", r1);
ReadObjectQuery query = new ReadObjectQuery(PLSQLEmployeeType.class);
query.addArgument("Z", Struct.class);
query.doNotCacheQueryResults();
query.dontMaintainCache();
query.setCall(call);
project.getDescriptor(PLSQLEmployeeType.class).getQueryManager().addQuery("PLSQLrecordWithCompatibleTypeInOut", 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(PLSQLRECORD_WITHCOMPATIBLETYPE_INOUT_PROJECT_XML));
assertTrue("control document not same as instance document", comparer.isNodeEqual(controlDoc, doc));
}
Aggregations