From 194738dd91aa9f9924761146c342a4871e9f9635 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Tue, 11 Nov 2014 15:30:34 +0000 Subject: [PATCH] Restore printing out test-failures after switch to JUnit4 execution git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1638179 13f79535-47bb-0310-9956-ffa450edef68 --- src/ooxml/java/org/apache/poi/util/OOXMLLite.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/util/OOXMLLite.java b/src/ooxml/java/org/apache/poi/util/OOXMLLite.java index c941901df..0550c1a91 100644 --- a/src/ooxml/java/org/apache/poi/util/OOXMLLite.java +++ b/src/ooxml/java/org/apache/poi/util/OOXMLLite.java @@ -36,6 +36,7 @@ import java.util.jar.JarFile; import junit.framework.TestCase; import org.junit.Test; +import org.junit.internal.TextListener; import org.junit.runner.JUnitCore; import org.junit.runner.Result; @@ -92,7 +93,6 @@ public final class OOXMLLite { } void build() throws IOException, ClassNotFoundException { - List> lst = new ArrayList>(); //collect unit tests System.out.println("Collecting unit tests from " + _testDir); @@ -101,7 +101,9 @@ public final class OOXMLLite { System.out.println("Found " + lst.size() + " classes"); //run tests - Result result = JUnitCore.runClasses(lst.toArray(new Class[lst.size()])); + JUnitCore jUnitCore = new JUnitCore(); + jUnitCore.addListener(new TextListener(System.out)); + Result result = jUnitCore.run(lst.toArray(new Class[lst.size()])); if (!result.wasSuccessful()) { throw new RuntimeException("Tests did not succeed, cannot build ooxml-lite jar"); }