Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #98 from energyworldnet/test-project-upgrades
Browse files Browse the repository at this point in the history
Upgrade test projects and add netcoreapp2.0 target
  • Loading branch information
yang-xiaodong committed Oct 12, 2018
2 parents 947220d + 09bd37e commit ff8798d
Show file tree
Hide file tree
Showing 24 changed files with 200 additions and 1,204 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ bld/
[Bb]in/
[Oo]bj/

# KDiff3
*.orig

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
Expand Down Expand Up @@ -170,6 +173,7 @@ publish/
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
tools/

# Microsoft Azure Build Output
csx/
Expand Down
12 changes: 6 additions & 6 deletions DotNetCore.NPOI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ Global
{4D994508-5489-4342-9EE8-6FDDB0763E66}.Release|Any CPU.Build.0 = Release|Any CPU
{F5A6FF78-2C51-44E8-9E31-CD1B3EF784E9}..net 2 Release|Any CPU.ActiveCfg = Release|Any CPU
{F5A6FF78-2C51-44E8-9E31-CD1B3EF784E9}..net 2 Release|Any CPU.Build.0 = Release|Any CPU
{F5A6FF78-2C51-44E8-9E31-CD1B3EF784E9}..net 4 Release|Any CPU.ActiveCfg = .net 4 Release|Any CPU
{F5A6FF78-2C51-44E8-9E31-CD1B3EF784E9}..net 4 Release|Any CPU.Build.0 = .net 4 Release|Any CPU
{F5A6FF78-2C51-44E8-9E31-CD1B3EF784E9}..net 4 Release|Any CPU.ActiveCfg = Release|Any CPU
{F5A6FF78-2C51-44E8-9E31-CD1B3EF784E9}..net 4 Release|Any CPU.Build.0 = Release|Any CPU
{F5A6FF78-2C51-44E8-9E31-CD1B3EF784E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5A6FF78-2C51-44E8-9E31-CD1B3EF784E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5A6FF78-2C51-44E8-9E31-CD1B3EF784E9}.NPOI.Tools|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -98,14 +98,14 @@ Global
{A920C2BA-8BFD-4F54-8401-7D1C0730F1F0}..net 4 Release|Any CPU.Build.0 = Release|Any CPU
{A920C2BA-8BFD-4F54-8401-7D1C0730F1F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A920C2BA-8BFD-4F54-8401-7D1C0730F1F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A920C2BA-8BFD-4F54-8401-7D1C0730F1F0}.NPOI.Tools|Any CPU.ActiveCfg = NPOI.Tools|Any CPU
{A920C2BA-8BFD-4F54-8401-7D1C0730F1F0}.NPOI.Tools|Any CPU.Build.0 = NPOI.Tools|Any CPU
{A920C2BA-8BFD-4F54-8401-7D1C0730F1F0}.NPOI.Tools|Any CPU.ActiveCfg = Debug|Any CPU
{A920C2BA-8BFD-4F54-8401-7D1C0730F1F0}.NPOI.Tools|Any CPU.Build.0 = Debug|Any CPU
{A920C2BA-8BFD-4F54-8401-7D1C0730F1F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A920C2BA-8BFD-4F54-8401-7D1C0730F1F0}.Release|Any CPU.Build.0 = Release|Any CPU
{0BF8C464-8779-43CF-AD7A-B1109A86EAAE}..net 2 Release|Any CPU.ActiveCfg = Release|Any CPU
{0BF8C464-8779-43CF-AD7A-B1109A86EAAE}..net 2 Release|Any CPU.Build.0 = Release|Any CPU
{0BF8C464-8779-43CF-AD7A-B1109A86EAAE}..net 4 Release|Any CPU.ActiveCfg = .net 4 Release|Any CPU
{0BF8C464-8779-43CF-AD7A-B1109A86EAAE}..net 4 Release|Any CPU.Build.0 = .net 4 Release|Any CPU
{0BF8C464-8779-43CF-AD7A-B1109A86EAAE}..net 4 Release|Any CPU.ActiveCfg = Release|Any CPU
{0BF8C464-8779-43CF-AD7A-B1109A86EAAE}..net 4 Release|Any CPU.Build.0 = Release|Any CPU
{0BF8C464-8779-43CF-AD7A-B1109A86EAAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0BF8C464-8779-43CF-AD7A-B1109A86EAAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0BF8C464-8779-43CF-AD7A-B1109A86EAAE}.NPOI.Tools|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
22 changes: 0 additions & 22 deletions test/NPOI.OpenXml4Net/App.config

This file was deleted.

26 changes: 26 additions & 0 deletions test/NPOI.OpenXml4Net/ConfigurationManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Microsoft.Extensions.Configuration;
using System.Collections.Specialized;
using System.Linq;

