@Test public void testSetData() throws Exception { ByteBuffer buffer = mock(ByteBuffer.class); when(buffer.removeByte()).thenReturn((byte) 0x01, (byte) 0x02); when(buffer.removeCString()).thenReturn("1234567890"); address.setData(buffer); assertEquals(0x01, address.getTon()); assertEquals(0x02, address.getNpi()); assertEquals("1234567890", address.getAddress()); }
public void setData(ByteBuffer buffer) throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException, WrongLengthOfStringException { byte ton = buffer.removeByte(); byte npi = buffer.removeByte(); String address = buffer.removeCString(); setAddress(address); setTon(ton); setNpi(npi); }
Address extends ByteData { public void setData(ByteBuffer buffer) throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException, WrongLengthOfStringException { byte ton = buffer.removeByte(); byte npi = buffer.removeByte(); String address = buffer.removeCString(); setAddress(address); setTon(ton); setNpi(npi); } }
Address extends ByteData { public void setData(ByteBuffer buffer) throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException, WrongLengthOfStringException { byte ton = buffer.removeByte(); byte npi = buffer.removeByte(); String address = buffer.removeCString(); setAddress(address); setTon(ton); setNpi(npi); } Address();  Address(int maxAddressLength);  Address(byte ton, byte npi, int maxAddressLength);  Address(String address);  Address(String address, int maxAddressLength);  Address(byte ton, byte npi, String address);  Address(byte ton, byte npi, String address, int maxAddressLength); }
Address extends ByteData { public void setData(ByteBuffer buffer) throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException, WrongLengthOfStringException { byte ton = buffer.removeByte(); byte npi = buffer.removeByte(); String address = buffer.removeCString(); setAddress(address); setTon(ton); setNpi(npi); } Address();  Address(int maxAddressLength);  Address(byte ton, byte npi, int maxAddressLength);  Address(String address);  Address(String address, int maxAddressLength);  Address(byte ton, byte npi, String address);  Address(byte ton, byte npi, String address, int maxAddressLength); void setData(ByteBuffer buffer); ByteBuffer getData(); void setTon(byte ton); void setNpi(byte npi); void setAddress(String address); void setAddress(String address, int maxAddressLength); byte getTon(); byte getNpi(); String getAddress(); String getAddress(String encoding); String debugString(); }
Address extends ByteData { public void setData(ByteBuffer buffer) throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException, WrongLengthOfStringException { byte ton = buffer.removeByte(); byte npi = buffer.removeByte(); String address = buffer.removeCString(); setAddress(address); setTon(ton); setNpi(npi); } Address();  Address(int maxAddressLength);  Address(byte ton, byte npi, int maxAddressLength);  Address(String address);  Address(String address, int maxAddressLength);  Address(byte ton, byte npi, String address);  Address(byte ton, byte npi, String address, int maxAddressLength); void setData(ByteBuffer buffer); ByteBuffer getData(); void setTon(byte ton); void setNpi(byte npi); void setAddress(String address); void setAddress(String address, int maxAddressLength); byte getTon(); byte getNpi(); String getAddress(); String getAddress(String encoding); String debugString();  }