From 569954cd001ac7140c853a5cd442b5b2d8cb8740 Mon Sep 17 00:00:00 2001 From: Ryan Izard <rizard@g.clemson.edu> Date: Wed, 3 Jun 2015 07:26:48 -0400 Subject: [PATCH] Fixed some unit test dependency issues where there are multiple @Before annotated methods. --- .../java/net/floodlightcontroller/core/OFSwitchBaseTest.java | 2 +- .../core/internal/OFChannelHandlerVer10Test.java | 2 +- .../core/internal/OFChannelHandlerVer13Test.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/net/floodlightcontroller/core/OFSwitchBaseTest.java b/src/test/java/net/floodlightcontroller/core/OFSwitchBaseTest.java index fc9a0c3c3..69c3f6e3a 100644 --- a/src/test/java/net/floodlightcontroller/core/OFSwitchBaseTest.java +++ b/src/test/java/net/floodlightcontroller/core/OFSwitchBaseTest.java @@ -154,9 +154,9 @@ public class OFSwitchBaseTest { switches.put(sw.getId(), sw); reset(switchManager); //expect(switchManager.getSwitch(sw.getId())).andReturn(sw).anyTimes(); + setUpPorts(); } - @Before public void setUpPorts() { OFPortDesc.Builder pdb = OFFactories.getFactory(OFVersion.OF_13).buildPortDesc(); // p1a is disabled diff --git a/src/test/java/net/floodlightcontroller/core/internal/OFChannelHandlerVer10Test.java b/src/test/java/net/floodlightcontroller/core/internal/OFChannelHandlerVer10Test.java index 038639f79..b724ebcd6 100644 --- a/src/test/java/net/floodlightcontroller/core/internal/OFChannelHandlerVer10Test.java +++ b/src/test/java/net/floodlightcontroller/core/internal/OFChannelHandlerVer10Test.java @@ -92,7 +92,6 @@ public class OFChannelHandlerVer10Test { private Capture<IOFConnectionBackend> newConnection; private Capture<OFFeaturesReply> newFeaturesReply; - @Before public void setUpFeaturesReply() { portDesc = factory.buildPortDesc() .setName("Eth1") @@ -111,6 +110,7 @@ public class OFChannelHandlerVer10Test { @Before public void setUp() throws Exception { + setUpFeaturesReply(); switchManager = createMock(IOFSwitchManager.class); connectionListener = createMock(IOFConnectionListener.class); newConnectionListener = createMock(INewOFConnectionListener.class); diff --git a/src/test/java/net/floodlightcontroller/core/internal/OFChannelHandlerVer13Test.java b/src/test/java/net/floodlightcontroller/core/internal/OFChannelHandlerVer13Test.java index 0703ef8c4..bd499214c 100644 --- a/src/test/java/net/floodlightcontroller/core/internal/OFChannelHandlerVer13Test.java +++ b/src/test/java/net/floodlightcontroller/core/internal/OFChannelHandlerVer13Test.java @@ -96,7 +96,6 @@ public class OFChannelHandlerVer13Test { private Capture<OFFeaturesReply> newFeaturesReply; - @Before public void setUpFeaturesReply() { portDesc = factory.buildPortDesc() .setName("Eth1") @@ -113,6 +112,7 @@ public class OFChannelHandlerVer13Test { @Before public void setUp() throws Exception { + setUpFeaturesReply(); switchManager = createMock(IOFSwitchManager.class); connectionListener = createMock(IOFConnectionListener.class); newConnectionListener = createMock(INewOFConnectionListener.class); -- GitLab