SOLR-6458: Hard coded ENGLISH locale for AbstractSolrMorphlineTestBase tests.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1621609 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2014-08-31 17:15:37 +00:00
parent e5b1613030
commit 6b51065b2f
1 changed files with 15 additions and 1 deletions

View File

@ -41,6 +41,7 @@ import org.apache.solr.client.solrj.impl.XMLResponseParser;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.kitesdk.morphline.api.Collector;
@ -61,7 +62,7 @@ import com.google.common.io.Files;
import com.typesafe.config.Config;
public class AbstractSolrMorphlineTestBase extends SolrTestCaseJ4 {
private static Locale savedLocale;
protected Collector collector;
protected Command morphline;
protected SolrServer solrServer;
@ -84,10 +85,23 @@ public class AbstractSolrMorphlineTestBase extends SolrTestCaseJ4 {
@BeforeClass
public static void beforeClass() throws Exception {
// TODO: test doesn't work with some Locales, see SOLR-6458
savedLocale = Locale.getDefault();
Locale.setDefault(Locale.ENGLISH);
// we leave this in case the above is addressed
assumeFalse("This test fails on UNIX with Turkish default locale (https://issues.apache.org/jira/browse/SOLR-6387)",
new Locale("tr").getLanguage().equals(Locale.getDefault().getLanguage()));
myInitCore(DEFAULT_BASE_DIR);
}
@AfterClass
public static void afterClass() throws Exception {
if (savedLocale != null) {
Locale.setDefault(savedLocale);
}
}
protected static void myInitCore(String baseDirName) throws Exception {
Joiner joiner = Joiner.on(File.separator);