Esempio n. 1
0
 @Override
 public void exceptionOccurred(Exception e) {
   ExecutionLog log = client.getExecutionLog();
   log.addException(e);
   try {
     client.kill();
   } finally {
     testSystemStopped(log, e);
   }
 }
Esempio n. 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;
   }
 }
Esempio n. 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
   }
 }
Esempio n. 5
0
 @Override
 public void kill() {
   client.kill();
 }
Esempio n. 6
0
 @Override
 public void bye() throws IOException, InterruptedException {
   client.done();
   client.join();
   testSystemStopped(null);
 }
Esempio n. 7
0
 @Override
 public void start() throws IOException {
   // TODO: start a server socket (thread) here
   client.start();
   testSystemStarted(this);
 }
Esempio n. 8
0
 public FitTestSystem(String testSystemName, CommandRunningFitClient fitClient) {
   this.testSystemListener = new CompositeTestSystemListener();
   this.testSystemName = testSystemName;
   this.client = fitClient;
   client.addFitClientListener(this);
 }
Esempio n. 9
0
 @Override
 public boolean isSuccessfullyStarted() {
   return client.isSuccessfullyStarted();
 }
Esempio n. 10
0
 @Override
 public void kill() {
   client.kill();
   testSystemStopped(client.getExecutionLog(), null);
 }
Esempio n. 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);
 }
Esempio n. 12
0
 @Override
 public void start() {
   client.start();
   testSystemStarted(this, descriptor.getTestSystemName(), descriptor.getTestRunner());
 }