logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1419697 [13/17] - in /logging/log4j/log4j2/trunk: api/src/main/java/org/apache/logging/log4j/ api/src/main/java/org/apache/logging/log4j/message/ api/src/main/java/org/apache/logging/log4j/simple/ api/src/main/java/org/apache/logging/log4j...
Date Mon, 10 Dec 2012 19:37:03 GMT
Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java Mon Dec 10 19:36:06 2012
@@ -43,15 +43,15 @@ public class RollingAppenderTimeTest {
     public static void setupClass() {
         deleteDir();
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final Configuration config = ctx.getConfiguration();
     }
 
     @AfterClass
     public static void cleanupClass() {
         deleteDir();
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
     }
@@ -64,12 +64,12 @@ public class RollingAppenderTimeTest {
             }
             logger.debug("This is test message number " + i);
         }
-        File dir = new File(DIR);
+        final File dir = new File(DIR);
         assertTrue("Directory not created", dir.exists() && dir.listFiles().length > 0);
-        File[] files = dir.listFiles();
+        final File[] files = dir.listFiles();
         assertTrue("No files created", files.length > 0);
         boolean found = false;
-        for (File file : files) {
+        for (final File file : files) {
             if (file.getName().endsWith(".gz")) {
                 found = true;
             }
@@ -78,10 +78,10 @@ public class RollingAppenderTimeTest {
     }
 
     private static void deleteDir() {
-        File dir = new File(DIR);
+        final File dir = new File(DIR);
         if (dir.exists()) {
-            File[] files = dir.listFiles();
-            for (File file : files) {
+            final File[] files = dir.listFiles();
+            for (final File file : files) {
                 file.delete();
             }
             dir.delete();

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderUncompressedTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderUncompressedTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderUncompressedTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderUncompressedTest.java Mon Dec 10 19:36:06 2012
@@ -43,15 +43,15 @@ public class RollingAppenderUncompressed
     public static void setupClass() {
         deleteDir();
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final Configuration config = ctx.getConfiguration();
     }
 
     @AfterClass
     public static void cleanupClass() {
         //deleteDir();
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
     }
@@ -61,13 +61,13 @@ public class RollingAppenderUncompressed
         for (int i=0; i < 100; ++i) {
             logger.debug("This is test message number " + i);
         }
-        File dir = new File(DIR);
+        final File dir = new File(DIR);
         assertTrue("Directory not created", dir.exists() && dir.listFiles().length > 0);
-        File[] files = dir.listFiles();
+        final File[] files = dir.listFiles();
         assertTrue("No files created", files.length > 0);
         boolean found = false;
-        for (File file : files) {
-            String name = file.getName();
+        for (final File file : files) {
+            final String name = file.getName();
             if (name.startsWith("test1") && name.endsWith(".log")) {
                 found = true;
             }
@@ -76,10 +76,10 @@ public class RollingAppenderUncompressed
     }
 
     private static void deleteDir() {
-        File dir = new File(DIR);
+        final File dir = new File(DIR);
         if (dir.exists()) {
-            File[] files = dir.listFiles();
-            for (File file : files) {
+            final File[] files = dir.listFiles();
+            for (final File file : files) {
                 file.delete();
             }
             dir.delete();

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppender2Test.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppender2Test.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppender2Test.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppender2Test.java Mon Dec 10 19:36:06 2012
@@ -51,13 +51,13 @@ public class JSONRoutingAppender2Test {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
                 break;
             }
         }
-        File file = new File("target/rolling1/rollingtest-Unknown.log");
+        final File file = new File("target/rolling1/rollingtest-Unknown.log");
         file.delete();
     }
 
@@ -66,7 +66,7 @@ public class JSONRoutingAppender2Test {
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
-        File file = new File("target/rolling1/rollingtest-Unknown.log");
+        final File file = new File("target/rolling1/rollingtest-Unknown.log");
         file.delete();
     }
 
@@ -74,12 +74,12 @@ public class JSONRoutingAppender2Test {
     public void routingTest() {
         StructuredDataMessage msg = new StructuredDataMessage("Test", "This is a test", "Service");
         EventLogger.logEvent(msg);
-        List<LogEvent> list = app.getEvents();
+        final List<LogEvent> list = app.getEvents();
         assertNotNull("No events generated", list);
         assertTrue("Incorrect number of events. Expected 1, got " + list.size(), list.size() == 1);
         msg = new StructuredDataMessage("Test", "This is a test", "Unknown");
         EventLogger.logEvent(msg);
-        File file = new File("target/rolling1/rollingtest-Unknown.log");
+        final File file = new File("target/rolling1/rollingtest-Unknown.log");
         assertTrue("File was not created", file.exists());
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppenderTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppenderTest.java Mon Dec 10 19:36:06 2012
@@ -51,13 +51,13 @@ public class JSONRoutingAppenderTest {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
                 break;
             }
         }
-        File file = new File("target/rolling1/rollingtest-Unknown.log");
+        final File file = new File("target/rolling1/rollingtest-Unknown.log");
         file.delete();
     }
 
@@ -66,7 +66,7 @@ public class JSONRoutingAppenderTest {
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
-        File file = new File("target/rolling1/rollingtest-Unknown.log");
+        final File file = new File("target/rolling1/rollingtest-Unknown.log");
         file.delete();
     }
 
@@ -74,12 +74,12 @@ public class JSONRoutingAppenderTest {
     public void routingTest() {
         StructuredDataMessage msg = new StructuredDataMessage("Test", "This is a test", "Service");
         EventLogger.logEvent(msg);
-        List<LogEvent> list = app.getEvents();
+        final List<LogEvent> list = app.getEvents();
         assertNotNull("No events generated", list);
         assertTrue("Incorrect number of events. Expected 1, got " + list.size(), list.size() == 1);
         msg = new StructuredDataMessage("Test", "This is a test", "Unknown");
         EventLogger.logEvent(msg);
-        File file = new File("target/rolling1/rollingtest-Unknown.log");
+        final File file = new File("target/rolling1/rollingtest-Unknown.log");
         assertTrue("File was not created", file.exists());
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java Mon Dec 10 19:36:06 2012
@@ -51,13 +51,13 @@ public class RoutingAppenderTest {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
                 break;
             }
         }
-        File file = new File("target/rolling1/rollingtest-Unknown.log");
+        final File file = new File("target/rolling1/rollingtest-Unknown.log");
         file.delete();
     }
 
@@ -66,7 +66,7 @@ public class RoutingAppenderTest {
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
-        File file = new File("target/rolling1/rollingtest-Unknown.log");
+        final File file = new File("target/rolling1/rollingtest-Unknown.log");
         file.delete();
     }
 
@@ -74,7 +74,7 @@ public class RoutingAppenderTest {
     public void routingTest() {
         StructuredDataMessage msg = new StructuredDataMessage("Test", "This is a test", "Service");
         EventLogger.logEvent(msg);
-        List<LogEvent> list = app.getEvents();
+        final List<LogEvent> list = app.getEvents();
         assertNotNull("No events generated", list);
         assertTrue("Incorrect number of events. Expected 1, got " + list.size(), list.size() == 1);
         msg = new StructuredDataMessage("Test", "This is a test", "Alert");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java Mon Dec 10 19:36:06 2012
@@ -37,13 +37,13 @@ public class FileOutputTest {
 
     @BeforeClass
     public static void setupClass() {
-        File file = new File(STATUS_LOG);
+        final File file = new File(STATUS_LOG);
         file.delete();
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final Configuration config = ctx.getConfiguration();
         if (config instanceof XMLConfiguration) {
-            String name = ((XMLConfiguration) config).getName();
+            final String name = ((XMLConfiguration) config).getName();
             if (name == null || !name.equals("XMLConfigTest")) {
                 ctx.reconfigure();
             }
@@ -55,16 +55,16 @@ public class FileOutputTest {
     @AfterClass
     public static void cleanupClass() {
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
-        File file = new File(STATUS_LOG);
+        final File file = new File(STATUS_LOG);
         file.delete();
     }
 
     @Test
     public void testConfig() {
-        File file = new File(STATUS_LOG);
+        final File file = new File(STATUS_LOG);
         assertTrue("Status output file does not exist", file.exists());
         assertTrue("File is empty", file.length() > 0);
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java Mon Dec 10 19:36:06 2012
@@ -48,13 +48,13 @@ public class TestConfigurator {
 
     @Test
     public void testFromFile() throws Exception {
-        LoggerContext ctx = Configurator.initialize("Test1", null, "target/test-classes/log4j2-config.xml");
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "target/test-classes/log4j2-config.xml");
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
         Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Incorrect Configuration. Expected " + CONFIG_NAME + " but found " + config.getName(),
             CONFIG_NAME.equals(config.getName()));
-        Map<String, Appender> map = config.getAppenders();
+        final Map<String, Appender> map = config.getAppenders();
         assertNotNull("No Appenders", map != null && map.size() > 0);
         assertTrue("Wrong configuration", map.containsKey("List"));
         Configurator.shutdown(ctx);
@@ -65,16 +65,16 @@ public class TestConfigurator {
 
     @Test
     public void testFromStream() throws Exception {
-        InputStream is = new FileInputStream("target/test-classes/log4j2-config.xml");
-        ConfigurationFactory.ConfigurationSource source =
+        final InputStream is = new FileInputStream("target/test-classes/log4j2-config.xml");
+        final ConfigurationFactory.ConfigurationSource source =
             new ConfigurationFactory.ConfigurationSource(is, "target/test-classes/log4j2-config.xml");
-        LoggerContext ctx = Configurator.initialize(null, source);
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final LoggerContext ctx = Configurator.initialize(null, source);
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
         Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Incorrect Configuration. Expected " + CONFIG_NAME + " but found " + config.getName(),
             CONFIG_NAME.equals(config.getName()));
-        Map<String, Appender> map = config.getAppenders();
+        final Map<String, Appender> map = config.getAppenders();
         assertNotNull("No Appenders", map != null && map.size() > 0);
         assertTrue("Wrong configuration", map.containsKey("List"));
         Configurator.shutdown(ctx);
@@ -85,16 +85,16 @@ public class TestConfigurator {
 
     @Test
     public void testFromStreamNoId() throws Exception {
-        InputStream is = new FileInputStream("target/test-classes/log4j2-config.xml");
-        ConfigurationFactory.ConfigurationSource source =
+        final InputStream is = new FileInputStream("target/test-classes/log4j2-config.xml");
+        final ConfigurationFactory.ConfigurationSource source =
             new ConfigurationFactory.ConfigurationSource(is);
-        LoggerContext ctx = Configurator.initialize(null, source);
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final LoggerContext ctx = Configurator.initialize(null, source);
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
         Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Incorrect Configuration. Expected " + CONFIG_NAME + " but found " + config.getName(),
             CONFIG_NAME.equals(config.getName()));
-        Map<String, Appender> map = config.getAppenders();
+        final Map<String, Appender> map = config.getAppenders();
         assertNotNull("No Appenders", map != null && map.size() > 0);
         assertTrue("Wrong configuration", map.containsKey("List"));
         Configurator.shutdown(ctx);
@@ -105,13 +105,13 @@ public class TestConfigurator {
 
     @Test
     public void testFromClassPath() throws Exception {
-        LoggerContext ctx = Configurator.initialize("Test1", null, "log4j2-config.xml");
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "log4j2-config.xml");
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
         Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Incorrect Configuration. Expected " + CONFIG_NAME + " but found " + config.getName(),
             CONFIG_NAME.equals(config.getName()));
-        Map<String, Appender> map = config.getAppenders();
+        final Map<String, Appender> map = config.getAppenders();
         assertNotNull("No Appenders", map != null && map.size() > 0);
         assertTrue("Wrong configuration", map.containsKey("List"));
         Configurator.shutdown(ctx);
@@ -122,13 +122,13 @@ public class TestConfigurator {
 
     @Test
     public void testByName() throws Exception {
-        LoggerContext ctx = Configurator.initialize("-config", null, (String) null);
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final LoggerContext ctx = Configurator.initialize("-config", null, (String) null);
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
         Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Incorrect Configuration. Expected " + CONFIG_NAME + " but found " + config.getName(),
             CONFIG_NAME.equals(config.getName()));
-        Map<String, Appender> map = config.getAppenders();
+        final Map<String, Appender> map = config.getAppenders();
         assertNotNull("No Appenders", map != null && map.size() > 0);
         assertTrue("Wrong configuration", map.containsKey("List"));
         Configurator.shutdown(ctx);
@@ -139,15 +139,15 @@ public class TestConfigurator {
 
     @Test
     public void testReconfiguration() throws Exception {
-        File file = new File("target/test-classes/log4j2-config.xml");
+        final File file = new File("target/test-classes/log4j2-config.xml");
         file.setLastModified(System.currentTimeMillis() - 120000);
-        LoggerContext ctx = Configurator.initialize("Test1", null, "target/test-classes/log4j2-config.xml");
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "target/test-classes/log4j2-config.xml");
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
         Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Incorrect Configuration. Expected " + CONFIG_NAME + " but found " + config.getName(),
             CONFIG_NAME.equals(config.getName()));
-        Map<String, Appender> map = config.getAppenders();
+        final Map<String, Appender> map = config.getAppenders();
         assertNotNull("No Appenders", map != null && map.size() > 0);
         assertTrue("Wrong configuration", map.containsKey("List"));
 
@@ -156,7 +156,7 @@ public class TestConfigurator {
         for (int i = 0; i < 17; ++i) {
             logger.debug("Test message " + i);
         }
-        Configuration newConfig = ctx.getConfiguration();
+        final Configuration newConfig = ctx.getConfiguration();
         assertTrue("Configuration not reset", newConfig != config);
         Configurator.shutdown(ctx);
         config = ctx.getConfiguration();
@@ -166,48 +166,48 @@ public class TestConfigurator {
 
     @Test
     public void testNoLoggers() throws Exception {
-        LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-loggers.xml");
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-loggers.xml");
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Unexpected configuration", DefaultConfiguration.DEFAULT_NAME.equals(config.getName()));
     }
 
     @Test
     public void testBadStatus() throws Exception {
-        LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-status.xml");
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-status.xml");
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Unexpected configuration", "XMLConfigTest".equals(config.getName()));
-        LoggerConfig root = config.getLoggerConfig("");
+        final LoggerConfig root = config.getLoggerConfig("");
         assertNotNull("No Root Logger", root);
         assertTrue("Expected error level, was " + root.getLevel(), Level.ERROR == root.getLevel());
     }
 
     @Test
     public void testBadFilterParam() throws Exception {
-        LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-badfilterparam.xml");
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-badfilterparam.xml");
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Unexpected configuration", "XMLConfigTest".equals(config.getName()));
-        LoggerConfig lcfg = config.getLoggerConfig("org.apache.logging.log4j.test1");
+        final LoggerConfig lcfg = config.getLoggerConfig("org.apache.logging.log4j.test1");
         assertNotNull("No Logger", lcfg);
-        Filter filter = lcfg.getFilter();
+        final Filter filter = lcfg.getFilter();
         assertNull("Unexpected Filter", filter);
     }
 
     @Test
     public void testNoFilters() throws Exception {
-        LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-nofilter.xml");
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-nofilter.xml");
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Unexpected configuration", "XMLConfigTest".equals(config.getName()));
-        LoggerConfig lcfg = config.getLoggerConfig("org.apache.logging.log4j.test1");
+        final LoggerConfig lcfg = config.getLoggerConfig("org.apache.logging.log4j.test1");
         assertNotNull("No Logger", lcfg);
-        Filter filter = lcfg.getFilter();
+        final Filter filter = lcfg.getFilter();
         assertNotNull("No Filter", filter);
         assertTrue("Incorrect filter", filter instanceof CompositeFilter);
         assertFalse("Unexpected filters", ((CompositeFilter) filter).hasFilters());
@@ -215,20 +215,20 @@ public class TestConfigurator {
 
     @Test
     public void testBadLayout() throws Exception {
-        LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-badlayout.xml");
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-badlayout.xml");
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Unexpected configuration", "XMLConfigTest".equals(config.getName()));
     }
 
     @Test
     public void testBadFileName() throws Exception {
-        String value = FILESEP.equals("/") ? "/rootdir/test.log" : "1:/target/bad:file.log";
+        final String value = FILESEP.equals("/") ? "/rootdir/test.log" : "1:/target/bad:file.log";
         System.setProperty("testfile", value);
-        LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-badfilename.xml");
-        Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "bad/log4j-badfilename.xml");
+        final Logger logger = LogManager.getLogger("org.apache.test.TestConfigurator");
+        final Configuration config = ctx.getConfiguration();
         assertNotNull("No configuration", config);
         assertTrue("Unexpected configuration", "XMLConfigTest".equals(config.getName()));
         assertTrue("Create bad appender", config.getAppenders().size() == 2);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationPropsTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationPropsTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationPropsTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationPropsTest.java Mon Dec 10 19:36:06 2012
@@ -40,7 +40,7 @@ public class XMLConfigurationPropsTest {
     @AfterClass
     public static void cleanupClass() {
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
     }
@@ -48,9 +48,9 @@ public class XMLConfigurationPropsTest {
     @Test
     public void testNoProps() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
-        Configuration config = ctx.getConfiguration();
+        final Configuration config = ctx.getConfiguration();
         assertTrue("Configuration is not an XMLConfiguration", config instanceof XMLConfiguration);
     }
 
@@ -59,9 +59,9 @@ public class XMLConfigurationPropsTest {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         System.setProperty("log4j.level", "debug");
         try {
-            LoggerContext ctx = (LoggerContext) LogManager.getContext();
+            final LoggerContext ctx = (LoggerContext) LogManager.getContext();
             ctx.reconfigure();
-            Configuration config = ctx.getConfiguration();
+            final Configuration config = ctx.getConfiguration();
             assertTrue("Configuration is not an XMLConfiguration", config instanceof XMLConfiguration);
         } finally {
             System.clearProperty("log4j.level");
@@ -75,9 +75,9 @@ public class XMLConfigurationPropsTest {
         System.setProperty("log4j.level", "debug");
         System.setProperty("log.level", "debug");
         try {
-            LoggerContext ctx = (LoggerContext) LogManager.getContext();
+            final LoggerContext ctx = (LoggerContext) LogManager.getContext();
             ctx.reconfigure();
-            Configuration config = ctx.getConfiguration();
+            final Configuration config = ctx.getConfiguration();
             assertTrue("Configuration is not an XMLConfiguration", config instanceof XMLConfiguration);
         } finally {
             System.clearProperty("log4j.level");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationTest.java Mon Dec 10 19:36:06 2012
@@ -50,10 +50,10 @@ public class XMLConfigurationTest {
     @BeforeClass
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final Configuration config = ctx.getConfiguration();
         if (config instanceof XMLConfiguration) {
-            String name = ((XMLConfiguration) config).getName();
+            final String name = ((XMLConfiguration) config).getName();
             if (name == null || !name.equals("XMLConfigTest")) {
                 ctx.reconfigure();
             }
@@ -65,46 +65,46 @@ public class XMLConfigurationTest {
     @AfterClass
     public static void cleanupClass() {
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
     }
 
     @Test
     public void testLogger() {
-        Logger logger = LogManager.getLogger("org.apache.logging.log4j.test1.Test");
+        final Logger logger = LogManager.getLogger("org.apache.logging.log4j.test1.Test");
         assertTrue(logger instanceof org.apache.logging.log4j.core.Logger);
-        org.apache.logging.log4j.core.Logger l = (org.apache.logging.log4j.core.Logger) logger;
+        final org.apache.logging.log4j.core.Logger l = (org.apache.logging.log4j.core.Logger) logger;
         assertEquals(Level.DEBUG, l.getLevel());
-        int filterCount = l.filterCount();
+        final int filterCount = l.filterCount();
         assertTrue("number of filters - " + filterCount, filterCount == 1);
-        Iterator<Filter> iter = l.getFilters();
-        Filter filter = iter.next();
+        final Iterator<Filter> iter = l.getFilters();
+        final Filter filter = iter.next();
         assertTrue(filter instanceof ThreadContextMapFilter);
-        Map<String, Appender> appenders = l.getAppenders();
+        final Map<String, Appender> appenders = l.getAppenders();
         assertNotNull(appenders);
         assertTrue("number of appenders = " + appenders.size(), appenders.size() == 1);
-        Appender a = appenders.get("STDOUT");
+        final Appender a = appenders.get("STDOUT");
         assertNotNull(a);
         assertEquals(a.getName(), "STDOUT");
     }
 
     public void testConfiguredAppenders() {
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        Configuration c = ctx.getConfiguration();
-        Map<String, Appender> apps = c.getAppenders();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final Configuration c = ctx.getConfiguration();
+        final Map<String, Appender> apps = c.getAppenders();
         assertNotNull(apps);
         assertEquals(apps.size(), 3);
     }
 
     @Test
     public void logToFile() throws Exception {
-        FileOutputStream fos = new FileOutputStream(LOGFILE, false);
+        final FileOutputStream fos = new FileOutputStream(LOGFILE, false);
         fos.flush();
         fos.close();
-        Logger logger = LogManager.getLogger("org.apache.logging.log4j.test2.Test");
+        final Logger logger = LogManager.getLogger("org.apache.logging.log4j.test2.Test");
         logger.debug("This is a test");
-        DataInputStream is = new DataInputStream(new BufferedInputStream(new FileInputStream(LOGFILE)));
+        final DataInputStream is = new DataInputStream(new BufferedInputStream(new FileInputStream(LOGFILE)));
         int count = 0;
         String str = "";
         while (is.available() != 0) {

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLLoggerPropsTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLLoggerPropsTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLLoggerPropsTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLLoggerPropsTest.java Mon Dec 10 19:36:06 2012
@@ -48,7 +48,7 @@ public class XMLLoggerPropsTest {
         System.setProperty("test", "test");
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
                 break;
@@ -73,7 +73,7 @@ public class XMLLoggerPropsTest {
             logger.debug("Test with props");
             logger = LogManager.getLogger("tiny.bubbles");
             logger.debug("Test on root");
-            List<String> events = app.getMessages();
+            final List<String> events = app.getMessages();
             assertTrue("No events", events.size() > 0);
             assertTrue("Incorrect number of events", events.size() == 2);
             assertTrue("Incorrect value", events.get(0).contains("test=test"));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java Mon Dec 10 19:36:06 2012
@@ -49,7 +49,7 @@ public class BurstFilterTest {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("ListAppender")) {
                 app = (ListAppender) entry.getValue();
                 filter = (BurstFilter) app.getFilter();
@@ -58,7 +58,7 @@ public class BurstFilterTest {
         }
     }
 
-    private Logger logger = LogManager.getLogger(BurstFilterTest.class.getName());
+    private final Logger logger = LogManager.getLogger(BurstFilterTest.class.getName());
 
     /**
      * Test BurstFilter by surpassing maximum number of log messages allowed by filter and
@@ -70,7 +70,7 @@ public class BurstFilterTest {
         assertNotNull("No ListAppender", app);
         assertNotNull("No BurstFilter", filter);
         // exceed the burst limit and make sure no more than 100 errors get logged
-        long start = System.nanoTime();
+        final long start = System.nanoTime();
         for (int i = 0; i < 110; i++) {
             if (i % 10 == 0) {
                 Thread.sleep(200);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java Mon Dec 10 19:36:06 2012
@@ -44,7 +44,7 @@ public class DynamicThresholdFilterTest 
 
     @After
     public void cleanup() {
-        LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
     }
@@ -53,9 +53,9 @@ public class DynamicThresholdFilterTest 
     public void testFilter() {
         ThreadContext.put("userid", "testuser");
         ThreadContext.put("organization", "apache");
-        KeyValuePair[] pairs = new KeyValuePair[] { new KeyValuePair("testuser", "DEBUG"),
+        final KeyValuePair[] pairs = new KeyValuePair[] { new KeyValuePair("testuser", "DEBUG"),
                                                     new KeyValuePair("JohnDoe", "warn")};
-        DynamicThresholdFilter filter = DynamicThresholdFilter.createFilter("userid", pairs, "ERROR", null, null);
+        final DynamicThresholdFilter filter = DynamicThresholdFilter.createFilter("userid", pairs, "ERROR", null, null);
         filter.start();
         assertTrue(filter.isStarted());
         assertTrue(filter.filter(null, Level.DEBUG, null, null, (Throwable)null) == Filter.Result.NEUTRAL);
@@ -72,16 +72,16 @@ public class DynamicThresholdFilterTest 
 
     @Test
     public void testConfig() {
-        LoggerContext ctx = Configurator.initialize("Test1", null, "target/test-classes/log4j2-dynamicfilter.xml");
-        Configuration config = ctx.getConfiguration();
-        Filter filter = config.getFilter();
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "target/test-classes/log4j2-dynamicfilter.xml");
+        final Configuration config = ctx.getConfiguration();
+        final Filter filter = config.getFilter();
         assertNotNull("No DynamicThresholdFilter", filter);
         assertTrue("Not a DynamicThresholdFilter", filter instanceof DynamicThresholdFilter);
-        DynamicThresholdFilter dynamic = (DynamicThresholdFilter) filter;
-        String key = dynamic.getKey();
+        final DynamicThresholdFilter dynamic = (DynamicThresholdFilter) filter;
+        final String key = dynamic.getKey();
         assertNotNull("Key is null", key);
         assertTrue("Incorrect key value", key.equals("loginId"));
-        Map<String, Level> map = dynamic.getLevelMap();
+        final Map<String, Level> map = dynamic.getLevelMap();
         assertNotNull("Map is null", map);
         assertTrue("Incorrect number of map elements", map.size() == 1);
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MapFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MapFilterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MapFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MapFilterTest.java Mon Dec 10 19:36:06 2012
@@ -46,14 +46,14 @@ public class MapFilterTest {
 
     @After
     public void cleanup() {
-        LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
     }
 
     @Test
     public void testFilter() {
-        KeyValuePair[] pairs = new KeyValuePair[] { new KeyValuePair("FromAccount", "211000"),
+        final KeyValuePair[] pairs = new KeyValuePair[] { new KeyValuePair("FromAccount", "211000"),
                                                     new KeyValuePair("ToAccount", "123456")};
         MapFilter filter = MapFilter.createFilter(pairs, "and", null, null);
         filter.start();
@@ -79,27 +79,27 @@ public class MapFilterTest {
 
     @Test
     public void testConfig() {
-        LoggerContext ctx = Configurator.initialize("Test1", null, "target/test-classes/log4j2-mapfilter.xml");
-        Configuration config = ctx.getConfiguration();
-        Filter filter = config.getFilter();
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "target/test-classes/log4j2-mapfilter.xml");
+        final Configuration config = ctx.getConfiguration();
+        final Filter filter = config.getFilter();
         assertNotNull("No MapFilter", filter);
         assertTrue("Not a MapFilter", filter instanceof  MapFilter);
-        MapFilter mapFilter = (MapFilter) filter;
+        final MapFilter mapFilter = (MapFilter) filter;
         assertFalse("Should not be And filter", mapFilter.isAnd());
-        Map<String, List<String>> map = mapFilter.getMap();
+        final Map<String, List<String>> map = mapFilter.getMap();
         assertNotNull("No Map", map == null);
         assertTrue("No elements in Map", map.size() != 0);
         assertTrue("Incorrect number of elements in Map", map.size() == 1);
         assertTrue("Map does not contain key eventId", map.containsKey("eventId"));
         assertTrue("List does not contain 2 elements", map.get("eventId").size() == 2);
-        Logger logger = LogManager.getLogger(MapFilterTest.class);
-        Map<String, String> eventMap = new HashMap<String, String>();
+        final Logger logger = LogManager.getLogger(MapFilterTest.class);
+        final Map<String, String> eventMap = new HashMap<String, String>();
         eventMap.put("eventId", "Login");
         logger.debug(new MapMessage(eventMap));
-        Map<String,Appender> appenders = config.getAppenders();
-        Appender app = appenders.get("LIST");
+        final Map<String,Appender> appenders = config.getAppenders();
+        final Appender app = appenders.get("LIST");
         assertNotNull("No List appender", app);
-        List<String> msgs = ((ListAppender) app).getMessages();
+        final List<String> msgs = ((ListAppender) app).getMessages();
         assertNotNull("No messages", msgs);
         assertTrue("No messages", msgs.size() > 0);
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MarkerFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MarkerFilterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MarkerFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MarkerFilterTest.java Mon Dec 10 19:36:06 2012
@@ -34,11 +34,11 @@ public class MarkerFilterTest {
 
     @Test
     public void testMarkers() {
-        Marker parent = MarkerManager.getMarker("Parent");
-        Marker child = MarkerManager.getMarker("Child", parent);
-        Marker grandChild = MarkerManager.getMarker("GrandChild", child);
-        Marker sibling = MarkerManager.getMarker("Sibling", parent);
-        Marker stranger = MarkerManager.getMarker("Stranger");
+        final Marker parent = MarkerManager.getMarker("Parent");
+        final Marker child = MarkerManager.getMarker("Child", parent);
+        final Marker grandChild = MarkerManager.getMarker("GrandChild", child);
+        final Marker sibling = MarkerManager.getMarker("Sibling", parent);
+        final Marker stranger = MarkerManager.getMarker("Stranger");
         MarkerFilter filter = MarkerFilter.createFilter("Parent", null, null);
         filter.start();
         assertTrue(filter.isStarted());

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/StructuredDataFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/StructuredDataFilterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/StructuredDataFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/StructuredDataFilterTest.java Mon Dec 10 19:36:06 2012
@@ -46,7 +46,7 @@ public class StructuredDataFilterTest {
 
     @Test
     public void testFilter() {
-        KeyValuePair[] pairs = new KeyValuePair[] { new KeyValuePair("id.name", "AccountTransfer"),
+        final KeyValuePair[] pairs = new KeyValuePair[] { new KeyValuePair("id.name", "AccountTransfer"),
                                                     new KeyValuePair("ToAccount", "123456")};
         StructuredDataFilter filter = StructuredDataFilter.createFilter(pairs, "and", null, null);
         filter.start();
@@ -72,14 +72,14 @@ public class StructuredDataFilterTest {
 
     @Test
     public void testConfig() {
-        LoggerContext ctx = Configurator.initialize("Test1", null, "target/test-classes/log4j2-sdfilter.xml");
-        Configuration config = ctx.getConfiguration();
-        Filter filter = config.getFilter();
+        final LoggerContext ctx = Configurator.initialize("Test1", null, "target/test-classes/log4j2-sdfilter.xml");
+        final Configuration config = ctx.getConfiguration();
+        final Filter filter = config.getFilter();
         assertNotNull("No StructuredDataFilter", filter);
         assertTrue("Not a StructuredDataFilter", filter instanceof  StructuredDataFilter);
-        StructuredDataFilter sdFilter = (StructuredDataFilter) filter;
+        final StructuredDataFilter sdFilter = (StructuredDataFilter) filter;
         assertFalse("Should not be And filter", sdFilter.isAnd());
-        Map<String, List<String>> map = sdFilter.getMap();
+        final Map<String, List<String>> map = sdFilter.getMap();
         assertNotNull("No Map", map);
         assertTrue("No elements in Map", map.size() != 0);
         assertTrue("Incorrect number of elements in Map", map.size() == 1);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilterTest.java Mon Dec 10 19:36:06 2012
@@ -34,7 +34,7 @@ public class ThreadContextMapFilterTest 
     public void testFilter() {
         ThreadContext.put("userid", "testuser");
         ThreadContext.put("organization", "Apache");
-        KeyValuePair[] pairs = new KeyValuePair[] { new KeyValuePair("userid", "JohnDoe"),
+        final KeyValuePair[] pairs = new KeyValuePair[] { new KeyValuePair("userid", "JohnDoe"),
                                                     new KeyValuePair("organization", "Apache")};
         ThreadContextMapFilter filter = ThreadContextMapFilter.createFilter(pairs, "and", null, null);
         filter.start();

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/ThresholdFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/ThresholdFilterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/ThresholdFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/ThresholdFilterTest.java Mon Dec 10 19:36:06 2012
@@ -32,7 +32,7 @@ public class ThresholdFilterTest {
 
     @Test
     public void testThresholds() {
-        ThresholdFilter filter = ThresholdFilter.createFilter("ERROR", null, null);
+        final ThresholdFilter filter = ThresholdFilter.createFilter("ERROR", null, null);
         filter.start();
         assertTrue(filter.isStarted());
         assertTrue(filter.filter(null, Level.DEBUG, null, null, (Throwable)null) == Filter.Result.DENY);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java Mon Dec 10 19:36:06 2012
@@ -34,10 +34,10 @@ public class TimeFilterTest {
 
     @Test
     public void testTime() {
-        TimeFilter filter = TimeFilter.createFilter("02:00:00", "03:00:00", "America/LosAngeles", null, null);
+        final TimeFilter filter = TimeFilter.createFilter("02:00:00", "03:00:00", "America/LosAngeles", null, null);
         filter.start();
         assertTrue(filter.isStarted());
-        Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("America/LosAngeles"));
+        final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("America/LosAngeles"));
         cal.set(Calendar.HOUR_OF_DAY, 02);
         long tod = cal.getTimeInMillis();
         LogEvent event = new Log4jLogEvent(null, null, null, null, null, null, null, null, null, null, tod);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/UUIDTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/UUIDTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/UUIDTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/UUIDTest.java Mon Dec 10 19:36:06 2012
@@ -34,17 +34,17 @@ public class UUIDTest {
 
     @Test
     public void testTimeBaseUUID() {
-        UUID uuid = UUIDUtil.getTimeBasedUUID();
-        UUID uuid2 = UUIDUtil.getTimeBasedUUID();
-        long current = (System.currentTimeMillis() * 10000) + NUM_100NS_INTERVALS_SINCE_UUID_EPOCH;
-        long time = uuid.timestamp();
+        final UUID uuid = UUIDUtil.getTimeBasedUUID();
+        final UUID uuid2 = UUIDUtil.getTimeBasedUUID();
+        final long current = (System.currentTimeMillis() * 10000) + NUM_100NS_INTERVALS_SINCE_UUID_EPOCH;
+        final long time = uuid.timestamp();
         assertTrue("Incorrect time", current + 10000 - time > 0);
-        UUID[] uuids = new UUID[COUNT];
-        long start = System.nanoTime();
+        final UUID[] uuids = new UUID[COUNT];
+        final long start = System.nanoTime();
         for (int i=0; i < COUNT; ++i) {
             uuids[i] = UUIDUtil.getTimeBasedUUID();
         }
-        long elapsed = System.nanoTime() - start;
+        final long elapsed = System.nanoTime() - start;
         System.out.println("Elapsed for " + COUNT + " UUIDS = " + elapsed + " Average = " + elapsed / COUNT + " ns");
         int errors = 0;
         for (int i=0; i < COUNT; ++i) {
@@ -56,19 +56,19 @@ public class UUIDTest {
             }
         }
         assertTrue(errors + " duplicate UUIDS", errors == 0);
-        int variant = uuid.variant();
+        final int variant = uuid.variant();
         assertTrue("Incorrect variant. Expected 2 got " + variant, variant == 2);
-        int version = uuid.version();
+        final int version = uuid.version();
         assertTrue("Incorrect version. Expected 1 got " + version, version == 1);
-        long node = uuid.node();
+        final long node = uuid.node();
         assertTrue("Invalid node", node != 0);
     }
 
     @Test
     public void testThreads() throws Exception {
-        Thread[] threads = new Thread[THREADS];
-        UUID[] uuids = new UUID[COUNT * THREADS];
-        long[] elapsed = new long[THREADS];
+        final Thread[] threads = new Thread[THREADS];
+        final UUID[] uuids = new UUID[COUNT * THREADS];
+        final long[] elapsed = new long[THREADS];
         for (int i=0; i < THREADS; ++i) {
             threads[i] = new Worker(uuids, elapsed, i, COUNT);
         }
@@ -98,12 +98,12 @@ public class UUIDTest {
 
     private class Worker extends Thread {
 
-        private UUID[] uuids;
-        private long[] elapsed;
-        private int index;
-        private int count;
+        private final UUID[] uuids;
+        private final long[] elapsed;
+        private final int index;
+        private final int count;
 
-        public Worker(UUID[] uuids, long[] elapsed, int index, int count) {
+        public Worker(final UUID[] uuids, final long[] elapsed, final int index, final int count) {
             this.uuids = uuids;
             this.index = index;
             this.count = count;
@@ -112,8 +112,8 @@ public class UUIDTest {
 
         @Override
         public void run() {
-            int pos = index * count;
-            long start = System.nanoTime();
+            final int pos = index * count;
+            final long start = System.nanoTime();
             for (int i=pos; i < pos + count; ++i) {
                 uuids[i] = UUIDUtil.getTimeBasedUUID();
             }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/HTMLLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/HTMLLayoutTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/HTMLLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/HTMLLayoutTest.java Mon Dec 10 19:36:06 2012
@@ -44,7 +44,7 @@ public class HTMLLayoutTest {
     @BeforeClass
     public static void setupClass() {
         ConfigurationFactory.setConfigurationFactory(cf);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
     }
 
@@ -67,8 +67,8 @@ public class HTMLLayoutTest {
     public void testLayout() throws Exception {
 
         // set up appender
-        HTMLLayout layout = HTMLLayout.createLayout("true", null, null, null, "small", null);
-        ListAppender appender = new ListAppender("List", null, layout, true, false);
+        final HTMLLayout layout = HTMLLayout.createLayout("true", null, null, null, "small", null);
+        final ListAppender appender = new ListAppender("List", null, layout, true, false);
         appender.start();
 
         // set appender on root and set level to debug
@@ -94,7 +94,7 @@ public class HTMLLayoutTest {
 
         appender.stop();
 
-        List<String> list = appender.getMessages();
+        final List<String> list = appender.getMessages();
         assertTrue("Incorrect number of lines. Require at least 85 " + list.size(), list.size() > 85);
         assertTrue("Incorrect header", list.get(3).equals("<title>Log4J Log Messages</title>"));
         assertTrue("Incorrect footer", list.get(list.size() - 1).equals("</body></html>"));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java Mon Dec 10 19:36:06 2012
@@ -51,7 +51,7 @@ public class PatternLayoutTest {
     @BeforeClass
     public static void setupClass() {
         ConfigurationFactory.setConfigurationFactory(cf);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
     }
 
@@ -67,16 +67,16 @@ public class PatternLayoutTest {
     @Test
     public void mdcPattern() throws Exception {
 
-        String mdcMsgPattern1 = "%m : %X%n";
-        String mdcMsgPattern2 = "%m : %X{key1}%n";
-        String mdcMsgPattern3 = "%m : %X{key2}%n";
-        String mdcMsgPattern4 = "%m : %X{key3}%n";
-        String mdcMsgPattern5 = "%m : %X{key1},%X{key2},%X{key3}%n";
+        final String mdcMsgPattern1 = "%m : %X%n";
+        final String mdcMsgPattern2 = "%m : %X{key1}%n";
+        final String mdcMsgPattern3 = "%m : %X{key2}%n";
+        final String mdcMsgPattern4 = "%m : %X{key3}%n";
+        final String mdcMsgPattern5 = "%m : %X{key1},%X{key2},%X{key3}%n";
 
         // set up appender
-        PatternLayout layout = PatternLayout.createLayout(msgPattern, ctx.getConfiguration(), null, null);
+        final PatternLayout layout = PatternLayout.createLayout(msgPattern, ctx.getConfiguration(), null, null);
         //FileOutputStream fos = new FileOutputStream(OUTPUT_FILE + "_mdc");
-        FileAppender appender = FileAppender.createAppender(OUTPUT_FILE + "_mdc", "false", "false", "File", "false",
+        final FileAppender appender = FileAppender.createAppender(OUTPUT_FILE + "_mdc", "false", "false", "File", "false",
             "true", "false", layout, null);
         appender.start();
 
@@ -135,12 +135,12 @@ public class PatternLayoutTest {
 
     @Test
     public void testRegex() throws Exception {
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        PatternLayout layout = PatternLayout.createLayout(regexPattern, ctx.getConfiguration(),
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final PatternLayout layout = PatternLayout.createLayout(regexPattern, ctx.getConfiguration(),
             null, null);
-        LogEvent event = new Log4jLogEvent(this.getClass().getName(), null, "org.apache.logging.log4j.core.Logger",
+        final LogEvent event = new Log4jLogEvent(this.getClass().getName(), null, "org.apache.logging.log4j.core.Logger",
             Level.INFO, new SimpleMessage("Hello, world!"), null);
-        byte[] result = layout.toByteArray(event);
+        final byte[] result = layout.toByteArray(event);
         assertEquals("org/apache/logging/log4j/core/layout/PatternLayoutTest Hello, world!", new String(result));
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/RFC5424LayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/RFC5424LayoutTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/RFC5424LayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/RFC5424LayoutTest.java Mon Dec 10 19:36:06 2012
@@ -57,7 +57,7 @@ public class RFC5424LayoutTest {
     public static void setupClass() {
         StatusLogger.getLogger().setLevel(Level.OFF);
         ConfigurationFactory.setConfigurationFactory(cf);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
     }
 
@@ -76,9 +76,9 @@ public class RFC5424LayoutTest {
     public void testLayout() throws Exception {
 
         // set up appender
-        RFC5424Layout layout = RFC5424Layout.createLayout("Local0", "Event", "3692", "true", "RequestContext",
+        final RFC5424Layout layout = RFC5424Layout.createLayout("Local0", "Event", "3692", "true", "RequestContext",
             "true", "ATM", null, "key1, key2, locale", null, "loginId", null, null);
-        ListAppender appender = new ListAppender("List", null, layout, true, false);
+        final ListAppender appender = new ListAppender("List", null, layout, true, false);
         appender.start();
 
         // set appender on root and set level to debug
@@ -100,7 +100,7 @@ public class RFC5424LayoutTest {
         ThreadContext.put("ipAddress", "192.168.0.120");
         ThreadContext.put("locale", Locale.US.getDisplayName());
         try {
-            StructuredDataMessage msg = new StructuredDataMessage("Transfer@18060", "Transfer Complete", "Audit");
+            final StructuredDataMessage msg = new StructuredDataMessage("Transfer@18060", "Transfer Complete", "Audit");
             msg.put("ToAccount", "123456");
             msg.put("FromAccount", "123457");
             msg.put("Amount", "200.00");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java Mon Dec 10 19:36:06 2012
@@ -48,7 +48,7 @@ public class SerializedLayoutTest {
     @BeforeClass
     public static void setupClass() {
         ConfigurationFactory.setConfigurationFactory(cf);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
     }
 
@@ -75,8 +75,8 @@ public class SerializedLayoutTest {
     public void testLayout() throws Exception {
 
         // set up appender
-        SerializedLayout layout = SerializedLayout.createLayout();
-        ListAppender appender = new ListAppender("List", null, layout, false, true);
+        final SerializedLayout layout = SerializedLayout.createLayout();
+        final ListAppender appender = new ListAppender("List", null, layout, false, true);
         appender.start();
 
         // set appender on root and set level to debug
@@ -100,16 +100,16 @@ public class SerializedLayoutTest {
 
         appender.stop();
 
-        List<byte[]> data = appender.getData();
+        final List<byte[]> data = appender.getData();
         assertTrue(data.size() > 0);
         int i = 0;
-        for (byte[] item : data) {
-            ByteArrayInputStream bais = new ByteArrayInputStream(item);
-            ObjectInputStream ois = new ObjectInputStream(bais);
+        for (final byte[] item : data) {
+            final ByteArrayInputStream bais = new ByteArrayInputStream(item);
+            final ObjectInputStream ois = new ObjectInputStream(bais);
             LogEvent event;
             try {
                 event = (LogEvent) ois.readObject();
-            } catch (IOException ioe) {
+            } catch (final IOException ioe) {
                 System.err.println("Exception processing item " + i);
                 throw ioe;
             }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java Mon Dec 10 19:36:06 2012
@@ -54,7 +54,7 @@ public class SyslogLayoutTest {
     @BeforeClass
     public static void setupClass() {
         ConfigurationFactory.setConfigurationFactory(cf);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
     }
 
@@ -73,9 +73,9 @@ public class SyslogLayoutTest {
     public void testLayout() throws Exception {
 
         // set up appender
-        SyslogLayout layout = SyslogLayout.createLayout("Local0", "true", null);
+        final SyslogLayout layout = SyslogLayout.createLayout("Local0", "true", null);
         //ConsoleAppender appender = new ConsoleAppender("Console", layout);
-        ListAppender appender = new ListAppender("List", null, layout, true, false);
+        final ListAppender appender = new ListAppender("List", null, layout, true, false);
         appender.start();
 
         // set appender on root and set level to debug
@@ -95,7 +95,7 @@ public class SyslogLayoutTest {
         ThreadContext.put("loginId", "JohnDoe");
         ThreadContext.put("ipAddress", "192.168.0.120");
         ThreadContext.put("locale", Locale.US.getDisplayName());
-        StructuredDataMessage msg = new StructuredDataMessage("Transfer@18060", "Transfer Complete", "Audit");
+        final StructuredDataMessage msg = new StructuredDataMessage("Transfer@18060", "Transfer Complete", "Audit");
         msg.put("ToAccount", "123456");
         msg.put("FromAccount", "123457");
         msg.put("Amount", "200.00");
@@ -105,7 +105,7 @@ public class SyslogLayoutTest {
 
         appender.stop();
 
-        List<String> list = appender.getMessages();
+        final List<String> list = appender.getMessages();
 
         assertTrue("Expected line 1 to end with: " + line1 + " Actual " + list.get(0), list.get(0).endsWith(line1));
         assertTrue("Expected line 2 to end with: " + line2 + " Actual " + list.get(1), list.get(1).endsWith(line2));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java Mon Dec 10 19:36:06 2012
@@ -44,7 +44,7 @@ public class XMLLayoutTest {
     @BeforeClass
     public static void setupClass() {
         ConfigurationFactory.setConfigurationFactory(cf);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
     }
 
@@ -64,8 +64,8 @@ public class XMLLayoutTest {
     public void testLayout() throws Exception {
 
         // set up appender
-        XMLLayout layout = XMLLayout.createLayout("true", "true", "true", null);
-        ListAppender appender = new ListAppender("List", null, layout, true, false);
+        final XMLLayout layout = XMLLayout.createLayout("true", "true", "true", null);
+        final ListAppender appender = new ListAppender("List", null, layout, true, false);
         appender.start();
 
         // set appender on root and set level to debug
@@ -89,7 +89,7 @@ public class XMLLayoutTest {
 
         appender.stop();
 
-        List<String> list = appender.getMessages();
+        final List<String> list = appender.getMessages();
 
         assertTrue("Incorrect number of lines. Require at least 50 " + list.size(), list.size() > 50);
         assertTrue("Incorrect header", list.get(0).equals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/ContextMapLookupTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/ContextMapLookupTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/ContextMapLookupTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/ContextMapLookupTest.java Mon Dec 10 19:36:06 2012
@@ -33,7 +33,7 @@ public class ContextMapLookupTest {
     @Test
     public void testLookup() {
         ThreadContext.put(TESTKEY, TESTVAL);
-        StrLookup lookup = new ContextMapLookup();
+        final StrLookup lookup = new ContextMapLookup();
         String value = lookup.lookup(TESTKEY);
         assertEquals(TESTVAL, value);
         value = lookup.lookup("BadKey");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/DateLookupTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/DateLookupTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/DateLookupTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/DateLookupTest.java Mon Dec 10 19:36:06 2012
@@ -36,9 +36,9 @@ public class DateLookupTest {
 
     @Test
     public void testLookup() {
-        StrLookup lookup = new DateLookup();
-        LogEvent event = new MyLogEvent();
-        String value = lookup.lookup(event, "MM/dd/yyyy");
+        final StrLookup lookup = new DateLookup();
+        final LogEvent event = new MyLogEvent();
+        final String value = lookup.lookup(event, "MM/dd/yyyy");
         assertNotNull(value);
         assertEquals("12/30/2011", value);
     }
@@ -69,7 +69,7 @@ public class DateLookupTest {
         }
 
         public long getMillis() {
-            Calendar cal = Calendar.getInstance();
+            final Calendar cal = Calendar.getInstance();
             cal.set(2011, 11, 30, 10, 56, 35);
             return cal.getTimeInMillis();
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/EnvironmentLookupTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/EnvironmentLookupTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/EnvironmentLookupTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/EnvironmentLookupTest.java Mon Dec 10 19:36:06 2012
@@ -29,7 +29,7 @@ public class EnvironmentLookupTest {
 
     @Test
     public void testLookup() {
-        StrLookup lookup = new EnvironmentLookup();
+        final StrLookup lookup = new EnvironmentLookup();
         String value = lookup.lookup("PATH");
         assertNotNull(value);
         value = lookup.lookup("BadKey");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java Mon Dec 10 19:36:06 2012
@@ -49,9 +49,9 @@ public class InterpolatorTest {
 
     @Test
     public void testLookup() {
-        Map<String, String> map = new HashMap<String, String>();
+        final Map<String, String> map = new HashMap<String, String>();
         map.put(TESTKEY, TESTVAL);
-        StrLookup lookup = new Interpolator(new MapLookup<String>(map));
+        final StrLookup lookup = new Interpolator(new MapLookup<String>(map));
         ThreadContext.put(TESTKEY, TESTVAL);
         String value = lookup.lookup(TESTKEY);
         assertEquals(TESTVAL, value);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/StrSubstitutorTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/StrSubstitutorTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/StrSubstitutorTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/StrSubstitutorTest.java Mon Dec 10 19:36:06 2012
@@ -48,10 +48,10 @@ public class StrSubstitutorTest {
 
     @Test
     public void testLookup() {
-        Map<String, String> map = new HashMap<String, String>();
+        final Map<String, String> map = new HashMap<String, String>();
         map.put(TESTKEY, TESTVAL);
-        StrLookup lookup = new Interpolator(new MapLookup<String>(map));
-        StrSubstitutor subst = new StrSubstitutor(lookup);
+        final StrLookup lookup = new Interpolator(new MapLookup<String>(map));
+        final StrSubstitutor subst = new StrSubstitutor(lookup);
         ThreadContext.put(TESTKEY, TESTVAL);
         String value = subst.replace("${TestKey}-${ctx:TestKey}-${sys:TestKey}");
         assertEquals("TestValue-TestValue-TestValue", value);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/StructuredDataLookupTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/StructuredDataLookupTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/StructuredDataLookupTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/StructuredDataLookupTest.java Mon Dec 10 19:36:06 2012
@@ -36,9 +36,9 @@ public class StructuredDataLookupTest {
 
     @Test
     public void testLookup() {
-        Message msg = new StructuredDataMessage("Test", "This is a test", "Audit");
-        LogEvent event = new Log4jLogEvent(null, null, null, Level.DEBUG, msg, null);
-        StrLookup lookup = new StructuredDataLookup();
+        final Message msg = new StructuredDataMessage("Test", "This is a test", "Audit");
+        final LogEvent event = new Log4jLogEvent(null, null, null, Level.DEBUG, msg, null);
+        final StrLookup lookup = new StructuredDataLookup();
         String value = lookup.lookup(event, TESTKEY);
         assertEquals(TESTVAL, value);
         value = lookup.lookup("BadKey");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/SystemPropertiesLookupTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/SystemPropertiesLookupTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/SystemPropertiesLookupTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/SystemPropertiesLookupTest.java Mon Dec 10 19:36:06 2012
@@ -44,7 +44,7 @@ public class SystemPropertiesLookupTest 
 
     @Test
     public void testLookup() {
-        StrLookup lookup = new SystemPropertiesLookup();
+        final StrLookup lookup = new SystemPropertiesLookup();
         String value = lookup.lookup(TESTKEY);
         assertEquals(TESTVAL, value);
         value = lookup.lookup("BadKey");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueAppenderTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueAppenderTest.java Mon Dec 10 19:36:06 2012
@@ -71,7 +71,7 @@ public class JMSQueueAppenderTest {
     @BeforeClass
     public static void setupClass() throws Exception {
         // MockContextFactory becomes the primary JNDI provider
-        StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
+        final StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
         StatusLogger.getLogger().registerListener(l);
         MockContextFactory.setAsInitial();
         context = new InitialContext();
@@ -88,9 +88,9 @@ public class JMSQueueAppenderTest {
 
     @Test
     public void testConfiguration() throws Exception {
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        Configuration config = ctx.getConfiguration();
-        Map<String, Appender> appenders = config.getAppenders();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final Configuration config = ctx.getConfiguration();
+        final Map<String, Appender> appenders = config.getAppenders();
         assertTrue(appenders.containsKey("JMSQueue"));
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueFailoverTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueFailoverTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueFailoverTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueFailoverTest.java Mon Dec 10 19:36:06 2012
@@ -78,7 +78,7 @@ public class JMSQueueFailoverTest {
     @Before
     public void before() {
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
                 break;
@@ -91,7 +91,7 @@ public class JMSQueueFailoverTest {
 
     private static void setupQueue() throws Exception {
         // MockContextFactory becomes the primary JNDI provider
-        StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
+        final StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
         StatusLogger.getLogger().registerListener(l);
         MockContextFactory.setAsInitial();
         context = new InitialContext();
@@ -104,9 +104,9 @@ public class JMSQueueFailoverTest {
     @Test
     public void testFailover() throws Exception {
         ThreadContext.put("appender", "Failover");
-        Logger logger = LogManager.getLogger(JMSQueueFailoverTest.class);
+        final Logger logger = LogManager.getLogger(JMSQueueFailoverTest.class);
         logger.debug("Test Message");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertNotNull("No events returned", events);
         assertTrue("No events returned", events.size() > 0);
         assertTrue("Incorrect event", "Test Message".equals(events.get(0).getMessage().getFormattedMessage()));
@@ -117,9 +117,9 @@ public class JMSQueueFailoverTest {
         context.rebind(QUEUE_NAME, new MockQueue(QUEUE_NAME));
         receiver = new JMSQueueReceiver(FACTORY_NAME, QUEUE_NAME, null, null);
         ThreadContext.put("appender", "Failover");
-        Logger logger = LogManager.getLogger(JMSQueueFailoverTest.class);
+        final Logger logger = LogManager.getLogger(JMSQueueFailoverTest.class);
         logger.debug("Test Message");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertNotNull("No events returned", events);
         assertTrue("No events returned", events.size() > 0);
         assertTrue("Incorrect event", "Test Message".equals(events.get(0).getMessage().getFormattedMessage()));



Mime
View raw message