lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [53/72] [abbrv] lucenenet git commit: Lucene.Net.TestFramework: Renamed Codecs\asserting\ to Codecs\Asserting\
Date Sun, 26 Feb 2017 23:37:41 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/77e95ccc/src/Lucene.Net.TestFramework/Codecs/asserting/AssertingTermVectorsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Codecs/asserting/AssertingTermVectorsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/asserting/AssertingTermVectorsFormat.cs
deleted file mode 100644
index eeba7da..0000000
--- a/src/Lucene.Net.TestFramework/Codecs/asserting/AssertingTermVectorsFormat.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-using System.Collections.Generic;
-using System.Diagnostics;
-
-namespace Lucene.Net.Codecs.asserting
-{
-    using AssertingAtomicReader = Lucene.Net.Index.AssertingAtomicReader;
-    using BytesRef = Lucene.Net.Util.BytesRef;
-    using Directory = Lucene.Net.Store.Directory;
-    using FieldInfo = Lucene.Net.Index.FieldInfo;
-    using FieldInfos = Lucene.Net.Index.FieldInfos;
-    using Fields = Lucene.Net.Index.Fields;
-    using IOContext = Lucene.Net.Store.IOContext;
-
-    /*
-         * Licensed to the Apache Software Foundation (ASF) under one or more
-         * contributor license agreements.  See the NOTICE file distributed with
-         * this work for additional information regarding copyright ownership.
-         * The ASF licenses this file to You under the Apache License, Version 2.0
-         * (the "License"); you may not use this file except in compliance with
-         * the License.  You may obtain a copy of the License at
-         *
-         *     http://www.apache.org/licenses/LICENSE-2.0
-         *
-         * Unless required by applicable law or agreed to in writing, software
-         * distributed under the License is distributed on an "AS IS" BASIS,
-         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-         * See the License for the specific language governing permissions and
-         * limitations under the License.
-         */
-
-    using Lucene40TermVectorsFormat = Lucene.Net.Codecs.Lucene40.Lucene40TermVectorsFormat;
-    using SegmentInfo = Lucene.Net.Index.SegmentInfo;
-
-    /// <summary>
-    /// Just like <seealso cref="Lucene40TermVectorsFormat"/> but with additional asserts.
-    /// </summary>
-    public class AssertingTermVectorsFormat : TermVectorsFormat
-    {
-        private readonly TermVectorsFormat @in = new Lucene40TermVectorsFormat();
-
-        public override TermVectorsReader VectorsReader(Directory directory, SegmentInfo
segmentInfo, FieldInfos fieldInfos, IOContext context)
-        {
-            return new AssertingTermVectorsReader(@in.VectorsReader(directory, segmentInfo,
fieldInfos, context));
-        }
-
-        public override TermVectorsWriter VectorsWriter(Directory directory, SegmentInfo
segmentInfo, IOContext context)
-        {
-            return new AssertingTermVectorsWriter(@in.VectorsWriter(directory, segmentInfo,
context));
-        }
-
-        internal class AssertingTermVectorsReader : TermVectorsReader
-        {
-            internal readonly TermVectorsReader @in;
-
-            internal AssertingTermVectorsReader(TermVectorsReader @in)
-            {
-                this.@in = @in;
-            }
-
-            protected override void Dispose(bool disposing)
-            {
-                if (disposing)
-                    @in.Dispose();
-            }
-
-            public override Fields Get(int doc)
-            {
-                Fields fields = @in.Get(doc);
-                return fields == null ? null : new AssertingAtomicReader.AssertingFields(fields);
-            }
-
-            public override object Clone()
-            {
-                return new AssertingTermVectorsReader((TermVectorsReader)@in.Clone());
-            }
-
-            public override long RamBytesUsed()
-            {
-                return @in.RamBytesUsed();
-            }
-
-            public override void CheckIntegrity()
-            {
-                @in.CheckIntegrity();
-            }
-        }
-
-        internal enum Status
-        {
-            UNDEFINED,
-            STARTED,
-            FINISHED
-        }
-
-        internal class AssertingTermVectorsWriter : TermVectorsWriter
-        {
-            internal readonly TermVectorsWriter @in;
-            internal Status DocStatus, FieldStatus, TermStatus;
-            internal int DocCount, FieldCount, TermCount, PositionCount;
-            internal bool HasPositions;
-
-            internal AssertingTermVectorsWriter(TermVectorsWriter @in)
-            {
-                this.@in = @in;
-                DocStatus = Status.UNDEFINED;
-                FieldStatus = Status.UNDEFINED;
-                TermStatus = Status.UNDEFINED;
-                FieldCount = TermCount = PositionCount = 0;
-            }
-
-            public override void StartDocument(int numVectorFields)
-            {
-                Debug.Assert(FieldCount == 0);
-                Debug.Assert(DocStatus != Status.STARTED);
-                @in.StartDocument(numVectorFields);
-                DocStatus = Status.STARTED;
-                FieldCount = numVectorFields;
-                DocCount++;
-            }
-
-            public override void FinishDocument()
-            {
-                Debug.Assert(FieldCount == 0);
-                Debug.Assert(DocStatus == Status.STARTED);
-                @in.FinishDocument();
-                DocStatus = Status.FINISHED;
-            }
-
-            public override void StartField(FieldInfo info, int numTerms, bool positions,
bool offsets, bool payloads)
-            {
-                Debug.Assert(TermCount == 0);
-                Debug.Assert(DocStatus == Status.STARTED);
-                Debug.Assert(FieldStatus != Status.STARTED);
-                @in.StartField(info, numTerms, positions, offsets, payloads);
-                FieldStatus = Status.STARTED;
-                TermCount = numTerms;
-                HasPositions = positions || offsets || payloads;
-            }
-
-            public override void FinishField()
-            {
-                Debug.Assert(TermCount == 0);
-                Debug.Assert(FieldStatus == Status.STARTED);
-                @in.FinishField();
-                FieldStatus = Status.FINISHED;
-                --FieldCount;
-            }
-
-            public override void StartTerm(BytesRef term, int freq)
-            {
-                Debug.Assert(DocStatus == Status.STARTED);
-                Debug.Assert(FieldStatus == Status.STARTED);
-                Debug.Assert(TermStatus != Status.STARTED);
-                @in.StartTerm(term, freq);
-                TermStatus = Status.STARTED;
-                PositionCount = HasPositions ? freq : 0;
-            }
-
-            public override void FinishTerm()
-            {
-                Debug.Assert(PositionCount == 0);
-                Debug.Assert(DocStatus == Status.STARTED);
-                Debug.Assert(FieldStatus == Status.STARTED);
-                Debug.Assert(TermStatus == Status.STARTED);
-                @in.FinishTerm();
-                TermStatus = Status.FINISHED;
-                --TermCount;
-            }
-
-            public override void AddPosition(int position, int startOffset, int endOffset,
BytesRef payload)
-            {
-                Debug.Assert(DocStatus == Status.STARTED);
-                Debug.Assert(FieldStatus == Status.STARTED);
-                Debug.Assert(TermStatus == Status.STARTED);
-                @in.AddPosition(position, startOffset, endOffset, payload);
-                --PositionCount;
-            }
-
-            public override void Abort()
-            {
-                @in.Abort();
-            }
-
-            public override void Finish(FieldInfos fis, int numDocs)
-            {
-                Debug.Assert(DocCount == numDocs);
-                Debug.Assert(DocStatus == (numDocs > 0 ? Status.FINISHED : Status.UNDEFINED));
-                Debug.Assert(FieldStatus != Status.STARTED);
-                Debug.Assert(TermStatus != Status.STARTED);
-                @in.Finish(fis, numDocs);
-            }
-
-            public override IComparer<BytesRef> Comparer
-            {
-                get
-                {
-                    return @in.Comparer;
-                }
-            }
-
-            protected override void Dispose(bool disposing)
-            {
-                if (disposing)
-                    @in.Dispose();
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/77e95ccc/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/RandomCodec.cs b/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
index 3b48119..68d0098 100644
--- a/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
+++ b/src/Lucene.Net.TestFramework/Index/RandomCodec.cs
@@ -7,8 +7,8 @@ using System.Diagnostics;
 namespace Lucene.Net.Index
 {
     
-    using AssertingDocValuesFormat = Lucene.Net.Codecs.asserting.AssertingDocValuesFormat;
-    using AssertingPostingsFormat = Lucene.Net.Codecs.asserting.AssertingPostingsFormat;
+    using AssertingDocValuesFormat = Lucene.Net.Codecs.Asserting.AssertingDocValuesFormat;
+    using AssertingPostingsFormat = Lucene.Net.Codecs.Asserting.AssertingPostingsFormat;
 
     /*
          * Licensed to the Apache Software Foundation (ASF) under one or more

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/77e95ccc/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj b/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
index d21e48b..f789033 100644
--- a/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
+++ b/src/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
@@ -122,22 +122,22 @@
     <Compile Include="Attributes\HasTimeoutAttribute.cs" />
     <Compile Include="Attributes\LongRunningTestAttribute.cs" />
     <Compile Include="Attributes\LuceneNetSpecificAttribute.cs" />
-    <Compile Include="Codecs\asserting\AssertingCodec.cs">
+    <Compile Include="Codecs\Asserting\AssertingCodec.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Codecs\asserting\AssertingDocValuesFormat.cs">
+    <Compile Include="Codecs\Asserting\AssertingDocValuesFormat.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Codecs\asserting\AssertingNormsFormat.cs">
+    <Compile Include="Codecs\Asserting\AssertingNormsFormat.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Codecs\asserting\AssertingPostingsFormat.cs">
+    <Compile Include="Codecs\Asserting\AssertingPostingsFormat.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Codecs\asserting\AssertingStoredFieldsFormat.cs">
+    <Compile Include="Codecs\Asserting\AssertingStoredFieldsFormat.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Codecs\asserting\AssertingTermVectorsFormat.cs">
+    <Compile Include="Codecs\Asserting\AssertingTermVectorsFormat.cs">
       <SubType>Code</SubType>
     </Compile>
     <Compile Include="Codecs\Bloom\TestBloomFilteredLucene41Postings.cs" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/77e95ccc/src/Lucene.Net.Tests/Index/TestBinaryDocValuesUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestBinaryDocValuesUpdates.cs b/src/Lucene.Net.Tests/Index/TestBinaryDocValuesUpdates.cs
index 72ea385..19351fd 100644
--- a/src/Lucene.Net.Tests/Index/TestBinaryDocValuesUpdates.cs
+++ b/src/Lucene.Net.Tests/Index/TestBinaryDocValuesUpdates.cs
@@ -12,7 +12,7 @@ namespace Lucene.Net.Index
     using NUnit.Framework;
     using System.IO;
     using System.Threading;
-    using AssertingDocValuesFormat = Lucene.Net.Codecs.asserting.AssertingDocValuesFormat;
+    using AssertingDocValuesFormat = Lucene.Net.Codecs.Asserting.AssertingDocValuesFormat;
     using BinaryDocValuesField = BinaryDocValuesField;
     using IBits = Lucene.Net.Util.IBits;
     using BytesRef = Lucene.Net.Util.BytesRef;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/77e95ccc/src/Lucene.Net.Tests/Index/TestNumericDocValuesUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestNumericDocValuesUpdates.cs b/src/Lucene.Net.Tests/Index/TestNumericDocValuesUpdates.cs
index 827433f..25b8b44 100644
--- a/src/Lucene.Net.Tests/Index/TestNumericDocValuesUpdates.cs
+++ b/src/Lucene.Net.Tests/Index/TestNumericDocValuesUpdates.cs
@@ -10,7 +10,7 @@ namespace Lucene.Net.Index
     using Lucene.Net.Support;
     using NUnit.Framework;
     using System.IO;
-    using AssertingDocValuesFormat = Lucene.Net.Codecs.asserting.AssertingDocValuesFormat;
+    using AssertingDocValuesFormat = Lucene.Net.Codecs.Asserting.AssertingDocValuesFormat;
     using BinaryDocValuesField = BinaryDocValuesField;
     using IBits = Lucene.Net.Util.IBits;
     using BytesRef = Lucene.Net.Util.BytesRef;


Mime
View raw message