@Test public void testVals() { for (int i = 0; i <= 0xff; i++) { DaumClassicResponse response = new DaumClassicResponse((byte) i); String cmd = response.getCmd(); byte cmdVal = response.getCmdVal(); if (cmd != null) { assertEquals((byte) i, cmdVal); } System.out.println("Cmd :" + i); } }
@Test public void testBody() { DaumClassicResponse response; response = new DaumClassicResponse((byte) 0x10); response.setBody(new byte[] {0x00, 0x01, 0x02}); assertEquals("0x00 0x01 0x02 ", CommandUtils.bytesToHexStr(response.getBodyVals())); response = new DaumClassicResponse((byte) 0x10); response.setBody(new byte[] {(byte) 0xFF}); assertEquals("0xff ", CommandUtils.bytesToHexStr(response.getBodyVals())); }