WakeOnLan { public static void sendWakeOnLan(String ipStr, String macStr) throws IllegalArgumentException, IOException { sendWakeOnLan(ipStr, macStr, DEFAULT_PORT, DEFAULT_TIMEOUT_MILLIS, DEFAULT_NO_PACKETS); } private  WakeOnLan(); static WakeOnLan onIp(String ipStr); static WakeOnLan onAddress(InetAddress inetAddress); WakeOnLan withMACAddress(String macStr); WakeOnLan setPort(int port); WakeOnLan setNoPackets(int noPackets); WakeOnLan setTimeout(int timeoutMillis); void wake(); void wake(final WakeOnLanListener wakeOnLanListener); static void sendWakeOnLan(String ipStr, String macStr); static void sendWakeOnLan(final String ipStr, final String macStr, final int port, final int timeoutMillis, final int packets); static void sendWakeOnLan(final InetAddress address, final String macStr, final int port, final int timeoutMillis, final int packets); static final int DEFAULT_PORT; static final int DEFAULT_TIMEOUT_MILLIS; static final int DEFAULT_NO_PACKETS; }
@Test(expected = IllegalArgumentException.class) public void testIllegalArgumentThrownOnInvalidPortHigh() throws Exception { WakeOnLan.sendWakeOnLan("192.168.0.1", "00:04:20:06:55:1a", 65536, 10000, 5); }
@Test(expected = IllegalArgumentException.class) public void testIllegalArgumentThrownOnInvalidPackets() throws Exception { WakeOnLan.sendWakeOnLan("192.168.0.1", "00:04:20:06:55:1a", 9, 10000, 0); }
@Test(expected = IllegalArgumentException.class) public void testIllegalArgumentThrownOnInvalidIPaddressStr() throws Exception { WakeOnLan.sendWakeOnLan((String)null, "00:04:20:06:55:1a", 9, 10000, 5); }
@Test(expected = IllegalArgumentException.class) public void testIllegalArgumentThrownOnInvalidIPaddress() throws Exception { WakeOnLan.sendWakeOnLan((InetAddress) null, "00:04:20:06:55:1a", 9, 10000, 5); }
@Test(expected = IllegalArgumentException.class) public void testIllegalArgumentThrownOnInvalidMACaddress() throws Exception { WakeOnLan.sendWakeOnLan("192.168.0.1", null, 9, 10000, 5); }
@Test(expected = IllegalArgumentException.class) public void testIllegalArgumentThrownOnInvalidPortLow() throws Exception { WakeOnLan.sendWakeOnLan("192.168.0.1", "00:04:20:06:55:1a", -1, 10000, 5); }