1 package org.onosproject.incubator.net.tunnel;
3 import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
6 import org.onlab.packet.IpAddress;
7 import org.onosproject.core.DefaultGroupId;
8 import org.onosproject.net.provider.ProviderId;
10 import com.google.common.testing.EqualsTester;
13 * Test of the default tunnel model entity.
15 public class DefaultTunnelTest {
17 * Checks that the Order class is immutable.
20 public void testImmutability() {
21 assertThatClassIsImmutable(DefaultTunnel.class);
25 public void testEquality() {
26 TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
28 TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
30 DefaultGroupId groupId = new DefaultGroupId(92034);
31 TunnelName tunnelName = TunnelName.tunnelName("TunnelName");
32 TunnelId tunnelId = TunnelId.valueOf(41654654);
33 ProviderId producerName1 = new ProviderId("producer1", "13");
34 ProviderId producerName2 = new ProviderId("producer2", "13");
35 Tunnel p1 = new DefaultTunnel(producerName1, src, dst, Tunnel.Type.VXLAN,
36 Tunnel.State.ACTIVE, groupId, tunnelId,
38 Tunnel p2 = new DefaultTunnel(producerName1, src, dst, Tunnel.Type.VXLAN,
39 Tunnel.State.ACTIVE, groupId, tunnelId,
41 Tunnel p3 = new DefaultTunnel(producerName2, src, dst, Tunnel.Type.OCH,
42 Tunnel.State.ACTIVE, groupId, tunnelId,
44 new EqualsTester().addEqualityGroup(p1, p2).addEqualityGroup(p3)