Attach exception messages to JUnit fail() calls
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 18 Feb 2016 21:34:37 +0000 (16:34 -0500)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 18 Feb 2016 23:45:14 +0000 (18:45 -0500)
Makes failures more informative!

Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/integration/context/AppContextITBase.java
lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/integration/context/AppContextOrderingITBase.java
lttng-ust-java-tests-common/src/test/java/org/lttng/ust/agent/context/ContextRegistrationIT.java
lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java
lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/context/JulAppContextOrderingIT.java
lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulLegacyApiIT.java
lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/filter/JulFilterListenerOrderingIT.java
lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/context/Log4jAppContextOrderingIT.java
lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jLegacyApiIT.java
lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/filter/Log4jFilterListenerOrderingIT.java

index 65eff8d1d611885147242662fb78ad535820f09f..695dd040e71e5682c25ee46b99c5ac420b1bde33 100644 (file)
@@ -69,7 +69,7 @@ public abstract class AppContextITBase {
             cim = ContextInfoManager.getInstance();
         } catch (SecurityException | IOException e) {
             /* The native library is not available! */
-            fail();
+            fail(e.getMessage());
         }
         session = ILttngSession.createSession(null, getDomain());
     }
index d0acca359c141455a173bc67d1e95f58886e8bd7..2a2da8e7a4bfe2995fbdfe88c6f8edbd31beec87 100644 (file)
@@ -78,7 +78,7 @@ public abstract class AppContextOrderingITBase {
             cim = ContextInfoManager.getInstance();
         } catch (SecurityException | IOException e) {
             /* The native library is not available! */
-            fail();
+            fail(e.getMessage());
         }
         session = ILttngSession.createSession(null, getDomain());
     }
index 4b8fc2caa76b1db3dda96bad025e557a8f85e66d..8455374346af04f6348cd19c72bc9834a325ba89 100644 (file)
@@ -46,7 +46,7 @@ public class ContextRegistrationIT {
         try {
             mgr = ContextInfoManager.getInstance();
         } catch (SecurityException | IOException e) {
-            fail();
+            fail(e.getMessage());
         }
     }
 
index a36578be8ebfca40963011c6292f8d2885de38c4..ddca5e977d5b841f2b58cc62c69d81e421e740b1 100644 (file)
@@ -66,7 +66,7 @@ public class OldLttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchma
             logger.addHandler(agentHandler);
 
         } catch (ReflectiveOperationException e) {
-            fail();
+            fail(e.getMessage());
         }
 
         session = ILttngSession.createSession(null, Domain.JUL);
index 1cef0d40e104497e9a364be340bd62583c8ef8ca..d3a2f6481e27ad775929b94c53ea324e5cc27358 100644 (file)
@@ -78,7 +78,7 @@ public class JulAppContextOrderingIT extends AppContextOrderingITBase {
         try {
             logHandler = new LttngLogHandler();
         } catch (SecurityException | IOException e) {
-            fail();
+            fail(e.getMessage());
         }
         logger.addHandler((Handler) logHandler);
     }
index 9a20f89a48b06627948f7a8f10cc850dde7a2277..35d70baaf71f8900719a10e4d95054f0502f15d9 100644 (file)
@@ -183,7 +183,7 @@ public class JulLegacyApiIT {
             julHandlerField.setAccessible(true);
             return (ILttngHandler) julHandlerField.get(LTTngAgent.getLTTngAgent());
         } catch (ReflectiveOperationException | SecurityException e) {
-            fail();
+            fail(e.getMessage());
             return null;
         }
     }
index e4a81b8f18b273df40a1d30b7dbe1eb4fe10715f..f52b90d5b0d30c37a690dc5d4348280217934ec2 100644 (file)
@@ -66,7 +66,7 @@ public class JulFilterListenerOrderingIT extends FilterListenerOrderingITBase {
         try {
             handler = new LttngLogHandler();
         } catch (SecurityException | IOException e) {
-            fail();
+            fail(e.getMessage());
         }
         logger.addHandler(handler);
     }
index 69e45bc09d8ed3e3dca879dee87d85689e180e62..7b69351f761e59c875b8b74cb1cec7276cfedb1b 100644 (file)
@@ -78,7 +78,7 @@ public class Log4jAppContextOrderingIT extends AppContextOrderingITBase {
         try {
             logHandler = new LttngLogAppender();
         } catch (SecurityException | IOException e) {
-            fail();
+            fail(e.getMessage());
         }
         logger.addAppender((Appender) logHandler);
     }
index e6b9a7903c40e010a7dd74e686ec43b9332ce058..fe613d39d2b5aa1c123aa4e4754a3bdc6586478e 100644 (file)
@@ -184,7 +184,7 @@ public class Log4jLegacyApiIT {
             log4jAppenderField.setAccessible(true);
             return (ILttngHandler) log4jAppenderField.get(LTTngAgent.getLTTngAgent());
         } catch (ReflectiveOperationException | SecurityException e) {
-            fail();
+            fail(e.getMessage());
             return null;
         }
     }
index e74a5d15817b6b8c67a308b81ddb8dd94722dede..5db9d2ba73594aaeb0e9ba03ede4b000e561f927 100644 (file)
@@ -66,7 +66,7 @@ public class Log4jFilterListenerOrderingIT extends FilterListenerOrderingITBase
         try {
             appender = new LttngLogAppender();
         } catch (SecurityException | IOException e) {
-            fail();
+            fail(e.getMessage());
         }
         logger.addAppender(appender);
     }
This page took 0.027997 seconds and 4 git commands to generate.