[mapguide-commits] r9785 - in sandbox/jng/vanilla_swig/Bindings/src/Test: . Java Java/extlib Java/src/org/osgeo/mapguide/test/platform/operations/resource

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Nov 14 06:54:14 PST 2020


Author: jng
Date: 2020-11-14 06:54:14 -0800 (Sat, 14 Nov 2020)
New Revision: 9785

Added:
   sandbox/jng/vanilla_swig/Bindings/src/Test/Java/extlib/ant-contrib.jar
Modified:
   sandbox/jng/vanilla_swig/Bindings/src/Test/
   sandbox/jng/vanilla_swig/Bindings/src/Test/Java/
   sandbox/jng/vanilla_swig/Bindings/src/Test/Java/build.xml
   sandbox/jng/vanilla_swig/Bindings/src/Test/Java/src/org/osgeo/mapguide/test/platform/operations/resource/SetResourceData.java
Log:
Fix up Java test runner to build and run properly (it is not passing, we'll deal with that later)

Index: sandbox/jng/vanilla_swig/Bindings/src/Test
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Test	2020-11-14 14:13:44 UTC (rev 9784)
+++ sandbox/jng/vanilla_swig/Bindings/src/Test	2020-11-14 14:54:14 UTC (rev 9785)

Property changes on: sandbox/jng/vanilla_swig/Bindings/src/Test
___________________________________________________________________
Added: svn:ignore
## -0,0 +1 ##
+java_dist
Index: sandbox/jng/vanilla_swig/Bindings/src/Test/Java
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Test/Java	2020-11-14 14:13:44 UTC (rev 9784)
+++ sandbox/jng/vanilla_swig/Bindings/src/Test/Java	2020-11-14 14:54:14 UTC (rev 9785)

Property changes on: sandbox/jng/vanilla_swig/Bindings/src/Test/Java
___________________________________________________________________
Added: svn:ignore
## -0,0 +1 ##
+build
Modified: sandbox/jng/vanilla_swig/Bindings/src/Test/Java/build.xml
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Test/Java/build.xml	2020-11-14 14:13:44 UTC (rev 9784)
+++ sandbox/jng/vanilla_swig/Bindings/src/Test/Java/build.xml	2020-11-14 14:54:14 UTC (rev 9785)
@@ -1,8 +1,12 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <project name="MgUnitTest" default="dist" basedir=".">
   <description>MgUnitTest project file</description>
-  <!-- Must install ant-contrib 1.0b2 or higher -->
-  <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
+  <!-- Must install ant-contrib 1.0b2 or higher as we need this to write a custom webconfig.ini -->
+  <taskdef resource="net/sf/antcontrib/antcontrib.properties">
+    <classpath>
+      <pathelement location="extlib/ant-contrib.jar"/>
+    </classpath>
+  </taskdef>
   <condition property="unix">
     <os family="unix" />
   </condition>
@@ -16,16 +20,17 @@
   <property name="classpath" location="lib" />
   <property name="extlib" location="extlib" />
   <property name="build.target" location="64" />
-  <property name="binsrc.web" location="../../../Web/bin/release64" />
-  <property name="jarsrc.web" location="../../../Web/src/WEB-INF/lib" />
-  <property name="mapguide.res.src" location="../../../Common/MapGuideCommon/Resources/mapguide_en.res" />
-  <property name="mapguide.config.src" location="../../../Web/src/webconfig.ini" />
+  <property name="binsrc.common" location="../../../../Common/bin/Release64" />
+  <property name="binsrc.web" location="../../../../Web/bin/Release64" />
+  <property name="jarsrc.web" location="../../../packages/Java/Release/x64" />
+  <property name="mapguide.res.src" location="../../../../Common/MapGuideCommon/Resources/mapguide_en.res" />
+  <property name="mapguide.config.src" location="../../../../Web/src/webconfig.ini" />
   <property name="mapguide.res" location="${dist}/Resources/mapguide_en.res" />
   <property name="mapguide.config" location="${dist}/webconfig.ini" />
-  <property name="mapguide.dictpath" location="../../../Oem/CsMap/Dictionaries" />
+  <property name="mapguide.dictpath" location="../../../../Oem/CsMap/CsMapDev/Dictionaries" />
   <property name="unittest.logpath" location="${dist}/unittest.log" />
   <!-- Linux-specific -->
-  <property name="mapguide.ldpath" location="/usr/local/mapguideopensource-3.0.0/lib:/usr/local/mapguideopensource-3.0.0/webserverextensions/lib" />
+  <property name="mapguide.ldpath" location="/usr/local/mapguideopensource-4.0.0/lib64:/usr/local/mapguideopensource-4.0.0/webserverextensions/lib64" />
   <path id="master-classpath">
     <fileset dir="${classpath}">
       <include name="*.jar" />
@@ -33,38 +38,53 @@
   </path>
   <target name="initwin" if="windows">
     <echo message="Init build environment for Windows" />
+    <echo message="  dist                = ${dist}" />
+    <echo message="  binsrc.web          = ${binsrc.web}" />
+    <echo message="  jarsrc.web          = ${jarsrc.web}" />
+    <echo message="  mapguide.res.src    = ${mapguide.res.src}" />
+    <echo message="  mapguide.config.src = ${mapguide.config.src}" />
+    <echo message="  mapguide.dictpath   = ${mapguide.dictpath}" />
     <!-- Create the time stamp -->
     <tstamp/>
     <!-- Create the build directory structure used by compile -->
     <mkdir dir="${build}"/>
     <!-- Copy required jars and dlls -->
+    <echo message="Copying files from ${jarsrc.web}" />
     <copy todir="${classpath}">
       <fileset dir="${jarsrc.web}">
-        <include name="**/MapGuideApi.jar" />
+        <include name="**/*.jar" />
+        <include name="**/*.dll" />
+        <include name="**/*.pdb" />
       </fileset>
     </copy>
+    <echo message="Copying support files from ${extlib}" />
     <copy todir="${classpath}">
       <fileset dir="${extlib}">
         <include name="**/sqlite4java.jar" />
       </fileset>
     </copy>
-    <condition property="binsrc.web" value="../../../Web/bin/release">
-      <equals arg1="${build.target}" arg2="32" />
-    </condition>
-    <condition property="binsrc.web" value="../../../Web/bin/release64">
-      <equals arg1="${build.target}" arg2="64" />
-    </condition>
     <echo message="Copying dlls from ${binsrc.web}" />
     <copy todir="${classpath}">
       <fileset dir="${binsrc.web}">
-        <include name="**/Mg*.dll" />
-        <include name="**/ACE.dll" />
-        <include name="**/GEOS.dll" />
-        <include name="**/lib_json.dll" />
-        <include name="**/MapGuideJavaApi.dll" />
-        <include name="**/xerces-c_3_1mg.dll" />
+        <include name="**/MgFoundation.*" />
+        <include name="**/MgGeometry.*" />
+        <include name="**/MgPlatformBase.*" />
+        <include name="**/MgMapGuideCommon.*" />
+        <include name="**/MgMdfModel.*" />
+        <include name="**/MgMdfParser.*" />
       </fileset>
     </copy>
+    <echo message="Copying dlls from ${binsrc.web}" />
+    <copy todir="${classpath}">
+      <fileset dir="${binsrc.web}">
+        <include name="**/MgHttpHandler*.*" />
+        <include name="**/MgWeb*.*" />
+        <include name="**/ACE.*" />
+        <include name="**/GEOS.*" />
+        <include name="**/lib_json.*" />
+        <include name="**/xerces-c_3_1mg.*" />
+      </fileset>
+    </copy>
   </target>
   <target name="initunix" if="unix">
     <echo message="Init build environment for Unix" />

Added: sandbox/jng/vanilla_swig/Bindings/src/Test/Java/extlib/ant-contrib.jar
===================================================================
(Binary files differ)

Index: sandbox/jng/vanilla_swig/Bindings/src/Test/Java/extlib/ant-contrib.jar
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Test/Java/extlib/ant-contrib.jar	2020-11-14 14:13:44 UTC (rev 9784)
+++ sandbox/jng/vanilla_swig/Bindings/src/Test/Java/extlib/ant-contrib.jar	2020-11-14 14:54:14 UTC (rev 9785)

Property changes on: sandbox/jng/vanilla_swig/Bindings/src/Test/Java/extlib/ant-contrib.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: sandbox/jng/vanilla_swig/Bindings/src/Test/Java/src/org/osgeo/mapguide/test/platform/operations/resource/SetResourceData.java
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Test/Java/src/org/osgeo/mapguide/test/platform/operations/resource/SetResourceData.java	2020-11-14 14:13:44 UTC (rev 9784)
+++ sandbox/jng/vanilla_swig/Bindings/src/Test/Java/src/org/osgeo/mapguide/test/platform/operations/resource/SetResourceData.java	2020-11-14 14:54:14 UTC (rev 9785)
@@ -41,15 +41,15 @@
             return TestResult.FromByteReader(null);
         }
         catch (MgException ex)
