Package org.xmlBlaster.util

Examples of org.xmlBlaster.util.Execute


            // if (Execute.isWindows()) cmd = "cmd " + cmd;
            if (closeCmd != null) {
               String tmpFilename = dumperFilename + format.format(count);
               String cmd = closeCmd + " " + tmpFilename;
               String[] args = ReplaceVariable.toArray(cmd, " ");
               Execute execute = new Execute(args, null, 10L);
               execute.run(); // blocks until finished
               if (execute.getExitValue() != 0) {
                  throw new Exception("Exception occured on executing '" + cmd + "");
               }
            }
            // make a backup
            // copyFile(dumperFilename, dumperFilename + ".bak");
View Full Code Here


   private void osExecute(String[] slaveNames, String cmd, ConnectionInfo connInfo) throws Exception {
      try {
         // if (Execute.isWindows()) cmd = "cmd " + cmd;
         String[] args = ReplaceVariable.toArray(cmd, " ");
         log.info("running for '" + SpecificDefault.toString(slaveNames) + "' for cmd '" + cmd + "'");
         Execute execute = new Execute(args, null, this.initialCmdSleepDelay);
         synchronized (this) {
            if (slaveNames != null) {
               for (int i=0; i < slaveNames.length; i++) {
                  String slaveName = slaveNames[i];
                  if (slaveName != null) {
                     Execute oldExecute = (Execute)this.runningExecutes.remove(slaveName);
                     if (oldExecute != null) {
                        log.warning("A new request for an initial update has come for '" + slaveName + "' but there is one already running. Will shut down the running one first");
                        oldExecute.stop();
                        log.info("old initial request for '" + slaveName + "' has been shut down");
                        this.runningExecutes.put(slaveName, execute);
                     }
                  }
               }
View Full Code Here

   }
  
   public void cancelUpdate(String slaveName) {
      this.dbSpecific.cancelUpdate(slaveName);
      synchronized (this) {
         Execute exec = (Execute)this.runningExecutes.remove(slaveName);
         if (exec != null)
            exec.stop();
      }
   }
View Full Code Here

      String[] commandArr = { pathToCBinary+sep+"TestMethods" };
      String[] envArr = { "" };

      log.info("######## Start test_C_MethodInvocations('" + commandArr[0] + "')");

      Execute e = new Execute(commandArr, envArr);
      e.setExecuteListener(this);
      e.run();

      if (e.getExitValue() != 0) {
         fail("C client library test '" + commandArr[0] + "' + failed exit=" + e.getExitValue() + ": " + e.getStderr());
      }

      if (e.getErrorText() != null) {
         fail(e.getErrorText());
      }

      if (e.getStdout().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStdout());
      }
      if (e.getStderr().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStderr());
      }

      log.info("######## SUCCESS test_C_MethodInvocations('" + commandArr[0] + "') exit=" +
               e.getExitValue() + " : " + e.getStdout());
   }
View Full Code Here

      String[] commandArr = { pathToCBinary+sep+"TestError" };
      String[] envArr = { "" };

      log.info("######## Start test_C_IllegalArguments('" + commandArr[0] + "')");

      Execute e = new Execute(commandArr, envArr);
      e.setExecuteListener(this);
      e.run();

      if (e.getExitValue() != 0) {
         fail("C client library test '" + commandArr[0] + "' + failed exit=" + e.getExitValue() + ": " + e.getStderr());
      }

      if (e.getErrorText() != null) {
         fail(e.getErrorText());
      }

      if (e.getStdout().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStdout());
      }
      if (e.getStderr().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStderr());
      }

      log.info("######## SUCCESS test_C_IllegalArguments('" + commandArr[0] + "') exit=" +
               e.getExitValue() + " : " + e.getStdout());
   }
