You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2022/02/21 12:54:08 UTC

[lucenenet] branch master updated (243976c -> e0c394b)

This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git.


    from 243976c  website: Added link for 4.8.0-beta00016 API docs
     new e0c9eae  website: Updated Lucene.Net.Codecs namespace documentation to demonstrate the registration using the Initialize() method rather than TestFrameworkSetUp() method.
     new e0c394b  docs: Lucene_Net_Codecs.md: Updated version in example to 4.8.0-beta00016

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md | 24 ++++++++++++++--------
 1 file changed, 15 insertions(+), 9 deletions(-)

[lucenenet] 02/02: docs: Lucene_Net_Codecs.md: Updated version in example to 4.8.0-beta00016

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit e0c394bcae761b88656800c4f3a4c1657d9c2db0
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Mon Feb 21 19:51:08 2022 +0700

    docs: Lucene_Net_Codecs.md: Updated version in example to 4.8.0-beta00016
---
 websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md b/websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md
index 9061b84..479cc33 100644
--- a/websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md
+++ b/websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md
@@ -193,7 +193,7 @@ Here is an example project file for .NET 5 for testing a project named `MyCodecs
     <PackageReference Include="nunit" Version="3.13.2" />
     <PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
-    <PackageReference Include="Lucene.Net.TestFramework" Version="4.8.0-beta00015" />
+    <PackageReference Include="Lucene.Net.TestFramework" Version="4.8.0-beta00016" />
     <PackageReference Include="System.Net.Primitives" Version="4.3.0"/>
     </ItemGroup>
 

[lucenenet] 01/02: website: Updated Lucene.Net.Codecs namespace documentation to demonstrate the registration using the Initialize() method rather than TestFrameworkSetUp() method.

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit e0c9eaeade9240e15700b73c855f0dd7ddd6524b
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Tue Nov 23 10:22:52 2021 +0700

    website: Updated Lucene.Net.Codecs namespace documentation to demonstrate the registration using the Initialize() method rather than TestFrameworkSetUp() method.
---
 websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md | 24 ++++++++++++++--------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md b/websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md
index b36b39e..9061b84 100644
--- a/websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md
+++ b/websites/apidocs/apiSpec/core/Lucene_Net_Codecs.md
@@ -180,20 +180,20 @@ The <xref:Lucene.Net.TestFramework> library contains specialized classes to mini
 > [!NOTE]
 > .NET Standard is not an executable target. Tests will not run unless you target a framework such as `netcoreapp3.1` or `net48`.
 
-Here is an example project file for .NET Core 3.1 for testing a project named `MyCodecs.csproj`.
+Here is an example project file for .NET 5 for testing a project named `MyCodecs.csproj`.
 
 ```xml
 <Project Sdk="Microsoft.NET.Sdk">
 
     <PropertyGroup>
-    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <TargetFramework>net5.0</TargetFramework>
     </PropertyGroup>
 
     <ItemGroup>
-    <PackageReference Include="nunit" Version="3.9.0" />
-    <PackageReference Include="NUnit3TestAdapter" Version="3.16.0" />
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
-    <PackageReference Include="Lucene.Net.TestFramework" Version="4.8.0-beta00008" />
+    <PackageReference Include="nunit" Version="3.13.2" />
+    <PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
+    <PackageReference Include="Lucene.Net.TestFramework" Version="4.8.0-beta00015" />
     <PackageReference Include="System.Net.Primitives" Version="4.3.0"/>
     </ItemGroup>
 
@@ -259,8 +259,11 @@ The goal of the <xref:Lucene.Net.Index.BasePostingsFormatTestCase> is that if al
 
 Codecs, postings formats and doc values formats can be injected into the test framework to integration test them against other Lucene.NET components. This is an advanced scenario that assumes integration tests for Lucene.NET components exist in your test project.
 
-In your test project, add a new file to the root of the project named `Startup.cs`. Remove any namespaces from the  
-file, but leave the `Startup` class and inherit <xref:Lucene.Net.Util.LuceneTestFrameworkInitializer>.
+In your test project, add a new file to the root of the project named `Startup.cs` that inherits <xref:Lucene.Net.Util.LuceneTestFrameworkInitializer>. The file may exist in any namespace. Override the `Initialize()` method to set your custom `CodecFactory`.
+
+> [!NOTE]
+> There may only be one `LuceneTestFrameworkInitializer` subclass per assembly.
+
 
 ```cs
 public class Startup : LuceneTestFrameworkInitializer
@@ -268,7 +271,7 @@ public class Startup : LuceneTestFrameworkInitializer
     /// <summary>
     /// Runs before all tests in the current assembly
     /// </summary>
-    protected override void TestFrameworkSetUp()
+    protected override void Initialize()
     {
         CodecFactory = new TestCodecFactory {
             CustomCodecTypes = new Codec[] { typeof(MyCodec) }
@@ -277,6 +280,9 @@ public class Startup : LuceneTestFrameworkInitializer
 }
 ```
 
+> [!IMPORTANT]
+> In Lucene.NET 4.8.0-beta00015 and prior, the `CodecFactory` should be set in the `TestFrameworkSetUp()` method, however all later versions must use the `Initialize()` method to set the factory properties, or an `InvalidOperationException` will be thrown.
+
 ## Setting the Default Codec for use in Tests
 
 The above block will register a new codec named `MyCodec` with the test framework. However, the test framework will not select the codec for use in tests on its own. To override the default behavior of selecting a random codec, the configuration parameter `tests:codec` must be set explicitly.