use of org.eclipse.persistence.tools.dbws.oracle.OracleHelper in project eclipselink by eclipse-ee4j.
the class TableTypeTestSuite method setUp.
@BeforeClass
public static void setUp() throws WSDLException, SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
if (conn == null) {
try {
conn = buildConnection();
} catch (Exception e) {
e.printStackTrace();
}
}
String ddlCreateProp = System.getProperty(DATABASE_DDL_CREATE_KEY, DEFAULT_DATABASE_DDL_CREATE);
if ("true".equalsIgnoreCase(ddlCreateProp)) {
ddlCreate = true;
}
String ddlDropProp = System.getProperty(DATABASE_DDL_DROP_KEY, DEFAULT_DATABASE_DDL_DROP);
if ("true".equalsIgnoreCase(ddlDropProp)) {
ddlDrop = true;
}
String ddlDebugProp = System.getProperty(DATABASE_DDL_DEBUG_KEY, DEFAULT_DATABASE_DDL_DEBUG);
if ("true".equalsIgnoreCase(ddlDebugProp)) {
ddlDebug = true;
}
if (ddlCreate) {
runDdl(conn, CREATE_TABLETYPE_TABLE, ddlDebug);
runDdl(conn, CREATE_TABLETYPE2_TABLE, ddlDebug);
try {
Statement stmt = conn.createStatement();
for (int i = 0; i < POPULATE_TABLETYPE_TABLE.length; i++) {
stmt.addBatch(POPULATE_TABLETYPE_TABLE[i]);
}
stmt.executeBatch();
stmt = conn.createStatement();
for (int i = 0; i < POPULATE_TABLETYPE2_TABLE.length; i++) {
stmt.addBatch(POPULATE_TABLETYPE2_TABLE[i]);
}
stmt.executeBatch();
} catch (SQLException e) {
// e.printStackTrace();
}
}
DBWS_BUILDER_XML_USERNAME = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<dbws-builder xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" + "<properties>" + "<property name=\"projectName\">tabletype</property>" + "<property name=\"logLevel\">off</property>" + "<property name=\"username\">";
DBWS_BUILDER_XML_PASSWORD = "</property><property name=\"password\">";
DBWS_BUILDER_XML_URL = "</property><property name=\"url\">";
DBWS_BUILDER_XML_DRIVER = "</property><property name=\"driver\">";
DBWS_BUILDER_XML_PLATFORM = "</property><property name=\"platformClassname\">";
DBWS_BUILDER_XML_MAIN = "</property>" + "</properties>" + "<table " + "schemaPattern=\"%\" " + "tableNamePattern=\"TABLETYPE\" " + "/>" + "<table " + "schemaPattern=\"%\" " + "tableNamePattern=\"TABLETYPE2\" " + "/>" + "</dbws-builder>";
builder = new DBWSBuilder();
OracleHelper builderHelper = new OracleHelper(builder);
builder.setBuilderHelper(builderHelper);
Field workbenchProj_field = BaseDBWSBuilderHelper.class.getDeclaredField("workbenchXMLProject");
workbenchProj_field.setAccessible(true);
ObjectPersistenceWorkbenchXMLProject workbenchXMLProject = (ObjectPersistenceWorkbenchXMLProject) workbenchProj_field.get(builderHelper);
XMLTransformationMapping versionMapping = (XMLTransformationMapping) workbenchXMLProject.getDescriptor(Project.class).getMappings().get(0);
TransformerBasedFieldTransformation versionTransformer = (TransformerBasedFieldTransformation) versionMapping.getFieldTransformations().get(0);
Field transformerField = TransformerBasedFieldTransformation.class.getDeclaredField("transformer");
transformerField.setAccessible(true);
ConstantTransformer constantTransformer = (ConstantTransformer) transformerField.get(versionTransformer);
constantTransformer.setValue("Eclipse Persistence Services - " + releaseVersion);
DBWSTestSuite.setUp(".");
}
use of org.eclipse.persistence.tools.dbws.oracle.OracleHelper in project eclipselink by eclipse-ee4j.
the class SimpleNestedTableTestSuite method setUp.
@BeforeClass
public static void setUp() throws WSDLException {
if (conn == null) {
try {
conn = buildConnection();
} catch (Exception e) {
e.printStackTrace();
}
}
String ddlCreateProp = System.getProperty(DATABASE_DDL_CREATE_KEY, DEFAULT_DATABASE_DDL_CREATE);
if ("true".equalsIgnoreCase(ddlCreateProp)) {
ddlCreate = true;
}
String ddlDropProp = System.getProperty(DATABASE_DDL_DROP_KEY, DEFAULT_DATABASE_DDL_DROP);
if ("true".equalsIgnoreCase(ddlDropProp)) {
ddlDrop = true;
}
String ddlDebugProp = System.getProperty(DATABASE_DDL_DEBUG_KEY, DEFAULT_DATABASE_DDL_DEBUG);
if ("true".equalsIgnoreCase(ddlDebugProp)) {
ddlDebug = true;
}
if (ddlCreate) {
runDdl(conn, CREATE_NUMBER_TABLE, ddlDebug);
runDdl(conn, CREATE_NUMBER_WRAPPER, ddlDebug);
runDdl(conn, CREATE_TEST_NUMBER_PACKAGE, ddlDebug);
runDdl(conn, CREATE_TEST_NUMBER_PACKAGE_BODY, ddlDebug);
runDdl(conn, CREATE_USERS_TABLE, ddlDebug);
runDdl(conn, CREATE_USERS_ID_LIST_TYPE, ddlDebug);
runDdl(conn, CREATE_USERS_PKG, ddlDebug);
runDdl(conn, CREATE_USERS_BODY, ddlDebug);
try {
Statement stmt = conn.createStatement();
for (int i = 0; i < POPULATE_TABLE.length; i++) {
stmt.addBatch(POPULATE_TABLE[i]);
}
stmt.executeBatch();
} catch (SQLException e) {
// e.printStackTrace();
}
}
DBWS_BUILDER_XML_USERNAME = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<dbws-builder xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" + "<properties>" + "<property name=\"projectName\">SimpleNestedTableTest</property>" + "<property name=\"logLevel\">off</property>" + "<property name=\"username\">";
DBWS_BUILDER_XML_PASSWORD = "</property><property name=\"password\">";
DBWS_BUILDER_XML_URL = "</property><property name=\"url\">";
DBWS_BUILDER_XML_DRIVER = "</property><property name=\"driver\">";
DBWS_BUILDER_XML_PLATFORM = "</property><property name=\"platformClassname\">";
DBWS_BUILDER_XML_MAIN = "</property>" + "</properties>" + "<plsql-procedure " + "name=\"GetUsersTest\" " + "catalogPattern=\"USERS_PKG\" " + "procedurePattern=\"GET_USERS_NAME_TEST\" " + "/>" + "<plsql-procedure " + "name=\"NumberTableTest\" " + "catalogPattern=\"TEST_NUMBER_LIST_PKG\" " + "procedurePattern=\"TEST_NUM\" " + // "returnType=\"wrapper_numtabType\" " +
"/>" + "</dbws-builder>";
builder = new DBWSBuilder();
OracleHelper builderHelper = new OracleHelper(builder);
builder.setBuilderHelper(builderHelper);
DBWSTestSuite.setUp(".");
}
use of org.eclipse.persistence.tools.dbws.oracle.OracleHelper in project eclipselink by eclipse-ee4j.
the class SimplePLSQLSFTestSuite method setUp.
@BeforeClass
public static void setUp() throws WSDLException {
if (conn == null) {
try {
conn = buildConnection();
} catch (Exception e) {
e.printStackTrace();
}
}
String ddlCreateProp = System.getProperty(DATABASE_DDL_CREATE_KEY, DEFAULT_DATABASE_DDL_CREATE);
if ("true".equalsIgnoreCase(ddlCreateProp)) {
ddlCreate = true;
}
String ddlDropProp = System.getProperty(DATABASE_DDL_DROP_KEY, DEFAULT_DATABASE_DDL_DROP);
if ("true".equalsIgnoreCase(ddlDropProp)) {
ddlDrop = true;
}
String ddlDebugProp = System.getProperty(DATABASE_DDL_DEBUG_KEY, DEFAULT_DATABASE_DDL_DEBUG);
if ("true".equalsIgnoreCase(ddlDebugProp)) {
ddlDebug = true;
}
if (ddlCreate) {
runDdl(conn, CREATE_OBJECT_TYPE, ddlDebug);
runDdl(conn, CREATE_SIMPLESF_TABLE, ddlDebug);
runDdl(conn, CREATE_SIMPLEPACKAGE2_PACKAGE, ddlDebug);
runDdl(conn, CREATE_SIMPLEPACKAGE2_BODY, ddlDebug);
try {
Statement stmt = conn.createStatement();
for (int i = 0; i < POPULATE_SIMPLESF_TABLE.length; i++) {
stmt.addBatch(POPULATE_SIMPLESF_TABLE[i]);
}
stmt.executeBatch();
} catch (SQLException e) {
// e.printStackTrace();
}
}
DBWS_BUILDER_XML_USERNAME = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<dbws-builder xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" + "<properties>" + "<property name=\"projectName\">simplePLSQLSF</property>" + "<property name=\"logLevel\">off</property>" + "<property name=\"username\">";
DBWS_BUILDER_XML_PASSWORD = "</property><property name=\"password\">";
DBWS_BUILDER_XML_URL = "</property><property name=\"url\">";
DBWS_BUILDER_XML_DRIVER = "</property><property name=\"driver\">";
DBWS_BUILDER_XML_PLATFORM = "</property><property name=\"platformClassname\">";
DBWS_BUILDER_XML_MAIN = "</property>" + "</properties>" + "<plsql-procedure " + "name=\"FindMaxSalTest\" " + "catalogPattern=\"SIMPLEPACKAGE2\" " + "procedurePattern=\"FINDPLSQLMAXSAL\" " + "isCollection=\"false\" " + "isSimpleXMLFormat=\"true\" " + "/>" + "<plsql-procedure " + "name=\"FindMaxSalForDeptTest\" " + "catalogPattern=\"SIMPLEPACKAGE2\" " + "procedurePattern=\"FINDPLSQLMAXSALFOR%\" " + "isCollection=\"false\" " + "isSimpleXMLFormat=\"true\" " + "simpleXMLFormatTag=\"max-sal-for-dept\" " + "/>" + "<plsql-procedure " + "name=\"TestMultipleOut\" " + "catalogPattern=\"SIMPLEPACKAGE2\" " + "procedurePattern=\"TEST_MULTI_OUT\" " + "/>" + "<plsql-procedure " + "name=\"XMLTypeTest\" " + "catalogPattern=\"SIMPLEPACKAGE2\" " + "procedurePattern=\"GET_XMLTYPE\" " + "isSimpleXMLFormat=\"true\" " + "/>" + "</dbws-builder>";
builder = new DBWSBuilder();
OracleHelper builderHelper = new OracleHelper(builder);
builder.setBuilderHelper(builderHelper);
DBWSTestSuite.setUp(".");
}
use of org.eclipse.persistence.tools.dbws.oracle.OracleHelper in project eclipselink by eclipse-ee4j.
the class SimpleSFTestSuite method setUp.
@BeforeClass
public static void setUp() throws WSDLException {
if (conn == null) {
try {
conn = buildConnection();
} catch (Exception e) {
e.printStackTrace();
}
}
String ddlCreateProp = System.getProperty(DATABASE_DDL_CREATE_KEY, DEFAULT_DATABASE_DDL_CREATE);
if ("true".equalsIgnoreCase(ddlCreateProp)) {
ddlCreate = true;
}
String ddlDropProp = System.getProperty(DATABASE_DDL_DROP_KEY, DEFAULT_DATABASE_DDL_DROP);
if ("true".equalsIgnoreCase(ddlDropProp)) {
ddlDrop = true;
}
String ddlDebugProp = System.getProperty(DATABASE_DDL_DEBUG_KEY, DEFAULT_DATABASE_DDL_DEBUG);
if ("true".equalsIgnoreCase(ddlDebugProp)) {
ddlDebug = true;
}
if (ddlCreate) {
runDdl(conn, CREATE_SIMPLESF_TABLE, ddlDebug);
runDdl(conn, CREATE_FINDMAXSAL_FUNC, ddlDebug);
runDdl(conn, CREATE_FINDMAXSALFORDEPT_FUNC, ddlDebug);
runDdl(conn, CREATE_GET_XMLTYPE_FUNC, ddlDebug);
try {
Statement stmt = conn.createStatement();
for (int i = 0; i < POPULATE_SIMPLESF_TABLE.length; i++) {
stmt.addBatch(POPULATE_SIMPLESF_TABLE[i]);
}
stmt.executeBatch();
} catch (SQLException e) {
// e.printStackTrace();
}
}
DBWS_BUILDER_XML_USERNAME = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<dbws-builder xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" + "<properties>" + "<property name=\"projectName\">simpleSF</property>" + "<property name=\"logLevel\">off</property>" + "<property name=\"username\">";
DBWS_BUILDER_XML_PASSWORD = "</property><property name=\"password\">";
DBWS_BUILDER_XML_URL = "</property><property name=\"url\">";
DBWS_BUILDER_XML_DRIVER = "</property><property name=\"driver\">";
DBWS_BUILDER_XML_PLATFORM = "</property><property name=\"platformClassname\">";
DBWS_BUILDER_XML_MAIN = "</property>" + "</properties>" + "<procedure " + "name=\"FindMaxSalTest\" " + "procedurePattern=\"FINDMAXSAL\" " + "isCollection=\"false\" " + "isSimpleXMLFormat=\"true\" " + "/>" + "<procedure " + "name=\"FindMaxSalForDeptTest\" " + "procedurePattern=\"FINDMAXSALFORDEPT\" " + "isCollection=\"false\" " + "isSimpleXMLFormat=\"true\" " + "simpleXMLFormatTag=\"max-sal-for-dept\" " + "/>" + "<procedure " + "name=\"getXMLTypeData\" " + "procedurePattern=\"GET_XMLTYPE\" " + "isCollection=\"false\" " + "isSimpleXMLFormat=\"true\" " + "/>" + "</dbws-builder>";
builder = new DBWSBuilder();
OracleHelper builderHelper = new OracleHelper(builder);
builder.setBuilderHelper(builderHelper);
DBWSTestSuite.setUp(".");
}
Aggregations