You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2010/10/19 18:29:22 UTC
svn commit: r1024312 - in /lucene/dev/trunk/solr/src/test/org/apache/solr:
handler/XmlUpdateRequestHandlerTest.java
handler/component/SearchHandlerTest.java schema/NotRequiredUniqueKeyTest.java
Author: yonik
Date: Tue Oct 19 16:29:22 2010
New Revision: 1024312
URL: http://svn.apache.org/viewvc?rev=1024312&view=rev
Log:
tests: convert to junit4
Modified:
lucene/dev/trunk/solr/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java
lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
lucene/dev/trunk/solr/src/test/org/apache/solr/schema/NotRequiredUniqueKeyTest.java
Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java?rev=1024312&r1=1024311&r2=1024312&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/handler/XmlUpdateRequestHandlerTest.java Tue Oct 19 16:29:22 2010
@@ -16,7 +16,7 @@
*/
package org.apache.solr.handler;
-import org.apache.solr.util.AbstractSolrTestCase;
+import org.apache.solr.SolrTestCaseJ4;
import java.io.StringReader;
import java.util.Collection;
@@ -24,26 +24,20 @@ import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
import org.apache.solr.common.SolrInputDocument;
+import org.junit.BeforeClass;
+import org.junit.Test;
-public class XmlUpdateRequestHandlerTest extends AbstractSolrTestCase
-{
- private XMLInputFactory inputFactory = XMLInputFactory.newInstance();
- protected XmlUpdateRequestHandler handler;
-
-@Override public String getSchemaFile() { return "schema.xml"; }
-@Override public String getSolrConfigFile() { return "solrconfig.xml"; }
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
+public class XmlUpdateRequestHandlerTest extends SolrTestCaseJ4 {
+ private static XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ protected static XmlUpdateRequestHandler handler;
+
+ @BeforeClass
+ public static void beforeTests() throws Exception {
+ initCore("solrconfig.xml","schema.xml");
handler = new XmlUpdateRequestHandler();
}
-
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
+
+ @Test
public void testReadDoc() throws Exception
{
String xml =
Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/SearchHandlerTest.java?rev=1024312&r1=1024311&r2=1024312&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/SearchHandlerTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/handler/component/SearchHandlerTest.java Tue Oct 19 16:29:22 2010
@@ -20,17 +20,23 @@ package org.apache.solr.handler.componen
import java.util.ArrayList;
import java.util.List;
+import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore;
-import org.apache.solr.util.AbstractSolrTestCase;
+import org.junit.BeforeClass;
+import org.junit.Test;
-public class SearchHandlerTest extends AbstractSolrTestCase
+public class SearchHandlerTest extends SolrTestCaseJ4
{
- @Override public String getSchemaFile() { return "schema.xml"; }
- @Override public String getSolrConfigFile() { return "solrconfig.xml"; }
+ @BeforeClass
+ public static void beforeTests() throws Exception {
+ initCore("solrconfig.xml","schema.xml");
+ }
+
@SuppressWarnings("unchecked")
+ @Test
public void testInitalization()
{
SolrCore core = h.getCore();
Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/schema/NotRequiredUniqueKeyTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/schema/NotRequiredUniqueKeyTest.java?rev=1024312&r1=1024311&r2=1024312&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/schema/NotRequiredUniqueKeyTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/schema/NotRequiredUniqueKeyTest.java Tue Oct 19 16:29:22 2010
@@ -17,9 +17,12 @@
package org.apache.solr.schema;
+import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.core.SolrCore;
import org.apache.solr.schema.SchemaField;
import org.apache.solr.util.AbstractSolrTestCase;
+import org.junit.BeforeClass;
+import org.junit.Test;
/**
* This is a simple test to make sure the unique key is not required
@@ -27,22 +30,14 @@ import org.apache.solr.util.AbstractSolr
*
* It needs its own file so it can load a special schema file
*/
-public class NotRequiredUniqueKeyTest extends AbstractSolrTestCase {
+public class NotRequiredUniqueKeyTest extends SolrTestCaseJ4 {
- @Override public String getSchemaFile() { return "schema-not-required-unique-key.xml"; }
- @Override public String getSolrConfigFile() { return "solrconfig.xml"; }
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
+ @BeforeClass
+ public static void beforeTests() throws Exception {
+ initCore("solrconfig.xml","schema-not-required-unique-key.xml");
}
-
+ @Test
public void testSchemaLoading()
{
SolrCore core = h.getCore();