@Test public void test_register() throws MalformedURLException { IpCamDeviceRegistry.register("test 01", "http: Assert.assertEquals(1, Webcam.getWebcams().size()); IpCamDeviceRegistry.register("test 02", "http: IpCamDeviceRegistry.register("test 03", "http: IpCamDeviceRegistry.register("test 04", "http: IpCamDeviceRegistry.register("test 05", "http: Assert.assertEquals(5, Webcam.getWebcams().size()); }
public static IpCamDevice register(IpCamDevice ipcam) { for (WebcamDevice d : DEVICES) { String name = ipcam.getName(); if (d.getName().equals(name)) { throw new WebcamException(String.format("Webcam with name '%s' is already registered", name)); } } DEVICES.add(ipcam); rescan(); return ipcam; }
IpCamDeviceRegistry { public static IpCamDevice register(IpCamDevice ipcam) { for (WebcamDevice d : DEVICES) { String name = ipcam.getName(); if (d.getName().equals(name)) { throw new WebcamException(String.format("Webcam with name '%s' is already registered", name)); } } DEVICES.add(ipcam); rescan(); return ipcam; } }
IpCamDeviceRegistry { public static IpCamDevice register(IpCamDevice ipcam) { for (WebcamDevice d : DEVICES) { String name = ipcam.getName(); if (d.getName().equals(name)) { throw new WebcamException(String.format("Webcam with name '%s' is already registered", name)); } } DEVICES.add(ipcam); rescan(); return ipcam; }  }
IpCamDeviceRegistry { public static IpCamDevice register(IpCamDevice ipcam) { for (WebcamDevice d : DEVICES) { String name = ipcam.getName(); if (d.getName().equals(name)) { throw new WebcamException(String.format("Webcam with name '%s' is already registered", name)); } } DEVICES.add(ipcam); rescan(); return ipcam; }  static IpCamDevice register(IpCamDevice ipcam); static IpCamDevice register(String name, String url, IpCamMode mode); static IpCamDevice register(String name, URL url, IpCamMode mode); static IpCamDevice register(String name, String url, IpCamMode mode, IpCamAuth auth); static IpCamDevice register(String name, URL url, IpCamMode mode, IpCamAuth auth); static boolean isRegistered(IpCamDevice ipcam); static boolean isRegistered(String name); static boolean isRegistered(URL url); static boolean isRegistered(URI uri); static boolean unregister(IpCamDevice ipcam); static boolean unregister(String name); static List<IpCamDevice> getIpCameras(); static void unregisterAll(); }
IpCamDeviceRegistry { public static IpCamDevice register(IpCamDevice ipcam) { for (WebcamDevice d : DEVICES) { String name = ipcam.getName(); if (d.getName().equals(name)) { throw new WebcamException(String.format("Webcam with name '%s' is already registered", name)); } } DEVICES.add(ipcam); rescan(); return ipcam; }  static IpCamDevice register(IpCamDevice ipcam); static IpCamDevice register(String name, String url, IpCamMode mode); static IpCamDevice register(String name, URL url, IpCamMode mode); static IpCamDevice register(String name, String url, IpCamMode mode, IpCamAuth auth); static IpCamDevice register(String name, URL url, IpCamMode mode, IpCamAuth auth); static boolean isRegistered(IpCamDevice ipcam); static boolean isRegistered(String name); static boolean isRegistered(URL url); static boolean isRegistered(URI uri); static boolean unregister(IpCamDevice ipcam); static boolean unregister(String name); static List<IpCamDevice> getIpCameras(); static void unregisterAll();  }