You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by mi...@apache.org on 2016/04/18 13:38:24 UTC

[38/50] logging-log4j2 git commit: Replace depreacted test code with EasyMock.newCapture().

Replace depreacted test code with EasyMock.newCapture().

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f30bd69f
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f30bd69f
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f30bd69f

Branch: refs/heads/LOG4J2-1365
Commit: f30bd69f8b20e8aa23b77d96c7bad76d3fe4f55f
Parents: b119e19
Author: ggregory <gg...@apache.org>
Authored: Sun Apr 17 16:50:19 2016 -0700
Committer: ggregory <gg...@apache.org>
Committed: Sun Apr 17 16:50:19 2016 -0700

----------------------------------------------------------------------
 .../appender/NoSqlDatabaseManagerTest.java      | 26 ++++++++++++++------
 1 file changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f30bd69f/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java
----------------------------------------------------------------------
diff --git a/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java b/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java
index 7809451..c3c11d1 100644
--- a/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java
+++ b/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java
@@ -16,6 +16,21 @@
  */
 package org.apache.logging.log4j.nosql.appender;
 
+import static org.easymock.EasyMock.anyInt;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.createStrictMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.getCurrentArguments;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.reset;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.IOException;
 import java.sql.SQLException;
 import java.util.Date;
@@ -30,15 +45,12 @@ import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.message.Message;
 import org.easymock.Capture;
+import org.easymock.EasyMock;
 import org.easymock.IAnswer;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.easymock.EasyMock.*;
-
-import static org.junit.Assert.*;
-
 public class NoSqlDatabaseManagerTest {
     private NoSqlConnection<Map<String, Object>, DefaultNoSqlObject> connection;
     private NoSqlProvider<NoSqlConnection<Map<String, Object>, DefaultNoSqlObject>> provider;
@@ -167,7 +179,7 @@ public class NoSqlDatabaseManagerTest {
             verify(this.provider, this.connection);
             reset(this.provider, this.connection);
 
-            final Capture<NoSqlObject<Map<String, Object>>> capture = new Capture<>();
+            final Capture<NoSqlObject<Map<String, Object>>> capture = EasyMock.newCapture();
 
             final LogEvent event = createStrictMock(LogEvent.class);
             final Message message = createStrictMock(Message.class);
@@ -256,7 +268,7 @@ public class NoSqlDatabaseManagerTest {
             verify(this.provider, this.connection);
             reset(this.provider, this.connection);
 
-            final Capture<NoSqlObject<Map<String, Object>>> capture = new Capture<>();
+            final Capture<NoSqlObject<Map<String, Object>>> capture = EasyMock.newCapture();
 
             final RuntimeException exception = new RuntimeException("This is something cool!");
             final Map<String, String> context = new HashMap<>();
@@ -393,7 +405,7 @@ public class NoSqlDatabaseManagerTest {
             verify(this.provider, this.connection);
             reset(this.provider, this.connection);
 
-            final Capture<NoSqlObject<Map<String, Object>>> capture = new Capture<>();
+            final Capture<NoSqlObject<Map<String, Object>>> capture = EasyMock.newCapture();
 
             final IOException exception1 = new IOException("This is the cause.");
             final SQLException exception2 = new SQLException("This is the result.", exception1);