From b67dfd840ebaf05eabf3e5b80ca7f1fac0b81c52 Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Fri, 15 Apr 2022 17:00:43 -0700 Subject: [PATCH] Replace slf4j-log4j12 Log4j12 is not developed any more and slf4j-simple should be used instead of slf4j-log4j12 for routing test outputs. Also remove unnecessary stubbings detected in some test classes. JIRA: OPNFLWPLUG-1124 Change-Id: I7b17dfae58125523a3f3c570dd02d0323a3066ab Signed-off-by: Sangwook Ha --- applications/forwardingrules-sync/pom.xml | 2 +- applications/topology-manager/pom.xml | 2 +- extension/openflowjava-extension-eric/pom.xml | 2 +- extension/openflowjava-extension-nicira/pom.xml | 2 +- extension/openflowplugin-extension-eric/pom.xml | 2 +- extension/openflowplugin-extension-nicira/pom.xml | 2 +- libraries/liblldp/pom.xml | 2 +- openflowjava/openflow-protocol-impl/pom.xml | 3 +-- openflowjava/openflow-protocol-it/pom.xml | 2 +- openflowplugin-common/pom.xml | 2 +- openflowplugin-impl/pom.xml | 2 +- .../impl/connection/ConnectionContextImplTest.java | 5 +---- .../impl/connection/listener/HandshakeListenerImplTest.java | 5 +---- .../openflowplugin/impl/rpc/RpcContextImplTest.java | 1 - openflowplugin-it/pom.xml | 2 +- openflowplugin/pom.xml | 2 +- samples/simple-client/pom.xml | 2 +- 17 files changed, 16 insertions(+), 24 deletions(-) diff --git a/applications/forwardingrules-sync/pom.xml b/applications/forwardingrules-sync/pom.xml index 7754f4d260..435cbd4bff 100644 --- a/applications/forwardingrules-sync/pom.xml +++ b/applications/forwardingrules-sync/pom.xml @@ -55,7 +55,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/applications/topology-manager/pom.xml b/applications/topology-manager/pom.xml index 74406b455e..801b189829 100644 --- a/applications/topology-manager/pom.xml +++ b/applications/topology-manager/pom.xml @@ -53,7 +53,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/extension/openflowjava-extension-eric/pom.xml b/extension/openflowjava-extension-eric/pom.xml index bbc340a379..3fcd5ef66f 100644 --- a/extension/openflowjava-extension-eric/pom.xml +++ b/extension/openflowjava-extension-eric/pom.xml @@ -35,7 +35,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/extension/openflowjava-extension-nicira/pom.xml b/extension/openflowjava-extension-nicira/pom.xml index 0447217813..2a9243ac28 100644 --- a/extension/openflowjava-extension-nicira/pom.xml +++ b/extension/openflowjava-extension-nicira/pom.xml @@ -37,7 +37,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/extension/openflowplugin-extension-eric/pom.xml b/extension/openflowplugin-extension-eric/pom.xml index 0029754664..e5d19eb2dc 100644 --- a/extension/openflowplugin-extension-eric/pom.xml +++ b/extension/openflowplugin-extension-eric/pom.xml @@ -46,7 +46,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/extension/openflowplugin-extension-nicira/pom.xml b/extension/openflowplugin-extension-nicira/pom.xml index 592ddb275c..71b4a47f1f 100644 --- a/extension/openflowplugin-extension-nicira/pom.xml +++ b/extension/openflowplugin-extension-nicira/pom.xml @@ -50,7 +50,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/libraries/liblldp/pom.xml b/libraries/liblldp/pom.xml index db702e6d64..c8b68c7f8d 100644 --- a/libraries/liblldp/pom.xml +++ b/libraries/liblldp/pom.xml @@ -24,7 +24,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/openflowjava/openflow-protocol-impl/pom.xml b/openflowjava/openflow-protocol-impl/pom.xml index a8d5d36c87..5c0f51b16b 100644 --- a/openflowjava/openflow-protocol-impl/pom.xml +++ b/openflowjava/openflow-protocol-impl/pom.xml @@ -84,9 +84,8 @@ - org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/openflowjava/openflow-protocol-it/pom.xml b/openflowjava/openflow-protocol-it/pom.xml index 20560fc74d..fd89b4f686 100644 --- a/openflowjava/openflow-protocol-it/pom.xml +++ b/openflowjava/openflow-protocol-it/pom.xml @@ -42,7 +42,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple diff --git a/openflowplugin-common/pom.xml b/openflowplugin-common/pom.xml index e869f47afa..1f1f2d0997 100644 --- a/openflowplugin-common/pom.xml +++ b/openflowplugin-common/pom.xml @@ -24,7 +24,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index d368486d21..413ea83ee6 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -106,7 +106,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImplTest.java index 42c89b5f99..abd6fbe6ff 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImplTest.java @@ -8,7 +8,6 @@ package org.opendaylight.openflowplugin.impl.connection; -import java.net.InetSocketAddress; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -48,8 +47,6 @@ public class ConnectionContextImplTest { @Before public void setUp() { - Mockito.when(connetionAdapter.getRemoteAddress()) - .thenReturn(InetSocketAddress.createUnresolved("ofp-ut.example.org", 4242)); Mockito.when(connetionAdapter.isAlive()).thenReturn(true); connectionContext = new ConnectionContextImpl(connetionAdapter, deviceConnectionStatusProvider); @@ -110,4 +107,4 @@ public class ConnectionContextImplTest { connectionContext.changeStateToWorking(); Assert.assertEquals(ConnectionContext.CONNECTION_STATE.WORKING, connectionContext.getConnectionState()); } -} \ No newline at end of file +} diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImplTest.java index 3528ed4dc7..2cb43deaa3 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImplTest.java @@ -14,7 +14,6 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import java.net.InetSocketAddress; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -100,11 +99,9 @@ public class HandshakeListenerImplTest { @Test public void testOnHandshakeFailure2() { - when(connectionAdapter.getRemoteAddress()) - .thenReturn(InetSocketAddress.createUnresolved("ut-ofp.example.org", 4242)); connectionContextSpy.setNodeId(new NodeId("openflow:1")); handshakeListener.onHandshakeFailure(); verify(handshakeContext).close(); verify(connectionContextSpy).closeConnection(false); } -} \ No newline at end of file +} diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImplTest.java index 30afdaa2de..9762a21a35 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImplTest.java @@ -158,7 +158,6 @@ public class RpcContextImplTest { @Test public void testClose() { - when(routedRpcReg.getInstance()).thenReturn(serviceInstance); rpcContext.registerRpcServiceImplementation(TestRpcService.class, serviceInstance); rpcContext.close(); assertTrue(rpcContext.isEmptyRpcRegistrations()); diff --git a/openflowplugin-it/pom.xml b/openflowplugin-it/pom.xml index 474ece8497..974ba99840 100644 --- a/openflowplugin-it/pom.xml +++ b/openflowplugin-it/pom.xml @@ -157,7 +157,7 @@ org.slf4j - log4j-over-slf4j + slf4j-simple test diff --git a/openflowplugin/pom.xml b/openflowplugin/pom.xml index f589121043..7601a3c021 100644 --- a/openflowplugin/pom.xml +++ b/openflowplugin/pom.xml @@ -57,7 +57,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple test diff --git a/samples/simple-client/pom.xml b/samples/simple-client/pom.xml index efc62ec038..802c10b120 100644 --- a/samples/simple-client/pom.xml +++ b/samples/simple-client/pom.xml @@ -40,7 +40,7 @@ org.slf4j - slf4j-log4j12 + slf4j-simple net.sourceforge.argparse4j -- 2.36.6