diff --git a/apps/t3/src/test/org/onosproject/t3/impl/T3TestObjects.java b/apps/t3/src/test/java/org/onosproject/t3/impl/T3TestObjects.java similarity index 97% rename from apps/t3/src/test/org/onosproject/t3/impl/T3TestObjects.java rename to apps/t3/src/test/java/org/onosproject/t3/impl/T3TestObjects.java index 8a3f6eb6ec..ff44e43bae 100644 --- a/apps/t3/src/test/org/onosproject/t3/impl/T3TestObjects.java +++ b/apps/t3/src/test/java/org/onosproject/t3/impl/T3TestObjects.java @@ -50,6 +50,10 @@ import org.onosproject.net.provider.ProviderId; */ final class T3TestObjects { + private T3TestObjects(){ + //banning construction + } + private static final String HOST_ONE_MAC = "00:00:00:00:00:01"; private static final String HOST_TWO_MAC = "00:00:00:00:00:02"; private static final String HOST_ONE_VLAN = "None"; @@ -221,7 +225,8 @@ final class T3TestObjects { private static final GroupBuckets BUCKETS_MULTIPLE = new GroupBuckets(ImmutableList.of(BUCKET, BUCKET_2)); - static final Group TOPO_GROUP = new DefaultGroup(TOPO_GROUP_ID, TOPO_GROUP_FLOW_DEVICE, Group.Type.SELECT, BUCKETS_MULTIPLE); + static final Group TOPO_GROUP = new DefaultGroup(TOPO_GROUP_ID, TOPO_GROUP_FLOW_DEVICE, + Group.Type.SELECT, BUCKETS_MULTIPLE); static final FlowEntry TOPO_SECOND_INPUT_FLOW_ENTRY = new DefaultFlowEntry(TOPO_SECOND_INPUT_FLOW); @@ -231,7 +236,8 @@ final class T3TestObjects { static final ConnectPoint TOPO_FLOW_OUT_CP_1 = ConnectPoint.deviceConnectPoint(TOPO_GROUP_FLOW_DEVICE + "/" + 2); - protected static final ConnectPoint TOPO_FLOW_OUT_CP_2 = ConnectPoint.deviceConnectPoint(TOPO_GROUP_FLOW_DEVICE + "/" + 3); + protected static final ConnectPoint TOPO_FLOW_OUT_CP_2 = + ConnectPoint.deviceConnectPoint(TOPO_GROUP_FLOW_DEVICE + "/" + 3); static final ConnectPoint TOPO_FLOW_4_IN_CP = ConnectPoint.deviceConnectPoint(TOPO_FLOW_4_DEVICE + "/" + 1); @@ -303,6 +309,7 @@ final class T3TestObjects { static final TrafficSelector PACKET_OK = DefaultTrafficSelector.builder() .matchInPort(PortNumber.portNumber(1)) + .matchEthType(EthType.EtherType.IPV4.ethType().toShort()) .matchIPSrc(IpPrefix.valueOf("127.0.0.1/32")) .matchIPDst(IpPrefix.valueOf("127.0.0.2/32")) .build(); diff --git a/apps/t3/src/test/org/onosproject/t3/impl/TroubleshootManagerTest.java b/apps/t3/src/test/java/org/onosproject/t3/impl/TroubleshootManagerTest.java similarity index 97% rename from apps/t3/src/test/org/onosproject/t3/impl/TroubleshootManagerTest.java rename to apps/t3/src/test/java/org/onosproject/t3/impl/TroubleshootManagerTest.java index 0417fafc26..28ab5b2b12 100644 --- a/apps/t3/src/test/org/onosproject/t3/impl/TroubleshootManagerTest.java +++ b/apps/t3/src/test/java/org/onosproject/t3/impl/TroubleshootManagerTest.java @@ -28,7 +28,6 @@ import org.onosproject.net.DefaultLink; import org.onosproject.net.DeviceId; import org.onosproject.net.Host; import org.onosproject.net.Link; -import org.onosproject.net.device.DeviceServiceAdapter; import org.onosproject.net.driver.DefaultDriver; import org.onosproject.net.driver.Driver; import org.onosproject.net.driver.DriverServiceAdapter; @@ -84,7 +83,7 @@ public class TroubleshootManagerTest { } /** - * Tests failure on device with no flows + * Tests failure on device with no flows. */ @Test public void noFlows() { @@ -113,7 +112,8 @@ public class TroubleshootManagerTest { //Test Success - StaticPacketTrace traceSuccess = testSuccess(PACKET_OK, DUAL_FLOW_IN_CP, DUAL_FLOW_DEVICE, DUAL_FLOW_OUT_CP, 1); + StaticPacketTrace traceSuccess = testSuccess(PACKET_OK, DUAL_FLOW_IN_CP, DUAL_FLOW_DEVICE, + DUAL_FLOW_OUT_CP, 1); //Testing Vlan Criterion criterion = traceSuccess.getGroupOuputs(DUAL_FLOW_DEVICE).get(0). @@ -135,7 +135,8 @@ public class TroubleshootManagerTest { @Test public void flowAndGroup() throws Exception { - StaticPacketTrace traceSuccess = testSuccess(PACKET_OK, GROUP_FLOW_IN_CP, GROUP_FLOW_DEVICE, GROUP_FLOW_OUT_CP, 1); + StaticPacketTrace traceSuccess = testSuccess(PACKET_OK, GROUP_FLOW_IN_CP, GROUP_FLOW_DEVICE, + GROUP_FLOW_OUT_CP, 1); assertTrue("Wrong Output Group", traceSuccess.getGroupOuputs(GROUP_FLOW_DEVICE) .get(0).getGroups().contains(GROUP)); @@ -234,7 +235,7 @@ public class TroubleshootManagerTest { return ImmutableList.of(TOPO_SINGLE_FLOW_ENTRY, TOPO_SECOND_INPUT_FLOW_ENTRY); } else if (deviceId.equals(TOPO_GROUP_FLOW_DEVICE)) { return ImmutableList.of(TOPO_GROUP_FLOW_ENTRY); - } else if (deviceId.equals(HARDWARE_DEVICE)){ + } else if (deviceId.equals(HARDWARE_DEVICE)) { return ImmutableList.of(HARDWARE_ETH_FLOW_ENTRY, HARDWARE_FLOW_ENTRY); } return ImmutableList.of(); @@ -244,7 +245,7 @@ public class TroubleshootManagerTest { private class TestDriverService extends DriverServiceAdapter { @Override public Driver getDriver(DeviceId deviceId) { - if(deviceId.equals(HARDWARE_DEVICE)){ + if (deviceId.equals(HARDWARE_DEVICE)) { return new DefaultDriver("ofdpa", ImmutableList.of(), "test", "test", "test", new HashMap<>(), new HashMap<>()); }