@Override public long getId() { return MacAddress.getMacAddress().toLong(); }
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { _agentManager.registerForInitialConnects(this, false); if (_nodeId == -1) { // FIXME: We really should not do this like this. It should be done // at config time and is stored as a config variable. _nodeId = MacAddress.getMacAddress().toLong(); } return true; }
@Test public final void testMacAddressLong() throws Exception { MacAddress mac = new MacAddress(1L); assertEquals(1L,mac.toLong()); }
@Test public final void testMacAddressToLong() throws Exception { // TODO this test should fail this address is beyond the acceptable range for macaddresses MacAddress mac = new MacAddress(Long.MAX_VALUE); assertEquals(Long.MAX_VALUE,mac.toLong()); System.out.println(mac.toString()); }
@Test public final void testMacAddress() throws Exception { MacAddress mac = new MacAddress(); assertEquals(0L,mac.toLong()); }
@Test public final void testMacAddress() throws Exception { final MacAddress mac = new MacAddress(); assertEquals(0L, mac.toLong()); }
@Test public final void testMacAddressLong() throws Exception { final MacAddress mac = new MacAddress(1L); assertEquals(1L, mac.toLong()); }
@Test public final void testMacAddressToLong() throws Exception { // TODO this test should fail this address is beyond the acceptable range for macaddresses final MacAddress mac = new MacAddress(Long.MAX_VALUE); assertEquals(Long.MAX_VALUE, mac.toLong()); System.out.println(mac.toString()); }