RemoteManager { @PostConstruct public void load() throws IOException { loadKeySets(); loadRemotes(); }  @PostConstruct void load(); void loadRemotes(); void loadKeySets(); void loadRemotes(InputStream is); void loadKeySets(InputStream is); Remote getRemote(String remoteType); Collection<Remote> getRemotes(); Set<String> getRemoteTypes(); Set<String> getKeySet(String remoteType); void addRemoteTypeToRemote(String remoteId, String remoteType); static final String DEFAULT_REMOTE_TYPE; static final String KEY_SETS_FILE; static final String REMOTES_FILE; }
@Test public void testLoad() throws IOException { RemoteManager rMan = new RemoteManager(); rMan.load(); Collection<Remote> remotes = rMan.getRemotes(); Assert.assertNotNull(remotes); Assert.assertFalse(remotes.isEmpty()); Remote motorolaRemote = rMan.getRemote("MOTOROLA"); Assert.assertNotNull(motorolaRemote); Assert.assertEquals(motorolaRemote.getName(), "MOTOROLA"); Assert.assertEquals(motorolaRemote.getImageSubpath(), "motorola"); KeySet ks = motorolaRemote.getKeySet(); Assert.assertNotNull(ks); Assert.assertTrue(ks.getName().contains("MOTOROLA")); Set<Key> keys = motorolaRemote.getKeys(); Assert.assertTrue(keys.contains(Key.GUIDE)); Remote genericRemote = rMan.getRemote("GENERIC"); Assert.assertNotNull(genericRemote); Assert.assertEquals(genericRemote.getName(), "GENERIC"); Assert.assertEquals(genericRemote.getImageSubpath(), "generic"); ks = genericRemote.getKeySet(); Assert.assertNotNull(ks); Assert.assertFalse(ks.getName().contains("GENERIC")); keys = genericRemote.getKeys(); Assert.assertTrue(keys.contains(Key.GUIDE)); }