Package org.xmlBlaster.contrib.replication.impl

Examples of org.xmlBlaster.contrib.replication.impl.SpecificDefault


    * @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");
   }
View Full Code Here


    * @throws Exception Any type is possible
    */
   public final void testCheckTableForCreation() throws Exception {
      currentMethod = new String("testCheckTableForCreation");
      log.info("Start " + currentMethod);
      SpecificDefault specificDefault = (SpecificDefault)dbSpecific;
      {
         String sql = "CREATE TABLE repl_items values(sss)";
         int ret = specificDefault.checkTableForCreation(sql);
         assertEquals("check the operation of SpecificDefault.checkTableForCreation('" + sql + "')", 0, ret);
      }
      {
         String sql = "CREATE TABLE repl_tables()";
         int ret = specificDefault.checkTableForCreation(sql);
         assertEquals("check the operation of SpecificDefault.checkTableForCreation('" + sql + "')", 0, ret);
      }
      {
         String sql = "CREATE SEQUENCE repl_items values(sss) ";
         int ret = specificDefault.checkTableForCreation(sql);
         assertEquals("check the operation of SpecificDefault.checkTableForCreation('" + sql + "')", -1, ret);
      }
      {
         String sql = "CREATE TABLE aaaxmsjd values(sss) ";
         int ret = specificDefault.checkTableForCreation(sql);
         assertEquals("check the operation of SpecificDefault.checkTableForCreation('" + sql + "')", 1, ret);
      }
   }
View Full Code Here

    * @throws Exception Any type is possible
    */
   public final void testCheckSequenceForCreation() throws Exception {
      currentMethod = new String("testCheckSequenceForCreation");
      log.info("Start " + currentMethod);
      SpecificDefault specificDefault = (SpecificDefault)dbSpecific;
      I_DbPool pool = (I_DbPool)info.getObject("db.pool");
      assertNotNull("pool must be instantiated", pool);
      {
         String sql = "CREATE SEQUENCE repl_seq  values(sss)";
         int ret = specificDefault.checkSequenceForCreation(sql);
         assertEquals("check the operation of SpecificDefault.checkSequenceForCreation('" + sql + "')", 0, ret);
      }
      {
         String sql = "CREATE SEQUENCE blabla  values(sss)";
         int ret = specificDefault.checkSequenceForCreation(sql);
         assertEquals("check the operation of SpecificDefault.checkTableForCreation('" + sql + "') shall be one since the sequence shall not exist", 1, ret);
      }
      {
         String sql = "CREATE TABLE repl_seq  values(sss)";
         int ret = specificDefault.checkSequenceForCreation(sql);
         assertEquals("check the operation of SpecificDefault.checkSequenceForCreation('" + sql + "')", -1, ret);
      }
      log.info("SUCCESS");
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.contrib.replication.impl.SpecificDefault

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.