P4Runtime unit tests for api, ctl, model modules

Change-Id: Iac1b1ef6e274c355ce3a26cffbd8adcb39694f69
diff --git a/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4ActionParamModelTest.java b/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4ActionParamModelTest.java
new file mode 100644
index 0000000..035465c
--- /dev/null
+++ b/protocols/p4runtime/model/src/test/java/org/onosproject/p4runtime/model/P4ActionParamModelTest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.p4runtime.model;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+import org.onosproject.net.pi.model.PiActionParamId;
+
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
+
+/**
+ * Test for P4ActionParamModel class.
+ */
+public class P4ActionParamModelTest {
+    private final PiActionParamId piActionParamId = PiActionParamId.of("port");
+    private final PiActionParamId sameAsPiActionParamId = PiActionParamId.of("port");
+    private final PiActionParamId piActionParamId2 = PiActionParamId.of("dstAddr");
+
+    private static final int BIT_WIDTH_32 = 32;
+    private static final int BIT_WIDTH_64 = 64;
+
+    private final P4ActionParamModel actionParamModel = new P4ActionParamModel(piActionParamId, BIT_WIDTH_32);
+
+    private final P4ActionParamModel sameAsActionParamModel = new P4ActionParamModel(sameAsPiActionParamId,
+                                                                                     BIT_WIDTH_32);
+
+    private final P4ActionParamModel actionParamModel2 = new P4ActionParamModel(piActionParamId2, BIT_WIDTH_32);
+
+    private final P4ActionParamModel actionParamModel3 = new P4ActionParamModel(piActionParamId, BIT_WIDTH_64);
+
+
+
+    /**
+     * Checks that the P4CounterModel class is immutable.
+     */
+    @Test
+    public void testImmutability() {
+        assertThatClassIsImmutable(P4ActionParamModel.class);
+    }
+
+    /**
+     * Checks the operation of equals(), hashCode() and toString() methods.
+     */
+    @Test
+    public void testEquals() {
+        new EqualsTester()
+                .addEqualityGroup(actionParamModel, sameAsActionParamModel)
+                .addEqualityGroup(actionParamModel2)
+                .addEqualityGroup(actionParamModel3)
+                .testEquals();
+    }
+}
\ No newline at end of file