* @throws Exception Any type is possible
*/
public final void testGetObjectName() throws Exception {
currentMethod = new String("testGetObjectName");
log.info("Start " + currentMethod);
SpecificDefault specificDefault = (SpecificDefault)dbSpecific;
{
String op = "CREATE TABLE";
String sql = "CREATE TABLE someName(aaa)";
String tableName = specificDefault.getObjectName(op, sql);
assertNotNull("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall not be null");
assertEquals("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "')", "someName", tableName);
}
{
String op = "CREATE TABLE";
String sql = "CREATE TABLE someName (aaa)";
String tableName = specificDefault.getObjectName(op, sql);
assertNotNull("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall not be null");
assertEquals("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "')", "someName", tableName);
}
{
String op = "CREATE TABLE";
String sql = "CREATE TABLE someName\n\n (aaa)";
String tableName = specificDefault.getObjectName(op, sql);
assertNotNull("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall not be null");
assertEquals("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "')", "someName", tableName);
}
{
String op = "CREATE TABLE";
String sql = "CREATE TABLE someName aaa";
String tableName = specificDefault.getObjectName(op, sql);
assertNotNull("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall not be null");
assertEquals("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "')", "someName", tableName);
}
{
String op = "CREATE TABLE";
String sql = "CREATE TABLE someName() ";
String tableName = specificDefault.getObjectName(op, sql);
assertNotNull("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall not be null");
assertEquals("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "')", "someName", tableName);
}
{
String op = "CREATE TABLE";
String sql = " CREATE TABLE someName(aaa)";
String tableName = specificDefault.getObjectName(op, sql);
assertNotNull("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall not be null");
assertEquals("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "')", "someName", tableName);
}
{
String op = "CREATE TABLE";
String sql = "\n\nCREATE TABLE someName(aaa)";
String tableName = specificDefault.getObjectName(op, sql);
assertNotNull("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall not be null");
assertEquals("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "')", "someName", tableName);
}
{
String op = "CREATE TABLE";
String sql = " CREATE TABLE\n someName (aaa)";
String tableName = specificDefault.getObjectName(op, sql);
assertNotNull("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall not be null");
assertEquals("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "')", "someName", tableName);
}
{
String op = "CREATE TABLE";
String sql = " CREATE TABLE\n someName (aaa)";
String tableName = specificDefault.getObjectName(op, sql);
assertNotNull("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall not be null");
assertEquals("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "')", "someName", tableName);
}
{ // this shall be null
String op = "CREATE TABLE";
String sql = " CREATE SEQUENCE someName(aaa)";
String tableName = specificDefault.getObjectName(op, sql);
if (tableName != null)
assertTrue("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall be null", false);
}
{ // this shall be null
String op = "CREATE TABLE";
String sql = null;
String tableName = specificDefault.getObjectName(op, sql);
if (tableName != null)
assertTrue("the operation of SpecificDefault.getObjectName('" + op + "',null) shall be null", false);
}
{ // this shall be null
String op = "CREATE TABLE";
String sql = "";
String tableName = specificDefault.getObjectName(op, sql);
if (tableName != null)
assertTrue("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall be null", false);
}
{ // this shall be null
String op = "CREATE TABLE";
String sql = " ";
String tableName = specificDefault.getObjectName(op, sql);
if (tableName != null)
assertTrue("the operation of SpecificDefault.getObjectName('" + op + "','" + sql + "') shall be null", false);
}
log.info("SUCCESS");
}