Package org.xmlBlaster.contrib

Examples of org.xmlBlaster.contrib.PropertiesInfo


   public void testSimplePublishWithFilterLockMode() {
      boolean deliverDat = false;
      boolean deliverGif = true;
      boolean absSubPath = true;
      I_Info prop = new PropertiesInfo(new Properties());
      prop.put("filewatcher.fileFilter", "*.gif");
      prop.put("filewatcher.lockExtention", "*.lck");
      doPublish(prop, deliverDat, deliverGif, absSubPath);
   }
View Full Code Here


    *
    */
   public final void testInfoHelper() {
      log.info("Start testInfoHelper");
     
      PropertiesInfo info = new PropertiesInfo(new Properties());
     
      info.put("replication.mapper.schema.testSchema", "testSchema1");
      info.put("replication.mapper.schema.testSchema1", "testSchema2");
      info.put("replication.mapper.schema2.testSchema100", "testSchema2");
      info.put("replication.mapper.sch.testSchema100", "testSchema2");
     
      Map map = InfoHelper.getPropertiesStartingWith("replication.mapper.schema.", info, null);
      assertEquals("testing amount", 2, map.size());
      assertEquals("testing 1/2", "testSchema1", (String)map.get("testSchema"));
      assertEquals("testing 1/2", "testSchema2", (String)map.get("testSchema1"));
View Full Code Here

    *
    */
   public final void testTableMapper() {
      log.info("Start testTableMapper");
     
      PropertiesInfo info = new PropertiesInfo(new Properties());
     
      info.put("replication.mapper.schema.AIS", "AIS1");
      info.put("replication.mapper.table.AIS.C_OUTS", "C_INS");
      info.put("replication.mapper.column.AIS.C_OUTS.COM_MESSAGEID", "COM_RECORDID");

      DefaultMapper mapper = new DefaultMapper();
      try {
         mapper.init(info);
      }
View Full Code Here

      props.put("one", "value1");
      props.put("two", "value2");
      props.put("three", "${one}");
      props.put("value1", "value43");
     
      PropertiesInfo propInfo = new PropertiesInfo(props);
      String key = "one";
      String val = propInfo.get(key, null);
      assertEquals("testing key '" + key + "'", "value1", val);
     
      key = "three";
      val = propInfo.get(key, null);
      assertEquals("testing key '" + key + "'", "value1", val);
     
      key = "four";
      val = propInfo.get(key, "default");
      assertEquals("testing key '" + key + "'", "default", val);
     
      key = "four";
      val = propInfo.get(key, "${one}");
      assertEquals("testing key '" + key + "'", "value1", val);
     
      key = "${one}";
      val = propInfo.get(key, null);
      assertEquals("testing key '" + key + "'", "value43", val);
     
      key = "four";
      val = propInfo.get(key, "${five}");
      assertEquals("testing key '" + key + "'", "${five}", val);
     
     
      props.put("test.${one}", "testOne");
      props.put("test.${two}", "test_${two}");
View Full Code Here

    *
    */
   public final void testTableToWatchInfoStatic() {
      log.info("Start testTableToWatchInfoStatic");
     
      I_Info info = new PropertiesInfo(new Properties());
      // info.put("table.schema1.table1", null); does not work since info will no add this
      info.put("table.schema1.table1", "actions=IDU");
      info.put("table.schema1.table2", "actions=IDU,trigger=trigger2,sequence=10");
      info.put("table.schema1.table3", "actions=IDU,trigger=trigger3,sequence=155");
      info.put("table.schema1.table4", "actions=IDU,trigger=trigger4,sequence=6");
      info.put("table.schema1.table5", "actions=IDU,trigger=trigger5,sequence=13");
      info.put("tablesomethingother", "should be ignored");
      info.put("somethingother", "should be ignored");
      try {
         Connection conn = null;
         TableToWatchInfo[] tables = TableToWatchInfo.getTablesToWatch(conn, info);
         assertEquals("number of tables", 5, tables.length);
         assertEquals("table sequence #1", "table1", tables[0].getTable());
View Full Code Here

   public final void testTableToWatchInfoForAllToken() {
      String txt = "testTableToWatchInfoForAllToken";
      log.info("Start " + txt);
      try {
         SpecificHelper specificHelper = new SpecificHelper(System.getProperties());
         I_Info info = new PropertiesInfo(specificHelper.getProperties());
         I_DbPool dbPool = setUpDbPool(info);
         Connection conn = dbPool.reserve();
         info.put("table.XMLBLASTER.*", "");
         TableToWatchInfo[] tables = TableToWatchInfo.getTablesToWatch(conn, info);
         assertTrue("wrong number of tables", tables.length > 0);
         for (int i=0; i < tables.length; i++) {
            log.info(tables[i].toXml());
         }
View Full Code Here

   public final void testSearchableConfig() {
      log.info("Start testSearchableConfig");

      try {
         SpecificHelper specificHelper = new SpecificHelper(System.getProperties());
         I_Info info = new PropertiesInfo((Properties)specificHelper.getProperties().clone());
         info.put("replication.searchable.xmlBlaster.table1", "first, second, third, fourth");
         info.put("replication.searchable.XMLBLASTER.TABLE2", "FIRST,SECOND");
        
         DbPool pool = new DbPool();
         pool.init(info);
         info.putObject(DbWriter.DB_POOL_KEY, pool);
        
         SearchableConfig searchableConfig = new SearchableConfig();
         searchableConfig.init(info);
         info.putObject(SearchableConfig.NAME, searchableConfig);
        
         pool.update("drop table table1");
         String txt = "create table table1 (first VARCHAR(100), second VARCHAR(100), third blob, fifth VARCHAR(29), primary key(first))";
         pool.update(txt);
        
View Full Code Here

TOP

Related Classes of org.xmlBlaster.contrib.PropertiesInfo

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.