[mapguide-commits] r9703 - in sandbox/jng/library_init/UnitTest/WebTier/DotNet: . TestStandalone TestStandalone/Properties
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Aug 4 06:46:07 PDT 2020
Author: jng
Date: 2020-08-04 06:46:07 -0700 (Tue, 04 Aug 2020)
New Revision: 9703
Added:
sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/
sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/App.config
sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/Program.cs
sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/Properties/
sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/Properties/AssemblyInfo.cs
sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/TestStandalone.csproj
Modified:
sandbox/jng/library_init/UnitTest/WebTier/DotNet/
sandbox/jng/library_init/UnitTest/WebTier/DotNet/DotNet.sln
sandbox/jng/library_init/UnitTest/WebTier/DotNet/prebuild.bat
Log:
Add .net test program that verifies that by calling the new library init APIs that any caught exceptions contain localized error messages
Index: sandbox/jng/library_init/UnitTest/WebTier/DotNet
===================================================================
--- sandbox/jng/library_init/UnitTest/WebTier/DotNet 2020-08-04 13:19:26 UTC (rev 9702)
+++ sandbox/jng/library_init/UnitTest/WebTier/DotNet 2020-08-04 13:46:07 UTC (rev 9703)
Property changes on: sandbox/jng/library_init/UnitTest/WebTier/DotNet
___________________________________________________________________
Modified: svn:ignore
## -1,3 +1,4 ##
Libs
*.suo
build.log
+.vs
Modified: sandbox/jng/library_init/UnitTest/WebTier/DotNet/DotNet.sln
===================================================================
--- sandbox/jng/library_init/UnitTest/WebTier/DotNet/DotNet.sln 2020-08-04 13:19:26 UTC (rev 9702)
+++ sandbox/jng/library_init/UnitTest/WebTier/DotNet/DotNet.sln 2020-08-04 13:46:07 UTC (rev 9703)
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Express 2012 for Windows Desktop
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30320.27
+MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestCommon", "TestCommon\TestCommon.csproj", "{80EAA5CB-E709-485A-86AC-DE9B5236EAB9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestMapGuideApi", "TestMapGuideApi\TestMapGuideApi.csproj", "{54A7F4EE-D977-4DFB-9922-C46C5FFB6822}"
@@ -7,40 +9,65 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MgTestRunner", "MgTestRunner\MgTestRunner.csproj", "{C920EC51-255B-4257-81AA-8D984B5B5A48}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestStandalone", "TestStandalone\TestStandalone.csproj", "{EA557D7D-37FC-4D99-A823-0BF22E6AE255}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {80EAA5CB-E709-485A-86AC-DE9B5236EAB9}.Debug|Any CPU.ActiveCfg = Debug|x86
{80EAA5CB-E709-485A-86AC-DE9B5236EAB9}.Debug|x64.ActiveCfg = Debug|x64
{80EAA5CB-E709-485A-86AC-DE9B5236EAB9}.Debug|x64.Build.0 = Debug|x64
{80EAA5CB-E709-485A-86AC-DE9B5236EAB9}.Debug|x86.ActiveCfg = Debug|x86
{80EAA5CB-E709-485A-86AC-DE9B5236EAB9}.Debug|x86.Build.0 = Debug|x86
+ {80EAA5CB-E709-485A-86AC-DE9B5236EAB9}.Release|Any CPU.ActiveCfg = Release|x86
{80EAA5CB-E709-485A-86AC-DE9B5236EAB9}.Release|x64.ActiveCfg = Release|x64
{80EAA5CB-E709-485A-86AC-DE9B5236EAB9}.Release|x64.Build.0 = Release|x64
{80EAA5CB-E709-485A-86AC-DE9B5236EAB9}.Release|x86.ActiveCfg = Release|x86
{80EAA5CB-E709-485A-86AC-DE9B5236EAB9}.Release|x86.Build.0 = Release|x86
+ {54A7F4EE-D977-4DFB-9922-C46C5FFB6822}.Debug|Any CPU.ActiveCfg = Debug|x86
{54A7F4EE-D977-4DFB-9922-C46C5FFB6822}.Debug|x64.ActiveCfg = Debug|x64
{54A7F4EE-D977-4DFB-9922-C46C5FFB6822}.Debug|x64.Build.0 = Debug|x64
{54A7F4EE-D977-4DFB-9922-C46C5FFB6822}.Debug|x86.ActiveCfg = Debug|x86
{54A7F4EE-D977-4DFB-9922-C46C5FFB6822}.Debug|x86.Build.0 = Debug|x86
+ {54A7F4EE-D977-4DFB-9922-C46C5FFB6822}.Release|Any CPU.ActiveCfg = Release|x86
{54A7F4EE-D977-4DFB-9922-C46C5FFB6822}.Release|x64.ActiveCfg = Release|x64
{54A7F4EE-D977-4DFB-9922-C46C5FFB6822}.Release|x64.Build.0 = Release|x64
{54A7F4EE-D977-4DFB-9922-C46C5FFB6822}.Release|x86.ActiveCfg = Release|x86
{54A7F4EE-D977-4DFB-9922-C46C5FFB6822}.Release|x86.Build.0 = Release|x86
+ {C920EC51-255B-4257-81AA-8D984B5B5A48}.Debug|Any CPU.ActiveCfg = Debug|x86
{C920EC51-255B-4257-81AA-8D984B5B5A48}.Debug|x64.ActiveCfg = Debug|x64
{C920EC51-255B-4257-81AA-8D984B5B5A48}.Debug|x64.Build.0 = Debug|x64
{C920EC51-255B-4257-81AA-8D984B5B5A48}.Debug|x86.ActiveCfg = Debug|x86
{C920EC51-255B-4257-81AA-8D984B5B5A48}.Debug|x86.Build.0 = Debug|x86
+ {C920EC51-255B-4257-81AA-8D984B5B5A48}.Release|Any CPU.ActiveCfg = Release|x86
{C920EC51-255B-4257-81AA-8D984B5B5A48}.Release|x64.ActiveCfg = Release|x64
{C920EC51-255B-4257-81AA-8D984B5B5A48}.Release|x64.Build.0 = Release|x64
{C920EC51-255B-4257-81AA-8D984B5B5A48}.Release|x86.ActiveCfg = Release|x86
{C920EC51-255B-4257-81AA-8D984B5B5A48}.Release|x86.Build.0 = Release|x86
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Debug|x64.Build.0 = Debug|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Debug|x86.Build.0 = Debug|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Release|x64.ActiveCfg = Release|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Release|x64.Build.0 = Release|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Release|x86.ActiveCfg = Release|Any CPU
+ {EA557D7D-37FC-4D99-A823-0BF22E6AE255}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {EAC49B87-D297-418B-A6A3-6FEE20C07B19}
+ EndGlobalSection
EndGlobal
Index: sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone
===================================================================
--- sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone 2020-08-04 13:19:26 UTC (rev 9702)
+++ sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone 2020-08-04 13:46:07 UTC (rev 9703)
Property changes on: sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,2 ##
+bin
+obj
Added: sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/App.config
===================================================================
--- sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/App.config (rev 0)
+++ sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/App.config 2020-08-04 13:46:07 UTC (rev 9703)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
+ </startup>
+</configuration>
\ No newline at end of file
Added: sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/Program.cs
===================================================================
--- sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/Program.cs (rev 0)
+++ sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/Program.cs 2020-08-04 13:46:07 UTC (rev 9703)
@@ -0,0 +1,36 @@
+using OSGeo.MapGuide;
+using System;
+
+namespace TestStandalone
+{
+ class Program
+ {
+ static int Main(string[] args)
+ {
+ if (args.Length != 3)
+ {
+ Console.WriteLine("Usage: TestStandalone <path to mapguide.res> <locale> <mentor_dictionary_path>");
+ return 1;
+ }
+
+ FoundationApi.MgInitializeLibrary(args[0], args[1]);
+
+ var csFactory = new MgCoordinateSystemFactory();
+ var catalog = csFactory.GetCatalog();
+ catalog.SetDictionaryDir(args[2]);
+
+ //Trigger some exceptions
+ try
+ {
+ csFactory.CreateFromCode("IDontExist");
+ }
+ catch (MgException ex)
+ {
+ Console.WriteLine(ex);
+ }
+
+ FoundationApi.MgUninitializeLibrary();
+ return 0;
+ }
+ }
+}
Added: sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/Properties/AssemblyInfo.cs
===================================================================
--- sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/Properties/AssemblyInfo.cs (rev 0)
+++ sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/Properties/AssemblyInfo.cs 2020-08-04 13:46:07 UTC (rev 9703)
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("TestStandalone")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("TestStandalone")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("ea557d7d-37fc-4d99-a823-0bf22e6ae255")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/TestStandalone.csproj
===================================================================
--- sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/TestStandalone.csproj (rev 0)
+++ sandbox/jng/library_init/UnitTest/WebTier/DotNet/TestStandalone/TestStandalone.csproj 2020-08-04 13:46:07 UTC (rev 9703)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{EA557D7D-37FC-4D99-A823-0BF22E6AE255}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>TestStandalone</RootNamespace>
+ <AssemblyName>TestStandalone</AssemblyName>
+ <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+ <Deterministic>true</Deterministic>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="OSGeo.MapGuide.Foundation, Version=1.0.0.1, Culture=neutral, processorArchitecture=AMD64">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\Libs\OSGeo.MapGuide.Foundation.dll</HintPath>
+ </Reference>
+ <Reference Include="OSGeo.MapGuide.Geometry, Version=1.0.0.1, Culture=neutral, processorArchitecture=AMD64">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\Libs\OSGeo.MapGuide.Geometry.dll</HintPath>
+ </Reference>
+ <Reference Include="OSGeo.MapGuide.PlatformBase, Version=1.0.0.1, Culture=neutral, processorArchitecture=AMD64">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\Libs\OSGeo.MapGuide.PlatformBase.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="App.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PreBuildEvent>call "$(SolutionDir)prebuild.bat" "$(ConfigurationName)" "$(PlatformName)"</PreBuildEvent>
+ </PropertyGroup>
+ <PropertyGroup>
+ <PostBuildEvent>copy /Y "$(SolutionDir)Libs\*.*" "$(TargetDir)"
+xcopy /S /Y /I "$(SolutionDir)..\..\..\Common\MapGuideCommon\Resources" "$(TargetDir)\Resources"</PostBuildEvent>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
Modified: sandbox/jng/library_init/UnitTest/WebTier/DotNet/prebuild.bat
===================================================================
--- sandbox/jng/library_init/UnitTest/WebTier/DotNet/prebuild.bat 2020-08-04 13:19:26 UTC (rev 9702)
+++ sandbox/jng/library_init/UnitTest/WebTier/DotNet/prebuild.bat 2020-08-04 13:46:07 UTC (rev 9703)
@@ -27,11 +27,15 @@
if "%PLAT%"=="x64" (
echo Copying x64 binaries from %SLN_DIR%..\..\..\Web\bin\%CFG%64
copy /Y "%SLN_DIR%..\..\..\Web\bin\%CFG%64\*.*" "%SLN_DIR%Libs\"
+ echo Copying x64 binaries from %SLN_DIR%..\..\..\Common\bin\%CFG%64
+ copy /Y "%SLN_DIR%..\..\..\Common\bin\%CFG%64\*.*" "%SLN_DIR%Libs\"
echo Copying x64 SqliteDotNet.dll from %SLN_DIR%..\..\..\Oem\SQLite\bin\%CFG%64\SqliteDotNet.dll
copy /Y "%SLN_DIR%..\..\..\Oem\SQLite\bin\%CFG%64\SqliteDotNet.dll" "%SLN_DIR%Libs\"
) else (
echo Copying x86 binaries from %SLN_DIR%..\..\..\Web\bin\%CFG%
copy /Y "%SLN_DIR%..\..\..\Web\bin\%CFG%\*.*" "%SLN_DIR%Libs\"
+ echo Copying x86 binaries from %SLN_DIR%..\..\..\Common\bin\%CFG%
+ copy /Y "%SLN_DIR%..\..\..\Common\bin\%CFG%\*.*" "%SLN_DIR%Libs\"
echo Copying x86 SqliteDotNet.dll
copy /Y "%SLN_DIR%..\..\..\Oem\SQLite\bin\%CFG%\SqliteDotNet.dll" "%SLN_DIR%Libs\"
)
More information about the mapguide-commits
mailing list