This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git
The following commit(s) were added to refs/heads/master by this push:
new 91a99b5 SLING-9419 - add stack traces to test failures, to investigate
91a99b5 is described below
commit 91a99b540f685ed448f9fdacccd4015415c7f3da
Author: Bertrand Delacretaz <[email protected]>
AuthorDate: Mon May 4 17:19:58 2020 +0200
SLING-9419 - add stack traces to test failures, to investigate
---
pom.xml | 6 ++++++
.../apache/sling/jcr/repoinit/RepositoryInitializerTest.java | 11 +++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 873a300..5cb2644 100644
--- a/pom.xml
+++ b/pom.xml
@@ -292,5 +292,11 @@
<version>1.0.16</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git
a/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java
b/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java
index bbbf605..55b5d26 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/RepositoryInitializerTest.java
@@ -29,6 +29,7 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
+import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.sling.jcr.api.SlingRepository;
import org.apache.sling.jcr.repoinit.impl.JcrRepoInitOpsProcessorImpl;
import org.apache.sling.jcr.repoinit.impl.RepoinitTextProvider.TextFormat;
@@ -134,14 +135,20 @@ public class RepositoryInitializerTest {
initializer.processRepository(context.getService(SlingRepository.class));
} catch(Exception e) {
if(expectedActivateException != null) {
- assertEquals(expectedActivateException, e.getClass());
+ assertEquals(
+ "Expecting a " + expectedActivateException.getName() + "
but got " + withStackTrace(e),
+ expectedActivateException, e.getClass());
} else {
- fail("Got unexpected " + e.getClass().getName() + " in
activation");
+ fail("Unexpected Exception in activation: " +
withStackTrace(e));
}
}
}
+ public static String withStackTrace(Throwable t) {
+ return t.toString() + "\n" + ExceptionUtils.getStackTrace(t);
+ }
+
@Test
public void testLogin() throws Exception {
if(testLogin) {