Package org.xmlBlaster.contrib.dbwriter.info

Examples of org.xmlBlaster.contrib.dbwriter.info.SqlDescription


      this.out = out;
      size = 0;
      this.transactionId = null;
      this.allTransactions.clear();
      this.sqlInfo = new SqlInfo(this.info);
      SqlDescription description = new SqlDescription(this.info);
      description.setCommand(REPLICATION_CMD);
      if (ident != null)
         description.setIdentity(ident);
      this.sqlInfo.setDescription(description);
      this.event = event;
   }
View Full Code Here


     
      SqlInfoParser parser = new SqlInfoParser();
      parser.init(this.info);
      SqlInfo record = parser.parse(xml);

      SqlDescription description = record.getDescription();
      assertNotNull("the description shall not be null", description);
      assertNotNull("the identity shall not be null", description.getIdentity());
      assertNotNull("the command shall not be null", description.getCommand());

      assertEquals("the identity content is wrong", "EDDI", description.getIdentity());
      assertEquals("the command content is wrong", "INSERT", description.getCommand());

      // test the column descriptions
      SqlColumn[] colDescriptions = description.getColumns();
      assertEquals("the number of column descriptions is wrong", 4, colDescriptions.length);
      String[] names = new String[] { "DATUM", "CPU", "COL1", "ICAO_ID"};
      for (int i=0; i < colDescriptions.length; i++) {
         log.info("test column description #" + i + " names: '" + names[i] + "' and '" + colDescriptions[i].getColName() + "'");
         assertEquals("the name of the column description #" + i + " is wrong", names[i], colDescriptions[i].getColName());
View Full Code Here

         is = new FileInputStream(xmlFileName);
        
      }
      String charSet = System.getProperty("charSet", null);
      SqlInfo record = parser.parse(is, charSet);
      SqlDescription description = record.getDescription();
      assertNotNull("the description shall not be null", description);
      assertNotNull("the identity shall not be null", description.getIdentity());
      assertNotNull("the command shall not be null", description.getCommand());

      assertEquals("the identity content is wrong", "EDDI", description.getIdentity());
      assertEquals("the command content is wrong", "INSERT", description.getCommand());

      // test the column descriptions
      SqlColumn[] colDescriptions = description.getColumns();
      assertEquals("the number of column descriptions is wrong", 4, colDescriptions.length);
      String[] names = new String[] { "DATUM", "CPU", "COL1", "ICAO_ID"};
      for (int i=0; i < colDescriptions.length; i++) {
         log.info("test column description #" + i + " names: '" + names[i] + "' and '" + colDescriptions[i].getColName() + "'");
         assertEquals("the name of the column description #" + i + " is wrong", names[i], colDescriptions[i].getColName());
View Full Code Here

   }

  
   private SqlInfo createMsg(I_Info info, String oldFirst, String oldSecond, String first, String second, String fifth, int replKey) {
      SqlInfo ret = new SqlInfo(info);
      SqlDescription description = new SqlDescription(info);
      // description.setCommand("UPDATE");
      description.setCommand(ReplicationConstants.REPLICATION_CMD);
      description.setIdentity("TABLE1");
      ret.setDescription(description);
      SqlRow row = new SqlRow(info, 0);
      row.setColumn(new ClientProperty("FIRST", null, null, first));
      row.setColumn(new ClientProperty("SECOND", null, null, second));
      row.setColumn(new ClientProperty("FIFTH", null, null, fifth));
View Full Code Here

         SqlInfo sqlInfo = new SqlInfo(info);
         Connection conn = pool.reserve();
         sqlInfo.fillMetadata(conn, null, "XMLBLASTER", "TABLE1", null, null);
         pool.release(conn);
        
         SqlDescription description = sqlInfo.getDescription();
         boolean isConfigured = description.isColumnSearchConfigured(null);
         assertTrue("shall be configured", isConfigured);
        
         isConfigured = description.isColumnSearchConfigured("FIRST");
         assertTrue("shall be configured", isConfigured);
         isConfigured = description.isColumnSearchConfigured("SECOND");
         assertTrue("shall be configured", isConfigured);
         isConfigured = description.isColumnSearchConfigured("THIRD");
         assertFalse("shall not be configured", isConfigured);
         isConfigured = description.isColumnSearchConfigured("FOURTH");
         assertTrue("shall be configured (since it could be added later)", isConfigured);
        
         String oldFirst = "oldOne";
         String oldSecond = "oldTwo";
         String first = "one";
View Full Code Here

TOP

Related Classes of org.xmlBlaster.contrib.dbwriter.info.SqlDescription

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.