@Test public void getBluetoothActiveDuration() throws IOException { Mockito.when(filereader.fileExist(Mockito.anyString())).thenReturn(true); String[] arr = new String[] { "1.413913535177E9 CONNECTED" ,"1.413913591806E9 CONNECTED" ,"1.413913610613E9 OFF" ,"1.413913620683E9 DISCONNECTED" ,"1.413913620883E9 CONNECTED" ,"1.413913622533E9 JUNK" ,"" }; Mockito.when(filereader.readAllLine(Mockito.anyString())).thenReturn(arr); bluetoothReader.readData("/", 0, 0); double activeDuration = bluetoothReader.getBluetoothActiveDuration(); assertEquals(77.086, ((double)Math.round(activeDuration*1000.0))/1000, 0); }
@Override public double getBluetoothActiveDuration() { return activeBluetoothDuration; }
BluetoothInfoReaderImpl extends PeripheralBase implements IBluetoothInfoReader { @Override public double getBluetoothActiveDuration() { return activeBluetoothDuration; } }
BluetoothInfoReaderImpl extends PeripheralBase implements IBluetoothInfoReader { @Override public double getBluetoothActiveDuration() { return activeBluetoothDuration; }  }
BluetoothInfoReaderImpl extends PeripheralBase implements IBluetoothInfoReader { @Override public double getBluetoothActiveDuration() { return activeBluetoothDuration; }  @Override List<BluetoothInfo> readData(String directory, double startTime, double traceDuration); @Override double getBluetoothActiveDuration(); }
BluetoothInfoReaderImpl extends PeripheralBase implements IBluetoothInfoReader { @Override public double getBluetoothActiveDuration() { return activeBluetoothDuration; }  @Override List<BluetoothInfo> readData(String directory, double startTime, double traceDuration); @Override double getBluetoothActiveDuration();  }