Skip to content
Snippets Groups Projects
Commit 569954cd authored by Ryan Izard's avatar Ryan Izard
Browse files

Fixed some unit test dependency issues where there are multiple @Before annotated methods.

parent f521b47b
No related branches found
No related tags found
No related merge requests found
...@@ -154,9 +154,9 @@ public class OFSwitchBaseTest { ...@@ -154,9 +154,9 @@ public class OFSwitchBaseTest {
switches.put(sw.getId(), sw); switches.put(sw.getId(), sw);
reset(switchManager); reset(switchManager);
//expect(switchManager.getSwitch(sw.getId())).andReturn(sw).anyTimes(); //expect(switchManager.getSwitch(sw.getId())).andReturn(sw).anyTimes();
setUpPorts();
} }
@Before
public void setUpPorts() { public void setUpPorts() {
OFPortDesc.Builder pdb = OFFactories.getFactory(OFVersion.OF_13).buildPortDesc(); OFPortDesc.Builder pdb = OFFactories.getFactory(OFVersion.OF_13).buildPortDesc();
// p1a is disabled // p1a is disabled
......
...@@ -92,7 +92,6 @@ public class OFChannelHandlerVer10Test { ...@@ -92,7 +92,6 @@ public class OFChannelHandlerVer10Test {
private Capture<IOFConnectionBackend> newConnection; private Capture<IOFConnectionBackend> newConnection;
private Capture<OFFeaturesReply> newFeaturesReply; private Capture<OFFeaturesReply> newFeaturesReply;
@Before
public void setUpFeaturesReply() { public void setUpFeaturesReply() {
portDesc = factory.buildPortDesc() portDesc = factory.buildPortDesc()
.setName("Eth1") .setName("Eth1")
...@@ -111,6 +110,7 @@ public class OFChannelHandlerVer10Test { ...@@ -111,6 +110,7 @@ public class OFChannelHandlerVer10Test {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
setUpFeaturesReply();
switchManager = createMock(IOFSwitchManager.class); switchManager = createMock(IOFSwitchManager.class);
connectionListener = createMock(IOFConnectionListener.class); connectionListener = createMock(IOFConnectionListener.class);
newConnectionListener = createMock(INewOFConnectionListener.class); newConnectionListener = createMock(INewOFConnectionListener.class);
......
...@@ -96,7 +96,6 @@ public class OFChannelHandlerVer13Test { ...@@ -96,7 +96,6 @@ public class OFChannelHandlerVer13Test {
private Capture<OFFeaturesReply> newFeaturesReply; private Capture<OFFeaturesReply> newFeaturesReply;
@Before
public void setUpFeaturesReply() { public void setUpFeaturesReply() {
portDesc = factory.buildPortDesc() portDesc = factory.buildPortDesc()
.setName("Eth1") .setName("Eth1")
...@@ -113,6 +112,7 @@ public class OFChannelHandlerVer13Test { ...@@ -113,6 +112,7 @@ public class OFChannelHandlerVer13Test {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
setUpFeaturesReply();
switchManager = createMock(IOFSwitchManager.class); switchManager = createMock(IOFSwitchManager.class);
connectionListener = createMock(IOFConnectionListener.class); connectionListener = createMock(IOFConnectionListener.class);
newConnectionListener = createMock(INewOFConnectionListener.class); newConnectionListener = createMock(INewOFConnectionListener.class);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment