ONOS-7066 ONOS-7067 PI abstractions refactoring and P4Info model parser
Includes changes previously reviewed in #15607, #15877, and #15955.
Change-Id: Ie2ff62e415f2099832ebfe05961a879b7b188fc3
diff --git a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiTableIdTest.java b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiTableIdTest.java
index d343cd7..eb1de71 100644
--- a/core/api/src/test/java/org/onosproject/net/pi/runtime/PiTableIdTest.java
+++ b/core/api/src/test/java/org/onosproject/net/pi/runtime/PiTableIdTest.java
@@ -18,6 +18,7 @@
import com.google.common.testing.EqualsTester;
import org.junit.Test;
+import org.onosproject.net.pi.model.PiTableId;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
@@ -28,16 +29,12 @@
* Unit tests for PiTableId class.
*/
public class PiTableIdTest {
- final String table10 = "table10";
- final String table20 = "table20";
- final PiTableId piTableId1 = PiTableId.of(table10);
- final PiTableId sameAsPiTableId1 = PiTableId.of(table10);
- final PiTableId piTableId2 = PiTableId.of(table20);
+ private final String table10 = "table10";
+ private final String table20 = "table20";
+ private final PiTableId piTableId1 = PiTableId.of(table10);
+ private final PiTableId sameAsPiTableId1 = PiTableId.of(table10);
+ private final PiTableId piTableId2 = PiTableId.of(table20);
- final String tableScope = "local";
- final PiTableId piTableIdWithScope1 = PiTableId.of(tableScope, table10);
- final PiTableId sameAsPiTableIdWithScope1 = PiTableId.of(tableScope, table10);
- final PiTableId piTableIdWithScope2 = PiTableId.of(tableScope, table20);
/**
* Checks that the PiTableId class is immutable.
*/
@@ -58,37 +55,11 @@
}
/**
- * Checks the operation of equals(), hashCode() and toString() methods.
- */
- @Test
- public void testEqualsWithScope() {
- new EqualsTester()
- .addEqualityGroup(piTableIdWithScope1, sameAsPiTableIdWithScope1)
- .addEqualityGroup(piTableIdWithScope2)
- .testEquals();
- }
-
- /**
* Checks the construction of a PiTableId object.
*/
@Test
public void testConstruction() {
- final String name = "table1";
- final PiTableId piTableId = PiTableId.of(name);
- assertThat(piTableId, is(notNullValue()));
- assertThat(piTableId.name(), is(name));
- }
-
- /**
- * Checks the construction of a PiTableId object.
- */
- @Test
- public void testConstructionWithScope() {
- final String name = "table1";
- final String scope = "local";
- final PiTableId piTableId = PiTableId.of(scope, name);
- assertThat(piTableId, is(notNullValue()));
- assertThat(piTableId.name(), is(name));
- assertThat(piTableId.scope().get(), is(scope));
+ assertThat(piTableId1, is(notNullValue()));
+ assertThat(piTableId1.id(), is(table10));
}
}