@Test public void setInterface() throws Exception { service.setInterface(ifName); Assert.assertEquals("Expected " + ifName + ", got", ifName, service.getInterface()); service.addRouteForCurrentService(); service.setInterface(ifName); Assert.assertEquals("Expected " + ifName + ", got", ifName, service.getInterface()); service.setInterface("eth0"); Assert.assertEquals("Expected \"eth0\", got", "eth0", service.getInterface()); }
@Override public synchronized Routing setInterface(String inf) { if (Objects.requireNonNull(inf).equals(interfaceName)) { return this; } interfaceName = inf; return this; }
LinuxRoutingService implements Routing { @Override public synchronized Routing setInterface(String inf) { if (Objects.requireNonNull(inf).equals(interfaceName)) { return this; } interfaceName = inf; return this; } }
LinuxRoutingService implements Routing { @Override public synchronized Routing setInterface(String inf) { if (Objects.requireNonNull(inf).equals(interfaceName)) { return this; } interfaceName = inf; return this; } LinuxRoutingService(SystemCall systemCall, RoutingDefinition initializer); }
LinuxRoutingService implements Routing { @Override public synchronized Routing setInterface(String inf) { if (Objects.requireNonNull(inf).equals(interfaceName)) { return this; } interfaceName = inf; return this; } LinuxRoutingService(SystemCall systemCall, RoutingDefinition initializer); String executeCommand(String command); int executeCommandRC(String command); @Override synchronized Routing setInterface(String inf); @Override Routing setNetmask(final IpAddress netmask); @Override IpAddress getNetmask(); @Override synchronized String getInterface(); @Override synchronized IpAddress getVirtualIp(); @Override synchronized boolean isActive(); @Override synchronized boolean removeRouteForCurrentService(); @Override synchronized boolean addRouteForCurrentService(); @Override boolean updateArpTableForCurrentService(); @Override String toString(); }
LinuxRoutingService implements Routing { @Override public synchronized Routing setInterface(String inf) { if (Objects.requireNonNull(inf).equals(interfaceName)) { return this; } interfaceName = inf; return this; } LinuxRoutingService(SystemCall systemCall, RoutingDefinition initializer); String executeCommand(String command); int executeCommandRC(String command); @Override synchronized Routing setInterface(String inf); @Override Routing setNetmask(final IpAddress netmask); @Override IpAddress getNetmask(); @Override synchronized String getInterface(); @Override synchronized IpAddress getVirtualIp(); @Override synchronized boolean isActive(); @Override synchronized boolean removeRouteForCurrentService(); @Override synchronized boolean addRouteForCurrentService(); @Override boolean updateArpTableForCurrentService(); @Override String toString();  }