SOLR-2673: fix test dependent on order

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1150394 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-07-24 15:05:08 +00:00
parent 19831e2208
commit 347ba7a172
1 changed files with 8 additions and 2 deletions

View File

@ -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 " +