From: <ble...@us...> - 2010-10-06 16:59:48
|
Revision: 3743 http://bigdata.svn.sourceforge.net/bigdata/?rev=3743&view=rev Author: blevine218 Date: 2010-10-06 16:59:41 +0000 (Wed, 06 Oct 2010) Log Message: ----------- Cleaning up log output during unit tests - Removed some hard-coded log levels - Removed some printlns - Reduced some log levels from DEBUG or TRACE to ERROR Modified Paths: -------------- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/boot/BootComponentTest.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/cache/TestHardReferenceQueue.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java Modified: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/boot/BootComponentTest.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/boot/BootComponentTest.java 2010-10-06 16:36:38 UTC (rev 3742) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/boot/BootComponentTest.java 2010-10-06 16:59:41 UTC (rev 3743) @@ -73,9 +73,12 @@ // @BeforeClass public static void initAll() { public static void initAll() { - System.setProperty("log4j.configuration", DataFinder.bestPath("var/config/logging/log4j.properties") ); - logger = LogUtil.getLog4jLogger - ( (BootComponentTest.class).getName() ); + String log4jConfigFile = System.getProperty("log4j.configuration"); + + if (log4jConfigFile == null) { + System.setProperty("log4j.configuration", DataFinder.bestPath("var/config/logging/log4j.properties") ); + } + logger = LogUtil.getLog4jLogger( (BootComponentTest.class).getName() ); } // Kills any lingering processes Modified: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/cache/TestHardReferenceQueue.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/cache/TestHardReferenceQueue.java 2010-10-06 16:36:38 UTC (rev 3742) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/cache/TestHardReferenceQueue.java 2010-10-06 16:59:41 UTC (rev 3743) @@ -80,7 +80,7 @@ new HardReferenceQueue<String>(new MyListener<String>(), 0); fail("Expecting: " + IllegalArgumentException.class); } catch (IllegalArgumentException ex) { - System.err.println("Ignoring expectedRefs exception: " + ex); + //System.err.println("Ignoring expectedRefs exception: " + ex); } } @@ -100,7 +100,7 @@ cache.add(null); fail("Expecting: " + IllegalArgumentException.class); } catch (IllegalArgumentException ex) { - System.err.println("Ignoring expectedRefs exception: " + ex); + //System.err.println("Ignoring expectedRefs exception: " + ex); } } Modified: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java 2010-10-06 16:36:38 UTC (rev 3742) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java 2010-10-06 16:59:41 UTC (rev 3743) @@ -20,6 +20,8 @@ import org.junit.Test; public class TestEntryUtil { + private static Level TEST_LOG_LEVEL = Level.ERROR; + @Test public void testGetEntryByType_with_null_args() throws SecurityException, NoSuchMethodException, @@ -75,14 +77,14 @@ public void testDisplayEntryEntryLogger() { EntryUtil.displayEntry( new Address(), - getLevelLogger(Level.DEBUG)); + getLevelLogger(TEST_LOG_LEVEL)); } @Test public void testDisplayEntryEntryStringLogger() { EntryUtil.displayEntry( new Location(), "Label", - getLevelLogger(Level.DEBUG)); + getLevelLogger(TEST_LOG_LEVEL)); } @Test public void testDisplayEntryStringEntryStringLogger() { @@ -90,7 +92,7 @@ "Prefix", new Comment("This is a comment."), "Label", - getLevelLogger(Level.DEBUG)); + getLevelLogger(TEST_LOG_LEVEL)); } @Test public void testDisplayEntryStringEntryStringLogger_null() { @@ -98,7 +100,7 @@ null, null, null, - getLevelLogger(Level.DEBUG)); + getLevelLogger(TEST_LOG_LEVEL)); } private static void assertNotEquivalentEntries(Entry entry1, Entry entry2) { @@ -106,7 +108,7 @@ EntryUtil.compareEntries( entry1, entry2, - getLevelLogger(Level.TRACE))); + getLevelLogger(TEST_LOG_LEVEL))); } @Test public void testCompareEntries_not_equal_null() { @@ -135,7 +137,7 @@ EntryUtil.compareEntries( entry1, entry2, - getLevelLogger(Level.TRACE))); + getLevelLogger(TEST_LOG_LEVEL))); } @Test public void testCompareEntries_equal_null() { @@ -196,7 +198,7 @@ EntryUtil.compareEntrySets("Equivalent", entries1, entries2, - getLevelLogger(Level.TRACE))); + getLevelLogger(TEST_LOG_LEVEL))); } private static void assertNotEquivalentSets(Entry[] entries1, Entry[] entries2) { @@ -204,7 +206,7 @@ EntryUtil.compareEntrySets("Not equivalent", entries1, entries2, - getLevelLogger(Level.TRACE))); + getLevelLogger(TEST_LOG_LEVEL))); } @Test public void testCompareEntrySets_unequiv_null() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |