Package org.xmlBlaster.contrib

Examples of org.xmlBlaster.contrib.I_Info


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


   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

   private I_DbSpecific getDbSpecific() {
      assertTrue("The agent must not be null", this.agent != null);
      DbWriter writer = this.agent.getDbWriter();
      assertTrue("The writer must not be null", writer != null);
      I_Info tmpInfo = writer.getInfo();
      assertTrue("The writer info must not be null", tmpInfo != null);

      String dbSpecificClass = tmpInfo.get("replication.dbSpecific.class", "org.xmlBlaster.contrib.replication.impl.SpecificOracle");
      I_DbSpecific dbSpecific = (I_DbSpecific)tmpInfo.getObject(dbSpecificClass + ".object");
      assertTrue("The dbSpecific for the writer must not be null", dbSpecific != null);
      return dbSpecific;
   }
View Full Code Here

      boolean extraUser = false;
      setupProperties(this.readerInfo, this.writerInfo, extraUser);
      extraUser = true; // to make it easy to recognize by the session name

      // we use the writerInfo since this will not instantiate an publisher
      I_Info tmpInfo =  new PropertiesInfo((Properties)this.specificHelper.getProperties().clone());
      setupProperties(null, tmpInfo, extraUser);
      boolean forceCreationAndInit = true;
      I_DbSpecific dbSpecific = ReplicationConverter.getDbSpecific(tmpInfo, forceCreationAndInit);
      I_DbPool pool = (I_DbPool)tmpInfo.getObject("db.pool");

      DbInfo persistentInfo = new DbInfo(pool, "replication", tmpInfo);
      String name = readerInfo.get("replication.prefix", "repl_") + ".oldReplKey";
      persistentInfo.put(name, "0");
View Full Code Here

    * Tests the creation of the necessary directories
    *
    */
   public void testDirectories() {
      // absolute path
      I_Info prop = new PropertiesInfo(new Properties());
      prop.put("mom.topicName", "dummy");
      prop.put("filewatcher.directoryName", this.dirName);
      prop.put("filewatcher.sent", this.dirNameSent);
      prop.put("filewatcher.discarded", this.dirNameDiscarded);
      try {
         new Publisher(this.global, "test", prop);
      }
      catch (XmlBlasterException ex) {
         ex.printStackTrace();
         assertTrue("An exception should not occur here " + ex.getMessage(), false);
      }
      checkDirs();

      // repeat that with already existing directories
      prop = new PropertiesInfo(new Properties());
      prop.put("mom.topicName", "dummy");
      prop.put("filewatcher.directoryName", this.dirName);
      prop.put("filewatcher.sent", this.dirNameSent);
      prop.put("filewatcher.discarded", this.dirNameDiscarded);
      try {
         new Publisher(this.global, "test", prop);
      }
      catch (XmlBlasterException ex) {
         ex.printStackTrace();
         assertTrue("An exception should not occur here " + ex.getMessage(), false);
      }
      checkDirs();
      cleanUpDirs();

      // relative path are added to the 'directoryName'
      prop = new PropertiesInfo(new Properties());
      prop.put("mom.topicName", "dummy");
      prop.put("filewatcher.directoryName", this.dirName);
      prop.put("filewatcher.sent", "Sent");
      prop.put("filewatcher.discarded", "Discarded");
      try {
         new Publisher(this.global, "test", prop);
      }
      catch (XmlBlasterException ex) {
         ex.printStackTrace();
         assertTrue("An exception should not occur here " + ex.getMessage(), false);
      }
      checkDirs();
      // relative path are added to the 'directoryName' repeat with existing directories
      prop = new PropertiesInfo(new Properties());
      prop.put("mom.topicName", "dummy");
      prop.put("filewatcher.directoryName", this.dirName);
      prop.put("filewatcher.sent", "Sent");
      prop.put("filewatcher.discarded", "Discarded");
      try {
         new Publisher(this.global, "test", prop);
      }
      catch (XmlBlasterException ex) {
         ex.printStackTrace();
         assertTrue("An exception should not occur here " + ex.getMessage(), false);
      }
      checkDirs();
     
      cleanUpDirs();
     
      // now some which should fail:
      // existing file but not a directory
      File file = new File(this.dirName);
      try {
         file.createNewFile();
      }
      catch (IOException ex) {
         assertTrue("could not create the file '" + this.dirName + "'", false);
      }
     
      prop = new PropertiesInfo(new Properties());
      prop.put("mom.topicName", "dummy");
      prop.put("filewatcher.directoryName", this.dirName);
      prop.put("filewatcher.sent", "Sent");
      prop.put("filewatcher.discarded", "Discarded");
      try {
         new Publisher(this.global, "test", prop);
         assertTrue("an exception should occur since '" + this.dirName + "' is a file and should be a directory", false);
      }
      catch (XmlBlasterException ex) {
         log.info("Exception is OK here");
      }
      cleanUpDirs();
     
      try {
         file = new File(this.dirName);
         boolean ret = file.mkdir();
         assertTrue("could not create directory '" + this.dirName + "'", ret);
         file = new File(this.dirNameSent);
         file.createNewFile();
      }
      catch (IOException ex) {
         assertTrue("could not create the file '" + this.dirNameSent + "'", false);
      }
     
      prop = new PropertiesInfo(new Properties());
      prop.put("mom.topicName", "dummy");
      prop.put("filewatcher.directoryName", this.dirName);
      prop.put("filewatcher.sent", "Sent");
      prop.put("filewatcher.discarded", "Discarded");
      try {
         new Publisher(this.global, "test", prop);
         assertTrue("an exception should occur since '" + this.dirName + "' is a file and should be a directory", false);
      }
      catch (XmlBlasterException ex) {
View Full Code Here

  
   public void testSimplePublish() {
      boolean deliverDat = true;
      boolean deliverGif = true;
      boolean absSubPath = true;
      I_Info prop = new PropertiesInfo(new Properties());
      doPublish(prop, deliverDat, deliverGif, absSubPath);
   }
View Full Code Here

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

  
   public void testSimplePublishWithFilterRegex() {
      boolean deliverDat = true;
      boolean deliverGif = true;
      boolean absSubPath = true;
      I_Info prop = new PropertiesInfo(new Properties());
      prop.put("filewatcher.filterType", "regex");
      // note that the double backslash would be simple if read from the configuration file
      prop.put("filewatcher.fileFilter", "(.*\\.dat)|(.*\\.gif)");
      doPublish(prop, deliverDat, deliverGif, absSubPath);
   }
View Full Code Here

  
   public void testPublishWithMoveAbsolute() {
      boolean deliverDat = true;
      boolean deliverGif = true;
      boolean absSubPath = true;
      I_Info prop = new PropertiesInfo(new Properties());
      prop.put("filewatcher.sent", this.dirName + File.separator + "Sent");
      prop.put("filewatcher.discarded", this.dirName + File.separator + "Discarded");
      doPublish(prop, deliverDat, deliverGif, absSubPath);
   }
View Full Code Here

   public void testPublishWithMoveRelative() {
      boolean deliverDat = true;
      boolean deliverGif = true;
      boolean absSubPath = false;
      I_Info prop = new PropertiesInfo(new Properties());
      prop.put("filewatcher.sent", "Sent");
      prop.put("filewatcher.discarded", "Discarded");
      doPublish(prop, deliverDat, deliverGif, absSubPath);
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.contrib.I_Info

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.