Example #1
0
 @Test
 public void testIsIPShouldFail() {
   String[] str = {"1.2.3.", ".2.3.", "1.2.3.q", ".2.3.1"};
   for (String s : str) {
     System.out.println(s);
     assertEquals(false, FormatCheck.isValidIP(s));
   }
 }
Example #2
0
 @Test
 public void testIsIPShouldPass() {
   String[] str = {"1.2.3.4", "112.45.233.4"};
   for (String s : str) {
     System.out.println(s);
     assertEquals(true, FormatCheck.isValidIP(s));
   }
 }