@Test(dataProvider = "testDirectTuneData") public void testDirectTune(String[] deviceIds, String channelNum, String remoteType) throws KeyException, InterruptedException { final MockMetaStbCache cache = new MockMetaStbCache(); MetaStb stb = TestUtils.createGenericMetaStb(); cache.cache.put(TestUtils.ID, stb); final IrClient client = EasyMock.createMock(IrClient.class); Key[] keys = Key.keysForChannel(channelNum); RemotePluginManager rpm = new RemotePluginManager(); HttpServletRequest req = createReq(); client.pressKeys(keys); EasyMock.expectLastCall(); EasyMock.replay(client, req); KeyController controller = getKeyController(cache, client, rpm); Wiring.autowire(controller, cache); controller.directTune(req, null, deviceIds, channelNum, remoteType); EasyMock.verify(client, req); }
@RequestMapping(method = { RequestMethod.POST }, value = "/directtune") @ResponseBody public void directTune(HttpServletRequest req, HttpServletResponse resp, @RequestParam(value = "deviceIds[]") String[] deviceIds, @RequestParam String channelNum, @RequestParam(required = false) String remoteType) throws KeyException, InterruptedException { Key[] keys = Key.keysForChannel(channelNum); sendKeys(req, resp, deviceIds, keys, null, remoteType); }
KeyController implements ViewConstants { @RequestMapping(method = { RequestMethod.POST }, value = "/directtune") @ResponseBody public void directTune(HttpServletRequest req, HttpServletResponse resp, @RequestParam(value = "deviceIds[]") String[] deviceIds, @RequestParam String channelNum, @RequestParam(required = false) String remoteType) throws KeyException, InterruptedException { Key[] keys = Key.keysForChannel(channelNum); sendKeys(req, resp, deviceIds, keys, null, remoteType); } }
KeyController implements ViewConstants { @RequestMapping(method = { RequestMethod.POST }, value = "/directtune") @ResponseBody public void directTune(HttpServletRequest req, HttpServletResponse resp, @RequestParam(value = "deviceIds[]") String[] deviceIds, @RequestParam String channelNum, @RequestParam(required = false) String remoteType) throws KeyException, InterruptedException { Key[] keys = Key.keysForChannel(channelNum); sendKeys(req, resp, deviceIds, keys, null, remoteType); }  }
KeyController implements ViewConstants { @RequestMapping(method = { RequestMethod.POST }, value = "/directtune") @ResponseBody public void directTune(HttpServletRequest req, HttpServletResponse resp, @RequestParam(value = "deviceIds[]") String[] deviceIds, @RequestParam String channelNum, @RequestParam(required = false) String remoteType) throws KeyException, InterruptedException { Key[] keys = Key.keysForChannel(channelNum); sendKeys(req, resp, deviceIds, keys, null, remoteType); }  @RequestMapping(method = { RequestMethod.POST }, value = "/sendKey") @ResponseBody void sendKey(HttpServletRequest req, HttpServletResponse resp,
            @RequestParam(value="deviceIds[]") String[] deviceIds, @RequestParam String key, @RequestParam(required = false) String remoteType); @RequestMapping(method = {RequestMethod.POST }, value = "/holdKey") @ResponseBody void holdKey(HttpServletRequest req, HttpServletResponse resp, 
            @RequestParam(value="deviceIds[]") String[] deviceIds, @RequestParam String key, @RequestParam String holdTime, @RequestParam(required = false) String remoteType); @RequestMapping(method = { RequestMethod.POST }, value = "/directtune") @ResponseBody void directTune(HttpServletRequest req, HttpServletResponse resp,
            @RequestParam(value = "deviceIds[]") String[] deviceIds,
            @RequestParam String channelNum,
            @RequestParam(required = false) String remoteType); }
KeyController implements ViewConstants { @RequestMapping(method = { RequestMethod.POST }, value = "/directtune") @ResponseBody public void directTune(HttpServletRequest req, HttpServletResponse resp, @RequestParam(value = "deviceIds[]") String[] deviceIds, @RequestParam String channelNum, @RequestParam(required = false) String remoteType) throws KeyException, InterruptedException { Key[] keys = Key.keysForChannel(channelNum); sendKeys(req, resp, deviceIds, keys, null, remoteType); }  @RequestMapping(method = { RequestMethod.POST }, value = "/sendKey") @ResponseBody void sendKey(HttpServletRequest req, HttpServletResponse resp,
            @RequestParam(value="deviceIds[]") String[] deviceIds, @RequestParam String key, @RequestParam(required = false) String remoteType); @RequestMapping(method = {RequestMethod.POST }, value = "/holdKey") @ResponseBody void holdKey(HttpServletRequest req, HttpServletResponse resp, 
            @RequestParam(value="deviceIds[]") String[] deviceIds, @RequestParam String key, @RequestParam String holdTime, @RequestParam(required = false) String remoteType); @RequestMapping(method = { RequestMethod.POST }, value = "/directtune") @ResponseBody void directTune(HttpServletRequest req, HttpServletResponse resp,
            @RequestParam(value = "deviceIds[]") String[] deviceIds,
            @RequestParam String channelNum,
            @RequestParam(required = false) String remoteType);  }