Examples of Run


Examples of org.apache.etch.interoptester.Run

 
  /** @throws Exception */
  @Test
  public void run6() throws Exception
  {
    Run r = Run.parse( itest, parseXml( "<run test=\"bar\"/>" ) );
    assertNull( test );
    Map<String, String> args = new HashMap<String, String>();
    args.put( "abc", "123" );
    r.run( args );
    assertEquals( "bar", test.name() );
    assertEquals( 0, test.args.size() );
  }
View Full Code Here

Examples of org.apache.etch.interoptester.Run

 
  /** @throws Exception */
  @Test
  public void run7() throws Exception
  {
    Run r = Run.parse( itest, parseXml( "<run test=\"bar\"><arg name=\"abc\" value=\"xy\"/></run>" ) );
    assertNull( test );
    Map<String, String> args = new HashMap<String, String>();
    args.put( "p1", "123" );
    r.run( args );
    assertEquals( "bar", test.name() );
    assertEquals( 1, test.args.size() );
    assertEquals( "xy", test.args.get( "abc" ) );
  }
View Full Code Here

Examples of org.apache.etch.interoptester.Run

 
  /** @throws Exception */
  @Test
  public void run8() throws Exception
  {
    Run r = Run.parse( itest, parseXml( "<run test=\"bar\"><arg name=\"abc\" value=\"x{p2}y\"/></run>" ) );
    assertNull( test );
    Map<String, String> args = new HashMap<String, String>();
    args.put( "p1", "123" );
    r.run( args );
    assertEquals( "bar", test.name() );
    assertEquals( 1, test.args.size() );
    assertEquals( "x{p2}y", test.args.get( "abc" ) );
  }
View Full Code Here

Examples of org.apache.etch.interoptester.Run

 
  /** @throws Exception */
  @Test
  public void run9() throws Exception
  {
    Run r = Run.parse( itest, parseXml( "<run test=\"bar\"><arg name=\"abc\" value=\"x{p1}y\"/></run>" ) );
    assertNull( test );
    Map<String, String> args = new HashMap<String, String>();
    args.put( "p1", "123" );
    r.run( args );
    assertEquals( "bar", test.name() );
    assertEquals( 1, test.args.size() );
    assertEquals( "x123y", test.args.get( "abc" ) );
  }
View Full Code Here

Examples of org.apache.etch.interoptester.Run

 
  /** @throws Exception */
  @Test
  public void run10() throws Exception
  {
    Run r = Run.parse( itest, parseXml( "<run test=\"bar\"><arg name=\"abc\" value=\"x\\{p1}y\"/></run>" ) );
    assertNull( test );
    Map<String, String> args = new HashMap<String, String>();
    args.put( "p1", "123" );
    r.run( args );
    assertEquals( "bar", test.name() );
    assertEquals( 1, test.args.size() );
    assertEquals( "x{p1}y", test.args.get( "abc" ) );
  }
View Full Code Here

Examples of org.apache.etch.interoptester.Run

 
  /** @throws Exception */
  @Test
  public void run11() throws Exception
  {
    Run r = Run.parse( itest, parseXml( "<run test=\"bar\"><arg name=\"abc\" value=\"x\\\\y\"/></run>" ) );
    assertNull( test );
    Map<String, String> args = new HashMap<String, String>();
    args.put( "p1", "123" );
    r.run( args );
    assertEquals( "bar", test.name() );
    assertEquals( 1, test.args.size() );
    assertEquals( "x\\y", test.args.get( "abc" ) );
  }
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.Run

  public JSONObject getRunStats(HttpSession session, JSONObject json) {
    if (runStatsManager != null) {
      Long runId = json.getLong("runId");
      try {
        Run run = requestManager.getRunById(runId);
        return runStatsManager.getSummaryStatsForRun(run);
      }
      catch (IOException e) {
        e.printStackTrace();
        return JSONUtils.SimpleJSONError("Cannot retrieve run: " + e.getMessage());
View Full Code Here

Examples of uk.org.taverna.server.client.Run

    // get server address from left over arguments
    Server server = getServer(line.getArgs());

    // create run
    Run run = server.createRun(workflow);
    System.out.println("Created run with uuid: " + run.getUUID());
    System.out.println("Created at " + run.getCreateTime());

    // set inputs
    if (baclavaIn != null) {
      try {
        run.uploadBaclavaFile(baclavaIn);
      } catch (IOException e) {
        System.out.println(e);
      }
    } else {
      if (inputs != null) {
        for (String port : inputs.keySet()) {
          String value = inputs.get(port);
          run.setInput(port, value);
          System.out.format("Set input '%s' to %s\n", port, value);
        }
      }

      if (files != null) {
        for (String port : files.keySet()) {
          File file = files.get(port);
          try {
            run.uploadInputFile(port, file);
            System.out.format(
                "Set input '%s' to use file '%s' as input\n",
                port, file.getName());
          } catch (IOException e) {
            System.err.format("Could not set input '%s': %s\n",
                port, e.getMessage());
            System.exit(1);
          }
        }
      }
    }

    // output baclava?
    if (baclavaOut != null) {
      run.setBaclavaOutput(baclavaOut.getName());
    }

    // Start run and wait until it is finished
    run.start();
    System.out.println("Started at " + run.getStartTime());
    System.out.print("Running");
    while (run.getStatus() == RunStatus.RUNNING) {
      try {
        Thread.sleep(1000);
        System.out.print(".");
      } catch (InterruptedException e) {
      }
    }
    System.out.println("\nFinished at " + run.getFinishTime());

    // get outputs
    String stdout = run.getConsoleOutput();
    String stderr = run.getConsoleError();
    int exitcode = run.getExitCode();
    System.out.println("Exitcode: " + exitcode);
    if (stdout != "") {
      System.out.println("Stdout:\n" + stdout);
    }
    if (stderr != "") {
      System.out.println("Stderr:\n" + stderr);
    }

    if (exitcode == 0) {
      if (baclavaOut != null) {
        try {
          FileUtils.writeStringToFile(baclavaOut,
              run.getBaclavaOutput());
          System.out.format("Baclava file written to '%s'\n",
              baclavaOut);
        } catch (IOException e) {
          System.out.format("Could not write baclava file '%s'\n",
              baclavaOut.getAbsoluteFile());
        }
      } else {
        System.out.println("Outputs:");
        for (String port : run.getOutputPorts()) {
          System.out.format("          %s -> %s\n", port,
              run.getOutput(port, outputRefs));
        }
      }
    }

    // delete run?
    if (deleteRun) {
      run.delete();
      System.out.println("Run deleted");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.