@Test public void runTest() { AAPSMocker.mockMainApp(); AAPSMocker.mockApplicationContext(); AAPSMocker.mockSP(); AAPSMocker.mockL(); MsgSetUserOptions packet = new MsgSetUserOptions(); packet.handleMessage(createArray(34, (byte) 7)); assertEquals(true, packet.failed); }
public void handleMessage(byte[] bytes) { int result = intFromBuff(bytes, 0, 1); if (result != 1) { failed = true; if (L.isEnabled(L.PUMPCOMM)) log.debug("Setting user options: " + result + " FAILED!!!"); } else { if (L.isEnabled(L.PUMPCOMM)) log.debug("Setting user options: " + result); } }
MsgSetUserOptions extends MessageBase { public void handleMessage(byte[] bytes) { int result = intFromBuff(bytes, 0, 1); if (result != 1) { failed = true; if (L.isEnabled(L.PUMPCOMM)) log.debug("Setting user options: " + result + " FAILED!!!"); } else { if (L.isEnabled(L.PUMPCOMM)) log.debug("Setting user options: " + result); } } }
MsgSetUserOptions extends MessageBase { public void handleMessage(byte[] bytes) { int result = intFromBuff(bytes, 0, 1); if (result != 1) { failed = true; if (L.isEnabled(L.PUMPCOMM)) log.debug("Setting user options: " + result + " FAILED!!!"); } else { if (L.isEnabled(L.PUMPCOMM)) log.debug("Setting user options: " + result); } } MsgSetUserOptions(); }
MsgSetUserOptions extends MessageBase { public void handleMessage(byte[] bytes) { int result = intFromBuff(bytes, 0, 1); if (result != 1) { failed = true; if (L.isEnabled(L.PUMPCOMM)) log.debug("Setting user options: " + result + " FAILED!!!"); } else { if (L.isEnabled(L.PUMPCOMM)) log.debug("Setting user options: " + result); } } MsgSetUserOptions(); void handleMessage(byte[] bytes); }
MsgSetUserOptions extends MessageBase { public void handleMessage(byte[] bytes) { int result = intFromBuff(bytes, 0, 1); if (result != 1) { failed = true; if (L.isEnabled(L.PUMPCOMM)) log.debug("Setting user options: " + result + " FAILED!!!"); } else { if (L.isEnabled(L.PUMPCOMM)) log.debug("Setting user options: " + result); } } MsgSetUserOptions(); void handleMessage(byte[] bytes); public boolean done; }