IrClient extends DawgClient implements KeyInput { @Override public void holdKey(Key key, long holdTime) throws KeyException { Map<String, Object> params = new HashMap<String, Object>(); int repeatCount = Long.valueOf(holdTime / SINGLE_KEY_PRESS_TIME).intValue(); logger.info("[Hold Key] Key: "+ key.name()+ " with repeat count: "+ repeatCount); params.put(COMMAND, key.getKey()); params.put(HOLD_TIME, repeatCount); URL url = formKeyUrl(IrOperation.pressKeyAndHold, params, null); executeRequest(url, key.name()); } IrClient(IrMeta irMeta);  IrClient(IrMeta irMeta, String remoteType);  IrClient(String catsHost, String irHost, String port, String remoteType);  IrClient(String catsHost, String blasterType, String irHost, String port, String remoteType); @Override void pressKey(Key key); @Override void pressKey(Key key, RemoteType remoteType); @Override void pressKeys(Key... keys); @Override void pressKeys(long delay, Key... keys); @Override void pressKeys(boolean validate, Key... keys); @Override void holdKey(Key key, long holdTime); static final Logger logger; static final String IR_SERVICE; static final String REST; static final String DEFAULT_BLASTER_TYPE; static final String KEY_SET; static final String COMMAND; static final String COMMAND_LIST; static final String DELAY_IN_MILLIS; static final String HOLD_TIME; static final long DEFAULT_DELAY; static final long SINGLE_KEY_PRESS_TIME; }
@Test public void testPressHoldKey() { IrClient client = new MockIrClient(catsHost, null, null, REMOTE_TYPE); try { long holdTime = 500; client.holdKey(Key.CHDN, holdTime ); } catch(Exception e) { Assert.fail("PressKey method threw exception" + e); } }