From: Dominik Stadler Date: Sat, 24 Aug 2013 18:32:45 +0000 (+0000) Subject: Exclude TestUnfixedBugs from OOXMLLite to avoid confusing output in ant-build of... X-Git-Tag: REL_3_10_BETA2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=77d75dd32a56a37aaa3ff6d584af867f33e096fb;p=poi.git Exclude TestUnfixedBugs from OOXMLLite to avoid confusing output in ant-build of ooxml-lite git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1517179 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/util/OOXMLLite.java b/src/ooxml/java/org/apache/poi/util/OOXMLLite.java index 67b820a117..cedc906edf 100644 --- a/src/ooxml/java/org/apache/poi/util/OOXMLLite.java +++ b/src/ooxml/java/org/apache/poi/util/OOXMLLite.java @@ -17,16 +17,25 @@ package org.apache.poi.util; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Vector; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + import junit.framework.TestCase; import junit.framework.TestSuite; import junit.textui.TestRunner; -import java.io.*; -import java.util.*; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import java.lang.reflect.Field; - /** * Build a 'lite' version of the ooxml-schemas.jar * @@ -84,7 +93,8 @@ public final class OOXMLLite { List lst = new ArrayList(); //collect unit tests System.out.println("Collecting unit tests from " + _testDir); - collectTests(_testDir, _testDir, lst, ".+?\\.Test.+?\\.class$"); + collectTests(_testDir, _testDir, lst, ".+?\\.Test.+?\\.class$", ".+TestUnfixedBugs.class"); + System.out.println("Found " + lst.size() + " tests"); TestSuite suite = new TestSuite(); for (String arg : lst) { @@ -146,16 +156,16 @@ public final class OOXMLLite { * @param out output * @param ptrn the pattern (regexp) to filter found files */ - private static void collectTests(File root, File arg, List out, String ptrn) { + private static void collectTests(File root, File arg, List out, String ptrn, String exclude) { if (arg.isDirectory()) { for (File f : arg.listFiles()) { - collectTests(root, f, out, ptrn); + collectTests(root, f, out, ptrn, exclude); } } else { String path = arg.getAbsolutePath(); String prefix = root.getAbsolutePath(); String cls = path.substring(prefix.length() + 1).replace(File.separator, "."); - if(cls.matches(ptrn)) out.add(cls); + if(cls.matches(ptrn) && !cls.matches(exclude)) out.add(cls); } }