RoboStroke { public ParameterService getParameters() { return parameters; } RoboStroke();  RoboStroke(DistanceResolver distanceResolver);  RoboStroke(DistanceResolver distanceResolver, DataSender dataSenderImpl); RoboStrokeEventBus getBus(); void setErrorListener(ErrorListener errorListener); void setFileInput(File file); void setInput(SensorDataInput dataInput); boolean isSeekableDataInput(); void stop(); SensorDataInput getDataInput(); GravityFilter getGravityFilter(); StrokeRateScanner getStrokeRateScanner(); StrokePowerScanner getStrokePowerScanner(); SensorDataSource getAccelerationSource(); GPSDataFilter getGpsFilter(); SensorDataSource getOrientationSource(); void setDataLogger(File logFile); ParameterService getParameters(); void destroy();  }
@Test public void testSplitRowingContinuousMode() throws Exception { test = new TestRoboStroke(v("dataInput")); final int strokesVal = v("strokes", Integer.class); BusEventListener listener = new BusEventListener() { @SuppressWarnings("incomplete-switch") @Override public void onBusEvent(DataRecord event) { switch (event.type) { case ROWING_COUNT: if ((Integer)event.data == strokesVal) { test.roboStroke.getParameters().setParam(ParamKeys.PARAM_ROWING_MODE.getId(), RowingSplitMode.AUTO + ""); } break; } } }; test.bus.addBusListener(listener); DataRecord event; try { event = splitRowing(RowingSplitMode.CONTINUOUS, false); } finally { test.bus.removeBusListener(listener); } Object[] data = (Object[]) event.data; float distance = (Float)data[1]; long splitTime = (Long) data[2]; long travelTime = (Long) data[3]; int strokes = (Integer) data[4]; Assert.assertEquals(v("splitTime", Double.class), splitTime / 1000000000.0, 0.5); Assert.assertEquals(v("distance", Double.class), distance, 1); Assert.assertEquals(v("travelTime", Double.class), travelTime / 1000.0, 1); Assert.assertEquals((double)strokesVal, strokes, 1); }