lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r927647 - in /lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj: LargeVolumeTestBase.java embedded/LargeVolumeBinaryJettyTest.java embedded/LargeVolumeEmbeddedTest.java embedded/LargeVolumeJettyTest.java
Date Fri, 26 Mar 2010 00:04:35 GMT
Author: yonik
Date: Fri Mar 26 00:04:34 2010
New Revision: 927647

URL: http://svn.apache.org/viewvc?rev=927647&view=rev
Log:
tests: convert jetty/examples to junit4

Modified:
    lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeBinaryJettyTest.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeEmbeddedTest.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeJettyTest.java

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java?rev=927647&r1=927646&r2=927647&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java Fri
Mar 26 00:04:34 2010
@@ -24,21 +24,24 @@ import java.util.List;
 import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.client.solrj.response.UpdateResponse;
 import org.apache.solr.common.SolrInputDocument;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
 
 /**
  * @version $Id$
  * @since solr 1.3
  */
-public abstract class LargeVolumeTestBase extends SolrExampleTestBase 
+public abstract class LargeVolumeTestBase extends SolrJettyTestBase 
 {
-  SolrServer gserver = null;
-  
+
   // for real load testing, make these numbers bigger
   static final int numdocs = 100; //1000 * 1000;
   static final int threadCount = 5;
-  
+
+  @Test
   public void testMultiThreaded() throws Exception {
-    gserver = this.getSolrServer();
+    SolrServer gserver = this.getSolrServer();
     gserver.deleteByQuery( "*:*" ); // delete everything!
     
     DocThread[] threads = new DocThread[threadCount];
@@ -61,6 +64,7 @@ public abstract class LargeVolumeTestBas
   }
 
   private void query(int count) throws SolrServerException, IOException {
+    SolrServer gserver = this.getSolrServer();
     SolrQuery query = new SolrQuery("*:*");
     QueryResponse response = gserver.query(query);
     assertEquals(0, response.getStatus());

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeBinaryJettyTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeBinaryJettyTest.java?rev=927647&r1=927646&r2=927647&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeBinaryJettyTest.java
(original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeBinaryJettyTest.java
Fri Mar 26 00:04:34 2010
@@ -20,6 +20,7 @@ import org.apache.solr.client.solrj.Larg
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
 import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
+import org.junit.BeforeClass;
 
 /**
  * @version $Id$
@@ -28,34 +29,9 @@ import org.apache.solr.client.solrj.impl
  * @since solr 1.4
  */
 public class LargeVolumeBinaryJettyTest extends LargeVolumeTestBase {
-  SolrServer server;
-  JettySolrRunner jetty;
-
-  int port = 0;
-  static final String context = "/example";
-
-
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
-
-    jetty = new JettySolrRunner(context, 0);
-    jetty.start();
-    port = jetty.getLocalPort();
-
-    server = this.createNewSolrServer();
-  }
-
-  @Override
-  public void tearDown() throws Exception {
-    super.tearDown();
-    jetty.stop();  // stop the server
-  }
-
-
-  @Override
-  protected SolrServer getSolrServer() {
-    return server;
+  @BeforeClass
+  public static void beforeTest() throws Exception {
+    createJetty(EXAMPLE_HOME, null, null);
   }
 
   @Override

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeEmbeddedTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeEmbeddedTest.java?rev=927647&r1=927646&r2=927647&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeEmbeddedTest.java
(original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeEmbeddedTest.java
Fri Mar 26 00:04:34 2010
@@ -19,27 +19,16 @@ package org.apache.solr.client.solrj.emb
 
 import org.apache.solr.client.solrj.LargeVolumeTestBase;
 import org.apache.solr.client.solrj.SolrServer;
+import org.junit.BeforeClass;
 
 /**
  * @version $Id$
  * @since solr 1.3
  */
 public class LargeVolumeEmbeddedTest extends LargeVolumeTestBase {
-
-  SolrServer server;
-  
-  @Override public void setUp() throws Exception 
-  {
-    super.setUp();
-    
-    // setup the server...
-    server = createNewSolrServer();
-  }
-
-  @Override
-  protected SolrServer getSolrServer()
-  {
-    return server;
+  @BeforeClass
+  public static void beforeTest() throws Exception {
+    initCore(EXAMPLE_CONFIG, EXAMPLE_SCHEMA, EXAMPLE_HOME);
   }
 
   @Override

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeJettyTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeJettyTest.java?rev=927647&r1=927646&r2=927647&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeJettyTest.java
(original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeJettyTest.java
Fri Mar 26 00:04:34 2010
@@ -20,42 +20,16 @@ package org.apache.solr.client.solrj.emb
 import org.apache.solr.client.solrj.LargeVolumeTestBase;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
+import org.junit.BeforeClass;
 
 /**
  * @version $Id$
  * @since solr 1.3
  */
 public class LargeVolumeJettyTest extends LargeVolumeTestBase {
-
-  SolrServer server;
-  JettySolrRunner jetty;
-
-  int port = 0;
-  static final String context = "/example";
-
-  
-  @Override public void setUp() throws Exception 
-  {
-    super.setUp();
-    
-    jetty = new JettySolrRunner( context, 0 );
-    jetty.start();
-    port = jetty.getLocalPort();
-    
-    server = this.createNewSolrServer();
-  }
-
-  @Override public void tearDown() throws Exception 
-  {
-    super.tearDown();
-    jetty.stop();  // stop the server
-  }
-  
-
-  @Override
-  protected SolrServer getSolrServer()
-  {
-    return server;
+  @BeforeClass
+  public static void beforeTest() throws Exception {
+    createJetty(EXAMPLE_HOME, null, null);
   }
 
   @Override



Mime
View raw message