You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by mh...@apache.org on 2014/07/15 23:43:15 UTC
git commit: setting up project structure and adding Version with
tests.
Repository: lucenenet
Updated Branches:
refs/heads/pcl a04d219f8 -> 31c7c2481
setting up project structure and adding Version with tests.
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/31c7c248
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/31c7c248
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/31c7c248
Branch: refs/heads/pcl
Commit: 31c7c24819d5de07065f2d84d4460b90f37f5473
Parents: a04d219
Author: Michael Herndon <mh...@michaelherndon.com>
Authored: Tue Jul 15 14:37:31 2014 -0700
Committer: Michael Herndon <mh...@michaelherndon.com>
Committed: Tue Jul 15 14:37:31 2014 -0700
----------------------------------------------------------------------
.gitignore | 40 ++++--
Lucene.sln | 68 +++++++++
NuGet.Config | 7 +
README.md | 31 +++++
README.txt | 29 ----
global.json | 3 +
src/Lucene.Core/Lucene.Core.csproj | 52 +++++++
src/Lucene.Core/Lucene.Core.kproj | 32 +++++
src/Lucene.Core/project.json | 16 +++
src/Lucene.Net.Core/Check.cs | 74 ++++++++++
src/Lucene.Net.Core/Lucene.Net.Core.csproj | 50 +++++++
src/Lucene.Net.Core/Lucene.Net.Core.kproj | 41 ++++++
src/Lucene.Net.Core/Support/EnumUtil.cs | 46 +++++++
.../Support/StringExtensionMethods.cs | 44 ++++++
src/Lucene.Net.Core/Util/Version.cs | 137 +++++++++++++++++++
src/Lucene.Net.Core/project.json | 20 +++
.../Lucene.Net.Core.Tests.csproj | 78 +++++++++++
.../Lucene.Net.Core.Tests.kproj | 39 ++++++
test/Lucene.Net.Core.Tests/Util/TestVersion.cs | 107 +++++++++++++++
test/Lucene.Net.Core.Tests/packages.config | 7 +
test/Lucene.Net.Core.Tests/project.json | 34 +++++
.../Lucene.Net.TestFramework.csproj | 70 ++++++++++
.../Lucene.Net.TestFramework.kproj | 40 ++++++
.../Util/LuceneTestCase.cs | 95 +++++++++++++
.../Util/TestAttribute.cs | 46 +++++++
test/Lucene.Net.TestFramework/packages.config | 7 +
test/Lucene.Net.TestFramework/project.json | 31 +++++
27 files changed, 1201 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 17fec4a..a8ad12a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,17 +1,29 @@
-# This is the git pattern ignore file for the project.
-# Git can be used with svn http://code.google.com/p/msysgit/
-bin
-Bin
-obj
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+[Oo]bj/
+[Bb]in/
+TestResults/
+.nuget/
+*.sln.ide/
+_ReSharper.*/
+packages/
+artifacts/
+PublishProfiles/
*.user
*.suo
-*.bak
-*.vs10x
-*.VisualState.xml
-*.userprefs
+*.cache
+*.docstates
+_ReSharper.*
+nuget.exe
+*net45.csproj
+*net451.csproj
+*k10.csproj
+*.psess
+*.vsp
*.pidb
-test-results
-build/artifacts
-build/bin
-_ReSharper*
-*.orig
+*.userprefs
+*DS_Store
+*.ncrunchsolution
+*.*sdf
+*.ipch
+*.sln.ide
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/Lucene.sln
----------------------------------------------------------------------
diff --git a/Lucene.sln b/Lucene.sln
new file mode 100644
index 0000000..2de0b8e
--- /dev/null
+++ b/Lucene.sln
@@ -0,0 +1,68 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.21901.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C90AB34C-AFCE-4CA1-8AB6-F25FC241639C}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E7E53642-2EDA-49CE-B730-95242CCF608D}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.TestFramework", "test\Lucene.Net.TestFramework\Lucene.Net.TestFramework.kproj", "{E8C34852-CE11-4CD0-A34A-E777B0BD705A}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Core", "src\Lucene.Net.Core\Lucene.Net.Core.kproj", "{CAF32BEA-5560-4E4A-A81F-11AA377F9929}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Core.Tests", "test\Lucene.Net.Core.Tests\Lucene.Net.Core.Tests.kproj", "{46467889-DCDD-4E2B-B583-6AACCE996EAC}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "portable-src", "portable-src", "{CD84C1EF-B845-4914-A9DD-D0F9ACC7DE6F}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "portable-test", "portable-test", "{4B0484AA-03E4-47A5-9989-AC42DDE1E06B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lucene.Net.Core", "src\Lucene.Net.Core\Lucene.Net.Core.csproj", "{AD8901C0-209D-4132-80AA-257DBACEECB4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lucene.Net.TestFramework", "test\Lucene.Net.TestFramework\Lucene.Net.TestFramework.csproj", "{F0D68FEA-B118-43B6-B760-3FB75CDE766D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lucene.Net.Core.Tests", "test\Lucene.Net.Core.Tests\Lucene.Net.Core.Tests.csproj", "{C879C7A6-FBE5-4F22-B363-A4356C7B8E76}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {E8C34852-CE11-4CD0-A34A-E777B0BD705A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E8C34852-CE11-4CD0-A34A-E777B0BD705A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E8C34852-CE11-4CD0-A34A-E777B0BD705A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E8C34852-CE11-4CD0-A34A-E777B0BD705A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CAF32BEA-5560-4E4A-A81F-11AA377F9929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CAF32BEA-5560-4E4A-A81F-11AA377F9929}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CAF32BEA-5560-4E4A-A81F-11AA377F9929}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CAF32BEA-5560-4E4A-A81F-11AA377F9929}.Release|Any CPU.Build.0 = Release|Any CPU
+ {46467889-DCDD-4E2B-B583-6AACCE996EAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {46467889-DCDD-4E2B-B583-6AACCE996EAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {46467889-DCDD-4E2B-B583-6AACCE996EAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {46467889-DCDD-4E2B-B583-6AACCE996EAC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AD8901C0-209D-4132-80AA-257DBACEECB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AD8901C0-209D-4132-80AA-257DBACEECB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AD8901C0-209D-4132-80AA-257DBACEECB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AD8901C0-209D-4132-80AA-257DBACEECB4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F0D68FEA-B118-43B6-B760-3FB75CDE766D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F0D68FEA-B118-43B6-B760-3FB75CDE766D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F0D68FEA-B118-43B6-B760-3FB75CDE766D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F0D68FEA-B118-43B6-B760-3FB75CDE766D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C879C7A6-FBE5-4F22-B363-A4356C7B8E76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C879C7A6-FBE5-4F22-B363-A4356C7B8E76}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C879C7A6-FBE5-4F22-B363-A4356C7B8E76}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C879C7A6-FBE5-4F22-B363-A4356C7B8E76}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {E8C34852-CE11-4CD0-A34A-E777B0BD705A} = {E7E53642-2EDA-49CE-B730-95242CCF608D}
+ {CAF32BEA-5560-4E4A-A81F-11AA377F9929} = {C90AB34C-AFCE-4CA1-8AB6-F25FC241639C}
+ {46467889-DCDD-4E2B-B583-6AACCE996EAC} = {E7E53642-2EDA-49CE-B730-95242CCF608D}
+ {AD8901C0-209D-4132-80AA-257DBACEECB4} = {CD84C1EF-B845-4914-A9DD-D0F9ACC7DE6F}
+ {F0D68FEA-B118-43B6-B760-3FB75CDE766D} = {4B0484AA-03E4-47A5-9989-AC42DDE1E06B}
+ {C879C7A6-FBE5-4F22-B363-A4356C7B8E76} = {4B0484AA-03E4-47A5-9989-AC42DDE1E06B}
+ EndGlobalSection
+EndGlobal
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/NuGet.Config
----------------------------------------------------------------------
diff --git a/NuGet.Config b/NuGet.Config
new file mode 100644
index 0000000..ee9e18c
--- /dev/null
+++ b/NuGet.Config
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <packageSources>
+ <add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" />
+ <add key="NuGet.org" value="https://nuget.org/api/v2/" />
+ </packageSources>
+</configuration>
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e8598f5
--- /dev/null
+++ b/README.md
@@ -0,0 +1,31 @@
+Apache Lucene.Net KVM / PCL
+
+# INTRODUCTION
+-------------
+Apache Lucene.Net is a C# full-text search engine. Apache Lucene.Net is not a complete application,
+but rather a code library and API that can easily be used to add search capabilities to applications.
+
+Apache Lucene.Net is compiled against Microsoft .NET Framework 4.0
+
+The Apache Lucene.Net web site is at:
+ http://lucenenet.apache.org
+
+
+# OVERVIEW
+-------------
+This branch is an experimental version of LUCENE.NET being built with Visual Studio 14 for PCL, portable class libraries, and the K10 / KLR (K or cloud Language Runtime for .NET
+
+
+
+# Running Tests
+
+ * open a command line tool
+ * change the directory to the test project that you wish to run.
+ * run the command <code>$ k test</code>
+
+ ### example
+
+ ```bash
+$ cd path/to/lucene.net/tests/Lucene.Net.Core.Tests
+$ k test
+ ```
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/README.txt
----------------------------------------------------------------------
diff --git a/README.txt b/README.txt
deleted file mode 100644
index 7449ab6..0000000
--- a/README.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Apache Lucene.Net README file
-
-
-INTRODUCTION
--------------
-Apache Lucene.Net is a C# full-text search engine. Apache Lucene.Net is not a complete application,
-but rather a code library and API that can easily be used to add search capabilities to applications.
-
-Apache Lucene.Net is compiled against Microsoft .NET Framework 4.0
-
-The Apache Lucene.Net web site is at:
- http://lucenenet.apache.org
-
-
-OVERVIEW
--------------
-This branch is an experimental version of to build a compatable async portal class library version
-of Lucene.Net 4x.
-
-
-FILES
----------------
-src/*
-
-test/*
- nUnit tests for Lucene.Net and Contrib projects
-
-
-
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/global.json
----------------------------------------------------------------------
diff --git a/global.json b/global.json
new file mode 100644
index 0000000..840c36f
--- /dev/null
+++ b/global.json
@@ -0,0 +1,3 @@
+{
+ "sources": ["src"]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/src/Lucene.Core/Lucene.Core.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Core/Lucene.Core.csproj b/src/Lucene.Core/Lucene.Core.csproj
new file mode 100644
index 0000000..013eee3
--- /dev/null
+++ b/src/Lucene.Core/Lucene.Core.csproj
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{ed2086bb-bcaf-49da-9c51-c2d777e6dee7}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Lucene.Core1</RootNamespace>
+ <AssemblyName>Lucene.Core1</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <!-- A reference to the entire .NET Framework is automatically included -->
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Class1.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+
+</Project>
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/src/Lucene.Core/Lucene.Core.kproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Core/Lucene.Core.kproj b/src/Lucene.Core/Lucene.Core.kproj
new file mode 100644
index 0000000..1a6583b
--- /dev/null
+++ b/src/Lucene.Core/Lucene.Core.kproj
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.Props" Condition="'$(VSToolsPath)' != ''" />
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>da771b45-fd68-420e-ba58-4a14cde80afa</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>Lucene.Core</RootNamespace>
+ </PropertyGroup>
+ <PropertyGroup Condition="$(OutputType) == 'Console'">
+ <DebuggerFlavor>ConsoleDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="$(OutputType) == 'Web'">
+ <DebuggerFlavor>WebDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" Label="Configuration">
+ </PropertyGroup>
+ <PropertyGroup>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <ItemGroup>
+ <Content Include="project.json" />
+ </ItemGroup>
+ <Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/src/Lucene.Core/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Core/project.json b/src/Lucene.Core/project.json
new file mode 100644
index 0000000..82f555e
--- /dev/null
+++ b/src/Lucene.Core/project.json
@@ -0,0 +1,16 @@
+{
+ "dependencies": {
+ },
+
+ "configurations" : {
+ "net451" : {
+ "dependencies": {
+ }
+ },
+ "k10" : {
+ "dependencies": {
+ "System.Runtime": "4.0.20.0"
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/src/Lucene.Net.Core/Check.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Check.cs b/src/Lucene.Net.Core/Check.cs
new file mode 100644
index 0000000..462d4cf
--- /dev/null
+++ b/src/Lucene.Net.Core/Check.cs
@@ -0,0 +1,74 @@
+/**
+ *
+ * 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.
+ *
+ */
+
+namespace Lucene.Net
+{
+ using System;
+ using System.Diagnostics;
+
+ /// <summary>
+ /// Summary description for Check
+ /// </summary>
+ public static class Check
+ {
+
+ [DebuggerStepThrough]
+ public static T NotNull<T>(string argument, T value, bool reference = false)
+ {
+ if (value == null)
+ {
+ if (reference)
+ throw new NullReferenceException(argument + " cannot be null.");
+ else
+ throw new ArgumentNullException(argument);
+
+ }
+
+ return value;
+ }
+
+ [DebuggerStepThrough]
+ public static string NotEmpty(string argument, string value, bool reference = false)
+ {
+ Check.NotNull(argument, value, reference);
+
+ if (value.Length == 0)
+ {
+ throw new ArgumentException(string.Format("Argument, {0}, must not be empty.", argument), argument);
+ }
+
+ return value;
+ }
+
+ [DebuggerStepThrough]
+ public static string NotEmptyOrWhitespace(string argument, string value, bool reference = false)
+ {
+ Check.NotEmpty(argument, value, reference);
+
+ if (value.Trim().Length == 0)
+ {
+ throw new ArgumentException(string.Format("Argument, {0}, is whitespace. {0} requires a value.", argument), argument);
+ }
+
+ return value;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/src/Lucene.Net.Core/Lucene.Net.Core.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Lucene.Net.Core.csproj b/src/Lucene.Net.Core/Lucene.Net.Core.csproj
new file mode 100644
index 0000000..c057a67
--- /dev/null
+++ b/src/Lucene.Net.Core/Lucene.Net.Core.csproj
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{AD8901C0-209D-4132-80AA-257DBACEECB4}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Lucene.Net.Core1</RootNamespace>
+ <AssemblyName>Lucene.Net.Core1</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <!-- A reference to the entire .NET Framework is automatically included -->
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/src/Lucene.Net.Core/Lucene.Net.Core.kproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Lucene.Net.Core.kproj b/src/Lucene.Net.Core/Lucene.Net.Core.kproj
new file mode 100644
index 0000000..5043a64
--- /dev/null
+++ b/src/Lucene.Net.Core/Lucene.Net.Core.kproj
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.Props" Condition="'$(VSToolsPath)' != ''" />
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>caf32bea-5560-4e4a-a81f-11aa377f9929</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>Lucene.Net</RootNamespace>
+ </PropertyGroup>
+ <PropertyGroup Condition="$(OutputType) == 'Console'">
+ <DebuggerFlavor>ConsoleDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="$(OutputType) == 'Web'">
+ <DebuggerFlavor>WebDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" Label="Configuration">
+ </PropertyGroup>
+ <PropertyGroup>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <ItemGroup>
+ <Content Include="project.json" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Check.cs" />
+ <Compile Include="Support\EnumUtil.cs" />
+ <Compile Include="Support\StringExtensionMethods.cs" />
+ <Compile Include="Util\Version.cs" />
+ </ItemGroup>
+ <Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/src/Lucene.Net.Core/Support/EnumUtil.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/EnumUtil.cs b/src/Lucene.Net.Core/Support/EnumUtil.cs
new file mode 100644
index 0000000..1ac7b12
--- /dev/null
+++ b/src/Lucene.Net.Core/Support/EnumUtil.cs
@@ -0,0 +1,46 @@
+/**
+ *
+ * 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.
+ *
+ */
+
+namespace Lucene.Net
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Reflection;
+
+ public static class EnumUtil
+ {
+ /// <summary>
+ /// Returns all the values of the Enum as an IEnumerable<T> where T : enum
+ /// </summary>
+ /// <typeparam name="T">The enum type.</typeparam>
+ /// <exception cref="System.ArgumentException">Throws when T is not an enum.</exception>
+ /// <returns>Returns an IEnumerable<T> of enum values for type T.</returns>
+ public static IList<T> ValuesOf<T>()
+ {
+ // TODO: resource: put exception message in resource.
+ if (!typeof(T).GetTypeInfo().IsEnum)
+ throw new ArgumentException("Type of T must be an enum");
+
+ return Enum.GetValues(typeof(T)).Cast<T>().ToList();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/src/Lucene.Net.Core/Support/StringExtensionMethods.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/StringExtensionMethods.cs b/src/Lucene.Net.Core/Support/StringExtensionMethods.cs
new file mode 100644
index 0000000..d2c6161
--- /dev/null
+++ b/src/Lucene.Net.Core/Support/StringExtensionMethods.cs
@@ -0,0 +1,44 @@
+/**
+ *
+ * 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.
+ *
+ */
+
+namespace Lucene.Net.Support
+{
+ using System.Text.RegularExpressions;
+
+ /// <summary>
+ /// String extenion methods to help with Java to C# conversion
+ /// </summary>
+ public static class StringExtensionMethods
+ {
+ /// <summary>
+ /// Replaces the first substring of this string that matches the given regular expression with the given replacement.
+ /// </summary>
+ /// <param name="input">The input value.</param>
+ /// <param name="expression">The regular expression.</param>
+ /// <param name="replacement">The replacement value. </param>
+ /// <returns>The string result after the replacement has been made.</returns>
+ public static string ReplaceFirst(this string input, string expression, string replacement)
+ {
+ var regex = new Regex(expression);
+ return regex.Replace(input, replacement, 1);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/src/Lucene.Net.Core/Util/Version.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Version.cs b/src/Lucene.Net.Core/Util/Version.cs
new file mode 100644
index 0000000..0a6bdd5
--- /dev/null
+++ b/src/Lucene.Net.Core/Util/Version.cs
@@ -0,0 +1,137 @@
+/**
+ *
+ * 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.
+ *
+ */
+
+namespace Lucene.Net.Util
+{
+ using Lucene.Net.Support;
+ using System;
+ using System.Text.RegularExpressions;
+
+
+ /// <summary> Use by certain classes to match version compatibility
+ /// across releases of Lucene.
+ ///
+ /// <b>WARNING</b>: When changing the version parameter
+ /// that you supply to components in Lucene, do not simply
+ /// change the version at search-time, but instead also adjust
+ /// your indexing code to match, and re-index.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Java <see href="https://github.com/apache/lucene-solr/blob/trunk/lucene/core/src/test/org/apache/lucene/util/TestVersion.java">Source</see>
+ /// </para>
+ /// </remarks>
+ public enum Version
+ {
+
+ /// <summary>
+ /// Match settings and bugs in Lucene's 4.3 release.
+ /// <para>
+ /// Use this to get the latest and greatest settings, bug fixes,
+ /// etc, for Lucene.
+ /// </para>
+ /// </summary>
+ [Obsolete()]
+ LUCENE_4_3,
+
+
+ /// <summary>
+ /// Match settings and bugs in Lucene.Net's 4.3 release.
+ /// <para>
+ /// Use this to get the latest and greatest settings, bug fixes,
+ /// etc, for Lucene.
+ /// </para>
+ /// </summary>
+ LUCENE_5_0,
+
+ // NOTE: Add new constants for later versions **here** to respect order!
+
+ /// <summary>
+ /// <p/><b>WARNING</b>: if you use this setting, and then
+ /// upgrade to a newer release of Lucene, sizable changes
+ /// may happen. If precise back compatibility is important
+ /// then you should instead explicitly specify an actual
+ /// version.
+ /// If you use this constant then you may need to
+ /// <b>re-index all of your documents</b> when upgrading
+ /// Lucene, as the way text is indexed may have changed.
+ /// Additionally, you may need to <b>re-test your entire
+ /// application</b> to ensure it behaves as expected, as
+ /// some defaults may have changed and may break functionality
+ /// in your application.
+ /// </summary>
+ [Obsolete("Use an actual version instead.")]
+ LUCENE_CURRENT,
+ }
+
+ public static class VersionEnumExtensions
+ {
+ /// <summary>
+ /// Verifies that the other version number is equal to or greater than the first version.
+ /// </summary>
+ /// <param name="first">The floor version.</param>
+ /// <param name="other">The actual version.</param>
+ /// <returns><see cref="bool"/> True, if the other version is equal or greater than the first, otherwise, false.</returns>
+ public static bool OnOrAfter(this Version first, Version other)
+ {
+ return first.CompareTo(other) >= 0;
+ }
+
+ /// <summary>
+ /// Parses the string value and converts it to the version. Some examples are: "4.3", "LUCENE_43", and "LUCENE_4_3"
+ /// </summary>
+ /// <remarks>
+ /// <code>
+ /// var version default(Version).ParseLeniently("4.3");
+ /// </code>
+ /// <para>
+ /// This is a convience method. C# does not support methods inside of Enums. This is close as it gets.
+ /// </para>
+ /// </remarks>
+ /// <param name="enumVersion">The enum value.</param>
+ /// <param name="version">The string representation of the version.</param>
+ /// <returns><see cref="Lucene.Net.Util.Version"/></returns>
+ public static Version ParseLeniently(this Version enumVersion, string version)
+ {
+ return ParseLeniently(version);
+ }
+
+ /// <summary>
+ /// Parses the string value and converts it to the version. Some examples are: "4.3", "LUCENE_43", and "LUCENE_4_3"
+ /// </summary>
+ /// <param name="version">The string representation of the version.</param>
+ /// <param name="version">The string representation of the version.</param>
+ /// <returns><see cref="Lucene.Net.Util.Version"/></returns>
+ public static Version ParseLeniently(string version)
+ {
+ var parsedMatchVersion = Check.NotEmptyOrWhitespace("version", version);
+
+ parsedMatchVersion = parsedMatchVersion.ToUpperInvariant()
+ .ReplaceFirst("^(\\d+)\\.(\\d+)$", "LUCENE_$1_$2")
+ .ReplaceFirst("^LUCENE_(\\d)(\\d)$", "LUCENE_$1_$2");
+
+ return (Version)Enum.Parse(typeof(Version), parsedMatchVersion);
+ }
+
+
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/src/Lucene.Net.Core/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/project.json b/src/Lucene.Net.Core/project.json
new file mode 100644
index 0000000..891efc2
--- /dev/null
+++ b/src/Lucene.Net.Core/project.json
@@ -0,0 +1,20 @@
+{
+ "dependencies": {
+ },
+
+ "configurations" : {
+ "net451" : {
+ "dependencies": {
+ }
+ },
+ "k10" : {
+ "dependencies": {
+ "System.Linq": "",
+ "System.Reflection": "",
+ "System.Runtime": "",
+ "System.Text.RegularExpressions": "",
+ "System.Diagnostics.Debug": ""
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.csproj b/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.csproj
new file mode 100644
index 0000000..94460f0
--- /dev/null
+++ b/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.csproj
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\..\packages\xunit.core.2.0.0-beta-build2700\build\portable-net45+win+wpa81+wp80\xunit.core.props" Condition="Exists('..\..\packages\xunit.core.2.0.0-beta-build2700\build\portable-net45+win+wpa81+wp80\xunit.core.props')" />
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{C879C7A6-FBE5-4F22-B363-A4356C7B8E76}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Lucene.Net.Core1</RootNamespace>
+ <AssemblyName>Lucene.Net.Core1</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="xunit.abstractions">
+ <HintPath>..\..\packages\xunit.abstractions.2.0.0-beta-build2700\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid\xunit.abstractions.dll</HintPath>
+ </Reference>
+ <Reference Include="xunit.assert">
+ <HintPath>..\..\packages\xunit.assert.2.0.0-beta-build2700\lib\portable-net45+win+wpa81+wp80+monoandroid+monotouch10\xunit.assert.dll</HintPath>
+ </Reference>
+ <Reference Include="xunit.core">
+ <HintPath>..\..\packages\xunit.core.2.0.0-beta-build2700\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid\xunit.core.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\Lucene.Net.Core\Lucene.Net.Core.csproj">
+ <Project>{ad8901c0-209d-4132-80aa-257dbaceecb4}</Project>
+ <Name>Lucene.Net.Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Lucene.Net.TestFramework\Lucene.Net.TestFramework.csproj">
+ <Project>{f0d68fea-b118-43b6-b760-3fb75cde766d}</Project>
+ <Name>Lucene.Net.TestFramework</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('..\..\packages\xunit.core.2.0.0-beta-build2700\build\portable-net45+win+wpa81+wp80\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.0.0-beta-build2700\build\portable-net45+win+wpa81+wp80\xunit.core.props'))" />
+ </Target>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.kproj
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.kproj b/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.kproj
new file mode 100644
index 0000000..37d7192
--- /dev/null
+++ b/test/Lucene.Net.Core.Tests/Lucene.Net.Core.Tests.kproj
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.Props" Condition="'$(VSToolsPath)' != ''" />
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>46467889-dcdd-4e2b-b583-6aacce996eac</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>Lucene.Net.Core.Tests</RootNamespace>
+ </PropertyGroup>
+ <PropertyGroup Condition="$(OutputType) == 'Console'">
+ <DebuggerFlavor>ConsoleDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="$(OutputType) == 'Web'">
+ <DebuggerFlavor>WebDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" Label="Configuration">
+ </PropertyGroup>
+ <PropertyGroup>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <ItemGroup>
+ <Content Include="packages.config" />
+ <Content Include="project.json" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Util\TestVersion.cs" />
+ </ItemGroup>
+ <Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.Core.Tests/Util/TestVersion.cs
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.Core.Tests/Util/TestVersion.cs b/test/Lucene.Net.Core.Tests/Util/TestVersion.cs
new file mode 100644
index 0000000..fadf0a3
--- /dev/null
+++ b/test/Lucene.Net.Core.Tests/Util/TestVersion.cs
@@ -0,0 +1,107 @@
+/**
+ *
+ * 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.
+ *
+ */
+
+namespace Lucene.Net.Util
+{
+ using Lucene.Net.TestFramework;
+ using System;
+ using System.Linq;
+ using System.Reflection;
+
+ /// <summary>
+ /// Summary description for TestVersion
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Java <see href="https://github.com/apache/lucene-solr/blob/trunk/lucene/core/src/test/org/apache/lucene/util/TestVersion.java">Source</see>
+ /// </para>
+ /// </remarks>
+ public class TestVersion : LuceneTestCase
+ {
+ #pragma warning disable 612,618
+ [Test("On or after", JavaMethodName = "test()")]
+ public void OnOrAfter()
+ {
+
+ var values = EnumUtil.ValuesOf<Version>();
+ foreach (Version v in values)
+ {
+ Ok(Version.LUCENE_CURRENT.OnOrAfter(v), "LUCENE_CURRENT must be always onOrAfter(" + v + ")");
+ }
+
+ Ok(Version.LUCENE_5_0.OnOrAfter(Version.LUCENE_4_3));
+ Ok(Version.LUCENE_4_3.OnOrAfter(Version.LUCENE_5_0) == false);
+
+ }
+
+ [Test(JavaMethodName = "testParseLenietly")]
+ public void ParseLenietly()
+ {
+ // There isn't a C# equivelant of having methods on enums
+
+ Equal(Version.LUCENE_4_3, default(Version).ParseLeniently("4.3"));
+ Equal(Version.LUCENE_4_3, default(Version).ParseLeniently("LUCENE_43"));
+ Equal(Version.LUCENE_CURRENT, default(Version).ParseLeniently("LUCENE_CURRENT"));
+ }
+
+ [Test(JavaMethodName = "testDeprecations")]
+ public void Deprecations()
+ {
+
+ var values = EnumUtil.ValuesOf<Version>();
+ var type = typeof(Version);
+
+
+ for (int i = 0; i < values.Count; i++)
+ {
+ var version = values[i];
+ var name = version.ToString();
+ var isObsolete = type.GetRuntimeField(name).GetCustomAttributes(false).Any(o => o is ObsoleteAttribute);
+
+ if (i + 1 == values.Count)
+ {
+ // Object.ReferenceEquals will not work for enums
+ var same = Enum.Equals(Version.LUCENE_CURRENT, version);
+ Ok(same, "Last constant must be LUCENE_CURRENT, version was {0}", name);
+ }
+
+ if (i + 2 != values.Count)
+ {
+ Ok(isObsolete, "{0} should be deprecated", name);
+ }
+ else
+ {
+ Ok(!isObsolete, "{0} should not be deprecased", name);
+ }
+ }
+ }
+
+ // TODO: 1.0 verify the need for this test.
+ // [Test(JavaMethodName = "testAgainstMainVersionConstant")]
+ public void VerifyAgainstMainVersionContant()
+ {
+
+ }
+
+ #pragma warning restore 618, 612
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.Core.Tests/packages.config
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.Core.Tests/packages.config b/test/Lucene.Net.Core.Tests/packages.config
new file mode 100644
index 0000000..8d179a3
--- /dev/null
+++ b/test/Lucene.Net.Core.Tests/packages.config
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="xunit" version="2.0.0-beta-build2700" targetFramework="portable-net45+win+wpa81+wp80" />
+ <package id="xunit.abstractions" version="2.0.0-beta-build2700" targetFramework="portable-net45+win+wpa81+wp80" />
+ <package id="xunit.assert" version="2.0.0-beta-build2700" targetFramework="portable-net45+win+wpa81+wp80" />
+ <package id="xunit.core" version="2.0.0-beta-build2700" targetFramework="portable-net45+win+wpa81+wp80" />
+</packages>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.Core.Tests/project.json
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.Core.Tests/project.json b/test/Lucene.Net.Core.Tests/project.json
new file mode 100644
index 0000000..fd82053
--- /dev/null
+++ b/test/Lucene.Net.Core.Tests/project.json
@@ -0,0 +1,34 @@
+{
+ "compilationOptions": {
+ "warningsAsErrors": false,
+ "define": ["XUNIT"]
+ },
+ "sources": ["../src"],
+ "code": "**/*.cs",
+ "commands": {
+ "test": "Xunit.KRunner"
+ },
+
+
+ "dependencies": {
+ "Lucene.Net.Core": "",
+ "Lucene.Net.TestFramework": "",
+ "Xunit.KRunner": "1.0.0-*"
+
+ },
+
+ "configurations" : {
+ "net451": {},
+ "net45" : {
+ "dependencies": {
+ }
+ },
+ "k10" : {
+ "dependencies": {
+ "System.Runtime": "4.0.20.0",
+ "System.Diagnostics.Debug": "4.0.10.0"
+ }
+
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj b/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
new file mode 100644
index 0000000..f495942
--- /dev/null
+++ b/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.csproj
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\..\packages\xunit.core.2.0.0-beta-build2700\build\portable-net45+win+wpa81+wp80\xunit.core.props" Condition="Exists('..\..\packages\xunit.core.2.0.0-beta-build2700\build\portable-net45+win+wpa81+wp80\xunit.core.props')" />
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{F0D68FEA-B118-43B6-B760-3FB75CDE766D}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Lucene.Net.Core1</RootNamespace>
+ <AssemblyName>Lucene.Net.Core1</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Util\LuceneTestCase.cs" />
+ <Compile Include="Util\TestAttribute.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="xunit.abstractions">
+ <HintPath>..\..\packages\xunit.abstractions.2.0.0-beta-build2700\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid\xunit.abstractions.dll</HintPath>
+ </Reference>
+ <Reference Include="xunit.assert">
+ <HintPath>..\..\packages\xunit.assert.2.0.0-beta-build2700\lib\portable-net45+win+wpa81+wp80+monoandroid+monotouch10\xunit.assert.dll</HintPath>
+ </Reference>
+ <Reference Include="xunit.core">
+ <HintPath>..\..\packages\xunit.core.2.0.0-beta-build2700\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid\xunit.core.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('..\..\packages\xunit.core.2.0.0-beta-build2700\build\portable-net45+win+wpa81+wp80\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.0.0-beta-build2700\build\portable-net45+win+wpa81+wp80\xunit.core.props'))" />
+ </Target>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.kproj
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.kproj b/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.kproj
new file mode 100644
index 0000000..9e7146b
--- /dev/null
+++ b/test/Lucene.Net.TestFramework/Lucene.Net.TestFramework.kproj
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.Props" Condition="'$(VSToolsPath)' != ''" />
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>e8c34852-ce11-4cd0-a34a-e777b0bd705a</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>Lucene.Net.TestFramework</RootNamespace>
+ </PropertyGroup>
+ <PropertyGroup Condition="$(OutputType) == 'Console'">
+ <DebuggerFlavor>ConsoleDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="$(OutputType) == 'Web'">
+ <DebuggerFlavor>WebDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" Label="Configuration">
+ </PropertyGroup>
+ <PropertyGroup>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <ItemGroup>
+ <Content Include="packages.config" />
+ <Content Include="project.json" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Util\LuceneTestCase.cs" />
+ <Compile Include="Util\TestAttribute.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/test/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
new file mode 100644
index 0000000..1651305
--- /dev/null
+++ b/test/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -0,0 +1,95 @@
+/**
+ *
+ * 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.
+ *
+ */
+
+
+namespace Lucene.Net.TestFramework
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Diagnostics;
+ using Xunit;
+
+ public class LuceneTestCase
+ {
+ public LuceneTestCase()
+ {
+ //
+ // TODO: Add constructor logic here
+ //
+ }
+
+
+
+ [DebuggerHidden]
+ public static void Ok(bool condition, string message = null, params object[] values)
+ {
+#if XUNIT
+ if (!string.IsNullOrWhiteSpace(message))
+ {
+ var exceptionMessage = message;
+
+ if(values != null && values.Length > 0)
+ {
+ exceptionMessage = String.Format(exceptionMessage, values);
+ }
+
+ Assert.True(condition, exceptionMessage);
+ }
+ else
+ {
+ Assert.True(condition);
+ }
+#endif
+ }
+
+ [DebuggerHidden]
+ public static void Equal(string expected, string actual)
+ {
+#if XUNIT
+ Assert.Equal(expected, actual);
+#endif
+ }
+
+ [DebuggerHidden]
+ public static void Equal<T>(T expected, T actual)
+ {
+#if XUNIT
+ Assert.Equal(expected, actual);
+#endif
+ }
+
+ [DebuggerHidden]
+ public static void Equal<T>(IEnumerable<T> expected, IEnumerable<T> actual)
+ {
+#if XUNIT
+ Assert.Equal(expected, actual);
+#endif
+ }
+
+ [DebuggerHidden]
+ public static void Throws<T>(Action code) where T : Exception
+ {
+#if XUNIT
+ Assert.Throws<T>(code);
+#endif
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.TestFramework/Util/TestAttribute.cs
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/Util/TestAttribute.cs b/test/Lucene.Net.TestFramework/Util/TestAttribute.cs
new file mode 100644
index 0000000..12b3c50
--- /dev/null
+++ b/test/Lucene.Net.TestFramework/Util/TestAttribute.cs
@@ -0,0 +1,46 @@
+/**
+ *
+ * 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.
+ *
+ */
+
+namespace Lucene.Net.TestFramework
+{
+ /// <summary>
+ /// Summary description for TestAttribute
+ /// </summary>
+ public class TestAttribute : Xunit.FactAttribute
+ {
+
+ public string JavaMethodName { get; set; }
+
+ public TestAttribute(string displayName, string javaMethodName = null, string skip = null)
+ {
+ this.DisplayName = displayName;
+ this.Skip = skip;
+ this.JavaMethodName = javaMethodName;
+ }
+
+ public TestAttribute()
+ {
+ //
+ // TODO: Add constructor logic here
+ //
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.TestFramework/packages.config
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/packages.config b/test/Lucene.Net.TestFramework/packages.config
new file mode 100644
index 0000000..8d179a3
--- /dev/null
+++ b/test/Lucene.Net.TestFramework/packages.config
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="xunit" version="2.0.0-beta-build2700" targetFramework="portable-net45+win+wpa81+wp80" />
+ <package id="xunit.abstractions" version="2.0.0-beta-build2700" targetFramework="portable-net45+win+wpa81+wp80" />
+ <package id="xunit.assert" version="2.0.0-beta-build2700" targetFramework="portable-net45+win+wpa81+wp80" />
+ <package id="xunit.core" version="2.0.0-beta-build2700" targetFramework="portable-net45+win+wpa81+wp80" />
+</packages>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/31c7c248/test/Lucene.Net.TestFramework/project.json
----------------------------------------------------------------------
diff --git a/test/Lucene.Net.TestFramework/project.json b/test/Lucene.Net.TestFramework/project.json
new file mode 100644
index 0000000..cfa4794
--- /dev/null
+++ b/test/Lucene.Net.TestFramework/project.json
@@ -0,0 +1,31 @@
+{
+ "compilationOptions": {
+ "warningsAsErrors": false,
+ "define": ["XUNIT"]
+ },
+ "sources": ["../src"],
+ "code": "**/*.cs",
+ "commands": {
+ "test": "Xunit.KRunner"
+ },
+
+
+ "dependencies": {
+ "Xunit.KRunner": "1.0.0-*"
+
+ },
+
+ "configurations" : {
+ "net451": {},
+ "net45" : {
+ "dependencies": {
+ }
+ },
+ "k10" : {
+ "dependencies": {
+ "System.Runtime": "4.0.20.0",
+ "System.Diagnostics.Debug": "4.0.10.0"
+ }
+ }
+ }
+}