From f970eb0f804af0233f273d74d842c9f4b3d37b4b Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Thu, 17 Dec 2015 18:41:31 +0100 Subject: [PATCH] Clean up SfcOpenflowUtilsTest and re-enable all tests nextHopGroupIdArray isn't used, remove it. (int) random() is always 0 (because of rounding), use the default Random() constructor. Drop redundant casts. static methods are final, drop the redundant final modifier. All the parameter creation methods are used but untrackable, suppress the unused warnings. Remove commented code. Fix shouldThrowExceptionForCreateSetAction() and re-enable it. Change-Id: I6b14f161eb3c96d5170030b34bc0c6cd0776cae1 Signed-off-by: Stephen Kitt --- .../util/openflow/SfcOpenflowUtilsTest.java | 49 ++++++++----------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/sfc-util/sfc-openflow-utils/src/test/java/org/opendaylight/sfc/util/openflow/SfcOpenflowUtilsTest.java b/sfc-util/sfc-openflow-utils/src/test/java/org/opendaylight/sfc/util/openflow/SfcOpenflowUtilsTest.java index 584b292e7..2b8d18f3a 100755 --- a/sfc-util/sfc-openflow-utils/src/test/java/org/opendaylight/sfc/util/openflow/SfcOpenflowUtilsTest.java +++ b/sfc-util/sfc-openflow-utils/src/test/java/org/opendaylight/sfc/util/openflow/SfcOpenflowUtilsTest.java @@ -16,17 +16,14 @@ import junitparams.Parameters; import org.apache.commons.lang.RandomStringUtils; import org.junit.Test; import org.junit.runner.RunWith; -//import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatch; import static com.fasterxml.uuid.EthernetAddress.constructMulticastAddress; -import static java.lang.Math.random; import static junitparams.JUnitParamsRunner.$; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -//import static org.mockito.Mockito.mock; import static org.opendaylight.sfc.util.openflow.SfcOpenflowUtils.createActionOutPort; import static org.opendaylight.sfc.util.openflow.SfcOpenflowUtils.createActionPopVlan; import static org.opendaylight.sfc.util.openflow.SfcOpenflowUtils.createActionPushVlan; @@ -41,16 +38,15 @@ public class SfcOpenflowUtilsTest{ private static Integer[] randNumArray= new Integer[6]; private static Integer[] randVlanArray= new Integer[6]; - private static Long[] nextHopGroupIdArray = new Long[6]; - private static Random randomInt = new Random((int)random()); + private static Random randomInt = new Random(); static { for(int i = 0; i