Beispiel #1
0
 @Test
 public void testIDisconnect() {
   try {
     src.iDisconnect();
   } catch (ActionFailedException exception) {
     exception.printStackTrace();
   }
 }
Beispiel #2
0
 @Test
 public void testScheduler() throws ActionFailedException {
   try {
     ObservationTimeSeries ts = new ObservationTimeSeries();
     for (int i = 0; i < ITERATIONS; i++) {
       ts.add(Observation.createRandomObservation());
     }
     for (int i = 0; i < ITERATIONS; i++) {
       Thread.sleep(1);
       ts.get(i).setTimestamp(System.currentTimeMillis());
     }
     src.setInput(ts);
     src.iConnect();
     synchronized (this) {
       this.wait(40 * ITERATIONS);
     }
   } catch (InterruptedException exception) {
     exception.printStackTrace();
   }
 }
Beispiel #3
0
 @Test
 public void testIConnect() throws ActionFailedException {
   try {
     ObservationTimeSeries ts = new ObservationTimeSeries();
     ts.add(Observation.createRandomObservation());
     ts.add(Observation.createRandomObservation());
     ts.add(Observation.createRandomObservation());
     ts.add(Observation.createRandomObservation());
     ts.get(0).setTimestamp(System.currentTimeMillis());
     Thread.sleep(10);
     ts.get(1).setTimestamp(System.currentTimeMillis());
     Thread.sleep(10);
     ts.get(2).setTimestamp(System.currentTimeMillis());
     Thread.sleep(10);
     ts.get(3).setTimestamp(System.currentTimeMillis());
     src.setInput(ts);
     src.iConnect();
   } catch (InterruptedException exception) {
     exception.printStackTrace();
   }
 }
Beispiel #4
0
 @Test(expected = ActionFailedException.class)
 public void testIConnectTimeSeriesLenghtIsNull() throws ActionFailedException {
   src.setInput(new ObservationTimeSeries());
   src.iConnect();
 }
Beispiel #5
0
 @Test(expected = ActionFailedException.class)
 public void testIConnectExceptionCase2() throws ActionFailedException {
   src.setInput(null);
   src.iConnect();
 }
Beispiel #6
0
 @Test(expected = ActionFailedException.class)
 public void testIConnectExceptionCase() throws ActionFailedException {
   src.iConnect();
 }