예제 #1
0
 @Test
 public void testTimeIsUpdated() throws Exception {
   Measurement last = initialHistory.getLastMeasurement();
   processor.process(exchange);
   MeasurementHistory newHistory = processor.getMeasurementHistory(exchange);
   assertNotSame(last, newHistory.getLastMeasurement());
 }
예제 #2
0
 @Test
 public void testReferenceDateIsNotChanged() throws Exception {
   Date referenceDate = initialHistory.getReferenceDate();
   processor.process(exchange);
   processor.process(exchange);
   assertEquals(referenceDate, processor.getMeasurementHistory(exchange).getReferenceDate());
 }
예제 #3
0
 @Test
 public void testUpdatedTimeIsAfterTheLastTime() throws Exception {
   Measurement initial = initialHistory.getLastMeasurement();
   processor.process(exchange);
   MeasurementHistory history = processor.getMeasurementHistory(exchange);
   Measurement last = history.getLastMeasurement();
   assertTrue(last.getTimestamp().getNanoValue() > initial.getTimestamp().getNanoValue());
 }
예제 #4
0
 @Override
 @Before
 public void setUp() throws Exception {
   super.setUp();
   processor = new TimeProcessor();
   processor.process(exchange);
   initialHistory = processor.getMeasurementHistory(exchange);
 }
예제 #5
0
 @Test
 public void testMeasurementHistoryIsCopied() throws Exception {
   processor.process(exchange);
   MeasurementHistory newHistory = processor.getMeasurementHistory(exchange);
   assertNotSame(initialHistory, newHistory);
 }