1 package org.onosproject.incubator.net.tunnel;
3 import static org.hamcrest.MatcherAssert.assertThat;
4 import static org.hamcrest.Matchers.is;
5 import static org.hamcrest.Matchers.notNullValue;
6 import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
9 import org.onlab.packet.IpAddress;
10 import org.onosproject.core.DefaultGroupId;
11 import org.onosproject.net.provider.ProviderId;
14 * Test of a tunnel event.
16 public class TunnelEventTest {
18 * Checks that the Order class is immutable.
21 public void testImmutability() {
22 assertThatClassIsImmutable(TunnelEvent.class);
26 * Checks the operation of equals(), hashCode() and toString() methods.
29 public void testConstructor() {
30 TunnelEndPoint src = IpTunnelEndPoint.ipTunnelPoint(IpAddress
32 TunnelEndPoint dst = IpTunnelEndPoint.ipTunnelPoint(IpAddress
34 DefaultGroupId groupId = new DefaultGroupId(92034);
35 TunnelName tunnelName = TunnelName.tunnelName("TunnelName");
36 TunnelId tunnelId = TunnelId.valueOf(41654654);
37 ProviderId producerName1 = new ProviderId("producer1", "13");
38 Tunnel p1 = new DefaultTunnel(producerName1, src, dst, Tunnel.Type.VXLAN,
39 Tunnel.State.ACTIVE, groupId, tunnelId,
41 TunnelEvent e1 = new TunnelEvent(TunnelEvent.Type.TUNNEL_ADDED, p1);
42 assertThat(e1, is(notNullValue()));
43 assertThat(e1.type(), is(TunnelEvent.Type.TUNNEL_ADDED));
44 assertThat(e1.subject(), is(p1));