Add missing (simple) test for org.apache.logging.log4j.Level.forName(String, int).
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/8b10560c Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/8b10560c Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/8b10560c Branch: refs/heads/master Commit: 8b10560c320d2f60791b2239d80bc9cf5eedc95b Parents: 71065d3 Author: ggregory <[email protected]> Authored: Tue Aug 25 16:15:29 2015 -0700 Committer: ggregory <[email protected]> Committed: Tue Aug 25 16:15:29 2015 -0700 ---------------------------------------------------------------------- .../test/java/org/apache/logging/log4j/LevelTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8b10560c/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java ---------------------------------------------------------------------- diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java index 9a37144..15d6874 100644 --- a/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java +++ b/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java @@ -33,6 +33,17 @@ public class LevelTest { } @Test + public void testForNameEquals() { + final String name = "Foo"; + final int intValue = 1; + final Level level = Level.forName(name, intValue); + assertNotNull(level); + assertEquals(level, Level.forName(name, intValue)); + assertEquals(level, Level.getLevel(name)); + assertEquals(intValue, Level.getLevel(name).intLevel()); + } + + @Test public void testGoodLevels() { final Level level = Level.toLevel("INFO"); assertNotNull(level);
