@Test public void testReadByte() throws IOException { pcf8574.readByte(); Mockito.verify(device).read(Matchers.any(byte[].class), Matchers.eq(1)); }
public int readByte() { if (device == null) return 0; byte[] buffer = new byte[]{0}; try { device.read(buffer, 1); } catch (IOException e) { } return buffer[0]; }
Pcf8574 implements AutoCloseable { public int readByte() { if (device == null) return 0; byte[] buffer = new byte[]{0}; try { device.read(buffer, 1); } catch (IOException e) { } return buffer[0]; } }
Pcf8574 implements AutoCloseable { public int readByte() { if (device == null) return 0; byte[] buffer = new byte[]{0}; try { device.read(buffer, 1); } catch (IOException e) { } return buffer[0]; } @VisibleForTesting  Pcf8574(I2cDevice device); }
Pcf8574 implements AutoCloseable { public int readByte() { if (device == null) return 0; byte[] buffer = new byte[]{0}; try { device.read(buffer, 1); } catch (IOException e) { } return buffer[0]; } @VisibleForTesting  Pcf8574(I2cDevice device); static Pcf8574 create(int address, boolean isPcf8574); static Pcf8574 create(int address, String bus, boolean isPcf8574); static int BV(int pin); @Override void close(); boolean writeByte(int mask, int data); int readValue(); void setPin(int pin, boolean state); boolean getPin(int pin); int readByte(); }
Pcf8574 implements AutoCloseable { public int readByte() { if (device == null) return 0; byte[] buffer = new byte[]{0}; try { device.read(buffer, 1); } catch (IOException e) { } return buffer[0]; } @VisibleForTesting  Pcf8574(I2cDevice device); static Pcf8574 create(int address, boolean isPcf8574); static Pcf8574 create(int address, String bus, boolean isPcf8574); static int BV(int pin); @Override void close(); boolean writeByte(int mask, int data); int readValue(); void setPin(int pin, boolean state); boolean getPin(int pin); int readByte();  }