Update junit Assert imports 03/12603/1
authorRobert Varga <rovarga@cisco.com>
Fri, 7 Nov 2014 12:42:30 +0000 (13:42 +0100)
committerRobert Varga <rovarga@cisco.com>
Fri, 7 Nov 2014 13:10:32 +0000 (14:10 +0100)
JUnit 4.11 has moved Assert to org.junit, and deprecated
junit.framework.Assert. This adjust the imports to fix the warnings.

Change-Id: Iecbf2a1b4ae097989e840ad6f6d5bf759c521639
Signed-off-by: Robert Varga <rovarga@cisco.com>
32 files changed:
opendaylight/commons/liblldp/src/test/java/org/opendaylight/controller/sal/packet/BitBufferHelperTest.java
opendaylight/config/config-persister-file-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/file/xml/FileStorageAdapterTest.java
opendaylight/config/netty-timer-config/src/test/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorGeneratedFilesTrackerTest.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/AbstractYangTest.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/RuntimeBeanEntryTest.java
opendaylight/config/yang-test/src/test/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModuleTest.java
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/MDFlowMappingTest.java
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/topology/test/TopologyMappingTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/CandidateTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/AugmentationVerifier.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/DOMRpcServiceTestBugfix560.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToNodeCodecTest.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierFactoryTest.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactoryTest.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/xml/codec/XmlUtilsTest.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPointManagerTest.java
opendaylight/md-sal/sal-netconf-connector/src/test/java/org/opendaylight/controller/sal/connect/netconf/NetconfToNotificationTest.java
opendaylight/md-sal/sal-netconf-connector/src/test/java/org/opendaylight/controller/sal/connect/netconf/NetconfToRpcRequestTest.java
opendaylight/md-sal/sal-netconf-connector/src/test/java/org/opendaylight/controller/sal/connect/netconf/sal/tx/NetconfDeviceWriteOnlyTxTest.java
opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/utils/LatestEntryRoutingLogicTest.java
opendaylight/md-sal/sal-rest-docgen/src/test/java/org/opendaylight/controller/sal/rest/doc/impl/ApiDocGeneratorTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/AdditionalHeaderParserTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultGetSchemaTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfConfigPersisterITTest.java
opendaylight/northbound/bundlescanner/implementation/src/test/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleScannerTest.java
opendaylight/northbound/topology/src/test/java/org/opendaylight/controller/topology/northbound/TopologyTest.java

index 2bfe70a..942ba4c 100644 (file)
@@ -8,12 +8,12 @@
 
 package org.opendaylight.controller.config.persist.storage.file.xml;
 
-import static junit.framework.Assert.assertFalse;
+import static org.junit.Assert.assertFalse;
 import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
-
+import com.google.common.base.Charsets;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -21,17 +21,12 @@ import java.nio.file.Files;
 import java.util.List;
 import java.util.SortedSet;
 import java.util.TreeSet;
-
-import junit.framework.Assert;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
 import org.opendaylight.controller.config.persist.test.PropertiesProviderTest;
 
