lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r1150367 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/backwards/ lucene/backwards/src/test-framework/ lucene/backwards/src/test/ solr/ solr/core/src/test/org/apache/solr/ solr/core/src/test/org/apache/solr/search/
Date Sun, 24 Jul 2011 13:47:22 GMT
Author: uschindler
Date: Sun Jul 24 13:47:21 2011
New Revision: 1150367

URL: http://svn.apache.org/viewvc?rev=1150367&view=rev
Log:
SOLR-2672, SOLR-2673: Fix a bunch of tests to no longer depend on order

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/src/test-framework/   (props changed)
    lucene/dev/branches/branch_3x/solr/   (props changed)
    lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/EchoParamsTest.java
    lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/search/TestFiltering.java

Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/EchoParamsTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/EchoParamsTest.java?rev=1150367&r1=1150366&r2=1150367&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/EchoParamsTest.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/EchoParamsTest.java Sun
Jul 24 13:47:21 2011
@@ -30,25 +30,32 @@ public class EchoParamsTest extends Solr
   }
 
   private static final String HEADER_XPATH = "/response/lst[@name='responseHeader']";
-
+  
   @Test
-  public void testDefaultEchoParams() {
+  public void test() {
+    defaultEchoParams();
+    defaultEchoParamsDefaultVersion();
+    explicitEchoParams();
+    allEchoParams();
+  }
+
+  // the following test methods rely on their order, which is no longer guaranteed by Java
7, so call them directly above:
+  
+  private void defaultEchoParams() {
     lrf.args.put("wt", "xml");
     lrf.args.put("version", "2.2");    
     assertQ(req("foo"),HEADER_XPATH + "/int[@name='status']");
     assertQ(req("foo"),"not(//lst[@name='params'])");
   }
 
-  @Test
-  public void testDefaultEchoParamsDefaultVersion() {
+  private void defaultEchoParamsDefaultVersion() {
     lrf.args.put("wt", "xml");
     lrf.args.remove("version");    
     assertQ(req("foo"),HEADER_XPATH + "/int[@name='status']");
     assertQ(req("foo"),"not(//lst[@name='params'])");
   }
 
-  @Test
-  public void testExplicitEchoParams() {
+  private void explicitEchoParams() {
     lrf.args.put("wt", "xml");
     lrf.args.put("version", "2.2");
     lrf.args.put("echoParams", "explicit");
@@ -57,8 +64,7 @@ public class EchoParamsTest extends Solr
     assertQ(req("foo"),HEADER_XPATH + "/lst[@name='params']/str[@name='wt'][.='xml']");
   }
 
-  @Test
-  public void testAllEchoParams() {
+  private void allEchoParams() {
     lrf = h.getRequestFactory
       ("crazy_custom_qt", 0, 20,
        "version","2.2",

Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/search/TestFiltering.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/search/TestFiltering.java?rev=1150367&r1=1150366&r2=1150367&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/search/TestFiltering.java
(original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/search/TestFiltering.java
Sun Jul 24 13:47:21 2011
@@ -36,6 +36,7 @@ public class TestFiltering extends SolrT
 
 
   public void testCaching() throws Exception {
+    clearIndex();
     assertU(adoc("id","4", "val_i","1"));
     assertU(adoc("id","1", "val_i","2"));
     assertU(adoc("id","3", "val_i","3"));



Mime
View raw message