Ray Milkey
Committed by Gerrit Code Review

Unit tests for flow objective manager

Change-Id: I2f4e3084493174fcff7d64d2da1806b7b811b41f
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +package org.onosproject.net.behaviour;
17 +
18 +import org.onosproject.net.DeviceId;
19 +import org.onosproject.net.driver.DriverData;
20 +import org.onosproject.net.driver.DriverHandler;
21 +import org.onosproject.net.flowobjective.FilteringObjective;
22 +import org.onosproject.net.flowobjective.ForwardingObjective;
23 +import org.onosproject.net.flowobjective.NextObjective;
24 +
25 +/**
26 + * Testing adapter for pipeliner class.
27 + */
28 +public class PipelinerAdapter implements Pipeliner {
29 + @Override
30 + public void init(DeviceId deviceId, PipelinerContext context) {
31 +
32 + }
33 +
34 + @Override
35 + public void filter(FilteringObjective filterObjective) {
36 +
37 + }
38 +
39 + @Override
40 + public void forward(ForwardingObjective forwardObjective) {
41 +
42 + }
43 +
44 + @Override
45 + public void next(NextObjective nextObjective) {
46 +
47 + }
48 +
49 + @Override
50 + public DriverHandler handler() {
51 + return null;
52 + }
53 +
54 + @Override
55 + public void setHandler(DriverHandler handler) {
56 +
57 + }
58 +
59 + @Override
60 + public DriverData data() {
61 + return null;
62 + }
63 +
64 + @Override
65 + public void setData(DriverData data) {
66 +
67 + }
68 +}
...@@ -80,6 +80,14 @@ ...@@ -80,6 +80,14 @@
80 </dependency> 80 </dependency>
81 81
82 <dependency> 82 <dependency>
83 + <groupId>org.onosproject</groupId>
84 + <artifactId>onos-of-ctl</artifactId>
85 + <scope>test</scope>
86 + <classifier>tests</classifier>
87 + <version>${project.version}</version>
88 + </dependency>
89 +
90 + <dependency>
83 <groupId>org.easymock</groupId> 91 <groupId>org.easymock</groupId>
84 <artifactId>easymock</artifactId> 92 <artifactId>easymock</artifactId>
85 <scope>test</scope> 93 <scope>test</scope>
......
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +package org.onosproject.net.flowobjective.impl;
17 +
18 +import org.onosproject.net.behaviour.NextGroup;
19 +import org.onosproject.net.flowobjective.FlowObjectiveStore;
20 +import org.onosproject.net.flowobjective.FlowObjectiveStoreDelegate;
21 +
22 +/**
23 + * Test adapter for the flow objective store API.
24 + */
25 +public class FlowObjectiveStoreAdapter implements FlowObjectiveStore {
26 + @Override
27 + public void putNextGroup(Integer nextId, NextGroup group) {
28 +
29 + }
30 +
31 + @Override
32 + public NextGroup getNextGroup(Integer nextId) {
33 + return null;
34 + }
35 +
36 + @Override
37 + public NextGroup removeNextGroup(Integer nextId) {
38 + return null;
39 + }
40 +
41 + @Override
42 + public int allocateNextId() {
43 + return 0;
44 + }
45 +
46 + @Override
47 + public void setDelegate(FlowObjectiveStoreDelegate delegate) {
48 +
49 + }
50 +
51 + @Override
52 + public void unsetDelegate(FlowObjectiveStoreDelegate delegate) {
53 +
54 + }
55 +
56 + @Override
57 + public boolean hasDelegate() {
58 + return false;
59 + }
60 +}