[ONOS-2225] Add codecs with unit test for FlowObjective REST API
* Add codec for FilteringObjective
* Add codec for ForwardingObjective
* Add codec for NextObjective
Change-Id: I715aa7f1969697468692459052fd27cc65ca2363
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/FilteringObjective.json b/core/common/src/test/resources/org/onosproject/codec/impl/FilteringObjective.json
new file mode 100644
index 0000000..228e7b0
--- /dev/null
+++ b/core/common/src/test/resources/org/onosproject/codec/impl/FilteringObjective.json
@@ -0,0 +1,25 @@
+{
+ "priority": 60,
+ "isPermanent": "false",
+ "timeout": 1,
+ "type": "PERMIT",
+ "operation": "ADD",
+ "conditions": [
+ {
+ "type": "IN_PORT",
+ "port": 23
+ }
+ ],
+ "meta": {
+ "instructions": [
+ {
+ "type": "OUTPUT",
+ "port": -3
+ },
+ {
+ "type": "DROP"
+ }
+ ],
+ "deferred": []
+ }
+}
\ No newline at end of file
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/ForwardingObjective.json b/core/common/src/test/resources/org/onosproject/codec/impl/ForwardingObjective.json
new file mode 100644
index 0000000..f3f53d4
--- /dev/null
+++ b/core/common/src/test/resources/org/onosproject/codec/impl/ForwardingObjective.json
@@ -0,0 +1,24 @@
+{
+ "priority": 60,
+ "isPermanent": "false",
+ "timeout": 1,
+ "flag": "SPECIFIC",
+ "operation": "ADD",
+ "selector": {
+ "criteria": [
+ {
+ "type": "ETH_TYPE",
+ "ethType": "0x806"
+ }
+ ]
+ },
+ "treatment":
+ {
+ "instructions":
+ [
+ {"type":"OUTPUT","port":-3},
+ {"type":"DROP"}
+ ],
+ "deferred":[]
+ }
+}
\ No newline at end of file
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/NextObjective.json b/core/common/src/test/resources/org/onosproject/codec/impl/NextObjective.json
new file mode 100644
index 0000000..dad9b03
--- /dev/null
+++ b/core/common/src/test/resources/org/onosproject/codec/impl/NextObjective.json
@@ -0,0 +1,27 @@
+{
+ "id": 1,
+ "type": "FAILOVER",
+ "operation": "ADD",
+ "treatments": [
+ {
+ "instructions": [
+ {
+ "type": "OUTPUT",
+ "port": -3
+ },
+ {
+ "type": "DROP"
+ }
+ ],
+ "deferred": []
+ }
+ ],
+ "meta": {
+ "criteria": [
+ {
+ "type": "IN_PORT",
+ "port": 23
+ }
+ ]
+ }
+}
\ No newline at end of file