-import com.google.common.base.Charsets;
-
 public class FileStorageAdapterTest {
 
     private static int i;
@@ -42,8 +37,9 @@ public class FileStorageAdapterTest {
     @Before
     public void setUp() throws Exception {
         file = Files.createTempFile("testFilePersist", ".txt").toFile();
-        if (!file.exists())
+        if (!file.exists()) {
             return;
+        }
         com.google.common.io.Files.write("", file, Charsets.UTF_8);
         i = 1;
     }
@@ -71,7 +67,7 @@ public class FileStorageAdapterTest {
 
         storage.persistConfig(holder);
 
-        Assert.assertEquals(storage.toString().replace("\\","/"),"XmlFileStorageAdapter [storage="+NON_EXISTENT_DIRECTORY+NON_EXISTENT_FILE+"]");
+        assertEquals(storage.toString().replace("\\","/"),"XmlFileStorageAdapter [storage="+NON_EXISTENT_DIRECTORY+NON_EXISTENT_FILE+"]");
         delete(new File(NON_EXISTENT_DIRECTORY));
     }
     @Test
@@ -109,7 +105,7 @@ public class FileStorageAdapterTest {
         storage.setNumberOfBackups(Integer.MAX_VALUE);
 
         List<ConfigSnapshotHolder> last = storage.loadLastConfigs();
-        Assert.assertEquals(createCaps(), last.get(0).getCapabilities());
+        assertEquals(createCaps(), last.get(0).getCapabilities());
     }
 
     private SortedSet<String> createCaps() {
@@ -188,8 +184,9 @@ public class FileStorageAdapterTest {
     @Test
     public void testNoLastConfig() throws Exception {
         File file = Files.createTempFile("testFilePersist", ".txt").toFile();
-        if (!file.exists())
+        if (!file.exists()) {
             return;
+        }
         XmlFileStorageAdapter storage = new XmlFileStorageAdapter();
         storage.setFileStorage(file);
 
@@ -223,12 +220,14 @@ public class FileStorageAdapterTest {
         return "<config>" + i++ + "</config>";
     }
 
-    private void delete(File f) throws IOException {
+    private void delete(final File f) throws IOException {
         if (f.isDirectory()) {
-            for (File c : f.listFiles())
+            for (File c : f.listFiles()) {
                 delete(c);
+            }
         }
-        if (!f.delete())
+        if (!f.delete()) {
             throw new FileNotFoundException("Failed to delete file: " + f);
+        }
     }
 }
index 5fe5f94..578476f 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.controller.config.yang.netty.timer;
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-
-import junit.framework.Assert;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.config.api.ConflictingVersionException;
@@ -42,9 +41,9 @@ public class HashedWheelTimerModuleTest extends AbstractConfigTest {
         try {
             createInstance(transaction, instanceName, 0L, 10, true);
             transaction.validateConfig();
-            Assert.fail();
+            fail();
         } catch (ValidationException e) {
-            Assert.assertTrue(e.getMessage().contains("TickDuration value must be greater than 0"));
+            assertTrue(e.getMessage().contains("TickDuration value must be greater than 0"));
         }
     }
 
@@ -53,9 +52,9 @@ public class HashedWheelTimerModuleTest extends AbstractConfigTest {
         try {
             createInstance(transaction, instanceName, 500L, 0, true);
             transaction.validateConfig();
-            Assert.fail();
+            fail();
         } catch (ValidationException e) {
-            Assert.assertTrue(e.getMessage().contains("TicksPerWheel value must be greater than 0"));
+            assertTrue(e.getMessage().contains("TicksPerWheel value must be greater than 0"));
         }
     }
 
@@ -112,7 +111,7 @@ public class HashedWheelTimerModuleTest extends AbstractConfigTest {
         assertStatus(status, 0, 1, 1);
     }
 
-    private ObjectName createInstance(ConfigTransactionJMXClient transaction, String instanceName,
+    private ObjectName createInstance(final ConfigTransactionJMXClient transaction, final String instanceName,
             final Long tickDuration, final Integer ticksPerWheel, final boolean hasThreadfactory)
             throws InstanceAlreadyExistsException {
         ObjectName nameCreated = transaction.createModule(factory.getImplementationName(), instanceName);
@@ -126,7 +125,7 @@ public class HashedWheelTimerModuleTest extends AbstractConfigTest {
         return nameCreated;
     }
 
-    private ObjectName createThreadfactoryInstance(ConfigTransactionJMXClient transaction, String instanceName,
+    private ObjectName createThreadfactoryInstance(final ConfigTransactionJMXClient transaction, final String instanceName,
             final String namePrefix) throws InstanceAlreadyExistsException {
         ObjectName nameCreated = transaction.createModule(threadFactory.getImplementationName(), instanceName);
         NamingThreadFactoryModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated,
index 4112ff0..589fe41 100644 (file)
@@ -7,10 +7,8 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
+import static org.junit.Assert.assertEquals;
 import java.io.File;
-
-import junit.framework.Assert;
-
 import org.junit.Test;
 
 public class JMXGeneratorGeneratedFilesTrackerTest {
@@ -20,7 +18,7 @@ public class JMXGeneratorGeneratedFilesTrackerTest {
         JMXGenerator.GeneratedFilesTracker tracker = new JMXGenerator.GeneratedFilesTracker();
 
         tracker.addFile(new File("./a/b/c"));
-        Assert.assertEquals(1, tracker.getFiles().size());
+        assertEquals(1, tracker.getFiles().size());
         tracker.addFile(new File("./a/b/c"));
     }
 }
index b9f2ba9..e3c3a30 100644 (file)
@@ -7,8 +7,7 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator;
 
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.format;
+import static org.junit.Assert.assertNotNull;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 
@@ -92,8 +91,8 @@ public abstract class AbstractYangTest {
             QName qName = identitySchemaNode.getQName();
             Preconditions.checkArgument(
                     result.containsKey(qName) == false,
-                    format("Two identities of %s contain same " + "qname %s",
-                            module, qName));
+                    "Two identities of %s contain same qname %s",
+                            module, qName);
             result.put(qName, identitySchemaNode);
         }
         return result;
index e80ebc6..38b0a3a 100644 (file)
@@ -7,10 +7,10 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator;
 
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.doReturn;
 
index 13a31f5..fb92647 100644 (file)
@@ -9,8 +9,6 @@ package org.opendaylight.controller.config.yang.test.impl;
 
 import com.google.common.collect.Lists;
 
-import junit.framework.Assert;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.config.api.IdentityAttributeRef;
@@ -96,7 +94,7 @@ public class NetconfTestImplModuleTest  extends AbstractConfigTest {
         List<ObjectName> testingDeps = proxy.getTestingDeps();
         ObjectName testingDep = proxy.getTestingDep();
 
-        Assert.assertEquals(TESTING_DEP_PREFIX, ObjectNameUtil.getInstanceName(testingDep));
+        assertEquals(TESTING_DEP_PREFIX, ObjectNameUtil.getInstanceName(testingDep));
         assertTestingDeps(testingDeps, 4);
 
         transaction.abortConfig();
@@ -135,11 +133,11 @@ public class NetconfTestImplModuleTest  extends AbstractConfigTest {
     }
 
     private void assertTestingDeps(List<ObjectName> testingDeps, int i) {
-        Assert.assertEquals(i, testingDeps.size());
+        assertEquals(i, testingDeps.size());
 
         int c = 1;
         for (ObjectName testingDep : testingDeps) {
-            Assert.assertEquals(TESTING_DEP_PREFIX + Integer.toString(c++), ObjectNameUtil.getInstanceName(testingDep));
+            assertEquals(TESTING_DEP_PREFIX + Integer.toString(c++), ObjectNameUtil.getInstanceName(testingDep));
         }
     }
 
index 45341fb..54ffddb 100644 (file)
@@ -22,8 +22,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import junit.framework.Assert;
-
 import org.junit.Test;
 import org.opendaylight.controller.sal.action.Flood;
 import org.opendaylight.controller.sal.action.FloodAll;
@@ -198,7 +196,7 @@ public class TestToSalConversionsUtils {
     public void testFromNodeConnectorRef() throws ConstructionException {
         Node node = new Node(NodeIDType.OPENFLOW, 42L);
         NodeConnector nodeConnector = ToSalConversionsUtils.fromNodeConnectorRef(new Uri("1"), node);
-        Assert.assertEquals("OF|1@OF|00:00:00:00:00:00:00:2a", nodeConnector.toString());
+        assertEquals("OF|1@OF|00:00:00:00:00:00:00:2a", nodeConnector.toString());
     }
 
     private void checkSalMatch(org.opendaylight.controller.sal.match.Match match, MtchType mt) throws ConstructionException {
index 9369217..2a0d47e 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.controller.sal.compatibility.topology.test;
 
-import junit.framework.Assert;
+import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
 import org.opendaylight.controller.sal.compatibility.topology.TopologyMapping;
@@ -30,7 +30,7 @@ public class TopologyMappingTest {
         NodeId nodeId = new NodeId("openflow:1");
         String observedNodeId = TopologyMapping.toADNodeId(nodeId);
 
-        Assert.assertEquals("1", observedNodeId);
+        assertEquals("1", observedNodeId);
     }
 
     /**
@@ -43,7 +43,7 @@ public class TopologyMappingTest {
         TpId source = new TpId("foo:2");
         NodeConnector observedNodeConnector = TopologyMapping.toADNodeConnector(source, nodeId);
 
-        Assert.assertEquals("OF|2@OF|00:00:00:00:00:00:00:01", observedNodeConnector.toString());
+        assertEquals("OF|2@OF|00:00:00:00:00:00:00:01", observedNodeConnector.toString());
     }
 
     /**
@@ -54,7 +54,7 @@ public class TopologyMappingTest {
         TpId source = new TpId("foo:2");
         String observedNodeConnectorId = TopologyMapping.toADNodeConnectorId(source);
 
-        Assert.assertEquals("2", observedNodeConnectorId);
+        assertEquals("2", observedNodeConnectorId);
     }
 
     /**
@@ -66,7 +66,7 @@ public class TopologyMappingTest {
         NodeId nodeId = new NodeId("openflow:1");
         Node observedNode = TopologyMapping.toADNode(nodeId);
 
-        Assert.assertEquals("OF|00:00:00:00:00:00:00:01", observedNode.toString());
+        assertEquals("OF|00:00:00:00:00:00:00:01", observedNode.toString());
     }
 
     /**
@@ -79,7 +79,7 @@ public class TopologyMappingTest {
         TpId source = new TpId("192.168.0.1");
         NodeConnector observedNodeConnector = TopologyMapping.toADNodeConnector(source, nodeId);
 
-        Assert.assertEquals("MD_SAL_DEPRECATED|192.168.0.1@MD_SAL_DEPRECATED|some_unknown_node", observedNodeConnector.toString());
+        assertEquals("MD_SAL_DEPRECATED|192.168.0.1@MD_SAL_DEPRECATED|some_unknown_node", observedNodeConnector.toString());
     }
 
 }
index a8d47e2..fb02481 100644 (file)
@@ -3,7 +3,7 @@ package org.opendaylight.controller.cluster.raft.behaviors;
 import akka.actor.ActorRef;
 import akka.actor.Props;
 import akka.testkit.JavaTestKit;
-import junit.framework.Assert;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl;
index edeab11..83b9ad3 100644 (file)
@@ -4,7 +4,6 @@ import akka.actor.ActorRef;
 import akka.actor.Props;
 import akka.testkit.JavaTestKit;
 import com.google.protobuf.ByteString;
-import junit.framework.Assert;
 import org.junit.Test;
 import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl;
 import org.opendaylight.controller.cluster.raft.MockRaftActorContext;
@@ -87,7 +86,7 @@ public class FollowerTest extends AbstractRaftActorBehaviorTest {
         RaftActorBehavior raftBehavior =
             follower.handleMessage(followerActor, new ElectionTimeout());
 
-        Assert.assertTrue(raftBehavior instanceof Candidate);
+        assertTrue(raftBehavior instanceof Candidate);
     }
 
     @Test
index 227354c..c8129e6 100644 (file)
@@ -7,9 +7,7 @@
  */
 package org.opendaylight.controller.sal.binding.test;
 
-import junit.framework.Assert;
-
-
+import static org.junit.Assert.assertNotNull;
 import org.opendaylight.yangtools.yang.binding.Augmentable;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
@@ -28,8 +26,8 @@ public class AugmentationVerifier<T extends Augmentable<T>> {
 
     public static <T extends Augmentable<T>> void assertHasAugmentation(T object,
             Class<? extends Augmentation<T>> augmentation) {
-        Assert.assertNotNull(object);
-        Assert.assertNotNull("Augmentation " + augmentation.getSimpleName() + " is not present.", object.getAugmentation(augmentation));
+        assertNotNull(object);
+        assertNotNull("Augmentation " + augmentation.getSimpleName() + " is not present.", object.getAugmentation(augmentation));
     }
 
     public static <T extends Augmentable<T>> AugmentationVerifier<T> from(T obj) {
index 4cc3780..ba75d57 100644 (file)
@@ -7,10 +7,10 @@
  */
 package org.opendaylight.controller.sal.binding.test.connect.dom;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNotSame;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
 
 import java.math.BigInteger;
 import java.util.Collections;
index 6686a83..7d616ca 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.controller.sal.binding.test.connect.dom;
 
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.InputStream;
 import java.util.Collections;
index 6de1083..5d5318f 100644 (file)
@@ -26,8 +26,8 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 import java.util.List;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 public class NormalizedNodeToNodeCodecTest {
index 4da7d8c..13dfff3 100644 (file)
@@ -10,7 +10,7 @@
 
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
-import junit.framework.Assert;
+import static org.junit.Assert.assertTrue;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
@@ -22,8 +22,7 @@ public class NodeIdentifierFactoryTest {
         NodeIdentifierFactory
             .getArgument("AugmentationIdentifier{childNames=[(urn:opendaylight:flow:table:statistics?revision=2013-12-15)flow-table-statistics]}");
 
-    Assert
-        .assertTrue(argument instanceof YangInstanceIdentifier.AugmentationIdentifier);
+    assertTrue(argument instanceof YangInstanceIdentifier.AugmentationIdentifier);
 
 
   }
index 76d4ceb..2ae83bd 100644 (file)
@@ -4,9 +4,9 @@ import org.junit.Test;
 import org.opendaylight.controller.cluster.datastore.util.TestModel;
 import org.opendaylight.yangtools.yang.common.QName;
 
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.TestCase.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 public class QNameFactoryTest {
 
index 0688bfb..60dbcb0 100644 (file)
@@ -8,11 +8,16 @@
 
 package org.opendaylight.controller.xml.codec;
 
-
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 import com.google.common.io.ByteSource;
-import junit.framework.Assert;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -27,15 +32,6 @@ import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
 
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-
 public class XmlUtilsTest {
 
   private static final DocumentBuilderFactory BUILDERFACTORY;
index 127b0cb..5d19188 100644 (file)
@@ -1,14 +1,12 @@
 package org.opendaylight.controller.sal.connect.netconf;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 import java.io.InputStream;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
-
 import javax.xml.parsers.DocumentBuilderFactory;
 import org.junit.Before;
 import org.junit.Test;
index 4bf2e84..bbb5038 100644 (file)
@@ -1,8 +1,8 @@
 package org.opendaylight.controller.sal.connect.netconf;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.io.InputStream;
 import java.util.Collections;
index cd031a1..f74bfc3 100644 (file)
@@ -8,14 +8,13 @@
 
 package org.opendaylight.controller.remote.rpc.utils;
 
-
+import static org.junit.Assert.assertTrue;
 import akka.actor.ActorRef;
 import akka.actor.ActorSystem;
 import akka.japi.Pair;
 import akka.testkit.JavaTestKit;
 import akka.testkit.TestProbe;
 import com.typesafe.config.ConfigFactory;
-import junit.framework.Assert;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -23,7 +22,6 @@ import org.junit.Test;
 import java.util.ArrayList;
 import java.util.List;
 
-
 public class LatestEntryRoutingLogicTest {
 
   static ActorSystem system;
@@ -52,6 +50,6 @@ public class LatestEntryRoutingLogicTest {
     pairList.add(new Pair<ActorRef, Long>(actor2, 3000L));
     pairList.add(new Pair<ActorRef, Long>(actor3, 2000L));
     RoutingLogic logic = new LatestEntryRoutingLogic(pairList);
-    Assert.assertTrue(logic.select().equals(actor2));
+    assertTrue(logic.select().equals(actor2));
   }
 }
index 9165281..02c5137 100644 (file)
@@ -14,7 +14,6 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeSet;
 import javax.ws.rs.core.UriInfo;
-import junit.framework.Assert;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.junit.After;
@@ -205,7 +204,7 @@ public class ApiDocGeneratorTest {
             if (m.getKey().getAbsolutePath().endsWith("toaster.yang")) {
                 ApiDeclaration doc = generator.getSwaggerDocSpec(m.getValue(), "http://localhost:8080/restconf", "",
                         schemaContext);
-                Assert.assertNotNull(doc);
+                assertNotNull(doc);
 
                 // testing bugs.opendaylight.org bug 1290. UnionType model type.
                 String jsonString = doc.getModels().toString();
index c2dcd67..444d4fe 100644 (file)
@@ -7,8 +7,7 @@
  */
 package org.opendaylight.controller.netconf.impl;
 
-import junit.framework.Assert;
-
+import static org.junit.Assert.assertEquals;
 import org.junit.Test;
 import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
 
@@ -18,18 +17,18 @@ public class AdditionalHeaderParserTest {
     public void testParsing() throws Exception {
         String s = "[netconf;10.12.0.102:48528;ssh;;;;;;]";
         NetconfHelloMessageAdditionalHeader header = NetconfHelloMessageAdditionalHeader.fromString(s);
-        Assert.assertEquals("netconf", header.getUserName());
-        Assert.assertEquals("10.12.0.102", header.getAddress());
-        Assert.assertEquals("ssh", header.getTransport());
+        assertEquals("netconf", header.getUserName());
+        assertEquals("10.12.0.102", header.getAddress());
+        assertEquals("ssh", header.getTransport());
     }
 
     @Test
     public void testParsing2() throws Exception {
         String s = "[tomas;10.0.0.0/10000;tcp;1000;1000;;/home/tomas;;]";
         NetconfHelloMessageAdditionalHeader header = NetconfHelloMessageAdditionalHeader.fromString(s);
-        Assert.assertEquals("tomas", header.getUserName());
-        Assert.assertEquals("10.0.0.0", header.getAddress());
-        Assert.assertEquals("tcp", header.getTransport());
+        assertEquals("tomas", header.getUserName());
+        assertEquals("10.0.0.0", header.getAddress());
+        assertEquals("tcp", header.getTransport());
     }
 
     @Test(expected = IllegalArgumentException.class)
index 58c6566..b54b218 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.controller.netconf.impl;
 
-import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assert.assertNotNull;
 
 import org.junit.Test;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
index b655e90..4218176 100644 (file)
@@ -8,8 +8,13 @@
 
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
 import com.google.common.base.Optional;
-import junit.framework.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
@@ -18,13 +23,6 @@ import org.opendaylight.controller.netconf.util.xml.XmlElement;
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Document;
 
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.mock;
-
 public class DefaultGetSchemaTest {
 
     private CapabilityProvider cap;
index d8eb841..cc17035 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.controller.netconf.it;
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.doAnswer;
index 1c35404..13431fb 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.controller.northbound.bundlescanner.internal;
 
-
-
 import java.io.File;
 import java.io.FileFilter;
 import java.net.MalformedURLException;
@@ -37,8 +35,8 @@ import org.osgi.framework.Constants;
 import org.springframework.osgi.mock.MockBundle;
 import org.springframework.osgi.mock.MockBundleContext;
 
-import static junit.framework.Assert.assertNotNull;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 public class BundleScannerTest {
index 298f328..bcfa2a9 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.controller.topology.northbound;
 
-
-
 import org.junit.Test;
 import org.opendaylight.controller.sal.core.Bandwidth;
 import org.opendaylight.controller.sal.core.ConstructionException;
@@ -28,7 +26,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 public class TopologyTest {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.