You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2014/06/25 06:51:02 UTC
svn commit: r1605265 [3/4] - in /logging/log4j/log4j2/trunk:
log4j-core/src/main/java/org/apache/logging/log4j/core/
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdb...
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessorTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessorTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessorTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessorTest.java Wed Jun 25 04:51:00 2014
@@ -31,20 +31,20 @@ import static org.junit.Assert.*;
*/
public class PatternProcessorTest {
- private String format(long time) {
- String actualStr = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS").format(new Date(time));
+ private String format(final long time) {
+ final String actualStr = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS").format(new Date(time));
return actualStr;
}
@Test
public void testGetNextTimeMonthlyReturnsFirstDayOfNextMonth() {
- PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM}.log.gz");
- Calendar initial = Calendar.getInstance();
+ final PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM}.log.gz");
+ final Calendar initial = Calendar.getInstance();
initial.set(2014, 9, 15, 10, 31, 59); // Oct 15th
- long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
+ final long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
// We expect 1st day of next month
- Calendar expected = Calendar.getInstance();
+ final Calendar expected = Calendar.getInstance();
expected.set(2014, 10, 1, 0, 0, 00);
expected.set(Calendar.MILLISECOND, 0);
assertEquals(format(expected.getTimeInMillis()), format(actual));
@@ -52,13 +52,13 @@ public class PatternProcessorTest {
@Test
public void testGetNextTimeMonthlyReturnsFirstDayOfNextMonth2() {
- PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM}.log.gz");
- Calendar initial = Calendar.getInstance();
+ final PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM}.log.gz");
+ final Calendar initial = Calendar.getInstance();
initial.set(2014, 0, 31, 10, 31, 59); // 2014 Jan 31st
- long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
+ final long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
// Expect 1st of next month: 2014 Feb 1st
- Calendar expected = Calendar.getInstance();
+ final Calendar expected = Calendar.getInstance();
expected.set(2014, 1, 1, 0, 0, 00);
expected.set(Calendar.MILLISECOND, 0);
assertEquals(format(expected.getTimeInMillis()), format(actual));
@@ -66,13 +66,13 @@ public class PatternProcessorTest {
@Test
public void testGetNextTimeMonthlyReturnsFirstDayOfNextMonth3() {
- PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM}.log.gz");
- Calendar initial = Calendar.getInstance();
+ final PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM}.log.gz");
+ final Calendar initial = Calendar.getInstance();
initial.set(2014, 11, 31, 10, 31, 59); // 2014 Dec 31st
- long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
+ final long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
// Expect 1st of next month: 2015 Jan 1st
- Calendar expected = Calendar.getInstance();
+ final Calendar expected = Calendar.getInstance();
expected.set(2015, 0, 1, 0, 0, 00);
expected.set(Calendar.MILLISECOND, 0);
assertEquals(format(expected.getTimeInMillis()), format(actual));
@@ -80,17 +80,17 @@ public class PatternProcessorTest {
@Test
public void testGetNextTimeWeeklyReturnsFirstDayOfNextWeek_US() {
- Locale old = Locale.getDefault();
+ final Locale old = Locale.getDefault();
Locale.setDefault(Locale.US); // force 1st day of the week to be Sunday
try {
- PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-W}.log.gz");
- Calendar initial = Calendar.getInstance();
+ final PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-W}.log.gz");
+ final Calendar initial = Calendar.getInstance();
initial.set(2014, 2, 4, 10, 31, 59); // Tue, March 4, 2014
- long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
+ final long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
// expect Sunday, March 9, 2014
- Calendar expected = Calendar.getInstance();
+ final Calendar expected = Calendar.getInstance();
expected.set(2014, 2, 9, 0, 0, 00);
expected.set(Calendar.MILLISECOND, 0);
assertEquals(format(expected.getTimeInMillis()), format(actual));
@@ -101,17 +101,17 @@ public class PatternProcessorTest {
@Test
public void testGetNextTimeWeeklyReturnsFirstDayOfNextWeek_FRANCE() {
- Locale old = Locale.getDefault();
+ final Locale old = Locale.getDefault();
Locale.setDefault(Locale.FRANCE); // force 1st day of the week to be Monday
try {
- PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-W}.log.gz");
- Calendar initial = Calendar.getInstance();
+ final PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-W}.log.gz");
+ final Calendar initial = Calendar.getInstance();
initial.set(2014, 2, 4, 10, 31, 59); // Tue, March 4, 2014
- long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
+ final long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
// expect Monday, March 10, 2014
- Calendar expected = Calendar.getInstance();
+ final Calendar expected = Calendar.getInstance();
expected.set(2014, 2, 10, 0, 0, 00);
expected.set(Calendar.MILLISECOND, 0);
assertEquals(format(expected.getTimeInMillis()), format(actual));
@@ -122,13 +122,13 @@ public class PatternProcessorTest {
@Test
public void testGetNextTimeHourlyReturnsFirstMinuteOfNextHour() {
- PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-dd-HH}.log.gz");
- Calendar initial = Calendar.getInstance();
+ final PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-dd-HH}.log.gz");
+ final Calendar initial = Calendar.getInstance();
initial.set(2014, 2, 4, 10, 31, 59); // Tue, March 4, 2014, 10:31
- long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
+ final long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
// expect Wed, March 4, 2014, 11:00
- Calendar expected = Calendar.getInstance();
+ final Calendar expected = Calendar.getInstance();
expected.set(2014, 2, 4, 11, 00, 00);
expected.set(Calendar.MILLISECOND, 0);
assertEquals(format(expected.getTimeInMillis()), format(actual));
@@ -136,13 +136,13 @@ public class PatternProcessorTest {
@Test
public void testGetNextTimeHourlyReturnsFirstMinuteOfNextHour2() {
- PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-dd-HH}.log.gz");
- Calendar initial = Calendar.getInstance();
+ final PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-dd-HH}.log.gz");
+ final Calendar initial = Calendar.getInstance();
initial.set(2014, 2, 4, 23, 31, 59); // Tue, March 4, 2014, 23:31
- long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
+ final long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
// expect Wed, March 5, 2014, 00:00
- Calendar expected = Calendar.getInstance();
+ final Calendar expected = Calendar.getInstance();
expected.set(2014, 2, 5, 00, 00, 00);
expected.set(Calendar.MILLISECOND, 0);
assertEquals(format(expected.getTimeInMillis()), format(actual));
@@ -150,15 +150,15 @@ public class PatternProcessorTest {
@Test
public void testGetNextTimeMinutelyReturnsFirstSecondOfNextMinute() {
- PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-dd-HH-mm}.log.gz");
- Calendar initial = Calendar.getInstance();
+ final PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-dd-HH-mm}.log.gz");
+ final Calendar initial = Calendar.getInstance();
initial.set(2014, 2, 4, 10, 31, 59); // Tue, March 4, 2014, 10:31
initial.set(Calendar.MILLISECOND, 0);
assertEquals("2014/03/04 10:31:59.000", format(initial.getTimeInMillis()));
- long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
+ final long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
// expect Tue, March 4, 2014, 10:32
- Calendar expected = Calendar.getInstance();
+ final Calendar expected = Calendar.getInstance();
expected.set(2014, 2, 4, 10, 32, 00);
expected.set(Calendar.MILLISECOND, 0);
assertEquals(format(expected.getTimeInMillis()), format(actual));
@@ -166,15 +166,15 @@ public class PatternProcessorTest {
@Test
public void testGetNextTimeSecondlyReturnsFirstMillisecOfNextSecond() {
- PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-dd-HH-mm-ss}.log.gz");
- Calendar initial = Calendar.getInstance();
+ final PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-dd-HH-mm-ss}.log.gz");
+ final Calendar initial = Calendar.getInstance();
initial.set(2014, 2, 4, 10, 31, 53); // Tue, March 4, 2014, 10:31:53
initial.set(Calendar.MILLISECOND, 123);
assertEquals("2014/03/04 10:31:53.123", format(initial.getTimeInMillis()));
- long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
+ final long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
// expect Tue, March 4, 2014, 10:31:54
- Calendar expected = Calendar.getInstance();
+ final Calendar expected = Calendar.getInstance();
expected.set(2014, 2, 4, 10, 31, 54);
expected.set(Calendar.MILLISECOND, 0);
assertEquals(format(expected.getTimeInMillis()), format(actual));
@@ -182,15 +182,15 @@ public class PatternProcessorTest {
@Test
public void testGetNextTimeMillisecondlyReturnsNextMillisec() {
- PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-dd-HH-mm-ss.SSS}.log.gz");
- Calendar initial = Calendar.getInstance();
+ final PatternProcessor pp = new PatternProcessor("logs/app-%d{yyyy-MM-dd-HH-mm-ss.SSS}.log.gz");
+ final Calendar initial = Calendar.getInstance();
initial.set(2014, 2, 4, 10, 31, 53); // Tue, March 4, 2014, 10:31:53.123
initial.set(Calendar.MILLISECOND, 123);
assertEquals("2014/03/04 10:31:53.123", format(initial.getTimeInMillis()));
- long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
+ final long actual = pp.getNextTime(initial.getTimeInMillis(), 1, false);
// expect Tue, March 4, 2014, 10:31:53.124
- Calendar expected = Calendar.getInstance();
+ final Calendar expected = Calendar.getInstance();
expected.set(2014, 2, 4, 10, 31, 53);
expected.set(Calendar.MILLISECOND, 124);
assertEquals(format(expected.getTimeInMillis()), format(actual));
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java Wed Jun 25 04:51:00 2014
@@ -73,27 +73,27 @@ public class RollingRandomAccessFileMana
assertHeader(logFile);
}
- private void assertHeader(File file) throws Exception {
- HtmlLayout layout = HtmlLayout.createDefaultLayout();
- String header = new String(layout.getHeader(), Charset.defaultCharset());
- String withoutTimestamp = header.substring(0, 435);
- String contents = new String(slurp(file), Charset.defaultCharset());
- String contentsInitialChunk = contents.substring(0, 435);
+ private void assertHeader(final File file) throws Exception {
+ final HtmlLayout layout = HtmlLayout.createDefaultLayout();
+ final String header = new String(layout.getHeader(), Charset.defaultCharset());
+ final String withoutTimestamp = header.substring(0, 435);
+ final String contents = new String(slurp(file), Charset.defaultCharset());
+ final String contentsInitialChunk = contents.substring(0, 435);
assertEquals(file.getName(), withoutTimestamp, contentsInitialChunk);
}
- private void assertFooter(File file) throws Exception {
- HtmlLayout layout = HtmlLayout.createDefaultLayout();
- String footer = new String(layout.getFooter(), Charset.defaultCharset());
- String contents = new String(slurp(file), Charset.defaultCharset());
+ private void assertFooter(final File file) throws Exception {
+ final HtmlLayout layout = HtmlLayout.createDefaultLayout();
+ final String footer = new String(layout.getFooter(), Charset.defaultCharset());
+ final String contents = new String(slurp(file), Charset.defaultCharset());
assertTrue(file.getName(), contents.endsWith(footer));
}
- private byte[] slurp(File file) throws Exception {
+ private byte[] slurp(final File file) throws Exception {
FileInputStream in = null;
try {
in = new FileInputStream(file);
- byte[] result = new byte[(int) file.length()];
+ final byte[] result = new byte[(int) file.length()];
int pos = 0;
int length = in.read(result);
while (length > 0) {
@@ -104,7 +104,7 @@ public class RollingRandomAccessFileMana
} finally {
try {
in.close();
- } catch (Exception ignored) {
+ } catch (final Exception ignored) {
}
}
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java Wed Jun 25 04:51:00 2014
@@ -65,11 +65,11 @@ public class RoutingAppenderWithJndiTest
// default route when there's no jndi resource
StructuredDataMessage msg = new StructuredDataMessage("Test", "This is a message from unknown context", "Context");
EventLogger.logEvent(msg);
- File defaultLogFile = new File("target/routingbyjndi/routingbyjnditest-unknown.log");
+ final File defaultLogFile = new File("target/routingbyjndi/routingbyjnditest-unknown.log");
assertTrue("The default log file was not created", defaultLogFile.exists());
// now set jndi resource to Application1
- Context context = new InitialContext();
+ final Context context = new InitialContext();
context.bind(JNDI_CONTEXT_NAME, "Application1");
msg = new StructuredDataMessage("Test", "This is a message from Application1", "Context");
@@ -97,7 +97,7 @@ public class RoutingAppenderWithJndiTest
context.rebind("java:comp/env/logging/context-name", "Application3");
msg = new StructuredDataMessage("Test", "This is a message from Application3", "Context");
EventLogger.logEvent(msg);
- File application3LogFile = new File("target/routingbyjndi/routingbyjnditest-Application3.log");
+ final File application3LogFile = new File("target/routingbyjndi/routingbyjnditest-Application3.log");
assertTrue("The Application3 log file was not created", application3LogFile.exists());
// now set jndi resource to Application4
@@ -105,7 +105,7 @@ public class RoutingAppenderWithJndiTest
context.rebind("java:comp/env/logging/context-name", "Application4");
msg = new StructuredDataMessage("Test", "This is a message from Application4", "Context");
EventLogger.logEvent(msg);
- File application4LogFile = new File("target/routingbyjndi/routingbyjnditest-Application4.log");
+ final File application4LogFile = new File("target/routingbyjndi/routingbyjnditest-Application4.log");
assertTrue("The Application3 log file was not created", application4LogFile.exists());
}
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingDefaultAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingDefaultAppenderTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingDefaultAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingDefaultAppenderTest.java Wed Jun 25 04:51:00 2014
@@ -65,7 +65,7 @@ public class RoutingDefaultAppenderTest
assertTrue("Incorrect number of events. Expected 1, got " + list.size(), list.size() == 1);
msg = new StructuredDataMessage("Test", "This is a test", "Alert");
EventLogger.logEvent(msg);
- File file = new File(LOG_FILE);
+ final File file = new File(LOG_FILE);
assertTrue("Alert file was not created", file.exists());
}
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerThreadNameStrategyTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerThreadNameStrategyTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerThreadNameStrategyTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerThreadNameStrategyTest.java Wed Jun 25 04:51:00 2014
@@ -24,27 +24,27 @@ public class AsyncLoggerThreadNameStrate
@Test
public void testDefaultThreadNameIsCached() throws Exception {
- AsyncLogger.ThreadNameStrategy tns = AsyncLogger.ThreadNameStrategy.create();
+ final AsyncLogger.ThreadNameStrategy tns = AsyncLogger.ThreadNameStrategy.create();
assertSame(AsyncLogger.ThreadNameStrategy.CACHED, tns);
}
@Test
public void testUseCachedThreadNameIfInvalidConfig() throws Exception {
System.setProperty("AsyncLogger.ThreadNameStrategy", "\\%%InValid ");
- AsyncLogger.ThreadNameStrategy tns = AsyncLogger.ThreadNameStrategy.create();
+ final AsyncLogger.ThreadNameStrategy tns = AsyncLogger.ThreadNameStrategy.create();
assertSame(AsyncLogger.ThreadNameStrategy.CACHED, tns);
}
@Test
public void testUseUncachedThreadNameIfConfigured() throws Exception {
System.setProperty("AsyncLogger.ThreadNameStrategy", "UNCACHED");
- AsyncLogger.ThreadNameStrategy tns = AsyncLogger.ThreadNameStrategy.create();
+ final AsyncLogger.ThreadNameStrategy tns = AsyncLogger.ThreadNameStrategy.create();
assertSame(AsyncLogger.ThreadNameStrategy.UNCACHED, tns);
}
@Test
public void testUncachedThreadNameStrategyReturnsCurrentThreadName() throws Exception {
- AsyncLogger.Info info = new AsyncLogger.Info(null, "original", false);
+ final AsyncLogger.Info info = new AsyncLogger.Info(null, "original", false);
final String name1 = "MODIFIED-THREADNAME1";
Thread.currentThread().setName(name1);
assertEquals(name1, AsyncLogger.ThreadNameStrategy.UNCACHED.getThreadName(info));
@@ -58,7 +58,7 @@ public class AsyncLoggerThreadNameStrate
public void testCachedThreadNameStrategyReturnsCachedThreadName() throws Exception {
final String original = "Original-ThreadName";
Thread.currentThread().setName(original);
- AsyncLogger.Info info = new AsyncLogger.Info(null, original, false);
+ final AsyncLogger.Info info = new AsyncLogger.Info(null, original, false);
assertEquals(original, AsyncLogger.ThreadNameStrategy.CACHED.getThreadName(info));
final String name2 = "OTHER-THREADNAME2";
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/RingBufferLogEventTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/RingBufferLogEventTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/RingBufferLogEventTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/RingBufferLogEventTest.java Wed Jun 25 04:51:00 2014
@@ -47,18 +47,18 @@ public class RingBufferLogEventTest {
@Test
public void testGetLevelReturnsOffIfNullLevelSet() {
- RingBufferLogEvent evt = new RingBufferLogEvent();
- String loggerName = null;
- Marker marker = null;
- String fqcn = null;
- Level level = null;
- Message data = null;
- Throwable t = null;
- Map<String, String> map = null;
- ContextStack contextStack = null;
- String threadName = null;
- StackTraceElement location = null;
- long currentTimeMillis = 0;
+ final RingBufferLogEvent evt = new RingBufferLogEvent();
+ final String loggerName = null;
+ final Marker marker = null;
+ final String fqcn = null;
+ final Level level = null;
+ final Message data = null;
+ final Throwable t = null;
+ final Map<String, String> map = null;
+ final ContextStack contextStack = null;
+ final String threadName = null;
+ final StackTraceElement location = null;
+ final long currentTimeMillis = 0;
evt.setValues(null, loggerName, marker, fqcn, level, data, t, map,
contextStack, threadName, location, currentTimeMillis);
assertEquals(Level.OFF, evt.getLevel());
@@ -66,18 +66,18 @@ public class RingBufferLogEventTest {
@Test
public void testGetMessageReturnsNonNullMessage() {
- RingBufferLogEvent evt = new RingBufferLogEvent();
- String loggerName = null;
- Marker marker = null;
- String fqcn = null;
- Level level = null;
- Message data = null;
- Throwable t = null;
- Map<String, String> map = null;
- ContextStack contextStack = null;
- String threadName = null;
- StackTraceElement location = null;
- long currentTimeMillis = 0;
+ final RingBufferLogEvent evt = new RingBufferLogEvent();
+ final String loggerName = null;
+ final Marker marker = null;
+ final String fqcn = null;
+ final Level level = null;
+ final Message data = null;
+ final Throwable t = null;
+ final Map<String, String> map = null;
+ final ContextStack contextStack = null;
+ final String threadName = null;
+ final StackTraceElement location = null;
+ final long currentTimeMillis = 0;
evt.setValues(null, loggerName, marker, fqcn, level, data, t, map,
contextStack, threadName, location, currentTimeMillis);
assertNotNull(evt.getMessage());
@@ -85,18 +85,18 @@ public class RingBufferLogEventTest {
@Test
public void testGetMillisReturnsConstructorMillisForNormalMessage() {
- RingBufferLogEvent evt = new RingBufferLogEvent();
- String loggerName = null;
- Marker marker = null;
- String fqcn = null;
- Level level = null;
- Message data = null;
- Throwable t = null;
- Map<String, String> map = null;
- ContextStack contextStack = null;
- String threadName = null;
- StackTraceElement location = null;
- long currentTimeMillis = 123;
+ final RingBufferLogEvent evt = new RingBufferLogEvent();
+ final String loggerName = null;
+ final Marker marker = null;
+ final String fqcn = null;
+ final Level level = null;
+ final Message data = null;
+ final Throwable t = null;
+ final Map<String, String> map = null;
+ final ContextStack contextStack = null;
+ final String threadName = null;
+ final StackTraceElement location = null;
+ final long currentTimeMillis = 123;
evt.setValues(null, loggerName, marker, fqcn, level, data, t, map,
contextStack, threadName, location, currentTimeMillis);
assertEquals(123, evt.getTimeMillis());
@@ -107,7 +107,7 @@ public class RingBufferLogEventTest {
private final String msg;
private final long timestamp;
- public TimeMsg(String msg, long timestamp) {
+ public TimeMsg(final String msg, final long timestamp) {
this.msg = msg;
this.timestamp = timestamp;
}
@@ -140,18 +140,18 @@ public class RingBufferLogEventTest {
@Test
public void testGetMillisReturnsMsgTimestampForTimestampMessage() {
- RingBufferLogEvent evt = new RingBufferLogEvent();
- String loggerName = null;
- Marker marker = null;
- String fqcn = null;
- Level level = null;
- Message data = new TimeMsg("", 567);
- Throwable t = null;
- Map<String, String> map = null;
- ContextStack contextStack = null;
- String threadName = null;
- StackTraceElement location = null;
- long currentTimeMillis = 123;
+ final RingBufferLogEvent evt = new RingBufferLogEvent();
+ final String loggerName = null;
+ final Marker marker = null;
+ final String fqcn = null;
+ final Level level = null;
+ final Message data = new TimeMsg("", 567);
+ final Throwable t = null;
+ final Map<String, String> map = null;
+ final ContextStack contextStack = null;
+ final String threadName = null;
+ final StackTraceElement location = null;
+ final long currentTimeMillis = 123;
evt.setValues(null, loggerName, marker, fqcn, level, data, t, map,
contextStack, threadName, location, currentTimeMillis);
assertEquals(567, evt.getTimeMillis());
@@ -159,27 +159,27 @@ public class RingBufferLogEventTest {
@Test
public void testSerializationDeserialization() throws IOException, ClassNotFoundException {
- RingBufferLogEvent evt = new RingBufferLogEvent();
- String loggerName = "logger.name";
- Marker marker = null;
- String fqcn = "f.q.c.n";
- Level level = Level.TRACE;
- Message data = new SimpleMessage("message");
- Throwable t = new InternalError("not a real error");
- Map<String, String> map = null;
- ContextStack contextStack = null;
- String threadName = "main";
- StackTraceElement location = null;
- long currentTimeMillis = 12345;
+ final RingBufferLogEvent evt = new RingBufferLogEvent();
+ final String loggerName = "logger.name";
+ final Marker marker = null;
+ final String fqcn = "f.q.c.n";
+ final Level level = Level.TRACE;
+ final Message data = new SimpleMessage("message");
+ final Throwable t = new InternalError("not a real error");
+ final Map<String, String> map = null;
+ final ContextStack contextStack = null;
+ final String threadName = "main";
+ final StackTraceElement location = null;
+ final long currentTimeMillis = 12345;
evt.setValues(null, loggerName, marker, fqcn, level, data, t, map,
contextStack, threadName, location, currentTimeMillis);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream out = new ObjectOutputStream(baos);
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(evt);
- ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
- RingBufferLogEvent other = (RingBufferLogEvent) in.readObject();
+ final ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
+ final RingBufferLogEvent other = (RingBufferLogEvent) in.readObject();
assertEquals(loggerName, other.getLoggerName());
assertEquals(marker, other.getMarker());
assertEquals(fqcn, other.getLoggerFqcn());
@@ -196,23 +196,23 @@ public class RingBufferLogEventTest {
@Test
public void testCreateMementoReturnsCopy() {
- RingBufferLogEvent evt = new RingBufferLogEvent();
- String loggerName = "logger.name";
- Marker marker = MarkerManager.getMarker("marked man");
- String fqcn = "f.q.c.n";
- Level level = Level.TRACE;
- Message data = new SimpleMessage("message");
- Throwable t = new InternalError("not a real error");
- Map<String, String> map = new HashMap<String, String>();
+ final RingBufferLogEvent evt = new RingBufferLogEvent();
+ final String loggerName = "logger.name";
+ final Marker marker = MarkerManager.getMarker("marked man");
+ final String fqcn = "f.q.c.n";
+ final Level level = Level.TRACE;
+ final Message data = new SimpleMessage("message");
+ final Throwable t = new InternalError("not a real error");
+ final Map<String, String> map = new HashMap<String, String>();
map.put("key", "value");
- ContextStack contextStack = new MutableThreadContextStack(Arrays.asList("a", "b"));
- String threadName = "main";
- StackTraceElement location = null;
- long currentTimeMillis = 12345;
+ final ContextStack contextStack = new MutableThreadContextStack(Arrays.asList("a", "b"));
+ final String threadName = "main";
+ final StackTraceElement location = null;
+ final long currentTimeMillis = 12345;
evt.setValues(null, loggerName, marker, fqcn, level, data, t, map,
contextStack, threadName, location, currentTimeMillis);
- LogEvent actual = evt.createMemento();
+ final LogEvent actual = evt.createMemento();
assertEquals(evt.getLoggerName(), actual.getLoggerName());
assertEquals(evt.getMarker(), actual.getMarker());
assertEquals(evt.getLoggerFqcn(), actual.getLoggerFqcn());
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java Wed Jun 25 04:51:00 2014
@@ -152,7 +152,7 @@ public class PerfTestDriver {
long _pct99_99;
double _latencyRowCount;
int _throughputRowCount;
- private long _averageOpsPerSec;
+ private final long _averageOpsPerSec;
// example line: avg=828 99%=1118 99.99%=5028 Count=3125
public Stats(final String raw) {
@@ -296,7 +296,7 @@ public class PerfTestDriver {
final ProcessBuilder pb = config.throughputTest(java);
pb.redirectErrorStream(true); // merge System.out and System.err
final long t1 = System.nanoTime();
- int count = config._threadCount >= 4 ? 3 : repeat;
+ final int count = config._threadCount >= 4 ? 3 : repeat;
runPerfTest(count, x++, config, pb);
System.out.printf(" took %.1f seconds%n", (System.nanoTime() - t1)
/ (1000.0 * 1000.0 * 1000.0));
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java Wed Jun 25 04:51:00 2014
@@ -63,11 +63,11 @@ public class ConfigurationTest {
@Rule
public TestRule rules;
- private InitialLoggerContext init;
+ private final InitialLoggerContext init;
private LoggerContext ctx;
- private SecureRandom random = new SecureRandom();
+ private final SecureRandom random = new SecureRandom();
public ConfigurationTest(final String configFileName, final String logFileName) {
this.logFileName = logFileName;
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CustomConfigurationTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CustomConfigurationTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CustomConfigurationTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CustomConfigurationTest.java Wed Jun 25 04:51:00 2014
@@ -66,7 +66,7 @@ public class CustomConfigurationTest {
ctx.reconfigure();
final Configuration config = ctx.getConfiguration();
assertTrue("Configuration is not an XmlConfiguration", config instanceof XmlConfiguration);
- for (StatusListener listener : StatusLogger.getLogger().getListeners()) {
+ for (final StatusListener listener : StatusLogger.getLogger().getListeners()) {
if (listener instanceof StatusConsoleListener) {
assertSame(listener.getStatusLevel(), Level.INFO);
break;
@@ -76,19 +76,19 @@ public class CustomConfigurationTest {
.withPattern(PatternLayout.SIMPLE_CONVERSION_PATTERN)
.withConfiguration(config)
.build();
- Appender appender = FileAppender.createAppender(LOG_FILE, "false", "false", "File", "true",
+ final Appender appender = FileAppender.createAppender(LOG_FILE, "false", "false", "File", "true",
"false", "false", "4000", layout, null, "false", null, config);
appender.start();
config.addAppender(appender);
- AppenderRef ref = AppenderRef.createAppenderRef("File", null, null);
- AppenderRef[] refs = new AppenderRef[] {ref};
+ final AppenderRef ref = AppenderRef.createAppenderRef("File", null, null);
+ final AppenderRef[] refs = new AppenderRef[] {ref};
- LoggerConfig loggerConfig = LoggerConfig.createLogger("false", Level.INFO, "org.apache.logging.log4j",
+ final LoggerConfig loggerConfig = LoggerConfig.createLogger("false", Level.INFO, "org.apache.logging.log4j",
"true", refs, null, config, null );
loggerConfig.addAppender(appender, null, null);
config.addLogger("org.apache.logging.log4j", loggerConfig);
ctx.updateLoggers();
- Logger logger = ctx.getLogger(CustomConfigurationTest.class.getName());
+ final Logger logger = ctx.getLogger(CustomConfigurationTest.class.getName());
logger.info("This is a test");
final File file = new File(LOG_FILE);
assertTrue("log file not created", file.exists());
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ReconfigurationDeadlockTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ReconfigurationDeadlockTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ReconfigurationDeadlockTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ReconfigurationDeadlockTest.java Wed Jun 25 04:51:00 2014
@@ -41,7 +41,7 @@ public class ReconfigurationDeadlockTest
@Test
public void testReconfig() throws InterruptedException {
- Updater updater = new Updater();
+ final Updater updater = new Updater();
for (int i = 0; i < THREAD_COUNT; ++i) {
threads[i] = new LoggerThread(i);
threads[i].setDaemon(true);
@@ -69,7 +69,7 @@ public class ReconfigurationDeadlockTest
}
updater.shutdown = true;
if (stillWaiting) {
- ThreadDumpMessage message = new ThreadDumpMessage("Waiting");
+ final ThreadDumpMessage message = new ThreadDumpMessage("Waiting");
System.err.print(message.getFormattedMessage());
}
for (int i = 0; i < THREAD_COUNT; ++i) {
@@ -86,7 +86,7 @@ public class ReconfigurationDeadlockTest
private final Logger logger = LogManager.getRootLogger();
private final int index;
- public LoggerThread(int i) {
+ public LoggerThread(final int i) {
index = i;
}
@Override
@@ -96,7 +96,7 @@ public class ReconfigurationDeadlockTest
for (i=0; i < 30; ++i) {
logger.error("Thread: " + index + ", Test: " + i++);
}
- } catch (Exception ie) {
+ } catch (final Exception ie) {
return;
}
finished[index] = true;
@@ -112,11 +112,11 @@ public class ReconfigurationDeadlockTest
while (!shutdown) {
try {
Thread.sleep(1000);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
// for running from IDE
- File file = new File("target/test-classes/reconfiguration-deadlock.xml");
+ final File file = new File("target/test-classes/reconfiguration-deadlock.xml");
if (file.exists()) {
file.setLastModified(System.currentTimeMillis());
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtilTest.java Wed Jun 25 04:51:00 2014
@@ -31,8 +31,8 @@ public class ResolverUtilTest {
@Test
public void testExtractPathFromJarUrl() throws Exception {
- URL url = new URL("jar:file:/C:/Users/me/.m2/repository/junit/junit/4.11/junit-4.11.jar!/org/junit/Test.class");
- String expected = "/C:/Users/me/.m2/repository/junit/junit/4.11/junit-4.11.jar";
+ final URL url = new URL("jar:file:/C:/Users/me/.m2/repository/junit/junit/4.11/junit-4.11.jar!/org/junit/Test.class");
+ final String expected = "/C:/Users/me/.m2/repository/junit/junit/4.11/junit-4.11.jar";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@@ -50,22 +50,22 @@ public class ResolverUtilTest {
@Test
public void testExtractPathFromJarUrlDecodedIfFileDoesNotExist() throws Exception {
- URL url = new URL("jar:file:/path+with+plus/file+does+not+exist.jar!/some/file");
- String expected = "/path with plus/file does not exist.jar";
+ final URL url = new URL("jar:file:/path+with+plus/file+does+not+exist.jar!/some/file");
+ final String expected = "/path with plus/file does not exist.jar";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@Test
public void testExtractPathFromFileUrl() throws Exception {
- URL url = new URL("file:/C:/Users/me/workspace/log4j2/log4j-core/target/test-classes/log4j2-config.xml");
- String expected = "/C:/Users/me/workspace/log4j2/log4j-core/target/test-classes/log4j2-config.xml";
+ final URL url = new URL("file:/C:/Users/me/workspace/log4j2/log4j-core/target/test-classes/log4j2-config.xml");
+ final String expected = "/C:/Users/me/workspace/log4j2/log4j-core/target/test-classes/log4j2-config.xml";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@Test
public void testExtractPathFromFileUrlNotDecodedIfFileExists() throws Exception {
final String existingFile = "/log4j+config+with+plus+characters.xml";
- URL url = ResolverUtilTest.class.getResource(existingFile);
+ final URL url = ResolverUtilTest.class.getResource(existingFile);
assertTrue("should be file url but was " + url, "file".equals(url.getProtocol()));
final String actual = new ResolverUtil().extractPath(url);
@@ -74,8 +74,8 @@ public class ResolverUtilTest {
@Test
public void testExtractPathFromFileUrlDecodedIfFileDoesNotExist() throws Exception {
- URL url = new URL("file:///path+with+plus/file+does+not+exist.xml");
- String expected = "/path with plus/file does not exist.xml";
+ final URL url = new URL("file:///path+with+plus/file+does+not+exist.xml");
+ final String expected = "/path with plus/file does not exist.xml";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@@ -83,9 +83,9 @@ public class ResolverUtilTest {
@Test
public void testExtractPathFromVfszipUrl() throws Exception {
// need to install URLStreamHandlerFactory to prevent "unknown protocol" MalformedURLException
- URL url = new URL(
+ final URL url = new URL(
"vfszip:/home2/jboss-5.0.1.CR2/jboss-as/server/ais/ais-deploy/myear.ear/mywar.war/WEB-INF/some.xsd");
- String expected = "/home2/jboss-5.0.1.CR2/jboss-as/server/ais/ais-deploy/myear.ear/mywar.war/WEB-INF/some.xsd";
+ final String expected = "/home2/jboss-5.0.1.CR2/jboss-as/server/ais/ais-deploy/myear.ear/mywar.war/WEB-INF/some.xsd";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@@ -94,8 +94,8 @@ public class ResolverUtilTest {
public void testExtractPathFromVfszipUrlWithPlusCharacters()
throws Exception {
// need to install URLStreamHandlerFactory to prevent "unknown protocol" MalformedURLException
- URL url = new URL("vfszip:/path+with+plus/file+name+with+plus.xml");
- String expected = "/path+with+plus/file+name+with+plus.xml";
+ final URL url = new URL("vfszip:/path+with+plus/file+name+with+plus.xml");
+ final String expected = "/path+with+plus/file+name+with+plus.xml";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@@ -103,8 +103,8 @@ public class ResolverUtilTest {
@Test
public void testExtractPathFromResourceBundleUrl() throws Exception {
// need to install URLStreamHandlerFactory to prevent "unknown protocol" MalformedURLException
- URL url = new URL("resourcebundle:/some/path/some/file.properties");
- String expected = "/some/path/some/file.properties";
+ final URL url = new URL("resourcebundle:/some/path/some/file.properties");
+ final String expected = "/some/path/some/file.properties";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@@ -112,43 +112,43 @@ public class ResolverUtilTest {
@Test
public void testExtractPathFromResourceBundleUrlWithPlusCharacters() throws Exception {
// need to install URLStreamHandlerFactory to prevent "unknown protocol" MalformedURLException
- URL url = new URL("resourcebundle:/some+path/some+file.properties");
- String expected = "/some+path/some+file.properties";
+ final URL url = new URL("resourcebundle:/some+path/some+file.properties");
+ final String expected = "/some+path/some+file.properties";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@Test
public void testExtractPathFromHttpUrl() throws Exception {
- URL url = new URL("http://java.sun.com/index.html#chapter1");
- String expected = "/index.html";
+ final URL url = new URL("http://java.sun.com/index.html#chapter1");
+ final String expected = "/index.html";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@Test
public void testExtractPathFromHttpUrlWithPlusCharacters() throws Exception {
- URL url = new URL("http://www.server.com/path+with+plus/file+name+with+plus.jar!/org/junit/Test.class");
- String expected = "/path with plus/file name with plus.jar";
+ final URL url = new URL("http://www.server.com/path+with+plus/file+name+with+plus.jar!/org/junit/Test.class");
+ final String expected = "/path with plus/file name with plus.jar";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@Test
public void testExtractPathFromHttpsComplexUrl() throws Exception {
- URL url = new URL("https://issues.apache.org/jira/browse/LOG4J2-445?focusedCommentId=13862479&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13862479");
- String expected = "/jira/browse/LOG4J2-445";
+ final URL url = new URL("https://issues.apache.org/jira/browse/LOG4J2-445?focusedCommentId=13862479&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13862479");
+ final String expected = "/jira/browse/LOG4J2-445";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@Test
public void testExtractPathFromFtpUrl() throws Exception {
- URL url = new URL("ftp://user001:secretpassword@private.ftp-servers.example.com/mydirectory/myfile.txt");
- String expected = "/mydirectory/myfile.txt";
+ final URL url = new URL("ftp://user001:secretpassword@private.ftp-servers.example.com/mydirectory/myfile.txt");
+ final String expected = "/mydirectory/myfile.txt";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
@Test
public void testExtractPathFromFtpUrlWithPlusCharacters() throws Exception {
- URL url = new URL("ftp://user001:secretpassword@private.ftp-servers.example.com/my+directory/my+file.txt");
- String expected = "/my directory/my file.txt";
+ final URL url = new URL("ftp://user001:secretpassword@private.ftp-servers.example.com/my+directory/my+file.txt");
+ final String expected = "/my directory/my file.txt";
assertEquals(expected, new ResolverUtil().extractPath(url));
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java Wed Jun 25 04:51:00 2014
@@ -69,7 +69,7 @@ public class Log4jLogEventTest {
final Log4jLogEvent evt = new Log4jLogEvent("some.test", null, Strings.EMPTY, Level.INFO, new SimpleMessage(
"abc"), null);
- byte[] binary = serialize(evt);
+ final byte[] binary = serialize(evt);
final Log4jLogEvent evt2 = deserialize(binary);
assertEquals(evt.getTimeMillis(), evt2.getTimeMillis());
@@ -93,7 +93,7 @@ public class Log4jLogEventTest {
final Log4jLogEvent evt = new Log4jLogEvent("some.test", null, Strings.EMPTY, Level.INFO, new SimpleMessage(
"abc"), thrown);
- byte[] binary = serialize(evt);
+ final byte[] binary = serialize(evt);
final Log4jLogEvent evt2 = deserialize(binary);
assertEquals(evt.getTimeMillis(), evt2.getTimeMillis());
@@ -113,14 +113,14 @@ public class Log4jLogEventTest {
assertEquals(evt.isIncludeLocation(), evt2.isIncludeLocation());
}
- private byte[] serialize(Log4jLogEvent event) throws IOException {
+ private byte[] serialize(final Log4jLogEvent event) throws IOException {
final ByteArrayOutputStream arr = new ByteArrayOutputStream();
final ObjectOutputStream out = new ObjectOutputStream(arr);
out.writeObject(event);
return arr.toByteArray();
}
- private Log4jLogEvent deserialize(byte[] binary) throws IOException, ClassNotFoundException {
+ private Log4jLogEvent deserialize(final byte[] binary) throws IOException, ClassNotFoundException {
final ByteArrayInputStream inArr = new ByteArrayInputStream(binary);
final ObjectInputStream in = new ObjectInputStream(inArr);
final Log4jLogEvent result = (Log4jLogEvent) in.readObject();
@@ -157,7 +157,7 @@ public class Log4jLogEventTest {
final String base64 = "rO0ABXNyAD5vcmcuYXBhY2hlLmxvZ2dpbmcubG9nNGouY29yZS5pbXBsLkx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5pbnRlcm5hbC5qdW5pdC5ydW5uZXIuUmVtb3RlVGVzdFJ1bm5lcnQAFVJlbW90ZVRlc3RSdW5uZXIuamF2YXQACHJ1blRlc3Rzc3EAfgAic3EAfgAlAXQABC5jcC9xAH4AKHNxAH4AKQAAAqtxAH4Ap3EAfgCocQB+AKlzcQB+ACJzcQB+ACUBdAAELmNwL3EAfgAoc3EAfgApAAABhnEAfgCncQB+AKhxAH4ATXNxAH4AInNxAH4AJQF0AAQuY3AvcQB+AChzcQB+ACkAAADFcQB+AKdxAH4AqHQABG1haW50ABZPTUcgSSd2ZSBiZWVuIGRlbGV0ZWQhcQB+ALd0AEVvcmcuYXBhY2hlLmxvZ2dpbmcubG9nNGouY29yZS5pbXBsLkxvZzRqTG9nRXZlbnRUZXN0JERlbGV0ZWRFeGNlcHRpb251cgA0W0xvcmcuYXBhY2hlLmxvZ2dpbmcubG9nNGouY29yZS5pbXBsLlRocm93YWJsZV
Byb3h5O/rtAeCFous5AgAAeHAAAAAA";
- byte[] binaryDecoded = DatatypeConverter.parseBase64Binary(base64);
+ final byte[] binaryDecoded = DatatypeConverter.parseBase64Binary(base64);
final Log4jLogEvent evt2 = deserialize(binaryDecoded);
assertEquals(loggerFQN, evt2.getLoggerFqcn());
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java Wed Jun 25 04:51:00 2014
@@ -47,10 +47,10 @@ public class ThrowableProxyTest {
@Test
public void testJsonIoContainer() throws IOException {
- ObjectMapper objectMapper = new Log4jJsonObjectMapper();
- Fixture expected = new Fixture();
+ final ObjectMapper objectMapper = new Log4jJsonObjectMapper();
+ final Fixture expected = new Fixture();
final String s = objectMapper.writeValueAsString(expected);
- Fixture actual = objectMapper.readValue(s, Fixture.class);
+ final Fixture actual = objectMapper.readValue(s, Fixture.class);
assertEquals(expected.proxy.getName(), actual.proxy.getName());
assertEquals(expected.proxy.getMessage(), actual.proxy.getMessage());
assertEquals(expected.proxy.getLocalizedMessage(), actual.proxy.getLocalizedMessage());
@@ -108,21 +108,21 @@ public class ThrowableProxyTest {
final String base64 = "rO0ABXNyADFvcmcuYXBhY2hlLmxvZ2dpbmcubG9nNGouY29yZS5pbXBsLlRocm93YWJsZVByb3h52cww1Zp7rPoCAAdJABJjb21tb25FbGVtZW50Q291bnRMAApjYXVzZVByb3h5dAAzTG9yZy9hcGFjaGUvbG9nZ2luZy9sb2c0ai9jb3JlL2ltcGwvVGhyb3dhYmxlUHJveHk7WwASZXh0ZW5kZWRTdGFja1RyYWNldAA/W0xvcmcvYXBhY2hlL2xvZ2dpbmcvbG9nNGovY29yZS9pbXBsL0V4dGVuZGVkU3RhY2tUcmFjZUVsZW1lbnQ7TAAQbG9jYWxpemVkTWVzc2FnZXQAEkxqYXZhL2xhbmcvU3RyaW5nO0wAB21lc3NhZ2VxAH4AA0wABG5hbWVxAH4AA1sAEXN1cHByZXNzZWRQcm94aWVzdAA0W0xvcmcvYXBhY2hlL2xvZ2dpbmcvbG9nNGovY29yZS9pbXBsL1Rocm93YWJsZVByb3h5O3hwAAAAAHB1cgA/W0xvcmcuYXBhY2hlLmxvZ2dpbmcubG9nNGouY29yZS5pbXBsLkV4dGVuZGVkU3RhY2tUcmFjZUVsZW1lbnQ7ys+II6XHz7wCAAB4cAAAABhzcgA8b3JnLmFwYWNoZS5sb2dnaW5nLmxvZzRqLmNvcmUuaW1wbC5FeHRlbmRlZFN0YWNrVHJhY2VFbGVtZW504d7Pusa2kAcCAAJMAA5leHRyYUNsYXNzSW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c3EAfgAMAXQABC5jcC9xAH4AD3NxAH4AEAAAAqtxAH4AgnEAfgCDcQB+AIRzcQB+AAhzcQB+AAwBdAAELmNwL3EAfgAPc3EAfgAQAAABhnEAfgCCcQB+AINxAH4ANHNxAH4ACHNxAH4ADAF0AAQuY3AvcQB+AA9zcQB+ABAAAADFcQB+AIJxAH4Ag3QABG1haW50ABZPTUcgSSd2ZSBiZWVuIGRlbGV0ZWQhcQB+AJJ0AEZvcmcuYXBhY2hlLmxvZ2dpbmcubG9nNGouY29yZS5pbXBsLlRocm93YWJsZVByb3h5VGVzdCREZWxldGVkRXhjZXB0aW9udXIANFtMb3JnLmFwYWNoZS5sb2dnaW5nLmxvZzRqLmNvcmUuaW1wbC5UaHJvd2FibGVQcm94eTv67QHghaLrOQIAAHhwAAAAAA==";
- byte[] binaryDecoded = DatatypeConverter.parseBase64Binary(base64);
+ final byte[] binaryDecoded = DatatypeConverter.parseBase64Binary(base64);
final ThrowableProxy proxy2 = deserialize(binaryDecoded);
assertEquals(this.getClass().getName() + "$DeletedException", proxy2.getName());
assertEquals(msg, proxy2.getMessage());
}
- private byte[] serialize(ThrowableProxy proxy) throws IOException {
+ private byte[] serialize(final ThrowableProxy proxy) throws IOException {
final ByteArrayOutputStream arr = new ByteArrayOutputStream();
final ObjectOutputStream out = new ObjectOutputStream(arr);
out.writeObject(proxy);
return arr.toByteArray();
}
- private ThrowableProxy deserialize(byte[] binary) throws IOException, ClassNotFoundException {
+ private ThrowableProxy deserialize(final byte[] binary) throws IOException, ClassNotFoundException {
final ByteArrayInputStream inArr = new ByteArrayInputStream(binary);
final ObjectInputStream in = new ObjectInputStream(inArr);
return (ThrowableProxy) in.readObject();
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/JacksonIssue429MyNamesTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/JacksonIssue429MyNamesTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/JacksonIssue429MyNamesTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/JacksonIssue429MyNamesTest.java Wed Jun 25 04:51:00 2014
@@ -46,7 +46,7 @@ public class JacksonIssue429MyNamesTest
}
@Override
- public StackTraceElement deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException,
+ public StackTraceElement deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException,
JsonProcessingException {
JsonToken t = jp.getCurrentToken();
// Must get an Object
@@ -55,7 +55,7 @@ public class JacksonIssue429MyNamesTest
int lineNumber = -1;
while ((t = jp.nextValue()) != JsonToken.END_OBJECT) {
- String propName = jp.getCurrentName();
+ final String propName = jp.getCurrentName();
if ("class".equals(propName)) {
className = jp.getText();
} else if ("file".equals(propName)) {
@@ -93,7 +93,7 @@ public class JacksonIssue429MyNamesTest
private final ObjectMapper MAPPER = objectMapper();
- protected String aposToQuotes(String json) {
+ protected String aposToQuotes(final String json) {
return json.replace("'", "\"");
}
@@ -104,7 +104,7 @@ public class JacksonIssue429MyNamesTest
@Test
public void testStackTraceElementWithCustom() throws Exception {
// first, via bean that contains StackTraceElement
- StackTraceBean bean = MAPPER
+ final StackTraceBean bean = MAPPER
.readValue(
aposToQuotes("{'Location':{'class':'package.SomeClass','method':'someMethod','file':'SomeClass.java','line':13}}"),
StackTraceBean.class);
@@ -113,12 +113,12 @@ public class JacksonIssue429MyNamesTest
Assert.assertEquals(StackTraceBean.NUM, bean.location.getLineNumber());
// and then directly, iff registered
- ObjectMapper mapper = new ObjectMapper();
- SimpleModule module = new SimpleModule();
+ final ObjectMapper mapper = new ObjectMapper();
+ final SimpleModule module = new SimpleModule();
module.addDeserializer(StackTraceElement.class, new MyStackTraceElementDeserializer());
mapper.registerModule(module);
- StackTraceElement elem = mapper.readValue(
+ final StackTraceElement elem = mapper.readValue(
aposToQuotes("{'class':'package.SomeClass','method':'someMethod','file':'SomeClass.java','line':13}"),
StackTraceElement.class);
Assert.assertNotNull(elem);
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/JacksonIssue429Test.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/JacksonIssue429Test.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/JacksonIssue429Test.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/JacksonIssue429Test.java Wed Jun 25 04:51:00 2014
@@ -41,7 +41,7 @@ public class JacksonIssue429Test {
}
@Override
- public StackTraceElement deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException,
+ public StackTraceElement deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException,
JsonProcessingException {
jp.skipChildren();
return new StackTraceElement("a", "b", "b", StackTraceBean.NUM);
@@ -61,7 +61,7 @@ public class JacksonIssue429Test {
private final ObjectMapper MAPPER = objectMapper();
- protected String aposToQuotes(String json) {
+ protected String aposToQuotes(final String json) {
return json.replace("'", "\"");
}
@@ -72,18 +72,18 @@ public class JacksonIssue429Test {
@Test
public void testStackTraceElementWithCustom() throws Exception {
// first, via bean that contains StackTraceElement
- StackTraceBean bean = MAPPER.readValue(aposToQuotes("{'Location':'foobar'}"), StackTraceBean.class);
+ final StackTraceBean bean = MAPPER.readValue(aposToQuotes("{'Location':'foobar'}"), StackTraceBean.class);
Assert.assertNotNull(bean);
Assert.assertNotNull(bean.location);
Assert.assertEquals(StackTraceBean.NUM, bean.location.getLineNumber());
// and then directly, iff registered
- ObjectMapper mapper = new ObjectMapper();
- SimpleModule module = new SimpleModule();
+ final ObjectMapper mapper = new ObjectMapper();
+ final SimpleModule module = new SimpleModule();
module.addDeserializer(StackTraceElement.class, new Jackson429StackTraceElementDeserializer());
mapper.registerModule(module);
- StackTraceElement elem = mapper.readValue(
+ final StackTraceElement elem = mapper.readValue(
aposToQuotes("{'class':'package.SomeClass','method':'someMethod','file':'SomeClass.java','line':123}"),
StackTraceElement.class);
Assert.assertNotNull(elem);
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/LevelMixInTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/LevelMixInTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/LevelMixInTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/LevelMixInTest.java Wed Jun 25 04:51:00 2014
@@ -37,7 +37,7 @@ public class LevelMixInTest {
private final Level level = Level.DEBUG;
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/HtmlLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/HtmlLayoutTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/HtmlLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/HtmlLayoutTest.java Wed Jun 25 04:51:00 2014
@@ -99,7 +99,7 @@ public class HtmlLayoutTest {
private void testLayout(final boolean includeLocation) throws Exception {
final Map<String, Appender> appenders = root.getAppenders();
- for (Appender appender : appenders.values()) {
+ for (final Appender appender : appenders.values()) {
root.removeAppender(appender);
}
// set up appender
@@ -133,11 +133,11 @@ public class HtmlLayoutTest {
appender.stop();
final List<String> list = appender.getMessages();
- StringBuilder sb = new StringBuilder();
- for (String string : list) {
+ final StringBuilder sb = new StringBuilder();
+ for (final String string : list) {
sb.append(string);
}
- String html = sb.toString();
+ final String html = sb.toString();
assertTrue("Incorrect number of lines. Require at least 85 " + list.size(), list.size() > 85);
final String string = list.get(3);
assertTrue("Incorrect header: " + string, string.equals("<meta charset=\"UTF-8\"/>"));
@@ -150,7 +150,7 @@ public class HtmlLayoutTest {
} else {
assertFalse("Location should not be in the output table", html.contains("<td>HtmlLayoutTest.java:"));
}
- for (Appender app : appenders.values()) {
+ for (final Appender app : appenders.values()) {
root.addAppender(app);
}
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java Wed Jun 25 04:51:00 2014
@@ -79,7 +79,7 @@ public class PatternLayoutTest {
final String mdcMsgPattern4 = "%m : %X{key3}%n";
final String mdcMsgPattern5 = "%m : %X{key1},%X{key2},%X{key3}%n";
final Map<String, Appender> appenders = root.getAppenders();
- for (Appender appender : appenders.values()) {
+ for (final Appender appender : appenders.values()) {
root.removeAppender(appender);
}
@@ -145,7 +145,7 @@ public class PatternLayoutTest {
appender.stop();
- for (Appender app : appenders.values()) {
+ for (final Appender app : appenders.values()) {
root.addAppender(app);
}
}
@@ -163,7 +163,7 @@ public class PatternLayoutTest {
assertEquals("org/apache/logging/log4j/core/layout/PatternLayoutTest Hello, world!", new String(result));
}
- private void testUnixTime(String pattern) throws Exception {
+ private void testUnixTime(final String pattern) throws Exception {
final LoggerContext ctx = (LoggerContext) LogManager.getContext();
final PatternLayout layout = PatternLayout.newBuilder()
.withPattern(pattern + " %m")
@@ -232,7 +232,7 @@ public class PatternLayoutTest {
ThreadContext.put("footer", "Hello world Footer");
final LogEvent event1 = new Log4jLogEvent(this.getClass().getName(), null,
"org.apache.logging.log4j.core.Logger", Level.INFO, new SimpleMessage("Hello, world 1!"), null);
- byte[] header = layout.getHeader();
+ final byte[] header = layout.getHeader();
assertNotNull("No header", header);
assertTrue("expected \"Hello world Header\", actual \"" + new String(header) + '"', new String(header).equals(new String("Hello world Header")));
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/Rfc5424LayoutTest.java Wed Jun 25 04:51:00 2014
@@ -122,17 +122,17 @@ public class Rfc5424LayoutTest {
assertTrue("Expected line 3 to end with: " + line3 + " Actual " + list.get(2), list.get(2).endsWith(line3));
assertTrue("Expected line 4 to end with: " + line4 + " Actual " + list.get(3), list.get(3).endsWith(line4));
- for (String frame : list) {
+ for (final String frame : list) {
int length = -1;
- int frameLength = frame.length();
- int firstSpacePosition = frame.indexOf(' ');
- String messageLength = frame.substring(0, firstSpacePosition);
+ final int frameLength = frame.length();
+ final int firstSpacePosition = frame.indexOf(' ');
+ final String messageLength = frame.substring(0, firstSpacePosition);
try {
length = Integer.parseInt(messageLength);
// the ListAppender removes the ending newline, so we expect one less size
assertEquals(frameLength, messageLength.length() + length);
}
- catch (NumberFormatException e) {
+ catch (final NumberFormatException e) {
assertTrue("Not a valid RFC 5425 frame", false);
}
}
@@ -299,12 +299,12 @@ public class Rfc5424LayoutTest {
@Test
public void testLoggerFields() {
- String[] fields = new String[] {
+ final String[] fields = new String[] {
"[BAZ@32473 baz=\"org.apache.logging.log4j.core.layout.Rfc5424LayoutTest.testLoggerFields\"]",
"[RequestContext@3692 bar=\"org.apache.logging.log4j.core.layout.Rfc5424LayoutTest.testLoggerFields\"]",
"[SD-ID@32473 source=\"org.apache.logging.log4j.core.layout.Rfc5424LayoutTest.testLoggerFields\"]"
};
- List<String> expectedToContain = Arrays.asList(fields);
+ final List<String> expectedToContain = Arrays.asList(fields);
for (final Appender appender : root.getAppenders().values()) {
root.removeAppender(appender);
@@ -332,9 +332,9 @@ public class Rfc5424LayoutTest {
final List<String> list = appender.getMessages();
assertTrue("Not enough list entries", list.size() > 0);
- String message = list.get(0);
+ final String message = list.get(0);
assertTrue("No class/method", message.contains("Rfc5424LayoutTest.testLoggerFields"));
- for (String value : expectedToContain) {
+ for (final String value : expectedToContain) {
Assert.assertTrue("Message expected to contain " + value + " but did not", message.contains(value));
}
appender.clear();
@@ -348,9 +348,9 @@ public class Rfc5424LayoutTest {
@Test
public void testDiscardEmptyLoggerFields() {
- String mdcId = "RequestContext";
+ final String mdcId = "RequestContext";
- List<String> expectedToContain = Arrays.asList(
+ final List<String> expectedToContain = Arrays.asList(
"[BAZ@32473 baz=\"org.apache.logging.log4j.core.layout.Rfc5424LayoutTest.testLoggerFields\"]" +
"[RequestContext@3692 bar=\"org.apache.logging.log4j.core.layout.Rfc5424LayoutTest.testLoggerFields\"]"
);
@@ -381,7 +381,7 @@ public class Rfc5424LayoutTest {
final List<String> list = appender.getMessages();
assertTrue("Not enough list entries", list.size() > 0);
- String message = list.get(0);
+ final String message = list.get(0);
Assert.assertTrue("SD-ID should have been discarded", !message.contains("SD-ID"));
Assert.assertTrue("BAZ should have been included", message.contains("BAZ"));
Assert.assertTrue(mdcId + "should have been included", message.contains(mdcId));
@@ -396,9 +396,9 @@ public class Rfc5424LayoutTest {
@Test
public void testSubstituteStructuredData() {
- String mdcId = "RequestContext";
+ final String mdcId = "RequestContext";
- String expectedToContain = "ATM - MSG-ID - Message";
+ final String expectedToContain = "ATM - MSG-ID - Message";
for (final Appender appender : root.getAppenders().values()) {
root.removeAppender(appender);
@@ -417,7 +417,7 @@ public class Rfc5424LayoutTest {
try {
final List<String> list = appender.getMessages();
assertTrue("Not enough list entries", list.size() > 0);
- String message = list.get(0);
+ final String message = list.get(0);
Assert.assertTrue("Not the expected message received", message.contains(expectedToContain));
appender.clear();
} finally {
@@ -447,7 +447,7 @@ public class Rfc5424LayoutTest {
try {
final List<String> list = appender.getMessages();
assertTrue("Not enough list entries", list.size() > 0);
- String message = list.get(0);
+ final String message = list.get(0);
assertTrue("Incorrect message. Expected - Hello World, Actual - " + message, message.contains("Hello World"));
} finally {
root.removeAppender(appender);
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java Wed Jun 25 04:51:00 2014
@@ -86,7 +86,7 @@ public class SerializedLayoutTest {
@Test
public void testLayout() throws Exception {
final Map<String, Appender> appenders = root.getAppenders();
- for (Appender appender : appenders.values()) {
+ for (final Appender appender : appenders.values()) {
root.removeAppender(appender);
}
// set up appender
@@ -136,7 +136,7 @@ public class SerializedLayoutTest {
assertTrue("Incorrect event", event.toString().equals(expected[i]));
++i;
}
- for (Appender app : appenders.values()) {
+ for (final Appender app : appenders.values()) {
root.addAppender(app);
}
}
@@ -149,7 +149,7 @@ public class SerializedLayoutTest {
"org.apache.logging.log4j.core.Logger", Level.INFO, new SimpleMessage("Hello, world!"), throwable);
final byte[] result = layout.toByteArray(event);
assertNotNull(result);
- FileOutputStream fos = new FileOutputStream(DAT_PATH);
+ final FileOutputStream fos = new FileOutputStream(DAT_PATH);
fos.write(layout.getHeader());
fos.write(result);
fos.close();
@@ -158,9 +158,9 @@ public class SerializedLayoutTest {
@Test
public void testDeserialization() throws Exception {
testSerialization();
- File file = new File(DAT_PATH);
- FileInputStream fis = new FileInputStream(file);
- ObjectInputStream ois = new ObjectInputStream(fis);
+ final File file = new File(DAT_PATH);
+ final FileInputStream fis = new FileInputStream(file);
+ final ObjectInputStream ois = new ObjectInputStream(fis);
final LogEvent event = (LogEvent) ois.readObject();
assertNotNull(event);
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java Wed Jun 25 04:51:00 2014
@@ -98,8 +98,8 @@ public class InterpolatorTest {
assertEquals(TEST_CONTEXT_NAME, value);
value = lookup.lookup("date:yyyy-MM-dd");
assertNotNull("No Date", value);
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
- String today = format.format(new Date());
+ final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+ final String today = format.format(new Date());
assertEquals(value, today);
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/JndiLookupTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/JndiLookupTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/JndiLookupTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/JndiLookupTest.java Wed Jun 25 04:51:00 2014
@@ -63,7 +63,7 @@ public class JndiLookupTest {
contextName = lookup.lookup(JndiLookup.CONTAINER_JNDI_RESOURCE_PATH_PREFIX + TEST_CONTEXT_RESOURCE_NAME);
assertEquals(TEST_CONTEXT_NAME, contextName);
- String nonExistingResource = lookup.lookup("logging/non-existing-resource");
+ final String nonExistingResource = lookup.lookup("logging/non-existing-resource");
assertNull(nonExistingResource);
}
}
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/ResourceBundleLookupTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/ResourceBundleLookupTest.java?rev=1605265&r1=1605264&r2=1605265&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/ResourceBundleLookupTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/ResourceBundleLookupTest.java Wed Jun 25 04:51:00 2014
@@ -27,14 +27,14 @@ public class ResourceBundleLookupTest {
@Test
public void testLookup() {
final StrLookup lookup = new ResourceBundleLookup();
- String value = lookup.lookup("org.apache.logging.log4j.core.lookup.resource-bundle_en:KeyA");
+ final String value = lookup.lookup("org.apache.logging.log4j.core.lookup.resource-bundle_en:KeyA");
Assert.assertEquals("ValueA", lookup.lookup("org.apache.logging.log4j.core.lookup.resource-bundle:KeyA"));
}
@Test
public void testLookupWithLocale() {
final StrLookup lookup = new ResourceBundleLookup();
- String value = lookup.lookup("org.apache.logging.log4j.core.lookup.resource-bundle:KeyA");
+ final String value = lookup.lookup("org.apache.logging.log4j.core.lookup.resource-bundle:KeyA");
Assert.assertEquals("ValueA", lookup.lookup("org.apache.logging.log4j.core.lookup.resource-bundle:KeyA"));
}