namespace System.Configuration
{
// TODO: Replace this shim with actual Options class
public static class ConfigurationManager
{
public static NameValueCollection AppSettings { get; }

static ConfigurationManager()
{
AppSettings = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", false)
.Build()
.GetSection("AppSettings")
.GetChildren()
.Aggregate(new NameValueCollection(), (acc, cur) =>
{
acc.Add(cur.Key, cur.Value);
return acc;
});
}
}
}
143 changes: 17 additions & 126 deletions test/NPOI.OpenXml4Net/NPOI.OOXML4Net.Testcases.csproj
Original file line number Diff line number Diff line change
@@ -1,137 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\NUnit.3.10.1\build\NUnit.props" Condition="Exists('..\..\packages\NUnit.3.10.1\build\NUnit.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F5A6FF78-2C51-44E8-9E31-CD1B3EF784E9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<RootNamespace>OOXML4Net.Testcases</RootNamespace>
<AssemblyName>OOXML4Net.Testcases</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\solution\Lib\.net4\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\solution\Lib\.net4\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '.net 4 Release|AnyCPU'">
<OutputPath>..\..\solution\Lib\.net4\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=3.10.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnit.3.10.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="OPC\Compliance\TestOPCComplianceCoreProperties.cs" />
<Compile Include="OPC\Compliance\TestOPCCompliancePackageModel.cs" />
<Compile Include="OPC\Compliance\TestOPCCompliancePartName.cs" />
<Compile Include="OpenXML4NetTestDataSamples.cs" />
<Compile Include="POIDataSamples.cs" />
<Compile Include="OPC\Internal\TestContentTypeManager.cs" />
<Compile Include="TestContentType.cs" />
<Compile Include="TestFileHelper.cs" />
<Compile Include="TestListParts.cs" />
<Compile Include="TestPackageCoreProperties.cs" />
<Compile Include="TestPackagePartName.cs" />
<Compile Include="TestPackageThumbnail.cs" />
<Compile Include="TestPackagingURIHelper.cs" />
<Compile Include="TestRelationships.cs" />
</ItemGroup>

<ItemGroup>
<None Include="App.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\NPOI.OOXML\NPOI.OOXML.csproj">
<Project>{4d994508-5489-4342-9ee8-6fddb0763e66}</Project>
<Name>NPOI.OOXML</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\NPOI.OpenXml4Net\NPOI.OpenXml4Net.csproj">
<Project>{b6aae93b-44b0-41a0-b478-0d72c115a40c}</Project>
<Name>NPOI.OpenXml4Net</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\NPOI.OpenXmlFormats\NPOI.OpenXmlFormats.csproj">
<Project>{6452e3fd-ef04-4136-a04c-896b7c96d1cd}</Project>
<Name>NPOI.OpenXmlFormats</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\NPOI\NPOI.csproj">
<Project>{2fb384cb-1041-47b5-9c0d-d6e9e5b4d4c0}</Project>
<Name>NPOI</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\NPOI.OOXML\NPOI.OOXML.csproj" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use 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\NUnit.3.10.1\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit.3.10.1\build\NUnit.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>

</Project>
2 changes: 1 addition & 1 deletion test/NPOI.OpenXml4Net/POIDataSamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private Stream OpenClasspathResource(String sampleFileName)
private void Initialise()
{

String dataDirName = System.Configuration.ConfigurationSettings.AppSettings[TEST_PROPERTY];
String dataDirName = System.Configuration.ConfigurationManager.AppSettings[TEST_PROPERTY];

if (dataDirName == null)
throw new Exception("Must set system property '"
Expand Down
6 changes: 6 additions & 0 deletions test/NPOI.OpenXml4Net/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AppSettings": {
"POI.testdata.path": "..\\..\\..\\..\\test-data",
"ClientSettingsProvider.ServiceUri": ""
}
}
4 changes: 0 additions & 4 deletions test/NPOI.OpenXml4Net/packages.config

This file was deleted.

31 changes: 0 additions & 31 deletions test/NPOI.OpenXmlFormats/App.config
Original file line number Diff line number Diff line change
@@ -1,40 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ooxml.Testcases.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<appSettings>
<add key="POI.testdata.path" value="..\..\..\test\test-data" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<system.diagnostics>
<switches>
<!-- Store the Source file of the [De-]Serialization process accessible for Debugging. -->
<add name="XmlSerialization.Compilation" value="1" />
</switches>
</system.diagnostics>
<userSettings>
<ooxml.Testcases.Properties.Settings>
<setting name="TEST_PROPERTY" serializeAs="String">
<value>..\..\..\..\test-data</value>
</setting>
</ooxml.Testcases.Properties.Settings>
</userSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>

0 comments on commit ff8798d

Please sign in to comment.