View Full Code Here

      String[] commandArr = { pathToCBinary+sep+"TestStress" };
      String[] envArr = { "" };

      log.info("######## Start test_C_Stress('" + commandArr[0] + "')");

      Execute e = new Execute(commandArr, envArr);
      e.setExecuteListener(this);
      e.run();

      if (e.getExitValue() != 0) {
         fail("C client library test '" + commandArr[0] + "' + failed exit=" + e.getExitValue() + ": " + e.getStderr());
      }

      if (e.getErrorText() != null) {
         fail(e.getErrorText());
      }

      if (e.getStdout().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStdout());
      }
      if (e.getStderr().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStderr());
      }

      log.info("######## SUCCESS test_C_Stress('" + commandArr[0] + "') exit=" +
               e.getExitValue() + " : " + e.getStdout());
   }
View Full Code Here

      String[] commandArr = { pathToCBinary+sep+"TestUtil" };
      String[] envArr = { "" };

      log.info("######## Start test_C_Util('" + commandArr[0] + "')");

      Execute e = new Execute(commandArr, envArr);
      e.setExecuteListener(this);
      e.run();

      if (e.getExitValue() != 0) {
         fail("C client library test '" + commandArr[0] + "' + failed exit=" + e.getExitValue() + ": " + e.getStderr());
      }

      if (e.getErrorText() != null) {
         fail(e.getErrorText());
      }

      if (e.getStdout().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStdout());
      }
      if (e.getStderr().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStderr());
      }

      log.info("######## SUCCESS test_C_Util('" + commandArr[0] + "') exit=" +
               e.getExitValue() + " : " + e.getStdout());
   }
View Full Code Here

      String[] commandArr = { pathToCBinary+sep+"TestXmlUtil" };
      String[] envArr = { "" };

      log.info("######## Start test_C_XmlUtil('" + commandArr[0] + "')");

      Execute e = new Execute(commandArr, envArr);
      e.setExecuteListener(this);
      e.run();

      if (e.getExitValue() != 0) {
         fail("C client library test '" + commandArr[0] + "' + failed exit=" + e.getExitValue() + ": " + e.getStderr());
      }

      if (e.getErrorText() != null) {
         fail(e.getErrorText());
      }

      if (e.getStdout().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStdout());
      }
      if (e.getStderr().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStderr());
      }

      log.info("######## SUCCESS test_C_XmlUtil('" + commandArr[0] + "') exit=" +
               e.getExitValue() + " : " + e.getStdout());
   }
View Full Code Here

      String[] commandArr = { pathToCBinary+sep+"TestTimeout" };
      String[] envArr = { "" };

      log.info("######## Start test_C_Timeout('" + commandArr[0] + "')");

      Execute e = new Execute(commandArr, envArr);
      e.setExecuteListener(this);
      e.run();

      if (e.getExitValue() != 0) {
         fail("C client library test '" + commandArr[0] + "' + failed exit=" + e.getExitValue() + ": " + e.getStderr());
      }

      if (e.getErrorText() != null) {
         fail(e.getErrorText());
      }

      if (e.getStdout().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStdout());
      }
      if (e.getStderr().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStderr());
      }

      log.info("######## SUCCESS test_C_Timeout('" + commandArr[0] + "') exit=" +
               e.getExitValue() + " : " + e.getStdout());
   }
View Full Code Here

      String[] commandArr = { pathToCBinary+sep+"TestQueue" };
      String[] envArr = { "" };

      log.info("######## Start test_C_Queue('" + commandArr[0] + "')");

      Execute e = new Execute(commandArr, envArr);
      e.setExecuteListener(this);
      e.run();

      if (e.getExitValue() != 0) {
         fail("C client library test '" + commandArr[0] + "' + failed exit=" + e.getExitValue() + ": " + e.getStderr());
      }

      if (e.getErrorText() != null) {
         fail(e.getErrorText());
      }

      if (e.getStdout().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStdout());
      }
      if (e.getStderr().indexOf("[TEST FAIL]") != -1) {
         fail("C client library test '" + commandArr[0] + "' + failed: " + e.getStderr());
      }

      log.info("######## SUCCESS test_C_Queue('" + commandArr[0] + "') exit=" +
               e.getExitValue() + " : " + e.getStdout());
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.Execute

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.