예제 #1
0
 @Test
 public void testIDisconnect() {
   try {
     src.iDisconnect();
   } catch (ActionFailedException exception) {
     exception.printStackTrace();
   }
 }
예제 #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();
   }
 }
예제 #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();
   }
 }
예제 #4
0
 @Test(expected = ActionFailedException.class)
 public void testIConnectTimeSeriesLenghtIsNull() throws ActionFailedException {
   src.setInput(new ObservationTimeSeries());
   src.iConnect();
 }
예제 #5
0
 @Test(expected = ActionFailedException.class)
 public void testIConnectExceptionCase2() throws ActionFailedException {
   src.setInput(null);
   src.iConnect();
 }
예제 #6
0
 @Test(expected = ActionFailedException.class)
 public void testIConnectExceptionCase() throws ActionFailedException {
   src.iConnect();
 }