You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2013/08/07 00:52:09 UTC

svn commit: r1511142 - in /lucene/dev/trunk/solr/core/src/test/org/apache/solr/core: AlternateDirectoryTest.java IndexReaderFactoryTest.java

Author: hossman
Date: Tue Aug  6 22:52:08 2013
New Revision: 1511142

URL: http://svn.apache.org/r1511142
Log:
Kill IndexReaderFactoryTest: the only thing it asserts is a lie.  Move that (fixed) assertion to AlternateDirectoryTest where it's already true.

Removed:
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/IndexReaderFactoryTest.java
Modified:
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java?rev=1511142&r1=1511141&r2=1511142&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/AlternateDirectoryTest.java Tue Aug  6 22:52:08 2013
@@ -25,21 +25,29 @@ import org.apache.solr.SolrTestCaseJ4;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+/**
+ * test that configs can override the DirectoryFactory and 
+ * IndexReaderFactory used in solr.
+ */
 public class AlternateDirectoryTest extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {
     initCore("solrconfig-altdirectory.xml", "schema.xml");
   }
 
-  /**
-   * Simple test to ensure that alternate IndexReaderFactory is being used.
-   */
-  @Test
   public void testAltDirectoryUsed() throws Exception {
     assertQ(req("q","*:*","qt","standard"));
     assertTrue(TestFSDirectoryFactory.openCalled);
     assertTrue(TestIndexReaderFactory.newReaderCalled);
   }
+  
+  public void testAltReaderUsed() throws Exception {
+    IndexReaderFactory readerFactory = h.getCore().getIndexReaderFactory();
+    assertNotNull("Factory is null", readerFactory);
+    assertEquals("readerFactory is wrong class",
+                 AlternateDirectoryTest.TestIndexReaderFactory.class.getName(), 
+                 readerFactory.getClass().getName());
+  }
 
   static public class TestFSDirectoryFactory extends StandardDirectoryFactory {
     public static volatile boolean openCalled = false;