[mapguide-commits] r8384 - in trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test: . mapguide mapguide/operations mapguide/operations/drawing
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Oct 6 02:22:11 PDT 2014
Author: jng
Date: 2014-10-06 02:22:11 -0700 (Mon, 06 Oct 2014)
New Revision: 8384
Added:
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/admin/
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/DescribeDrawing.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/DrawingServiceOperationExecutor.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingLayers.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingSectionResources.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingSections.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawing.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingLayer.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingSection.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingSectionResource.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/mapping/
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/rendering/
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/site/
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/
Modified:
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/MapGuideTestExecutorCollection.java
Log:
#2307: Add drawing service operation tests.
Modified: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/MapGuideTestExecutorCollection.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/MapGuideTestExecutorCollection.java 2014-10-06 09:02:45 UTC (rev 8383)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/MapGuideTestExecutorCollection.java 2014-10-06 09:22:11 UTC (rev 8384)
@@ -20,6 +20,7 @@
import org.osgeo.mapguide.test.platform.operations.feature.*;
import org.osgeo.mapguide.test.platform.operations.resource.*;
import org.osgeo.mapguide.test.platform.operations.maplayer.*;
+import org.osgeo.mapguide.test.mapguide.operations.drawing.*;
public class MapGuideTestExecutorCollection extends TestExecutorCollectionBase
{
@@ -113,8 +114,6 @@
_executors.put("RemoveGroup".toUpperCase(), new RemoveGroup(resSvc, dbPath, creator));
_executors.put("ShowGroup".toUpperCase(), new ShowGroup(resSvc, dbPath, creator));
- /*
-
//Drawing Service
_executors.put("DescribeDrawing".toUpperCase(), new DescribeDrawing(drawSvc, dbPath));
_executors.put("GetDrawing".toUpperCase(), new GetDrawing(drawSvc, dbPath));
@@ -124,6 +123,7 @@
_executors.put("EnumerateDrawingSections".toUpperCase(), new EnumerateDrawingSections(drawSvc, dbPath));
_executors.put("EnumerateDrawingSectionResources".toUpperCase(), new EnumerateDrawingSectionResources(drawSvc, dbPath));
_executors.put("GetDrawingSectionResource".toUpperCase(), new GetDrawingSectionResource(drawSvc, dbPath));
+ /*
//Mapping Service
Added: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/DescribeDrawing.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/DescribeDrawing.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/DescribeDrawing.java 2014-10-06 09:22:11 UTC (rev 8384)
@@ -0,0 +1,37 @@
+package org.osgeo.mapguide.test.mapguide.operations.drawing;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+
+public class DescribeDrawing extends DrawingServiceOperationExecutor
+{
+ public DescribeDrawing(MgDrawingService drawSvc, String vm)
+ {
+ super("DescribeDrawing", drawSvc, vm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ HashMap<String, String> param = new HashMap<String, String>();
+ ReadParameterValue(paramSetId, "RESOURCEID", param);
+
+ MgResourceIdentifier resId = null;
+ if (param.get("RESOURCEID") != null)
+ {
+ resId = new MgResourceIdentifier(param.get("RESOURCEID"));
+ }
+
+ MgByteReader reader = _drawingService.describeDrawing(resId);
+ return TestResult.FromByteReader(reader);
+ }
+ catch (MgException ex)
+ {
+ return TestResult.FromMgException(ex);
+ }
+ }
+}
\ No newline at end of file
Added: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/DrawingServiceOperationExecutor.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/DrawingServiceOperationExecutor.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/DrawingServiceOperationExecutor.java 2014-10-06 09:22:11 UTC (rev 8384)
@@ -0,0 +1,18 @@
+package org.osgeo.mapguide.test.mapguide.operations.drawing;
+
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+
+import com.almworks.sqlite4java.*;
+
+public abstract class DrawingServiceOperationExecutor extends PlatformApiTestExecutor
+{
+ protected MgDrawingService _drawingService;
+
+ protected DrawingServiceOperationExecutor(String opName, MgDrawingService drawSvc, String unitTestVm)
+ {
+ super(opName, ApiTypes.Platform, unitTestVm);
+ _drawingService = drawSvc;
+ }
+}
\ No newline at end of file
Added: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingLayers.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingLayers.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingLayers.java 2014-10-06 09:22:11 UTC (rev 8384)
@@ -0,0 +1,42 @@
+package org.osgeo.mapguide.test.mapguide.operations.drawing;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+
+public class EnumerateDrawingLayers extends DrawingServiceOperationExecutor
+{
+ public EnumerateDrawingLayers(MgDrawingService drawSvc, String vm)
+ {
+ super("EnumerateDrawingLayers", drawSvc, vm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ HashMap<String, String> param = new HashMap<String, String>();
+ ReadParameterValue(paramSetId, "RESOURCEID", param);
+ ReadParameterValue(paramSetId, "SECTION", param);
+
+ MgResourceIdentifier resId = null;
+ if (param.get("RESOURCEID") != null)
+ {
+ resId = new MgResourceIdentifier(param.get("RESOURCEID"));
+ }
+
+ String section = "";
+ if (param.get("SECTION") != null)
+ section = param.get("SECTION");
+ MgStringCollection coll = _drawingService.enumerateLayers(resId, section);
+ MgByteReader reader = coll.toXml();
+ return TestResult.FromByteReader(reader);
+ }
+ catch (MgException ex)
+ {
+ return TestResult.FromMgException(ex);
+ }
+ }
+}
\ No newline at end of file
Added: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingSectionResources.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingSectionResources.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingSectionResources.java 2014-10-06 09:22:11 UTC (rev 8384)
@@ -0,0 +1,41 @@
+package org.osgeo.mapguide.test.mapguide.operations.drawing;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+
+public class EnumerateDrawingSectionResources extends DrawingServiceOperationExecutor
+{
+ public EnumerateDrawingSectionResources(MgDrawingService drawSvc, String vm)
+ {
+ super("EnumerateDrawingSectionResources", drawSvc, vm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ HashMap<String, String> param = new HashMap<String, String>();
+ ReadParameterValue(paramSetId, "RESOURCEID", param);
+ ReadParameterValue(paramSetId, "SECTION", param);
+
+ MgResourceIdentifier resId = null;
+ if (param.get("RESOURCEID") != null)
+ {
+ resId = new MgResourceIdentifier(param.get("RESOURCEID"));
+ }
+
+ String section = "";
+ if (param.get("SECTION") != null)
+ section = param.get("SECTION");
+ MgByteReader reader = _drawingService.enumerateSectionResources(resId, section);
+ return TestResult.FromByteReader(reader);
+ }
+ catch (MgException ex)
+ {
+ return TestResult.FromMgException(ex);
+ }
+ }
+}
\ No newline at end of file
Added: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingSections.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingSections.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/EnumerateDrawingSections.java 2014-10-06 09:22:11 UTC (rev 8384)
@@ -0,0 +1,37 @@
+package org.osgeo.mapguide.test.mapguide.operations.drawing;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+
+public class EnumerateDrawingSections extends DrawingServiceOperationExecutor
+{
+ public EnumerateDrawingSections(MgDrawingService drawSvc, String vm)
+ {
+ super("EnumerateDrawingSections", drawSvc, vm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ HashMap<String, String> param = new HashMap<String, String>();
+ ReadParameterValue(paramSetId, "RESOURCEID", param);
+
+ MgResourceIdentifier resId = null;
+ if (param.get("RESOURCEID") != null)
+ {
+ resId = new MgResourceIdentifier(param.get("RESOURCEID"));
+ }
+
+ MgByteReader reader = _drawingService.enumerateSections(resId);
+ return TestResult.FromByteReader(reader);
+ }
+ catch (MgException ex)
+ {
+ return TestResult.FromMgException(ex);
+ }
+ }
+}
\ No newline at end of file
Added: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawing.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawing.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawing.java 2014-10-06 09:22:11 UTC (rev 8384)
@@ -0,0 +1,37 @@
+package org.osgeo.mapguide.test.mapguide.operations.drawing;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+
+public class GetDrawing extends DrawingServiceOperationExecutor
+{
+ public GetDrawing(MgDrawingService drawSvc, String vm)
+ {
+ super("GetDrawing", drawSvc, vm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ HashMap<String, String> param = new HashMap<String, String>();
+ ReadParameterValue(paramSetId, "RESOURCEID", param);
+
+ MgResourceIdentifier resId = null;
+ if (param.get("RESOURCEID") != null)
+ {
+ resId = new MgResourceIdentifier(param.get("RESOURCEID"));
+ }
+
+ MgByteReader reader = _drawingService.getDrawing(resId);
+ return TestResult.FromByteReader(reader);
+ }
+ catch (MgException ex)
+ {
+ return TestResult.FromMgException(ex);
+ }
+ }
+}
\ No newline at end of file
Added: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingLayer.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingLayer.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingLayer.java 2014-10-06 09:22:11 UTC (rev 8384)
@@ -0,0 +1,39 @@
+package org.osgeo.mapguide.test.mapguide.operations.drawing;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+
+public class GetDrawingLayer extends DrawingServiceOperationExecutor
+{
+ public GetDrawingLayer(MgDrawingService drawSvc, String vm)
+ {
+ super("GetDrawingLayer", drawSvc, vm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ HashMap<String, String> param = new HashMap<String, String>();
+ ReadParameterValue(paramSetId, "RESOURCEID", param);
+ ReadParameterValue(paramSetId, "SECTION", param);
+ ReadParameterValue(paramSetId, "LAYER", param);
+
+ MgResourceIdentifier resId = null;
+ if (param.get("RESOURCEID") != null)
+ {
+ resId = new MgResourceIdentifier(param.get("RESOURCEID"));
+ }
+
+ MgByteReader reader = _drawingService.getLayer(resId, param.get("SECTION"), param.get("LAYER"));
+ return TestResult.FromByteReader(reader, "GETDRAWINGLAYER");
+ }
+ catch (MgException ex)
+ {
+ return TestResult.FromMgException(ex);
+ }
+ }
+}
\ No newline at end of file
Added: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingSection.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingSection.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingSection.java 2014-10-06 09:22:11 UTC (rev 8384)
@@ -0,0 +1,38 @@
+package org.osgeo.mapguide.test.mapguide.operations.drawing;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+
+public class GetDrawingSection extends DrawingServiceOperationExecutor
+{
+ public GetDrawingSection(MgDrawingService drawSvc, String vm)
+ {
+ super("GetDrawingSection", drawSvc, vm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ HashMap<String, String> param = new HashMap<String, String>();
+ ReadParameterValue(paramSetId, "RESOURCEID", param);
+ ReadParameterValue(paramSetId, "SECTION", param);
+
+ MgResourceIdentifier resId = null;
+ if (param.get("RESOURCEID") != null)
+ {
+ resId = new MgResourceIdentifier(param.get("RESOURCEID"));
+ }
+
+ MgByteReader reader = _drawingService.getSection(resId, param.get("SECTION"));
+ return TestResult.FromByteReader(reader, "GETDRAWINGSECTION");
+ }
+ catch (MgException ex)
+ {
+ return TestResult.FromMgException(ex);
+ }
+ }
+}
\ No newline at end of file
Added: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingSectionResource.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingSectionResource.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/drawing/GetDrawingSectionResource.java 2014-10-06 09:22:11 UTC (rev 8384)
@@ -0,0 +1,38 @@
+package org.osgeo.mapguide.test.mapguide.operations.drawing;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+
+public class GetDrawingSectionResource extends DrawingServiceOperationExecutor
+{
+ public GetDrawingSectionResource(MgDrawingService drawSvc, String vm)
+ {
+ super("GetDrawingSectionResource", drawSvc, vm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ HashMap<String, String> param = new HashMap<String, String>();
+ ReadParameterValue(paramSetId, "RESOURCEID", param);
+ ReadParameterValue(paramSetId, "RESOURCENAME", param);
+
+ MgResourceIdentifier resId = null;
+ if (param.get("RESOURCEID") != null)
+ {
+ resId = new MgResourceIdentifier(param.get("RESOURCEID"));
+ }
+
+ MgByteReader reader = _drawingService.getSectionResource(resId, param.get("RESOURCENAME"));
+ return TestResult.FromByteReader(reader, "GETDRAWINGSECTIONRESOURCE");
+ }
+ catch (MgException ex)
+ {
+ return TestResult.FromMgException(ex);
+ }
+ }
+}
\ No newline at end of file
More information about the mapguide-commits
mailing list