Package org.sikuli.remote.script

Examples of org.sikuli.remote.script.Script


  protected void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    ScriptType type = getScriptType(req);
    try {
      Worker worker = type.getWorker().newInstance();
        Script script = new Script(getScriptName(req));
        script.setArgs(getArgs(req));
        script.setSource(getCommand(req));
       
        worker.work(script);
       
        resp.setStatus(HttpServletResponse.SC_OK);
      resp.setContentType("text/xml");
View Full Code Here


public class TestSikuliWorker {
 
 
  @Test
  public void testExecuteScriptSuccessful1() { 
    Script script = new Script("test");
    HashMap<String, String> args = new HashMap<String, String>();
    args.put("a", "3");
    script.setArgs(args);
    ArrayList<String> source = new ArrayList<String>();
    source.add("from sikuli.Sikuli import *");
    source.add("print a");
    script.setSource(source);
   
    Worker worker = new SikuliWorker();
    worker.work(script);
   
    assertEquals(ScriptStatus.PASS, script.getStatus());
  }
View Full Code Here

  }
 
 
  @Test
  public void testExecuteScriptSuccessful2() { 
    Script script = new Script("test");
    ArrayList<String> source = new ArrayList<String>();
    source.add("from sikuli.Sikuli import *");
    script.setSource(source);
   
    Worker worker = new SikuliWorker();
    worker.work(script);
   
    assertEquals(ScriptStatus.PASS, script.getStatus());
  }
View Full Code Here

    assertEquals(ScriptStatus.PASS, script.getStatus());
  }
 
  @Test
  public void testExcuteScriptFailed() {
    Script script = new Script("test");
    ArrayList<String> source = new ArrayList<String>();
    source.add("raise NameError");
    script.setSource(source);
   
    Worker worker = new SikuliWorker();
    worker.work(script);
   
    assertEquals(ScriptStatus.FAIL, script.getStatus());
    assertTrue(script.getFailure_reason() instanceof ScriptExcuteFailedException);
  }
View Full Code Here

TOP

Related Classes of org.sikuli.remote.script.Script

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.