Author: psrna
Date: 2010-12-16 04:41:19 -0500 (Thu, 16 Dec 2010)
New Revision: 27543
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:
* publishing/unpublishing tests fixed
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 2010-12-16
08:50:57 UTC (rev 27542)
+++
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Properties.java 2010-12-16
09:41:19 UTC (rev 27543)
@@ -14,7 +14,7 @@
public static final String URL =
"http://localhost:8080/modeshape-rest";
public static final String WEBDAV_URL =
"http://localhost:8080/modeshape-webdav";
- public static final String REPOSITORY = "repository";
+ public static final String REPOSITORY = "eds";
public static final String WORKSPACE = "default";
public static final String USER = "admin";
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 2010-12-16
08:50:57 UTC (rev 27542)
+++
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Publishing.java 2010-12-16
09:41:19 UTC (rev 27543)
@@ -15,6 +15,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
@@ -28,12 +29,13 @@
import org.junit.BeforeClass;
import org.junit.Test;
+
/**
*
* @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." +
@@ -53,6 +55,8 @@
open.finish(wiz);
assertTrue(projectExplorer.isFilePresent(Properties.PROJECT_NAME,
Properties.FILE_NAME));
+ bot.editorByTitle(Properties.FILE_NAME).close();
+
String projectLocation = SWTUtilExt.getPathToProject(Properties.PROJECT_NAME);
try {
FileWriter fstream = new FileWriter(projectLocation + "/" +
Properties.FILE_NAME);
@@ -64,6 +68,15 @@
log.error(e.getMessage());
}
+ bot.viewByTitle("Project Explorer").show();
+ bot.viewByTitle("Project Explorer").setFocus();
+ SWTBot viewBot = bot.viewByTitle("Project Explorer").bot();
+
+ SWTBotTreeItem node = SWTEclipseExt.selectTreeLocation(viewBot,
Properties.PROJECT_NAME);
+
+ ContextMenuHelper.prepareTreeItemForContextMenu(viewBot.tree(), node);
+ ContextMenuHelper.clickContextMenu(viewBot.tree(), "Refresh");
+
}
@BeforeClass
@@ -108,8 +121,8 @@
private void openModeshapeView(){
bot.menu(IDELabel.Menu.WINDOW)
- .menu(IDELabel.Menu.SHOW_VIEW)
- .menu(IDELabel.Menu.OTHER).click();
+ .menu(IDELabel.Menu.SHOW_VIEW)
+ .menu(IDELabel.Menu.OTHER).click();
SWTBotShell shell = bot.shell("Show View");
shell.activate();
@@ -135,6 +148,7 @@
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
assertTrue("Repository mismatch.",
repoCombo.getText().equals(Properties.REPOSITORY));
@@ -165,10 +179,10 @@
assertTrue("Repository mismatch.", table.cell(0,
2).equals(Properties.REPOSITORY));
assertTrue("Workspace mismatch.", table.cell(0,
3).equals(Properties.WORKSPACE));
- String expectedPublishedUrl = Properties.URL + "/" +
- Properties.REPOSITORY + "/" +
- Properties.WORKSPACE + "/items/" +
- Properties.PROJECT_NAME + "/" +
+ String expectedPublishedUrl = Properties.URL + "/" +
+ Properties.REPOSITORY + "/" +
+ Properties.WORKSPACE + "/items/files/" +
+ Properties.PROJECT_NAME + "/" +
Properties.FILE_NAME;
assertTrue("Published Url mismatch.", table.cell(0,
4).equals(expectedPublishedUrl));
@@ -195,6 +209,7 @@
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
assertTrue("Repository mismatch.",
repoCombo.getText().equals(Properties.REPOSITORY));
@@ -228,11 +243,12 @@
try {
- URL url = new URL(Properties.WEBDAV_URL + "/" +
- Properties.REPOSITORY + "/" +
- Properties.WORKSPACE + "/" +
- Properties.PROJECT_NAME + "/" +
+ URL url = new URL(Properties.WEBDAV_URL + "/" +
+ Properties.REPOSITORY + "/" +
+ Properties.WORKSPACE + "/files/" +
+ Properties.PROJECT_NAME + "/" +
Properties.FILE_NAME);
+
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
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 2010-12-16
08:50:57 UTC (rev 27542)
+++
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/TeiidFilesPublishing.java 2010-12-16
09:41:19 UTC (rev 27543)
@@ -34,7 +34,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." +
@@ -96,8 +96,8 @@
private void openModeshapeView(){
bot.menu(IDELabel.Menu.WINDOW)
- .menu(IDELabel.Menu.SHOW_VIEW)
- .menu(IDELabel.Menu.OTHER).click();
+ .menu(IDELabel.Menu.SHOW_VIEW)
+ .menu(IDELabel.Menu.OTHER).click();
SWTBotShell shell = bot.shell("Show View");
shell.activate();
@@ -124,6 +124,7 @@
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
assertTrue("Repository mismatch.",
repoCombo.getText().equals(Properties.REPOSITORY));
@@ -155,6 +156,7 @@
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
assertTrue("Repository mismatch.",
repoCombo.getText().equals(Properties.REPOSITORY));
@@ -178,10 +180,10 @@
try {
- URL url = new URL(Properties.WEBDAV_URL + "/" +
- Properties.REPOSITORY + "/" +
- Properties.WORKSPACE + "/" +
- Properties.TEIID_PROJECT_NAME + "/" + filename);
+ URL url = new URL(Properties.WEBDAV_URL + "/" +
+ Properties.REPOSITORY + "/" +
+ Properties.WORKSPACE + "/files/" +
+ Properties.TEIID_PROJECT_NAME + "/" + filename);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");