Skip to content

Apache Lucene open-source search software

SOLR-2673: fix test dependent on order

Robert Muir347ba7a17211
diff --git a/solr/core/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java b/solr/core/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java
index 9ca8583ea87..485bcf65c61 100644
--- a/solr/core/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/core/RAMDirectoryFactoryTest.java
@@ -26,7 +26,13 @@ import java.io.IOException;
* Test-case for RAMDirectoryFactory
*/
public class RAMDirectoryFactoryTest extends LuceneTestCase {
- public void testOpenReturnsTheSameForSamePath() throws IOException {
+
+ public void test() throws Exception {
+ dotestOpenReturnsTheSameForSamePath();
+ dotestOpenSucceedForEmptyDir();
+ }
+
+ private void dotestOpenReturnsTheSameForSamePath() throws IOException {
final Directory directory = new RefCntRamDirectory();
RAMDirectoryFactory factory = new RAMDirectoryFactory() {
@Override
@@ -45,7 +51,7 @@ public class RAMDirectoryFactoryTest extends LuceneTestCase {
dir2.close();
}
- public void testOpenSucceedForEmptyDir() throws IOException {
+ private void dotestOpenSucceedForEmptyDir() throws IOException {
RAMDirectoryFactory factory = new RAMDirectoryFactory();
Directory dir = factory.open("/fake/path");
assertNotNull("RAMDirectoryFactory should create RefCntRamDirectory even if the path doen't lead " +