예제 #1
0
 @Override
 public void exceptionOccurred(Exception e) {
   ExecutionLog log = client.getExecutionLog();
   log.addException(e);
   try {
     client.kill();
   } finally {
     testSystemStopped(log, e);
   }
 }
예제 #2
0
 @Override
 public void runTests(TestPage pageToTest) throws IOException, InterruptedException {
   processingQueue.addLast(pageToTest);
   String html = pageToTest.getHtml();
   try {
     if (html.length() == 0) client.send(EMPTY_PAGE_CONTENT);
     else client.send(html);
   } catch (InterruptedException e) {
     exceptionOccurred(e);
     throw e;
   } catch (IOException e) {
     exceptionOccurred(e);
     throw e;
   }
 }
예제 #3
0
 @Override
 public void exceptionOccurred(Throwable t) {
   try {
     client.kill();
   } finally {
     testSystemStopped(t);
   }
 }
 @Override
 public void run() {
   try {
     Thread.sleep(1000); // next waitFor() can finish too quickly on Linux!
     commandRunner.waitForCommandToFinish();
     synchronized (fitClient) {
       if (!fitClient.isConnectionEstablished()) {
         fitClient.notify();
         Exception e =
             new Exception(
                 "FitClient: external process terminated before a connection could be established.");
         commandRunner.exceptionOccurred(e);
         fitClient.exceptionOccurred(e);
       }
     }
   } catch (InterruptedException e) {
     Thread.currentThread().interrupt(); // remember interrupted
   }
 }
예제 #5
0
 @Override
 public void kill() {
   client.kill();
 }
예제 #6
0
 @Override
 public void bye() throws IOException, InterruptedException {
   client.done();
   client.join();
   testSystemStopped(null);
 }
예제 #7
0
 @Override
 public void start() throws IOException {
   // TODO: start a server socket (thread) here
   client.start();
   testSystemStarted(this);
 }
예제 #8
0
 public FitTestSystem(String testSystemName, CommandRunningFitClient fitClient) {
   this.testSystemListener = new CompositeTestSystemListener();
   this.testSystemName = testSystemName;
   this.client = fitClient;
   client.addFitClientListener(this);
 }
예제 #9
0
 @Override
 public boolean isSuccessfullyStarted() {
   return client.isSuccessfullyStarted();
 }
예제 #10
0
 @Override
 public void kill() {
   client.kill();
   testSystemStopped(client.getExecutionLog(), null);
 }
예제 #11
0
 @Override
 public void runTests(TestPage pageToTest) throws IOException, InterruptedException {
   String html = pageToTest.getDecoratedData().getHtml();
   if (html.length() == 0) client.send(EMPTY_PAGE_CONTENT);
   else client.send(html);
 }
예제 #12
0
 @Override
 public void start() {
   client.start();
   testSystemStarted(this, descriptor.getTestSystemName(), descriptor.getTestRunner());
 }