| 58 | private MovingAverage func; |
| 59 | |
| 60 | @Before |
| 61 | public void before() throws Exception { |
| 62 | view = SeekableViewsForTest.generator(START_TIME, INTERVAL, |
| 63 | NUM_POINTS, true, 1, 1); |
| 64 | data_query = mock(TSQuery.class); |
| 65 | when(data_query.startTime()).thenReturn(START_TIME); |
| 66 | when(data_query.endTime()).thenReturn(START_TIME + (INTERVAL * NUM_POINTS)); |
| 67 | |
| 68 | dps = PowerMockito.mock(DataPoints.class); |
| 69 | when(dps.iterator()).thenReturn(view); |
| 70 | when(dps.metricNameAsync()).thenReturn(Deferred.fromResult(METRIC)); |
| 71 | |
| 72 | group_bys = new DataPoints[] { dps }; |
| 73 | |
| 74 | query_results = new ArrayList<DataPoints[]>(1); |
| 75 | query_results.add(group_bys); |
| 76 | |
| 77 | params = new ArrayList<String>(1); |
| 78 | func = new MovingAverage(); |
| 79 | } |
| 80 | |
| 81 | @Test |
| 82 | public void evaluateWindow1dps() throws Exception { |