Skip to content

Commit

Permalink
Maven build works nice too
Browse files Browse the repository at this point in the history
  • Loading branch information
magicprinc committed Oct 18, 2022
1 parent 67d7cfa commit 7691de0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions jOOL-java-8/src/test/java/org/jooq/lambda/ExtraMagicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,30 @@ public void andThen () {

@Test public void modulesHackJUL () {
Object jul = getActualLogger("java.util.logging.Logger", ExtraMagicTest.class);
if (jul == null) {
System.out.println("No JUL in classpath ???!!!");
return;
}
assertEquals("class java.util.logging.Logger", jul.getClass().toString());
assertTrue(jul.toString().startsWith("java.util.logging.Logger@"));
}

@Test public void modulesHackSlf4j () {
Object slf4j = getActualLogger("org.slf4j.LoggerFactory", ExtraMagicTest.class);
if (slf4j == null) {
System.out.println("No Slf4j in classpath");
return;
}
assertEquals("class org.slf4j.simple.SimpleLogger", slf4j.getClass().toString());// class org.slf4j.helpers.NOPLogger
assertTrue(slf4j.toString().startsWith("org.slf4j.simple.SimpleLogger@"));// org.slf4j.helpers.NOPLogger(NOP)
}

@Test public void modulesHackLog4j () {
Object log4j = getActualLogger("org.apache.logging.log4j.LogManager", ExtraMagicTest.class);
if (log4j == null) {
System.out.println("No Log4j in classpath");
return;
}
assertEquals("class org.apache.logging.log4j.core.Logger", log4j.getClass().toString());
assertTrue(log4j.toString().startsWith("org.jooq.lambda.ExtraMagicTest:ERROR in "));
}
Expand Down
12 changes: 12 additions & 0 deletions jOOL/src/test/java/org/jooq/lambda/ExtraMagicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,30 @@ public void andThen () {

@Test public void modulesHackJUL () {
Object jul = getActualLogger("java.util.logging.Logger", ExtraMagicTest.class);
if (jul == null) {
System.out.println("No JUL in classpath ???!!!");
return;
}
assertEquals("class java.util.logging.Logger", jul.getClass().toString());
assertTrue(jul.toString().startsWith("java.util.logging.Logger@"));
}

@Test public void modulesHackSlf4j () {
Object slf4j = getActualLogger("org.slf4j.LoggerFactory", ExtraMagicTest.class);
if (slf4j == null) {
System.out.println("No Slf4j in classpath");
return;
}
assertEquals("class org.slf4j.simple.SimpleLogger", slf4j.getClass().toString());// class org.slf4j.helpers.NOPLogger
assertTrue(slf4j.toString().startsWith("org.slf4j.simple.SimpleLogger@"));// org.slf4j.helpers.NOPLogger(NOP)
}

@Test public void modulesHackLog4j () {
Object log4j = getActualLogger("org.apache.logging.log4j.LogManager", ExtraMagicTest.class);
if (log4j == null) {
System.out.println("No Log4j in classpath");
return;
}
assertEquals("class org.apache.logging.log4j.core.Logger", log4j.getClass().toString());
assertTrue(log4j.toString().startsWith("org.jooq.lambda.ExtraMagicTest:ERROR in "));
}
Expand Down

0 comments on commit 7691de0

Please sign in to comment.