/** * @param client The client to run tests in. * @param id The Browser id to execute tests in. */ public ResponseStream run( String id, JsTestDriverClient client, RunData runData, JstdTestCase testCase) { List<String> testsToRun = tests; for (TestsPreProcessor preProcessor : preProcessors) { // makes sure that the preProcessor doesn't modify the base test list // by providing an Iterator testsToRun = preProcessor.process(id, testsToRun.iterator()); } final ResponseStream runTestsActionResponseStream = responseStreamFactory.getRunTestsActionResponseStream(id); if (testsToRun.size() == 1 && testsToRun.get(0).equals("all")) { client.runAllTests(id, runTestsActionResponseStream, captureConsole, testCase); } else if (testsToRun.size() > 0) { client.runTests(id, runTestsActionResponseStream, testsToRun, captureConsole, testCase); } return runTestsActionResponseStream; }
public void run(String id, JsTestDriverClient client) { CountDownLatch latch = new CountDownLatch(1); client.eval(id, new ResponseStreamFactoryImpl(latch), cmd); try { latch.await(); } catch (InterruptedException e) { // uh } }