tests: convert to junit4

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1024312 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2010-10-19 16:29:22 +00:00
parent 72e081de1a
commit 933ebe5522
3 changed files with 29 additions and 34 deletions

View File

@ -16,7 +16,7 @@
*/ */
package org.apache.solr.handler; package org.apache.solr.handler;
import org.apache.solr.util.AbstractSolrTestCase; import org.apache.solr.SolrTestCaseJ4;
import java.io.StringReader; import java.io.StringReader;
import java.util.Collection; import java.util.Collection;
@ -24,26 +24,20 @@ import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamReader;
import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.SolrInputDocument;
import org.junit.BeforeClass;
import org.junit.Test;
public class XmlUpdateRequestHandlerTest extends AbstractSolrTestCase public class XmlUpdateRequestHandlerTest extends SolrTestCaseJ4 {
{ private static XMLInputFactory inputFactory = XMLInputFactory.newInstance();
private XMLInputFactory inputFactory = XMLInputFactory.newInstance(); protected static XmlUpdateRequestHandler handler;
protected XmlUpdateRequestHandler handler;
@Override public String getSchemaFile() { return "schema.xml"; } @BeforeClass
@Override public String getSolrConfigFile() { return "solrconfig.xml"; } public static void beforeTests() throws Exception {
initCore("solrconfig.xml","schema.xml");
@Override
public void setUp() throws Exception {
super.setUp();
handler = new XmlUpdateRequestHandler(); handler = new XmlUpdateRequestHandler();
} }
@Override @Test
public void tearDown() throws Exception {
super.tearDown();
}
public void testReadDoc() throws Exception public void testReadDoc() throws Exception
{ {
String xml = String xml =

View File

@ -20,17 +20,23 @@ package org.apache.solr.handler.component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.util.NamedList; import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore; 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"; } @BeforeClass
@Override public String getSolrConfigFile() { return "solrconfig.xml"; } public static void beforeTests() throws Exception {
initCore("solrconfig.xml","schema.xml");
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Test
public void testInitalization() public void testInitalization()
{ {
SolrCore core = h.getCore(); SolrCore core = h.getCore();

View File

@ -17,9 +17,12 @@
package org.apache.solr.schema; package org.apache.solr.schema;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.core.SolrCore; import org.apache.solr.core.SolrCore;
import org.apache.solr.schema.SchemaField; import org.apache.solr.schema.SchemaField;
import org.apache.solr.util.AbstractSolrTestCase; 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 * This is a simple test to make sure the unique key is not required
@ -27,22 +30,14 @@ import org.apache.solr.util.AbstractSolrTestCase;
* *
* It needs its own file so it can load a special schema file * 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"; } @BeforeClass
@Override public String getSolrConfigFile() { return "solrconfig.xml"; } public static void beforeTests() throws Exception {
initCore("solrconfig.xml","schema-not-required-unique-key.xml");
@Override
public void setUp() throws Exception {
super.setUp();
}
@Override
public void tearDown() throws Exception {
super.tearDown();
} }
@Test
public void testSchemaLoading() public void testSchemaLoading()
{ {
SolrCore core = h.getCore(); SolrCore core = h.getCore();