From 9698aac2742296ec9d739424acd6dd54229e3f4c Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Wed, 2 Nov 2005 03:22:01 +0000 Subject: [PATCH] test for presence/absence of physical norms file git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@330177 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/TestDocumentWriter.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/test/org/apache/lucene/index/TestDocumentWriter.java b/src/test/org/apache/lucene/index/TestDocumentWriter.java index ee506cfebf8..94753f6b8ed 100644 --- a/src/test/org/apache/lucene/index/TestDocumentWriter.java +++ b/src/test/org/apache/lucene/index/TestDocumentWriter.java @@ -54,9 +54,10 @@ public class TestDocumentWriter extends TestCase { DocumentWriter writer = new DocumentWriter(dir, analyzer, similarity, 50); assertTrue(writer != null); try { - writer.addDocument("test", testDoc); + String segName="test"; + writer.addDocument(segName, testDoc); //After adding the document, we should be able to read it back in - SegmentReader reader = SegmentReader.get(new SegmentInfo("test", 1, dir)); + SegmentReader reader = SegmentReader.get(new SegmentInfo(segName, 1, dir)); assertTrue(reader != null); Document doc = reader.document(0); assertTrue(doc != null); @@ -84,6 +85,14 @@ public class TestDocumentWriter extends TestCase { assertTrue(fields != null && fields.length == 1); assertTrue(fields[0].stringValue().equals(DocHelper.FIELD_3_TEXT)); + // test that the norm file is not present if omitNorms is true + for (int i=0; i