Author: psrna
Date: 2011-03-01 09:29:35 -0500 (Tue, 01 Mar 2011)
New Revision: 29408
Added:
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/modeshape.ui.bot.test.properties
Modified:
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Properties.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Publishing.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/TeiidFilesPublishing.java
Log:
Added:
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/modeshape.ui.bot.test.properties
===================================================================
---
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/modeshape.ui.bot.test.properties
(rev 0)
+++
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/modeshape.ui.bot.test.properties 2011-03-01
14:29:35 UTC (rev 29408)
@@ -0,0 +1,12 @@
+# SWTBotTest properties
+# all properties are optional, all defined paths should exist
+# <java version>,<jre/jdk home>
+JAVA=1.6,/usr/lib/jvm/java-6-sun/jre
+#EAP|JBOSS_AS|EPP|SOA,<server version>,<jre version to run
with>|default,<server home>
+# note : when server is type of SOA, version is version of SOA (not the bundled EAP)
+#SERVER=JBOSS_AS,5.0,1.6,/home/psrna/data/jboss/jboss/jboss-as
+SERVER=SOA,5.1,1.6,/home/psrna/data/jboss/soa-5.1.0.CR1-eds/jboss-as
+#<seam version>,<seam runtime home>
+#SEAM=2.2,/home/psrna/data/jboss/jboss-eap-5.0/seam
+#<esb versoin>,<esb runtime home>
+#ESB=4.7,/home/psrna/data/jboss/jbossesb-4.7
Property changes on:
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/modeshape.ui.bot.test.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Properties.java
===================================================================
---
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Properties.java 2011-03-01
14:01:31 UTC (rev 29407)
+++
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Properties.java 2011-03-01
14:29:35 UTC (rev 29408)
@@ -26,8 +26,11 @@
public static final String TEIID_PROJECT_DESC = ".project";
- public static final String ORACLE_SQL =
"data/CreateDB_PartsSupplier_Oracle.sql";
- public static final String SQLSERVER_SQL =
"data/CreateDB_PartsSupplier_SQLServer.sql";
+ public static final String DATA_1 = "data/parts_table.data";
+ public static final String DATA_2 = "data/ship_via_table.data";
+ public static final String DATA_3 = "data/status_table.data";
+ public static final String DATA_4 =
"data/supplier_parts_table.data";
+ public static final String DATA_5 = "data/supplier_table.data";
public static final String PARTS_SOURCE_A = "PartsSourceA.xmi";
public static final String PARTS_SOURCE_B = "PartsSourceB.xmi";
Modified:
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Publishing.java
===================================================================
---
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Publishing.java 2011-03-01
14:01:31 UTC (rev 29407)
+++
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Publishing.java 2011-03-01
14:29:35 UTC (rev 29408)
@@ -35,7 +35,7 @@
* @author psrna
*
*/
-//@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,version="5.1"),perspective="Java
EE")
+@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,version="5.1"),perspective="Java
EE")
public class Publishing extends SWTTestExt{
private static final String CONNERR_MSG = "Unable to connect using the specified
server properties." +
@@ -139,15 +139,15 @@
SWTBot viewBot = view.bot();
SWTBotTreeItem node = eclipse.selectTreeLocation(viewBot, Properties.PROJECT_NAME,
Properties.FILE_NAME);
- ContextMenuHelper.prepareTreeItemForContextMenu(projectExplorer.tree(),node);
- ContextMenuHelper.clickContextMenu(projectExplorer.tree(), "ModeShape",
"Publish");
+ ContextMenuHelper.prepareTreeItemForContextMenu(projectExplorer.bot().tree(),node);
+ ContextMenuHelper.clickContextMenu(projectExplorer.bot().tree(), "ModeShape",
"Publish");
- SWTBotShell shell = bot.shell("Publish");
+ SWTBotShell shell = bot.shell("Publish to ModeShape");
shell.activate();
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
- SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
- SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("JCR Repository:");
+ SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("JCR
Workspace:");
workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
@@ -167,8 +167,8 @@
SWTBot viewBot = view.bot();
SWTBotTreeItem node = eclipse.selectTreeLocation(viewBot, Properties.PROJECT_NAME,
Properties.FILE_NAME);
- ContextMenuHelper.prepareTreeItemForContextMenu(projectExplorer.tree(),node);
- ContextMenuHelper.clickContextMenu(projectExplorer.tree(), "ModeShape",
"Show Published Locations");
+ ContextMenuHelper.prepareTreeItemForContextMenu(projectExplorer.bot().tree(),node);
+ ContextMenuHelper.clickContextMenu(projectExplorer.bot().tree(), "ModeShape",
"Show Published Locations");
SWTBotShell shell = bot.shell("Published Locations");
shell.activate();
@@ -200,15 +200,15 @@
SWTBot viewBot = view.bot();
SWTBotTreeItem node = eclipse.selectTreeLocation(viewBot, Properties.PROJECT_NAME,
Properties.FILE_NAME);
- ContextMenuHelper.prepareTreeItemForContextMenu(projectExplorer.tree(),node);
- ContextMenuHelper.clickContextMenu(projectExplorer.tree(), "ModeShape",
"Unpublish");
+ ContextMenuHelper.prepareTreeItemForContextMenu(projectExplorer.bot().tree(),node);
+ ContextMenuHelper.clickContextMenu(projectExplorer.bot().tree(), "ModeShape",
"Unpublish");
- SWTBotShell shell = bot.shell("Unpublish");
+ SWTBotShell shell = bot.shell("Unpublish from ModeShape");
shell.activate();
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
- SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
- SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("JCR Repository:");
+ SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("JCR
Workspace:");
workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
Modified:
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/TeiidFilesPublishing.java
===================================================================
---
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/TeiidFilesPublishing.java 2011-03-01
14:01:31 UTC (rev 29407)
+++
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/TeiidFilesPublishing.java 2011-03-01
14:29:35 UTC (rev 29408)
@@ -1,5 +1,8 @@
package org.jboss.tools.modeshape.rest.ui.bot.tests;
+import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellCloses;
+import static org.eclipse.swtbot.swt.finder.waits.Conditions.waitForShell;
+
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -15,6 +18,7 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -34,7 +38,7 @@
* @author psrna
*
*/
-//@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,version="5.1"),
perspective="Teiid Designer")
+@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,version="5.1"),
perspective="Teiid Designer")
public class TeiidFilesPublishing extends SWTTestExt{
private static final String CONNERR_MSG = "Unable to connect using the specified
server properties." +
@@ -52,6 +56,8 @@
open.finish(shell.bot(), IDELabel.Button.FINISH);
+ bot.waitUntil(Conditions.shellIsActive("Downloading..."));
+ bot.waitUntil(Conditions.shellCloses(bot.shell("Downloading...")));
}
@BeforeClass
@@ -115,15 +121,15 @@
SWTBot viewBot = view.bot();
SWTBotTreeItem node = eclipse.selectTreeLocation(viewBot,
Properties.TEIID_PROJECT_NAME);
- ContextMenuHelper.prepareTreeItemForContextMenu(projectExplorer.tree(),node);
- ContextMenuHelper.clickContextMenu(projectExplorer.tree(), "ModeShape",
"Publish");
+ ContextMenuHelper.prepareTreeItemForContextMenu(projectExplorer.bot().tree(),node);
+ ContextMenuHelper.clickContextMenu(projectExplorer.bot().tree(), "ModeShape",
"Publish");
- SWTBotShell shell = bot.shell("Publish");
+ SWTBotShell shell = bot.shell("Publish to ModeShape");
shell.activate();
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
- SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
- SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("JCR Repository:");
+ SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("JCR
Workspace:");
workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
@@ -131,13 +137,18 @@
assertTrue("Workspace mismatch.",
workspaceCombo.getText().equals(Properties.WORKSPACE));
open.finish(shell.bot());
+ bot.waitUntil(Conditions.shellCloses(shell));
assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.TEIID_PROJECT_DESC));
assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.PARTS_SOURCE_A));
assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.PARTS_SOURCE_B));
assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.PARTS_VIRTUAL));
- assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.ORACLE_SQL));
- assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.SQLSERVER_SQL));
+ assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.DATA_1));
+ assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.DATA_2));
+ assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.DATA_3));
+ assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.DATA_4));
+ assertTrue("HTTP Response code must be 200 after publishing.",
HttpURLConnection.HTTP_OK == testPublishedFile(Properties.DATA_5));
+
}
@Test
@@ -147,15 +158,15 @@
SWTBot viewBot = view.bot();
SWTBotTreeItem node = eclipse.selectTreeLocation(viewBot,
Properties.TEIID_PROJECT_NAME);
- ContextMenuHelper.prepareTreeItemForContextMenu(projectExplorer.tree(),node);
- ContextMenuHelper.clickContextMenu(projectExplorer.tree(), "ModeShape",
"Unpublish");
+ ContextMenuHelper.prepareTreeItemForContextMenu(projectExplorer.bot().tree(),node);
+ ContextMenuHelper.clickContextMenu(projectExplorer.bot().tree(), "ModeShape",
"Unpublish");
- SWTBotShell shell = bot.shell("Unpublish");
+ SWTBotShell shell = bot.shell("Unpublish from ModeShape");
shell.activate();
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
- SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
- SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("JCR Repository:");
+ SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("JCR
Workspace:");
workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
@@ -163,13 +174,18 @@
assertTrue("Workspace mismatch.",
workspaceCombo.getText().equals(Properties.WORKSPACE));
open.finish(shell.bot());
+ bot.waitUntil(Conditions.shellCloses(shell));
assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.TEIID_PROJECT_DESC));
assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.PARTS_SOURCE_A));
assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.PARTS_SOURCE_B));
assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.PARTS_VIRTUAL));
- assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.ORACLE_SQL));
- assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.SQLSERVER_SQL));
+ assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.DATA_1));
+ assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.DATA_2));
+ assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.DATA_3));
+ assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.DATA_4));
+ assertTrue("HTTP Response code must be 404 after unpublishing.",
HttpURLConnection.HTTP_NOT_FOUND == testPublishedFile(Properties.DATA_5));
+
}
/**