-        {
-            //HACK/FIXME: The test suite is passing paths with incorrect case to this operation (presumably to exercise
-            //this operation in a Linux environment where case-sensitive paths matter), but there's no way in my knowledge 
-            //to perform platform-specific verification of test results. So what we have is an intentionally failing test 
-            //for a platform that has no means to verify that.
-            //
-            //As a workaround, when such bad paths are encountered (that should present themselves as thrown
+        {
+            //HACK/FIXME: The test suite is passing paths with incorrect case to this operation (presumably to exercise
+            //this operation in a Linux environment where case-sensitive paths matter), but there's no way in my knowledge 
+            //to perform platform-specific verification of test results. So what we have is an intentionally failing test 
+            //for a platform that has no means to verify that.
+            //
+            //As a workaround, when such bad paths are encountered (that should present themselves as thrown
             //MgFileNotFoundException objects), return the result that is expected on Windows: An empty result.
-            if (!CommonUtility.IsWindows() && (ex instanceof MgFileNotFoundException)) {
+            if (!CommonUtility.IsWindows() && (ex.getExceptionCode() == MgExceptionCodes.MgFileNotFoundException)) {
                 return TestResult.FromByteReader(null);
             } else {
                 return TestResult.FromMgException(ex);



More information about the mapguide-commits mailing list