Lines Matching refs:lp
247 private void assertAllRoutesHaveInterface(String iface, LinkProperties lp) {
248 for (RouteInfo r : lp.getRoutes()) {
260 LinkProperties lp = new LinkProperties();
262 assertTrue(lp.addRoute(r));
263 assertEquals(1, lp.getRoutes().size());
264 assertAllRoutesHaveInterface(null, lp);
267 assertFalse(lp.addRoute(r));
268 assertEquals(1, lp.getRoutes().size());
273 lp.addRoute(r);
278 lp.setInterfaceName("rmnet0");
279 assertAllRoutesHaveInterface("rmnet0", lp);
283 lp.addRoute(r);
289 lp.setInterfaceName("wlan0");
290 lp.addRoute(r);
291 assertEquals(2, lp.getRoutes().size());
292 assertAllRoutesHaveInterface("wlan0", lp);
296 lp.addRoute(r);
297 assertEquals(3, lp.getRoutes().size());
298 assertAllRoutesHaveInterface("wlan0", lp);
301 LinkProperties lp2 = new LinkProperties(lp);
302 assertAllRoutesHaveInterface("wlan0", lp);
303 assertEquals(0, lp.compareAllRoutes(lp2).added.size());
304 assertEquals(0, lp.compareAllRoutes(lp2).removed.size());
308 assertEquals(3, lp.compareAllRoutes(lp2).added.size());
309 assertEquals(3, lp.compareAllRoutes(lp2).removed.size());
364 private LinkAddress getFirstLinkAddress(LinkProperties lp) {
365 return lp.getLinkAddresses().iterator().next();
370 LinkProperties lp = new LinkProperties();
373 assertFalse(lp.hasIPv4Address());
374 assertFalse(lp.hasGlobalIPv6Address());
379 lp.addStackedLink(stacked);
384 assertFalse(lp.hasIPv4Address());
385 assertFalse(lp.hasGlobalIPv6Address());
386 lp.removeStackedLink("stacked");
387 assertFalse(lp.hasIPv4Address());
388 assertFalse(lp.hasGlobalIPv6Address());
393 assertEquals(0, lp.getLinkAddresses().size());
394 assertTrue(lp.addLinkAddress(LINKADDRV6));
395 assertEquals(1, lp.getLinkAddresses().size());
396 assertFalse(lp.hasIPv4Address());
397 assertTrue(lp.hasGlobalIPv6Address());
399 assertTrue(lp.removeLinkAddress(LINKADDRV6));
400 assertEquals(0, lp.getLinkAddresses().size());
402 assertTrue(lp.addLinkAddress(LINKADDRV6LINKLOCAL));
403 assertEquals(1, lp.getLinkAddresses().size());
404 assertFalse(lp.hasGlobalIPv6Address());
406 assertTrue(lp.addLinkAddress(LINKADDRV4));
407 assertEquals(2, lp.getLinkAddresses().size());
408 assertTrue(lp.hasIPv4Address());
409 assertFalse(lp.hasGlobalIPv6Address());
411 assertTrue(lp.addLinkAddress(LINKADDRV6));
412 assertEquals(3, lp.getLinkAddresses().size());
413 assertTrue(lp.hasIPv4Address());
414 assertTrue(lp.hasGlobalIPv6Address());
416 assertTrue(lp.removeLinkAddress(LINKADDRV6LINKLOCAL));
417 assertEquals(2, lp.getLinkAddresses().size());
418 assertTrue(lp.hasIPv4Address());
419 assertTrue(lp.hasGlobalIPv6Address());
423 assertFalse(lp.addLinkAddress(LINKADDRV4));
424 assertEquals(2, lp.getLinkAddresses().size());
425 assertTrue(lp.hasIPv4Address());
426 assertTrue(lp.removeLinkAddress(LINKADDRV4));
427 assertEquals(1, lp.getLinkAddresses().size());
428 assertFalse(lp.hasIPv4Address());
429 assertFalse(lp.removeLinkAddress(LINKADDRV4));
430 assertEquals(1, lp.getLinkAddresses().size());
435 assertEquals(1, lp.getLinkAddresses().size());
436 assertEquals(LINKADDRV6, getFirstLinkAddress(lp));
445 assertTrue(lp.addLinkAddress(deprecated));
446 assertEquals(1, lp.getLinkAddresses().size());
447 assertEquals(deprecated, getFirstLinkAddress(lp));
448 assertFalse(LINKADDRV6.equals(getFirstLinkAddress(lp)));
451 assertTrue(lp.removeLinkAddress(LINKADDRV6));
452 assertEquals(0, lp.getLinkAddresses().size());
457 LinkProperties lp = new LinkProperties();
458 lp.addLinkAddress(LINKADDRV4);
459 lp.addLinkAddress(LINKADDRV6);
464 assertFalse(lp.equals(lp2));
466 lp2.setLinkAddresses(lp.getLinkAddresses());
467 assertTrue(lp.equals(lp));