Extending TestCase which is a Junit3 format, and using Junit4
annotations at the same time in same class causes confusion,
and can also lead to runtime problems.
An example for a problem - putting @Ignore on a test case which starts
with word "test" and is located in a class that extends TestCase will
actually NOT ignore the test because it will be interpreted as Junit3
and not as Junit4.
Removing extending TestCase will make the unitests to be interpreted
as Junit4 style and leave no room for confusion.
Change-Id: I2365f0921d64667a5489c42eeb53adadc45efdaa
Signed-off-by: Alissa Bonas <abonas@redhat.com>
12 files changed:
package org.opendaylight.controller.arphandler.internal;\r
\r
\r
package org.opendaylight.controller.arphandler.internal;\r
\r
\r
-import junit.framework.TestCase;\r
-\r
import org.junit.Assert;\r
import org.junit.Test;\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
\r
-public class ArphandlerTest extends TestCase {\r
+public class ArphandlerTest {\r
\r
@Test\r
public void testArphandlerCreation() {\r
\r
@Test\r
public void testArphandlerCreation() {\r
import org.junit.Assert;\r
import org.junit.Test;\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
\r
-import junit.framework.TestCase;\r
-\r
-public class TestClusteringTest extends TestCase {\r
+public class TestClusteringTest {\r
\r
@Test\r
public void testComplexClass() {\r
\r
@Test\r
public void testComplexClass() {\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
import org.opendaylight.controller.sal.core.ConstructionException;\r
import org.opendaylight.controller.sal.core.Node;\r
import org.opendaylight.controller.sal.core.ConstructionException;\r
import org.opendaylight.controller.sal.core.Node;\r
-\r
-import junit.framework.TestCase;\r
-\r
+import org.opendaylight.controller.sal.core.NodeConnector;\r
import org.opendaylight.controller.sal.packet.address.EthernetAddress;\r
import org.opendaylight.controller.sal.packet.address.EthernetAddress;\r
import org.opendaylight.controller.sal.utils.NodeConnectorCreator;\r
import org.opendaylight.controller.sal.utils.NodeConnectorCreator;\r
-import org.opendaylight.controller.sal.core.NodeConnector;\r
import org.opendaylight.controller.sal.utils.NodeCreator;\r
\r
import org.opendaylight.controller.sal.utils.NodeCreator;\r
\r
-public class HostNodeConnectorTest extends TestCase {\r
+public class HostNodeConnectorTest {\r
\r
@Test\r
public void testHostNodeConnector() throws UnknownHostException {\r
\r
@Test\r
public void testHostNodeConnector() throws UnknownHostException {\r
import java.net.InetAddress;\r
import java.net.UnknownHostException;\r
\r
import java.net.InetAddress;\r
import java.net.UnknownHostException;\r
\r
-import junit.framework.TestCase;\r
-\r
import org.junit.Assert;\r
import org.junit.Test;\r
import org.opendaylight.controller.hosttracker.IHostId;\r
import org.opendaylight.controller.hosttracker.IPHostId;\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
import org.opendaylight.controller.hosttracker.IHostId;\r
import org.opendaylight.controller.hosttracker.IPHostId;\r
\r
-public class HostTrackerTest extends TestCase {\r
+public class HostTrackerTest {\r
\r
@Test\r
public void testHostTrackerCallable() throws UnknownHostException {\r
\r
@Test\r
public void testHostTrackerCallable() throws UnknownHostException {\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
\r
import org.junit.Assert;\r
import org.junit.Test;\r
import org.opendaylight.controller.sal.core.ConstructionException;\r
import org.opendaylight.controller.sal.core.Node;\r
import org.opendaylight.controller.sal.core.ConstructionException;\r
import org.opendaylight.controller.sal.core.Node;\r
-\r
-import junit.framework.TestCase;\r
-\r
+import org.opendaylight.controller.sal.core.NodeConnector;\r
import org.opendaylight.controller.sal.packet.address.EthernetAddress;\r
import org.opendaylight.controller.sal.packet.address.EthernetAddress;\r
import org.opendaylight.controller.sal.utils.NodeConnectorCreator;\r
import org.opendaylight.controller.sal.utils.NodeConnectorCreator;\r
-import org.opendaylight.controller.sal.core.NodeConnector;\r
import org.opendaylight.controller.sal.utils.NodeCreator;\r
\r
import org.opendaylight.controller.sal.utils.NodeCreator;\r
\r
-public class HostNodeConnectorTest extends TestCase {\r
+public class HostNodeConnectorTest {\r
\r
@Test\r
public void testHostNodeConnector() throws UnknownHostException {\r
\r
@Test\r
public void testHostNodeConnector() throws UnknownHostException {\r
import org.junit.Assert;
import org.junit.Test;
import org.junit.Assert;
import org.junit.Test;
-import junit.framework.TestCase;
-
-public class CommonsNorthboundTest extends TestCase {
+public class CommonsNorthboundTest {
@Test
public void testRestMessages() {
@Test
public void testRestMessages() {
import org.junit.Assert;
import org.junit.Test;
import org.junit.Assert;
import org.junit.Test;
-import junit.framework.TestCase;
-
-public class CommonsNorthboundExceptionTest extends TestCase {
+public class CommonsNorthboundExceptionTest {
@Test
public void testMethodNotAllowed() {
@Test
public void testMethodNotAllowed() {
import java.util.HashSet;
import java.util.Set;
import java.util.HashSet;
import java.util.Set;
-import junit.framework.TestCase;
-
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.controller.sal.core.Property;
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.controller.sal.core.Property;
-public class ControllerManagerNorthboundTest extends TestCase {
+public class ControllerManagerNorthboundTest {
@Test
public void testControllerProperties() {
@Test
public void testControllerProperties() {
import org.junit.Assert;
import org.junit.Test;
import org.junit.Assert;
import org.junit.Test;
-import junit.framework.TestCase;
-
-public class StaticRoutingNorthboundTest extends TestCase {
+public class StaticRoutingNorthboundTest {
@Test
public void testStaticRoute() {
@Test
public void testStaticRoute() {
import java.util.ArrayList;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
-import junit.framework.TestCase;
-
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.controller.sal.core.Node;
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.reader.NodeTableStatistics;
import org.opendaylight.controller.sal.utils.NodeCreator;
import org.opendaylight.controller.sal.reader.NodeTableStatistics;
import org.opendaylight.controller.sal.utils.NodeCreator;
-public class StatisticsNorthboundTest extends TestCase {
+public class StatisticsNorthboundTest {
@Test
public void testFlowStatistics() {
@Test
public void testFlowStatistics() {
package org.opendaylight.controller.switchmanager.northbound;
package org.opendaylight.controller.switchmanager.northbound;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import java.util.ArrayList;
import org.junit.Assert;
import org.junit.Test;
import org.junit.Assert;
import org.junit.Test;
-import junit.framework.TestCase;
-
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.core.Property;
import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
import org.opendaylight.controller.sal.utils.NodeCreator;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.core.Property;
import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
import org.opendaylight.controller.sal.utils.NodeCreator;
-public class SwitchManagerNorthboundTest extends TestCase {
+public class SwitchManagerNorthboundTest {
@Test
public void testNodes() {
@Test
public void testNodes() {
import org.opendaylight.controller.samples.loadbalancer.entities.VIP;\r
import org.opendaylight.controller.samples.loadbalancer.policies.RoundRobinLBPolicy;\r
\r
import org.opendaylight.controller.samples.loadbalancer.entities.VIP;\r
import org.opendaylight.controller.samples.loadbalancer.policies.RoundRobinLBPolicy;\r
\r
-import junit.framework.TestCase;\r
-\r
/**\r
*\r
* Class to unit test the load balancing policies.\r
*\r
*/\r
/**\r
*\r
* Class to unit test the load balancing policies.\r
*\r
*/\r
-public class LoadBalancerTest extends TestCase {\r
+public class LoadBalancerTest {\r
@Test\r
public void testRoundRobinPolicy() {\r
ConfigManager cm = null;\r
@Test\r
public void testRoundRobinPolicy() {\r
ConfigManager cm = null;\r
c1 = new Client("10.0.0.1","TCP",(short)5003);\r
Assert.assertTrue(rrp.getPoolMemberForClient(c1, vip).equals(host4.getIp()));\r
}\r
c1 = new Client("10.0.0.1","TCP",(short)5003);\r
Assert.assertTrue(rrp.getPoolMemberForClient(c1, vip).equals(host4.getIp()));\r
}\r
-}
\ No newline at end of file