Committed by
Gerrit Code Review
Unit tests for OpenFlowControllerImplTest
Change-Id: I8a6d68f66e5a96597c4a0793940c3f707837f555
Showing
3 changed files
with
14 additions
and
2 deletions
... | @@ -41,6 +41,9 @@ import org.projectfloodlight.openflow.protocol.OFVersion; | ... | @@ -41,6 +41,9 @@ import org.projectfloodlight.openflow.protocol.OFVersion; |
41 | * Testing adapter for the OpenFlow switch driver class. | 41 | * Testing adapter for the OpenFlow switch driver class. |
42 | */ | 42 | */ |
43 | public class OpenflowSwitchDriverAdapter implements OpenFlowSwitchDriver { | 43 | public class OpenflowSwitchDriverAdapter implements OpenFlowSwitchDriver { |
44 | + | ||
45 | + RoleState role = RoleState.MASTER; | ||
46 | + | ||
44 | @Override | 47 | @Override |
45 | public void setAgent(OpenFlowAgent agent) { | 48 | public void setAgent(OpenFlowAgent agent) { |
46 | 49 | ||
... | @@ -218,12 +221,12 @@ public class OpenflowSwitchDriverAdapter implements OpenFlowSwitchDriver { | ... | @@ -218,12 +221,12 @@ public class OpenflowSwitchDriverAdapter implements OpenFlowSwitchDriver { |
218 | 221 | ||
219 | @Override | 222 | @Override |
220 | public void setRole(RoleState role) { | 223 | public void setRole(RoleState role) { |
221 | - | 224 | + this.role = role; |
222 | } | 225 | } |
223 | 226 | ||
224 | @Override | 227 | @Override |
225 | public RoleState getRole() { | 228 | public RoleState getRole() { |
226 | - return null; | 229 | + return role; |
227 | } | 230 | } |
228 | 231 | ||
229 | @Override | 232 | @Override | ... | ... |
openflow/ctl/src/test/java/org/onosproject/openflow/controller/impl/OpenFlowControllerImplTest.java
0 → 100644
This diff is collapsed. Click to expand it.
... | @@ -63,6 +63,15 @@ | ... | @@ -63,6 +63,15 @@ |
63 | <version>1.3</version> | 63 | <version>1.3</version> |
64 | <scope>test</scope> | 64 | <scope>test</scope> |
65 | </dependency> | 65 | </dependency> |
66 | + <dependency> | ||
67 | + <groupId>org.easymock</groupId> | ||
68 | + <artifactId>easymock</artifactId> | ||
69 | + <scope>test</scope> | ||
70 | + </dependency> | ||
71 | + <dependency> | ||
72 | + <groupId>org.osgi</groupId> | ||
73 | + <artifactId>org.osgi.core</artifactId> | ||
74 | + </dependency> | ||
66 | </dependencies> | 75 | </dependencies> |
67 | 76 | ||
68 | <build> | 77 | <build> | ... | ... |
-
Please register or login to post a comment