[mapguide-commits] r8386 - in trunk/MgDev/UnitTest/WebTier/Java: . src/org/osgeo/mapguide/test src/org/osgeo/mapguide/test/common src/org/osgeo/mapguide/test/mapguide/operations/weblayout
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Oct 6 04:33:24 PDT 2014
Author: jng
Date: 2014-10-06 04:33:24 -0700 (Mon, 06 Oct 2014)
New Revision: 8386
Added:
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_BackDescription.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_BackTooltip.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ForwardDescription.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ForwardTooltip.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetCenter.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetInformationPaneWidth.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetInitialTaskUrl.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetMapDefinition.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetScale.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetTaskPaneWidth.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetTitle.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_HomeDescription.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_HomeTooltip.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowContextMenu.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowLegend.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowProperties.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowStatusbar.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowTaskbar.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowTaskpane.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowToolbar.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TasksDescription.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TasksName.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TasksTooltip.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TestUiItem.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WebLayoutOperationExecutor.java
Modified:
trunk/MgDev/UnitTest/WebTier/Java/build.xml
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/MapGuideTestExecutorCollection.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/common/CommonUtility.java
trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/common/TestResult.java
Log:
#2307:
- Wipe out any dumped binary files and log files as part of the "check" target before running the main jar.
- Add web layout test operations. This brings up test suite parity with the .net runner.
Modified: trunk/MgDev/UnitTest/WebTier/Java/build.xml
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/build.xml 2014-10-06 10:35:18 UTC (rev 8385)
+++ trunk/MgDev/UnitTest/WebTier/Java/build.xml 2014-10-06 11:33:24 UTC (rev 8386)
@@ -142,6 +142,11 @@
</target>
<target name="check" depends="dist">
+ <!-- Remove any log files and dumped binary files from previous run -->
+ <delete>
+ <fileset dir="${dist}" includes="**/*.bin"/>
+ <fileset dir="${dist}" includes="**/*.log"/>
+ </delete>
<exec executable="java" dir="${dist}">
<arg line="-jar MgUnitTest.jar ${mapguide.config} ${unittest.logpath}" />
<env key="MENTOR_DICTIONARY_PATH" value="${mapguide.dictpath}" />
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 10:35:18 UTC (rev 8385)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/MapGuideTestExecutorCollection.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -23,6 +23,7 @@
import org.osgeo.mapguide.test.mapguide.operations.drawing.*;
import org.osgeo.mapguide.test.mapguide.operations.admin.*;
import org.osgeo.mapguide.test.mapguide.operations.site.*;
+import org.osgeo.mapguide.test.mapguide.operations.weblayout.*;
public class MapGuideTestExecutorCollection extends TestExecutorCollectionBase
{
@@ -170,8 +171,6 @@
_executors.put("UpdateServer".toUpperCase(), new UpdateServer(site, dbPath));
_executors.put("RemoveServer".toUpperCase(), new RemoveServer(site, dbPath));
- /*
-
//Web Layout
_executors.put("WL_GetTitle".toUpperCase(), new WL_GetTitle(wlCreator, dbPath));
_executors.put("WL_GetMapDefinition".toUpperCase(), new WL_GetMapDefinition(wlCreator, dbPath));
@@ -197,8 +196,6 @@
_executors.put("WL_TasksName".toUpperCase(), new WL_TasksName(wlCreator, dbPath));
_executors.put("WL_TasksTooltip".toUpperCase(), new WL_TasksTooltip(wlCreator, dbPath));
_executors.put("WL_TasksDescription".toUpperCase(), new WL_TasksDescription(wlCreator, dbPath));
-
- */
}
class MgWebLayoutCreator implements IWebLayoutCreator
Modified: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/common/CommonUtility.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/common/CommonUtility.java 2014-10-06 10:35:18 UTC (rev 8385)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/common/CommonUtility.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -19,6 +19,14 @@
public class CommonUtility
{
+ public static String DoubleToString(double d)
+ {
+ if(d == (long) d)
+ return String.format("%d",(long)d);
+ else
+ return String.format("%s",d);
+ }
+
public static MgStringCollection StringToMgStringCollection(String str)
{
try
Modified: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/common/TestResult.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/common/TestResult.java 2014-10-06 10:35:18 UTC (rev 8385)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/common/TestResult.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -1,6 +1,7 @@
package org.osgeo.mapguide.test.common;
import java.util.UUID;
+import java.text.DecimalFormat;
import org.osgeo.mapguide.*;
import org.osgeo.mapguide.test.*;
@@ -74,7 +75,14 @@
}
public static TestResult Double(double value) {
- return new TestResult((value + ""), "text/plain");
+ /*
+ DecimalFormat format = new DecimalFormat("0.#");
+ if (value < 0.0)
+ return new TestResult("-" + format.format(Math.abs(value)), "text/plain");
+ else
+ return new TestResult(format.format(value), "text/plain");
+ */
+ return new TestResult(String.format("%g", value), "text/plain");
}
public static TestResult Boolean(boolean value) {
Added: trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_BackDescription.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_BackDescription.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_BackDescription.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,33 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_BackDescription extends WebLayoutOperationExecutor
+{
+ public WL_BackDescription(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_BackDescription", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tbar = tp.getTaskBar();
+ MgWebWidgetCollection tbuttons = tbar.getTaskButtons();
+ MgWebTaskBarWidget back = (MgWebTaskBarWidget)tbuttons.getWidget(MgWebTaskButtonType.Back);
+ return TestResult.String(back.getDescription());
+ }
+ 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/weblayout/WL_BackTooltip.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_BackTooltip.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_BackTooltip.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,33 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_BackTooltip extends WebLayoutOperationExecutor
+{
+ public WL_BackTooltip(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_BackTooltip", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tbar = tp.getTaskBar();
+ MgWebWidgetCollection tbuttons = tbar.getTaskButtons();
+ MgWebTaskBarWidget back = (MgWebTaskBarWidget)tbuttons.getWidget(MgWebTaskButtonType.Back);
+ return TestResult.String(back.getTooltip());
+ }
+ 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/weblayout/WL_ForwardDescription.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ForwardDescription.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ForwardDescription.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,33 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_ForwardDescription extends WebLayoutOperationExecutor
+{
+ public WL_ForwardDescription(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_ForwardDescription", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tbar = tp.getTaskBar();
+ MgWebWidgetCollection tbuttons = tbar.getTaskButtons();
+ MgWebTaskBarWidget fwd = (MgWebTaskBarWidget)tbuttons.getWidget(MgWebTaskButtonType.Forward);
+ return TestResult.String(fwd.getDescription());
+ }
+ 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/weblayout/WL_ForwardTooltip.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ForwardTooltip.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ForwardTooltip.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,33 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_ForwardTooltip extends WebLayoutOperationExecutor
+{
+ public WL_ForwardTooltip(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_ForwardTooltip", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tbar = tp.getTaskBar();
+ MgWebWidgetCollection tbuttons = tbar.getTaskButtons();
+ MgWebTaskBarWidget fwd = (MgWebTaskBarWidget)tbuttons.getWidget(MgWebTaskButtonType.Forward);
+ return TestResult.String(fwd.getTooltip());
+ }
+ 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/weblayout/WL_GetCenter.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetCenter.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetCenter.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,38 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_GetCenter extends WebLayoutOperationExecutor
+{
+ public WL_GetCenter(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_GetCenter", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgPoint center = _wl.getCenter();
+ if (center == null)
+ {
+ return TestResult.String("");
+ }
+ else
+ {
+ MgCoordinate coord = center.getCoordinate();
+ return TestResult.String(CommonUtility.DoubleToString(coord.getX()) + "/" + CommonUtility.DoubleToString(coord.getY()));
+ }
+ }
+ 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/weblayout/WL_GetInformationPaneWidth.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetInformationPaneWidth.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetInformationPaneWidth.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,30 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_GetInformationPaneWidth extends WebLayoutOperationExecutor
+{
+ public WL_GetInformationPaneWidth(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_GetInformationPaneWidth", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebInformationPane ip = _wl.getInformationPane();
+ return TestResult.Integer(ip.getWidth());
+ }
+ 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/weblayout/WL_GetInitialTaskUrl.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetInitialTaskUrl.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetInitialTaskUrl.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,30 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_GetInitialTaskUrl extends WebLayoutOperationExecutor
+{
+ public WL_GetInitialTaskUrl(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_GetInitialTaskUrl", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ return TestResult.String(tp.getInitialTaskUrl());
+ }
+ 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/weblayout/WL_GetMapDefinition.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetMapDefinition.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetMapDefinition.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,29 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_GetMapDefinition extends WebLayoutOperationExecutor
+{
+ public WL_GetMapDefinition(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_GetMapDefinition", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ return TestResult.String(_wl.getMapDefinition());
+ }
+ 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/weblayout/WL_GetScale.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetScale.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetScale.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,29 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_GetScale extends WebLayoutOperationExecutor
+{
+ public WL_GetScale(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_GetScale", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ return TestResult.Double(_wl.getScale());
+ }
+ 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/weblayout/WL_GetTaskPaneWidth.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetTaskPaneWidth.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetTaskPaneWidth.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,30 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_GetTaskPaneWidth extends WebLayoutOperationExecutor
+{
+ public WL_GetTaskPaneWidth(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_GetTaskPaneWidth", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ return TestResult.Integer(tp.getWidth());
+ }
+ 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/weblayout/WL_GetTitle.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetTitle.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_GetTitle.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,29 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_GetTitle extends WebLayoutOperationExecutor
+{
+ public WL_GetTitle(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_GetTitle", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ return TestResult.String(_wl.getTitle());
+ }
+ 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/weblayout/WL_HomeDescription.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_HomeDescription.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_HomeDescription.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,33 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_HomeDescription extends WebLayoutOperationExecutor
+{
+ public WL_HomeDescription(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_HomeDescription", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tbar = tp.getTaskBar();
+ MgWebWidgetCollection tbuttons = tbar.getTaskButtons();
+ MgWebTaskBarWidget home = (MgWebTaskBarWidget)tbuttons.getWidget(MgWebTaskButtonType.Home);
+ return TestResult.String(home.getDescription());
+ }
+ 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/weblayout/WL_HomeTooltip.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_HomeTooltip.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_HomeTooltip.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,33 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_HomeTooltip extends WebLayoutOperationExecutor
+{
+ public WL_HomeTooltip(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_HomeTooltip", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tbar = tp.getTaskBar();
+ MgWebWidgetCollection tbuttons = tbar.getTaskButtons();
+ MgWebTaskBarWidget home = (MgWebTaskBarWidget)tbuttons.getWidget(MgWebTaskButtonType.Home);
+ return TestResult.String(home.getTooltip());
+ }
+ 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/weblayout/WL_ShowContextMenu.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowContextMenu.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowContextMenu.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,30 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_ShowContextMenu extends WebLayoutOperationExecutor
+{
+ public WL_ShowContextMenu(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_ShowContextMenu", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebContextMenu ctx = _wl.getContextMenu();
+ return TestResult.Boolean(ctx.isVisible());
+ }
+ 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/weblayout/WL_ShowLegend.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowLegend.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowLegend.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,30 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_ShowLegend extends WebLayoutOperationExecutor
+{
+ public WL_ShowLegend(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_ShowLegend", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebInformationPane ip = _wl.getInformationPane();
+ return TestResult.Boolean(ip.isLegendBandVisible());
+ }
+ 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/weblayout/WL_ShowProperties.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowProperties.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowProperties.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,30 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_ShowProperties extends WebLayoutOperationExecutor
+{
+ public WL_ShowProperties(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_ShowProperties", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebInformationPane ip = _wl.getInformationPane();
+ return TestResult.Boolean(ip.isPropertiesBandVisible());
+ }
+ 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/weblayout/WL_ShowStatusbar.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowStatusbar.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowStatusbar.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,30 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_ShowStatusbar extends WebLayoutOperationExecutor
+{
+ public WL_ShowStatusbar(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_ShowStatusbar", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebUiPane sb = _wl.getStatusBar();
+ return TestResult.Boolean(sb.isVisible());
+ }
+ 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/weblayout/WL_ShowTaskbar.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowTaskbar.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowTaskbar.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,31 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_ShowTaskbar extends WebLayoutOperationExecutor
+{
+ public WL_ShowTaskbar(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_ShowTaskbar", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tb = tp.getTaskBar();
+ return TestResult.Boolean(tb.isVisible());
+ }
+ 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/weblayout/WL_ShowTaskpane.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowTaskpane.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowTaskpane.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,30 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_ShowTaskpane extends WebLayoutOperationExecutor
+{
+ public WL_ShowTaskpane(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_ShowTaskpane", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ return TestResult.Boolean(tp.isVisible());
+ }
+ 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/weblayout/WL_ShowToolbar.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowToolbar.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_ShowToolbar.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,30 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_ShowToolbar extends WebLayoutOperationExecutor
+{
+ public WL_ShowToolbar(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_ShowToolbar", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebToolBar tb = _wl.getToolBar();
+ return TestResult.Boolean(tb.isVisible());
+ }
+ 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/weblayout/WL_TasksDescription.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TasksDescription.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TasksDescription.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,33 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_TasksDescription extends WebLayoutOperationExecutor
+{
+ public WL_TasksDescription(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_TasksDescription", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tbar = tp.getTaskBar();
+ MgWebWidgetCollection tbuttons = tbar.getTaskButtons();
+ MgWebTaskBarWidget tasks = (MgWebTaskBarWidget)tbuttons.getWidget(MgWebTaskButtonType.Tasks);
+ return TestResult.String(tasks.getDescription());
+ }
+ 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/weblayout/WL_TasksName.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TasksName.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TasksName.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,33 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_TasksName extends WebLayoutOperationExecutor
+{
+ public WL_TasksName(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_TasksName", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tbar = tp.getTaskBar();
+ MgWebWidgetCollection tbuttons = tbar.getTaskButtons();
+ MgWebTaskBarWidget tasks = (MgWebTaskBarWidget)tbuttons.getWidget(MgWebTaskButtonType.Tasks);
+ return TestResult.String(tasks.getName());
+ }
+ 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/weblayout/WL_TasksTooltip.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TasksTooltip.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TasksTooltip.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,33 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_TasksTooltip extends WebLayoutOperationExecutor
+{
+ public WL_TasksTooltip(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_TasksTooltip", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tbar = tp.getTaskBar();
+ MgWebWidgetCollection tbuttons = tbar.getTaskButtons();
+ MgWebTaskBarWidget tasks = (MgWebTaskBarWidget)tbuttons.getWidget(MgWebTaskButtonType.Tasks);
+ return TestResult.String(tasks.getTooltip());
+ }
+ 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/weblayout/WL_TestUiItem.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TestUiItem.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WL_TestUiItem.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,55 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import java.util.*;
+import com.almworks.sqlite4java.*;
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+public class WL_TestUiItem extends WebLayoutOperationExecutor
+{
+ public WL_TestUiItem(IWebLayoutCreator layout, String unitTestVm)
+ {
+ super("WL_TestUiItem", layout, unitTestVm);
+ }
+
+ public TestResult Execute(int paramSetId)
+ {
+ try
+ {
+ CreateWebLayoutFromResource(paramSetId);
+
+ MgWebWidgetCollection coll = null;
+ HashMap<String, String> param = new HashMap<String, String>();
+ ReadParameterValue(paramSetId, "CONTAINER", param);
+ ReadParameterValue(paramSetId, "INDEX", param);
+
+ switch (param.get("CONTAINER"))
+ {
+ case "toolbar":
+ MgWebToolBar tb = _wl.getToolBar();
+ coll = tb.getWidgets();
+ break;
+ case "tasklist":
+ MgWebTaskPane tp = _wl.getTaskPane();
+ MgWebTaskBar tbar = tp.getTaskBar();
+ coll = tbar.getTaskList();
+ break;
+ case "contextmenu":
+ coll = _wl.getContextMenu();
+ break;
+ }
+
+ MgWebWidget widget = coll.getWidget(Integer.parseInt(param.get("INDEX")));
+ if (widget == null)
+ return TestResult.String("Null widget");
+ else
+ return TestResult.String(FormatProperties(widget));
+ }
+ 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/weblayout/WebLayoutOperationExecutor.java
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WebLayoutOperationExecutor.java (rev 0)
+++ trunk/MgDev/UnitTest/WebTier/Java/src/org/osgeo/mapguide/test/mapguide/operations/weblayout/WebLayoutOperationExecutor.java 2014-10-06 11:33:24 UTC (rev 8386)
@@ -0,0 +1,91 @@
+package org.osgeo.mapguide.test.mapguide.operations.weblayout;
+
+import org.osgeo.mapguide.*;
+import org.osgeo.mapguide.test.*;
+import org.osgeo.mapguide.test.common.*;
+import org.osgeo.mapguide.test.operations.*;
+
+import com.almworks.sqlite4java.*;
+
+public abstract class WebLayoutOperationExecutor extends PlatformApiTestExecutor
+{
+ protected MgWebLayout _wl;
+ protected IWebLayoutCreator _creator;
+
+ protected WebLayoutOperationExecutor(String name, IWebLayoutCreator wl, String unitTestVm)
+ {
+ super(name, ApiTypes.Platform, unitTestVm);
+ _creator = wl;
+ }
+
+ protected void CreateWebLayoutFromResource(int paramSetId)
+ {
+ if (_wl != null)
+ return;
+
+ try {
+ SQLiteStatement stmt = _conn.prepare(String.format("Select ParamValue from Params WHERE ParamSet=%d AND ParamName=\"WEBLAYOUT\"", paramSetId));
+ String wlId = null;
+ if (stmt.step()) {
+ wlId = CommonUtility.GetStringFromStatement(stmt, "ParamValue");
+ if (CommonUtility.IsNullOrEmpty(wlId))
+ {
+ wlId = "Library://UnitTest/layouts/Test.WebLayout";
+ }
+ } else {
+ wlId = "Library://UnitTest/layouts/Test.WebLayout";
+ }
+ MgResourceIdentifier resId = new MgResourceIdentifier(wlId);
+ _wl = _creator.CreateWebLayout(resId);
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+
+ protected String FormatProperties(MgWebWidget it)
+ {
+ String name = "";
+ switch (it.getType())
+ {
+ case MgWebWidgetType.Separator:
+ name = "";
+ break;
+ case MgWebWidgetType.Command:
+ MgWebCommand cmd = ((MgWebCommandWidget)it).getCommand();
+ name = cmd.getLabel();
+ break;
+ case MgWebWidgetType.Flyout:
+ name = ((MgWebFlyoutWidget)it).getLabel();
+ break;
+ }
+
+ String str = "[" + name + "/" + it.getType();
+ if (it.getType() == MgWebWidgetType.Separator)
+ {
+ return str + "]";
+ }
+ else if (it.getType() == MgWebWidgetType.Command)
+ {
+ MgWebCommand cmd = ((MgWebCommandWidget)it).getCommand();
+ return str + "/" + cmd.getName() + "]";
+ }
+ else if (it.getType() == MgWebWidgetType.Flyout)
+ {
+ MgWebFlyoutWidget fly = ((MgWebFlyoutWidget)it);
+ str = str + "/" + fly.getIconUrl();
+ MgWebWidgetCollection coll = fly.getSubItems();
+ for (int i = 0; i < coll.getCount(); i++)
+ {
+ MgWebWidget widget = coll.getWidget(i);
+ str = str + "/" + FormatProperties(widget);
+ }
+ str = str + "]";
+ }
+ else
+ {
+ return "[** error **]";
+ }
+
+ return str;
+ }
+}
\ No newline at end of file
More information about the mapguide-commits
mailing list