Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-1916: reinstate @Ignore'ed test

James Dyer012c260973ab
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
index 111f04b2a78..b67eb2cc7e7 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder2.java
@@ -238,7 +238,7 @@ public class TestDocBuilder2 extends AbstractDataImportHandlerTestCase {
}
@Test
- @Ignore("Known Locale/TZ problems: see https://issues.apache.org/jira/browse/SOLR-1916")
+ @Ignore("Fix Me. See SOLR-4103.")
public void testFileListEntityProcessor_lastIndexTime() throws Exception {
File tmpdir = File.createTempFile("test", "tmp", TEMP_DIR);
tmpdir.delete();
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
index 3efd942b9cb..91ebd1ae41c 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
@@ -132,7 +132,6 @@ public class TestFileListEntityProcessor extends AbstractDataImportHandlerTestCa
}
@Test
- @Ignore("Known Locale/TZ problems: see https://issues.apache.org/jira/browse/SOLR-1916")
public void testNTOT() throws IOException {
File tmpdir = File.createTempFile("test", "tmp", TEMP_DIR);
tmpdir.delete();
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessor2.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessor2.java
deleted file mode 100644
index 14acbfe2a18..00000000000
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessor2.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.handler.dataimport;
-
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.text.SimpleDateFormat;
-import java.text.ParseException;
-
-/**
- * <p>
- * Test for SqlEntityProcessor which checks full and delta imports using the
- * test harness
- * </p>
- *
- *
- * @since solr 1.3
- */
-@Ignore("FIXME: I fail so often it makes me ill!")
-public class TestSqlEntityProcessor2 extends AbstractDataImportHandlerTestCase {
- @BeforeClass
- public static void beforeClass() throws Exception {
- initCore("dataimport-solrconfig.xml", "dataimport-schema.xml");
- }
-
- @Before
- @Override
- public void setUp() throws Exception {
- super.setUp();
- clearIndex();
- assertU(commit());
- }
-
- @Test
- @SuppressWarnings("unchecked")
- @Ignore("Known Locale/TZ problems: see https://issues.apache.org/jira/browse/SOLR-1916")
- /**
- * This test is here for historical purposes only.
- * When SOLR-1916 is fixed, it would be best to rewrite this test.
- *
- * @throws Exception
- */
- public void testLastIndexTime() throws Exception {
- List row = new ArrayList();
- row.add(createMap("id", 5));
- MockDataSource.setIterator("select * from x where last_modified > OK", row.iterator());
- runFullImport(dataConfig_LastIndexTime);
- assertQ(req("id:5"), "//*[@numFound='1']");
- }
-
- static class DateFormatValidatingEvaluator extends Evaluator {
- @Override
- public String evaluate(String expression, Context context) {
- List l = new DateFormatEvaluator().parseParams(expression, context.getVariableResolver());
- Object o = l.get(0);
- String dateStr = null;
- if (o instanceof Evaluator.VariableWrapper) {
- Evaluator.VariableWrapper wrapper = (Evaluator.VariableWrapper) o;
- o = wrapper.resolve();
- dateStr = o.toString();
- }
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ROOT);
- try {
- formatter.parse(dateStr);
- } catch (ParseException e) {
- DataImportHandlerException.wrapAndThrow(DataImportHandlerException.SEVERE, e);
- }
- return "OK";
- }
- }
-
- private static String dataConfig_LastIndexTime = "<dataConfig><dataSource type=\"MockDataSource\"/>\n" +
- "\t<function name=\"checkDateFormat\" class=\"org.apache.solr.handler.dataimport.TestSqlEntityProcessor2$DateFormatValidatingEvaluator\"/>\n" +
- "\t<document>\n" +
- "\t\t<entity name=\"x\" query=\"select * from x where last_modified > ${dih.functions.checkDateFormat(dih.last_index_time)}\" />\n" +
- "\t</document>\n" +
- "</dataConfig>";
-}