From 7691de0fd1c937b9a67f5f48f8ade291cf3ddbf1 Mon Sep 17 00:00:00 2001 From: Andrej Fink Date: Tue, 18 Oct 2022 20:05:14 +0300 Subject: [PATCH] Maven build works nice too --- .../test/java/org/jooq/lambda/ExtraMagicTest.java | 12 ++++++++++++ .../test/java/org/jooq/lambda/ExtraMagicTest.java | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/jOOL-java-8/src/test/java/org/jooq/lambda/ExtraMagicTest.java b/jOOL-java-8/src/test/java/org/jooq/lambda/ExtraMagicTest.java index 56a3d95..1b72174 100644 --- a/jOOL-java-8/src/test/java/org/jooq/lambda/ExtraMagicTest.java +++ b/jOOL-java-8/src/test/java/org/jooq/lambda/ExtraMagicTest.java @@ -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 ")); } diff --git a/jOOL/src/test/java/org/jooq/lambda/ExtraMagicTest.java b/jOOL/src/test/java/org/jooq/lambda/ExtraMagicTest.java index 56a3d95..1b72174 100644 --- a/jOOL/src/test/java/org/jooq/lambda/ExtraMagicTest.java +++ b/jOOL/src/test/java/org/jooq/lambda/ExtraMagicTest.java @@ -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 ")); }