SOLR-12759: detect actual problem and only then "assumeTrue" to bail

This commit is contained in:
David Smiley 2018-09-18 13:43:41 -04:00
parent 7d0a7782fa
commit 5abee478b6

View File

@ -15,8 +15,11 @@
* limitations under the License.
*/
package org.apache.solr.handler.extraction;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrException;
@ -41,8 +44,12 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
@BeforeClass
public static void beforeClass() throws Exception {
assumeFalse("SOLR-12759 JDK 11 (1st release) and Tika 1.x can result in extracting dates in a bad format.",
System.getProperty("java.version").startsWith("11"));
// Is the JDK/env affected by a known bug?
if (!TimeZone.getDefault().getDisplayName(false, TimeZone.SHORT, Locale.US).matches("[A-Z]{3}([+-]\\d\\d(:\\d\\d)?)?")) {
assert System.getProperty("java.version").startsWith("11") : "Is some other JVM affected? Or bad regex?";
assumeTrue("SOLR-12759 JDK 11 (1st release) and Tika 1.x can result in extracting dates in a bad format.", false);
}
initCore("solrconfig.xml", "schema.xml", getFile("extraction/solr").getAbsolutePath());
}