Package net.azib.ipscan.core.values

Examples of net.azib.ipscan.core.values.IntegerWithUnit


    if (!result.isAlive() && !config.scanDeadHosts) {
      // the host is dead, we are not going to continue...
      subject.abortAddressScanning();
    }
   
    return result.isAlive() ? new IntegerWithUnit(result.getAverageTime(), "ms") : null;
  }
View Full Code Here


    ScanningResultList scanningResults = new ScanningResultList(fetcherRegistry);
    scanningResults.initNewScan(mockFeeder("info"));
    ScanningResult result = scanningResults.createResult(InetAddress.getByName("127.0.0.1"));
    result.setValue(0, new InetAddressHolder(InetAddress.getByName("127.0.0.1")));
    result.setValue(1, "HOSTNAME");
    result.setValue(2, new IntegerWithUnit(10, "ms"));
    scanningResults.registerAtIndex(0, result);
   
    OpenerLauncher ol = new OpenerLauncher(fetcherRegistry, scanningResults);
   
    assertEquals("\\\\127.0.0.1", ol.prepareOpenerStringForItem("\\\\${fetcher.ip}", 0));
View Full Code Here

    assertTrue(comparator.compare(res("123"), res(123)) == 0);
    assertTrue(comparator.compare(res("ZZZ"), res(99)) > 0);
    assertTrue(comparator.compare(res("125"), res("13")) < 0);
    assertTrue(comparator.compare(res(125), res(13)) > 0);
   
    assertTrue(comparator.compare(res(new IntegerWithUnit(125, "ms")), res(new IntegerWithUnit(13, "ms"))) > 0);
  }
View Full Code Here

*/
public class IntegerWithUnitTest {
 
  @Test
  public void testIntValue() throws Exception {
    assertEquals(0, new IntegerWithUnit(0, "a").intValue());
    assertEquals(-1, new IntegerWithUnit(-1, "a").intValue());
    assertEquals(Integer.MAX_VALUE, new IntegerWithUnit(Integer.MAX_VALUE, "a").intValue());
  }
View Full Code Here

    assertEquals(Integer.MAX_VALUE, new IntegerWithUnit(Integer.MAX_VALUE, "a").intValue());
  }
 
  @Test
  public void testToString() throws Exception {
    assertEquals("151" + Labels.getLabel("unit.ms"), new IntegerWithUnit(151, "ms").toString());
  }
View Full Code Here

    assertEquals("151" + Labels.getLabel("unit.ms"), new IntegerWithUnit(151, "ms").toString());
  }

  @Test
  public void testEquals() throws Exception {
    assertTrue(new IntegerWithUnit(666, null).equals(new IntegerWithUnit(666, null)));
    assertTrue(new IntegerWithUnit(42, "a").equals(new IntegerWithUnit(42, "b")));
    assertFalse(new IntegerWithUnit(0, null).equals(null));
    assertFalse(new IntegerWithUnit(42, "a").equals(new IntegerWithUnit(43, "a")));
  }
View Full Code Here

    assertFalse(new IntegerWithUnit(42, "a").equals(new IntegerWithUnit(43, "a")));
  }
 
  @Test
  public void testHashCode() throws Exception {
    assertEquals(3, new IntegerWithUnit(3, null).hashCode());
    assertEquals(-31, new IntegerWithUnit(-31, null).hashCode());
  }
View Full Code Here

  }
 
  @Test
  public void testCompareTo() throws Exception {
    assertTrue(Comparable.class.isAssignableFrom(IntegerWithUnit.class));
    assertEquals(0, new IntegerWithUnit(1, null).compareTo(new IntegerWithUnit(1, null)));
    assertEquals(1, new IntegerWithUnit(123456789, null).compareTo(new IntegerWithUnit(123456, null)));
    assertEquals(-1, new IntegerWithUnit(12, null).compareTo(new IntegerWithUnit(123456, null)));
    assertEquals(1, new IntegerWithUnit(12, null).compareTo(null));
    IntegerWithUnit instance = new IntegerWithUnit(211082, null);
    assertEquals(0, instance.compareTo(instance));
  }
View Full Code Here

TOP

Related Classes of net.azib.ipscan.core.values.IntegerWithUnit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.