diff --git a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexCreationTestCase.java b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexCreationTestCase.java index c9ede6843..ace9bd543 100644 --- a/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexCreationTestCase.java +++ b/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexCreationTestCase.java @@ -80,9 +80,10 @@ public abstract class AbstractIndexCreationTestCase extends AbstractIndexerTestC IndexReader reader = IndexReader.open( index.getIndexDirectory() ); try { + assertEquals( "Check index size", 1, reader.numDocs() ); + Document document = reader.document( 0 ); assertRecord( record, document ); - assertEquals( "Check index size", 1, reader.numDocs() ); } finally { @@ -101,9 +102,10 @@ public abstract class AbstractIndexCreationTestCase extends AbstractIndexerTestC IndexReader reader = IndexReader.open( index.getIndexDirectory() ); try { + assertEquals( "Check index size", 1, reader.numDocs() ); + Document document = reader.document( 0 ); assertRecord( record, document ); - assertEquals( "Check index size", 1, reader.numDocs() ); } finally { @@ -127,9 +129,10 @@ public abstract class AbstractIndexCreationTestCase extends AbstractIndexerTestC IndexReader reader = IndexReader.open( index.getIndexDirectory() ); try { + assertEquals( "Check index size", 1, reader.numDocs() ); + Document document = reader.document( 0 ); assertRecord( record, document ); - assertEquals( "Check index size", 1, reader.numDocs() ); } finally {