JBoss Tools SVN: r43028 - in branches/jbosstools-3.3.x/openshift: tests/org.jboss.tools.openshift.ui.bot.test/META-INF and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: sbunciak
Date: 2012-08-14 11:27:13 -0400 (Tue, 14 Aug 2012)
New Revision: 43028
Added:
branches/jbosstools-3.3.x/openshift/.project
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/Connection.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteApp.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/EmbedCartrides.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/RenameDomain.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/wizard/
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/wizard/RepublishApp.java
Removed:
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/CreateAppAS7.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/CreateDomain.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/DeleteAppAS7.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/DestroyDomain.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/EmbeddCartrides.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/RenameDomain.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/RepublishAppASS7.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/SSHKeyManagement.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/DomainDestroyer.java
Modified:
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/resources/openshift.ui.bot.test.properties
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftAllBotTests.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftUI.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/TestProperties.java
Log:
Refactored OpenShift SWTBot tests.
Added: branches/jbosstools-3.3.x/openshift/.project
===================================================================
--- branches/jbosstools-3.3.x/openshift/.project (rev 0)
+++ branches/jbosstools-3.3.x/openshift/.project 2012-08-14 15:27:13 UTC (rev 43028)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>openshift</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: OpenShift SWTBot Tests
-Bundle-SymbolicName: org.jboss.tools.openshift.ui.bot.test
-Bundle-Version: 2.3.0.qualifier
-Bundle-Activator: org.jboss.tools.openshift.ui.bot.test.Activator
-Bundle-Vendor: Red Hat
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.apache.log4j;bundle-version="1.2.15",
- org.jboss.tools.ui.bot.ext,
- org.junit4;bundle-version="4.8.1",
- org.eclipse.swtbot.eclipse.core;bundle-version="2.0.5",
- org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.5",
- org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.5",
- org.eclipse.swtbot.junit4_x;bundle-version="2.0.5",
- org.eclipse.swtbot.swt.finder;bundle-version="2.0.5",
- org.eclipse.core.resources;bundle-version="3.7.100",
- org.eclipse.ui.forms;bundle-version="3.5.100",
- org.eclipse.ui.ide;bundle-version="3.7.0",
- org.apache.commons.httpclient;bundle-version="3.1.0",
- org.apache.commons.logging;bundle-version="1.0.4",
- org.apache.commons.codec;bundle-version="1.3.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ActivationPolicy: lazy
Copied: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF (from rev 43025, trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF)
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF (rev 0)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF 2012-08-14 15:27:13 UTC (rev 43028)
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OpenShift SWTBot Tests
+Bundle-SymbolicName: org.jboss.tools.openshift.ui.bot.test
+Bundle-Version: 2.3.0.qualifier
+Bundle-Activator: org.jboss.tools.openshift.ui.bot.test.Activator
+Bundle-Vendor: Red Hat
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.apache.log4j;bundle-version="1.2.15",
+ org.jboss.tools.ui.bot.ext,
+ org.junit4;bundle-version="4.8.1",
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.5",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.5",
+ org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.5",
+ org.eclipse.swtbot.junit4_x;bundle-version="2.0.5",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.5",
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ org.eclipse.ui.forms;bundle-version="3.5.100",
+ org.eclipse.ui.ide;bundle-version="3.7.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/resources/openshift.ui.bot.test.properties
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/resources/openshift.ui.bot.test.properties 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/resources/openshift.ui.bot.test.properties 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,8 +1,7 @@
-openshift.user.name=sbunciak
+openshift.user.name=sbunciak+jbt(a)redhat.com
openshift.user.pwd=rhtest123
openshift.jbossapp.name=jbossapp
openshift.jbossapp.cartridges=mysql;cron
openshift.user.wrongpwd=rhtest
openshift.domain=rhtestdomain
openshift.domain.new=rhtest
-openshift.ssh.passphrase=dXZlZ2VsNFJPVj8\=
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/CreateAppAS7.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/CreateAppAS7.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/CreateAppAS7.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,57 +0,0 @@
-package org.jboss.tools.openshift.ui.bot.test;
-
-import org.eclipse.swtbot.swt.finder.waits.Conditions;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
-import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
-import org.jboss.tools.openshift.ui.bot.util.TestProperties;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.junit.Test;
-
-public class CreateAppAS7 extends SWTTestExt {
-
- @Test
- public void canCreateApplication() {
-
- SWTBotText appNameText = bot.textInGroup("New application", 0);
- bot.waitUntil(Conditions.widgetIsEnabled(appNameText));
-
- assertTrue("App name should be empty!", appNameText.getText()
- .equals(""));
-
- appNameText.setText(TestProperties
- .getProperty("openshift.jbossapp.name"));
-
- log.info("OpenShift SWTBot Tests: Application name set.");
-
- SWTBotCombo appTypeCombo = bot.comboBoxInGroup("New application");
- bot.waitUntil(Conditions.widgetIsEnabled(appNameText));
- appTypeCombo.setSelection(OpenShiftUI.AppType.JBOSS);
-
- log.info("OpenShift SWTBot Tests: Application type selected.");
-
- bot.button(IDELabel.Button.NEXT).click();
-
- bot.waitUntil(Conditions.widgetIsEnabled(bot
- .button(IDELabel.Button.FINISH)));
- bot.button(IDELabel.Button.FINISH).click();
-
- log.info("OpenShift SWTBot Tests: Application creation started.");
-
- bot.waitForShell("Information", 500);
- bot.text(0).setText(TestProperties.getPassphrase());
- bot.button(IDELabel.Button.OK).click();
-
- log.info("OpenShift SWTBot Tests: SSH passphrase given.");
-
- bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_20S);
-
- log.info("OpenShift SWTBot Tests: 'New Application wizard' was closed.");
-
- assertNotNull("OpenShift Server runtime is not in the Servers View!",
- servers.findServerByName(servers.show().bot().tree(),
- TestProperties.getProperty("openshift.jbossapp.name")));
- }
-
-}
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/CreateDomain.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/CreateDomain.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/CreateDomain.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,63 +0,0 @@
-package org.jboss.tools.openshift.ui.bot.test;
-
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.waits.ICondition;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
-import org.jboss.tools.openshift.ui.bot.util.TestProperties;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.junit.Test;
-
-/**
- * Domain creation consists of creating the SSH key pair, storing user password
- * in the secure storage and creating the domain itself.
- *
- * @author sbunciak
- *
- */
-public class CreateDomain extends SWTTestExt {
-
- @Test
- public void canCreateDomain() throws InterruptedException {
-
- SWTBotText domainText = bot.text(0);
-
- assertTrue("Domain should not be set at this stage!", domainText
- .getText().equals(""));
-
- domainText.setText(TestProperties.getProperty("openshift.domain"));
- bot.button(IDELabel.Button.FINISH).click();
-
- log.info("OpenShift SWTBot Tests: Domain name set.");
-
- // wait while the domain is being created
- bot.waitWhile(new ICondition() {
- @Override
- public boolean test() {
- return bot.shell(IDELabel.Shell.SECURE_STORAGE).isVisible();
- }
-
- @Override
- public void init(SWTBot bot) {
- // keep empty
- }
-
- @Override
- public String getFailureMessage() {
- return "Domain creation wizard still visible in user account after reasonable timeout.";
- }
-
- }, TIME_20S, TIME_1S);
-
- log.info("OpenShift SWTBot Tests: Domain created.");
- log.info("OpenShift SWTBot Tests: Waiting for 'New Application wizard'.");
-
- bot.waitForShell("New OpenShift Application", 100);
-
- log.info("OpenShift SWTBot Tests: 'New Application wizard' created.");
-
- bot.waitUntil(new NonSystemJobRunsCondition());
- }
-
-}
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/DeleteAppAS7.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/DeleteAppAS7.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/DeleteAppAS7.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,78 +0,0 @@
-package org.jboss.tools.openshift.ui.bot.test;
-
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.waits.ICondition;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
-import org.jboss.tools.openshift.ui.bot.util.TestProperties;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.junit.Test;
-
-public class DeleteAppAS7 extends SWTTestExt {
-
- SWTBotTreeItem account;
-
- @Test
- public void canDeleteApplication() {
- projectExplorer.show();
- projectExplorer.bot().tree(0).contextMenu("Delete").click();
-
- bot.waitForShell("Delete Resources");
- bot.checkBox().select();
- bot.button(IDELabel.Button.OK).click();
-
- assertFalse("The project still exists!",
- projectExplorer.existsResource(TestProperties
- .getProperty("openshift.jbossapp.name")));
-
- SWTBotView openshiftConsole = open.viewOpen(OpenShiftUI.Console.iView);
-
- SWTBot consoleBot = openshiftConsole.bot();
-
- account = consoleBot.tree()
- .expandNode(TestProperties.getProperty("openshift.user.name"))
- .doubleClick();
-
- account.getNode(0).contextMenu("Delete Application").click();
-
- bot.waitForShell("Application deletion");
-
- bot.button(IDELabel.Button.OK).click();
- bot.waitWhile(new ICondition() {
- @Override
- public boolean test() throws Exception {
- return account.getItems().length > 0;
- }
-
- @Override
- public void init(SWTBot bot) {
- // keep empty
- }
-
- @Override
- public String getFailureMessage() {
- return "Application is still present in user account after reasonable timeout.";
- }
-
- }, TIME_60S, TIME_1S);
-
-
- /*
- * TODO
- *
- * // delete jenkins if present if (account.getNode("jenkins") != null)
- * { account.getNode("jenkins").contextMenu("Delete Application");
- *
- * bot.waitForShell("Application deletion");
- * bot.button(IDELabel.Button.OK).click();
- *
- * bot.waitUntil(new NonSystemJobRunsCondition()); }
- */
- assertTrue("Application still present in the OpenShift Console view!",
- account.getItems().length == 0);
-
- }
-
-}
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/DestroyDomain.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/DestroyDomain.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/DestroyDomain.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,27 +0,0 @@
-package org.jboss.tools.openshift.ui.bot.test;
-
-import org.jboss.tools.openshift.ui.bot.util.DomainDestroyer;
-import org.jboss.tools.openshift.ui.bot.util.TestProperties;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.junit.Test;
-
-public class DestroyDomain extends SWTTestExt {
-
- /*
- * Since there is no way how to destroy a domain from JBoss Tools, we need
- * to use OpenShift REST API to clean the account
- */
- @Test
- public void canDestroyDomain() {
-
- // destroy domain
- int resp_code = DomainDestroyer.destroyDomain(
- TestProperties.getProperty("openshift.domain.new"),
- TestProperties.getProperty("openshift.user.name"),
- TestProperties.getProperty("openshift.user.pwd"));
-
- assertTrue("Trying to destroy domain: HTTP Response code is not 200.",
- resp_code == 200);
-
- }
-}
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/EmbeddCartrides.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/EmbeddCartrides.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/EmbeddCartrides.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,83 +0,0 @@
-package org.jboss.tools.openshift.ui.bot.test;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
-import org.jboss.tools.openshift.ui.bot.util.TestProperties;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.junit.Test;
-
-public class EmbeddCartrides extends SWTTestExt {
-
- @Test
- public void canEmbeddCartriges() {
-
- SWTBotView openshiftConsole = open.viewOpen(OpenShiftUI.Console.iView);
-
- SWTBotTreeItem account = openshiftConsole.bot().tree()
- .expandNode(TestProperties.getProperty("openshift.user.name"))
- .doubleClick();
-
- account.getNode(0).contextMenu("Edit Embeddable Cartridges").click();
-
- StringTokenizer tokenizer = new StringTokenizer(
- TestProperties.getProperty("openshift.jbossapp.cartridges"),
- ";");
-
- bot.waitForShell("");
-
- SWTBotTable cartridgeTable = bot.tableInGroup("Embeddable Cartridges");
-
- selectCartridges(tokenizer, cartridgeTable);
-
- bot.button(IDELabel.Button.FINISH).click();
-
- bot.waitForShell("Embedded Cartridges");
- bot.button(IDELabel.Button.OK).click();
- }
-
- private void selectCartridges(StringTokenizer tokenizer,
- SWTBotTable cartridgeTable) {
-
- while (tokenizer.hasMoreTokens()) {
-
- String cartridge = tokenizer.nextToken();
- System.out.println(cartridge);
- if (cartridge.equals("jenkins")) {
- cartridgeTable.getTableItem(OpenShiftUI.Cartridge.JENKINS).toggleCheck();
- bot.waitForShell("New Jenkins application");
- bot.text(0).setText("jenkins");
- bot.button(IDELabel.Button.OK).click();
- //bot.waitUntil(condition, timeout)
- bot.waitUntil(new NonSystemJobRunsCondition(), 200);
- }
- if (cartridge.equals("mysql")) {
- cartridgeTable.getTableItem(OpenShiftUI.Cartridge.MYSQL).toggleCheck();
- }
- if (cartridge.equals("phpmyadmin")) {
- cartridgeTable.getTableItem(OpenShiftUI.Cartridge.PHPMYADMIN).toggleCheck();
- }
- if (cartridge.equals("cron")) {
- cartridgeTable.getTableItem(OpenShiftUI.Cartridge.CRON).toggleCheck();
- }
- if (cartridge.equals("postgresql")) {
- cartridgeTable.getTableItem(OpenShiftUI.Cartridge.POSTGRESQL).toggleCheck();
- }
- if (cartridge.equals("mongodb")) {
- cartridgeTable.getTableItem(OpenShiftUI.Cartridge.MONGODB).toggleCheck();
- }
- if (cartridge.equals("rockmongo")) {
- cartridgeTable.getTableItem(OpenShiftUI.Cartridge.ROCKMONGO).toggleCheck();
- }
- if (cartridge.equals("metrics")) {
- cartridgeTable.getTableItem(OpenShiftUI.Cartridge.METRICS).toggleCheck();
- }
- }
- }
-
-}
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftAllBotTests.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftAllBotTests.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftAllBotTests.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -10,6 +10,14 @@
******************************************************************************/
package org.jboss.tools.openshift.ui.bot.test;
+import org.jboss.tools.openshift.ui.bot.test.explorer.CreateApp;
+import org.jboss.tools.openshift.ui.bot.test.explorer.CreateDomain;
+import org.jboss.tools.openshift.ui.bot.test.explorer.DeleteApp;
+import org.jboss.tools.openshift.ui.bot.test.explorer.DeleteDomain;
+import org.jboss.tools.openshift.ui.bot.test.explorer.EmbedCartrides;
+import org.jboss.tools.openshift.ui.bot.test.explorer.RenameDomain;
+import org.jboss.tools.openshift.ui.bot.test.explorer.Connection;
+import org.jboss.tools.openshift.ui.bot.test.wizard.RepublishApp;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@@ -19,35 +27,17 @@
* <br>
* This bot test will try to demonstrate a new OpenShift Application and domain life cycle.
*
- * <br>
- * TestSuite covers following test cases :
- * <ul>
- * <li>JBDS50_XXXX User credentials validation</li>
- * <li></li>
- * <li>JBDS50_XXXX Domain is created, renamed correctly</li>
- * <li>JBDS50_XXXX App with JBossAS7 cartridge is created correctly via
- * OpenShift wizards</li>
- * <li>JBDS50_XXXX Embed jenkins etc. into OpenShift applications</li>
- * <li>JBDS50_XXXX App with JBossAS7 cartridge can be deleted</li>
- * <li>JBDS50_XXXX JBoss server adapter is created successfully</li>
- * <li>JBDS50_XXXX App with JBossAS7 cartridge can be modified and republished</li>
- * <li>JBDS50_XXXX SSH keys management</li>
- * </ul>
- *
* @author sbunciak
*/
@SuiteClasses({
-
-ValidateCredentials.class,
-SSHKeyManagement.class,
+Connection.class,
CreateDomain.class,
-CreateAppAS7.class,
-EmbeddCartrides.class,
-RepublishAppASS7.class,
+CreateApp.class,
+EmbedCartrides.class,
+RepublishApp.class,
+DeleteApp.class,
RenameDomain.class,
-DeleteAppAS7.class,
-DestroyDomain.class
-
+DeleteDomain.class
})
@RunWith(RequirementAwareSuite.class)
public class OpenShiftAllBotTests {
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/RenameDomain.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/RenameDomain.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/RenameDomain.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,54 +0,0 @@
-package org.jboss.tools.openshift.ui.bot.test;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-import org.eclipse.swtbot.swt.finder.waits.Conditions;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
-import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
-import org.jboss.tools.openshift.ui.bot.util.TestProperties;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.junit.Test;
-
-public class RenameDomain extends SWTTestExt {
-
- @Test
- public void canRenameDomain() {
-
- SWTBotView openshiftConsole = open.viewOpen(OpenShiftUI.Console.iView);
-
- openshiftConsole.bot().tree()
- .getTreeItem(TestProperties.getProperty("openshift.user.name"))
- .contextMenu("Create or Edit Domain").click();
-
- bot.waitForShell("");
-
- SWTBotText domainText = bot.text(0);
-
- assertTrue(
- "Domain should be set correctly at this stage!",
- domainText.getText().equals(
- TestProperties.getProperty("openshift.domain")));
-
- domainText.setText(TestProperties.getProperty("openshift.domain.new"));
-
- bot.button(IDELabel.Button.FINISH).click();
- bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S);
-
- HttpClient client = new HttpClient();
- GetMethod method = new GetMethod("https://"
- + TestProperties.getProperty("openshift.jbossapp.name") + "-"
- + TestProperties.getProperty("openshift.domain.new")
- + ".rhcloud.com/Test.html");
-
- try {
- assertTrue(client.executeMethod(method) == 200);
- } catch (Exception e) {
- log.error("File has not been published to the server!", e);
- } finally {
- method.releaseConnection();
- }
- }
-
-}
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/RepublishAppASS7.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/RepublishAppASS7.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/RepublishAppASS7.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,59 +0,0 @@
-package org.jboss.tools.openshift.ui.bot.test;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.jboss.tools.openshift.ui.bot.util.TestProperties;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem;
-import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.junit.Test;
-
-public class RepublishAppASS7 extends SWTTestExt {
-
- @Test
- public void canModifyAndRepublishApp() {
- SWTBot wiz = open.newObject(ActionItem.NewObject.WebHTMLPage.LABEL);
- wiz.text(0).setText(
- TestProperties.getProperty("openshift.jbossapp.name")
- + "/src/main/webapp");
- wiz.text(1).setText("Test.html");
-
- wiz.button(IDELabel.Button.FINISH).click();
-
- projectExplorer.show();
- projectExplorer.bot().tree().select(0);
- ContextMenuHelper.clickContextMenu(projectExplorer.bot().tree(),
- "Team", "Commit and Push...");
-
- bot.waitForShell("Commit Changes");
- bot.styledText(0).setText("comment");
-
- bot.table().getTableItem(0).toggleCheck();
- //bot.toolbarButtonWithTooltip("Select All").click();
-
- bot.button("Commit").click();
-
- bot.waitForShell("Push to Another Repository");
- bot.button(IDELabel.Button.FINISH).click();
-
- bot.waitForShell("Push Results: origin", 200);
- bot.button(IDELabel.Button.OK).click();
-
- HttpClient client = new HttpClient();
- GetMethod method = new GetMethod("https://"
- + TestProperties.getProperty("openshift.jbossapp.name") + "-"
- + TestProperties.getProperty("openshift.domain")
- + ".rhcloud.com/Test.html");
-
- try {
- assertTrue(client.executeMethod(method) == 200);
- } catch (Exception e) {
- log.error("File has not been published to the server!", e);
- } finally {
- method.releaseConnection();
- }
- }
-
-}
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/SSHKeyManagement.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/SSHKeyManagement.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/SSHKeyManagement.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,50 +0,0 @@
-package org.jboss.tools.openshift.ui.bot.test;
-
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
-import org.eclipse.swtbot.swt.finder.waits.Conditions;
-import org.hamcrest.Matcher;
-import org.jboss.tools.openshift.ui.bot.util.TestProperties;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.junit.Test;
-
-public class SSHKeyManagement extends SWTTestExt {
-
- @Test
- public void canCreateSSHKey() {
-
- bot.waitForShell("", 100);
-
- @SuppressWarnings("unchecked")
- Matcher<Widget> matcher = WidgetMatcherFactory.allOf(
- WidgetMatcherFactory.widgetOfType(Shell.class),
- WidgetMatcherFactory.withText(""));
-
- bot.waitUntilWidgetAppears(Conditions.waitForWidget(matcher));
-
- log.info("OpenShift SWTBot Tests: SSH Keys creation.");
-
- bot.link(0).click("SSH2 Preferences");
- bot.waitForShell(IDELabel.Shell.PREFERENCES);
-
- log.info("OpenShift SWTBot Tests: SSH Preferences opened.");
-
- //SWTBotText sshDirText = bot.text(1);
- //sshDirText.setText(System.getProperty("user.home") + "/.ssh2");
-
- bot.button(IDELabel.Button.OK).click();
- bot.waitUntilWidgetAppears(Conditions.waitForWidget(matcher));
-
- bot.button(IDELabel.Shell.NEW).click();
- bot.waitForShell("New ssh key");
- bot.text(0).setText(TestProperties.getPassphrase());
- bot.button(IDELabel.Button.OK).click();
-
- log.info("OpenShift SWTBot Tests: SSH Keys created.");
-
- bot.waitUntilWidgetAppears(Conditions.waitForWidget(matcher));
- }
-
-}
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/ValidateCredentials.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,81 +0,0 @@
-package org.jboss.tools.openshift.ui.bot.test;
-
-import java.io.File;
-
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
-import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
-import org.jboss.tools.openshift.ui.bot.util.TestProperties;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.junit.Before;
-import org.junit.Test;
-
-@Require(clearWorkspace = true)
-public class ValidateCredentials extends SWTTestExt {
-
- @Before
- public void prepareSSHPrefs() {
- // clear dir from libra stuff
- File sshDir = new File(System.getProperty("user.home") + "/.ssh");
- if (sshDir.exists() && sshDir.isDirectory()
- && sshDir.listFiles().length > 0) {
- for (File file : sshDir.listFiles()) {
- if (file.getName().contains("libra"))
- file.delete();
- }
- }
-
- }
-
- @Test
- public void canValidateCredentials() throws InterruptedException {
- // create new OpenShift Application
- SWTBot wiz = open.newObject(OpenShiftUI.NewApplication.iNewObject);
-
- storePasswordThenForward();
-
- // set wrong user credentials
- wiz.text(0).setText(TestProperties.getProperty("openshift.user.name"));
- wiz.text(1).setText(
- TestProperties.getProperty("openshift.user.wrongpwd"));
-
- SWTBotButton nextButton = wiz.button(IDELabel.Button.NEXT);
- // try to move forward
- nextButton.click();
-
- // wait for credentials validation
- bot.waitUntil(new NonSystemJobRunsCondition());
-
- assertFalse("Next > button shouldn't be enabled to move forward.",
- nextButton.isEnabled());
-
- // set correct user credentials and save it to secure storage
- wiz.text(0).setText(TestProperties.getProperty("openshift.user.name"));
- wiz.text(1).setText(TestProperties.getProperty("openshift.user.pwd"));
- wiz.checkBox(0).select();
-
- // move forward
- nextButton.click();
-
- storePasswordThenForward();
-
- bot.waitForShell("", 100);
-
- log.info("OpenShift SWTBot Tests: Credentials validated.");
- }
-
- /*
- * give the secure storage password (will use the same as user's ssh
- * passphrase)
- */
- private void storePasswordThenForward() {
- if (bot.waitForShell(IDELabel.Shell.SECURE_STORAGE) != null) {
- bot.text(0).setText(TestProperties.getPassphrase());
- bot.button(IDELabel.Button.OK).click();
- }
- }
-
-}
Added: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/Connection.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/Connection.java (rev 0)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/Connection.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -0,0 +1,57 @@
+package org.jboss.tools.openshift.ui.bot.test.explorer;
+
+import org.eclipse.swtbot.swt.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
+import org.jboss.tools.openshift.ui.bot.util.TestProperties;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+@Require(clearWorkspace = true)
+public class Connection extends SWTTestExt {
+
+ @Test
+ public void canCreateConnectionToOpenShiftAccount() {
+ // open OpenShift Explorer
+ open.viewOpen(OpenShiftUI.Explorer.iView);
+
+ bot.toolbarButtonWithTooltip(OpenShiftUI.Labels.CONNECT_TO_OPENSHIFT)
+ .click();
+
+ // open credentials dialog
+ SWTBotShell shell = bot.waitForShell(OpenShiftUI.Shell.CREDENTIALS);
+
+ // set wrong user credentials
+ bot.text(0).setText(TestProperties.get("openshift.user.name"));
+ bot.text(1).setText(TestProperties.get("openshift.user.wrongpwd"));
+ bot.checkBox(0).deselect();
+
+ SWTBotButton finishButton = bot.button(IDELabel.Button.FINISH);
+ // try to move forward
+ finishButton.click();
+
+ // wait for credentials validation
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_20S);
+
+ assertFalse("Finish button shouldn't be enabled.",
+ finishButton.isEnabled());
+
+ // set correct user credentials and save it to secure storage
+ bot.text(0).setText(TestProperties.get("openshift.user.name"));
+ bot.text(1).setText(TestProperties.get("openshift.user.pwd"));
+
+ // create connection to OpenShift account
+ finishButton.click();
+
+ // wait for credentials validation
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_20S);
+ bot.waitUntil(Conditions.shellCloses(shell));
+
+ log.info("*** OpenShift SWTBot Tests: Credentials validated. ***");
+ log.info("*** OpenShift SWTBot Tests: Connection to OpenShift established. ***");
+ }
+}
Added: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java (rev 0)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -0,0 +1,130 @@
+package org.jboss.tools.openshift.ui.bot.test.explorer;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
+import org.jboss.tools.openshift.ui.bot.util.TestProperties;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Before;
+import org.junit.Test;
+
+public class CreateApp extends SWTTestExt {
+
+ @Before
+ public void cleanUpProject() {
+ File gitDir = new File(System.getProperty("user.home") + "/git");
+
+ if (gitDir.exists() && gitDir.isDirectory()
+ && gitDir.listFiles().length > 0) {
+ for (File file : gitDir.listFiles()) {
+ if (file.getName().contains(
+ TestProperties.get("openshift.jbossapp.name")))
+ try {
+ delete(file);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ @Test
+ public void canCreateImportAppFromExplorer() {
+ SWTBotView openshiftConsole = open.viewOpen(OpenShiftUI.Explorer.iView);
+
+ openshiftConsole.bot().tree()
+ .getTreeItem(TestProperties.get("openshift.user.name"))
+ .contextMenu(OpenShiftUI.Labels.EXPLORER_NEW_APP).click();
+
+ bot.waitForShell(OpenShiftUI.Shell.NEW_APP);
+
+ // fill app info
+ SWTBotText appNameText = bot.textInGroup("New application", 0);
+ bot.waitUntil(Conditions.widgetIsEnabled(appNameText));
+
+ assertTrue("App name should be empty!", appNameText.getText()
+ .equals(""));
+
+ appNameText.setText(TestProperties.get("openshift.jbossapp.name"));
+
+ log.info("*** OpenShift SWTBot Tests: Application name set. ***");
+
+ SWTBotCombo appTypeCombo = bot.comboBoxInGroup("New application");
+ bot.waitUntil(Conditions.widgetIsEnabled(appNameText));
+ appTypeCombo.setSelection(OpenShiftUI.AppType.JBOSS);
+
+ log.info("*** OpenShift SWTBot Tests: Application type selected. ***");
+
+ bot.button(IDELabel.Button.NEXT).click();
+
+ bot.button(IDELabel.Button.NEXT).click();
+
+ bot.waitUntil(Conditions.widgetIsEnabled(bot
+ .button(IDELabel.Button.FINISH)));
+ bot.button(IDELabel.Button.FINISH).click();
+
+ log.info("*** OpenShift SWTBot Tests: Application creation started. ***");
+
+ // only for the 1st time
+ // bot.waitForShell("Question", 500);
+ // bot.button(IDELabel.Button.YES).click();
+
+ bot.waitForShell("Information", 500);
+ bot.text(0).setText(TestProperties.get("openshift.user.pwd"));
+ bot.button(IDELabel.Button.OK).click();
+
+ log.info("*** OpenShift SWTBot Tests: SSH passphrase given. ***");
+
+ bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S);
+
+ log.info("*** OpenShift SWTBot Tests: New Application wizard closed. ***");
+
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S, TIME_1S);
+
+ servers.serverExists(TestProperties.get("openshift.jbossapp.name")
+ + " OpenShift Server");
+
+ log.info("*** OpenShift SWTBot Tests: OpenShift Server Adapter created. ***");
+ }
+
+ private void delete(File file) throws IOException {
+
+ if (file.isDirectory()) {
+ // directory is empty, then delete it
+ if (file.list().length == 0) {
+ file.delete();
+ log.debug("Directory is deleted : "
+ + file.getAbsolutePath());
+ } else {
+ // list all the directory contents
+ String files[] = file.list();
+
+ for (String temp : files) {
+ // construct the file structure
+ File fileDelete = new File(file, temp);
+ // recursive delete
+ delete(fileDelete);
+ }
+
+ // check the directory again, if empty then delete it
+ if (file.list().length == 0) {
+ file.delete();
+ log.debug("Directory is deleted : "
+ + file.getAbsolutePath());
+ }
+ }
+ } else {
+ // if file, then delete it
+ file.delete();
+ log.debug("File is deleted : " + file.getAbsolutePath());
+ }
+ }
+
+}
Added: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java (rev 0)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -0,0 +1,89 @@
+package org.jboss.tools.openshift.ui.bot.test.explorer;
+
+import java.io.File;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
+import org.jboss.tools.openshift.ui.bot.util.TestProperties;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Domain creation consists of creating the SSH key pair, storing user password
+ * in the secure storage and creating the domain itself.
+ *
+ * @author sbunciak
+ *
+ */
+public class CreateDomain extends SWTTestExt {
+
+ private boolean keyAvailable = false;
+
+ @Before
+ public void prepareSSHPrefs() {
+ // clear dir from libra stuff
+
+ File sshDir = new File(System.getProperty("user.home") + "/.ssh");
+
+ if (sshDir.exists() && sshDir.isDirectory()
+ && sshDir.listFiles().length > 0) {
+ for (File file : sshDir.listFiles()) {
+ if (file.getName().contains("id_rsa"))
+ keyAvailable = true;
+ }
+ }
+
+ }
+
+ @Test
+ public void canCreateDomain() throws InterruptedException {
+ // open OpenShift Explorer
+ SWTBotView openshiftExplorer = open
+ .viewOpen(OpenShiftUI.Explorer.iView);
+
+ openshiftExplorer.bot().tree()
+ .getTreeItem(TestProperties.get("openshift.user.name"))
+ .contextMenu(OpenShiftUI.Labels.EXPLORER_CREATE_EDIT_DOMAIN)
+ .click();
+
+ bot.waitForShell(OpenShiftUI.Shell.DOMAIN);
+
+ SWTBotText domainText = bot.text(0);
+
+ assertTrue("Domain should not be set at this stage!", domainText
+ .getText().equals(""));
+
+ domainText.setText(TestProperties.get("openshift.domain"));
+ log.info("*** OpenShift SWTBot Tests: Domain name set. ***");
+
+ if (keyAvailable) {
+
+ assertTrue("SSH key should be set!",bot.text(1).getText().contains("id_rsa"));
+
+ } else {
+ throw new UnsupportedOperationException(
+ "Creation of ssh key not implemented yet.");
+ /*
+ * bot.button(IDELabel.Shell.NEW).click();
+ * bot.waitForShell(OpenShiftUI.Shell.NEW_SSH);
+ * bot.text(0).setText(TestProperties.getPassphrase());
+ * bot.button(IDELabel.Button.OK).click();
+ * bot.waitForShell(OpenShiftUI.Shell.DOMAIN);
+ *
+ * log.info("*** OpenShift SWTBot Tests: SSH Keys created. ***");
+ */
+ }
+
+ bot.button(IDELabel.Button.FINISH).click();
+
+ // wait while the domain is being created
+ bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S);
+
+ log.info("*** OpenShift SWTBot Tests: Domain created. ***");
+ }
+
+}
Added: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteApp.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteApp.java (rev 0)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteApp.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -0,0 +1,47 @@
+package org.jboss.tools.openshift.ui.bot.test.explorer;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
+import org.jboss.tools.openshift.ui.bot.util.TestProperties;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+public class DeleteApp extends SWTTestExt {
+
+ SWTBotTreeItem account;
+
+ @Test
+ public void canDeleteApplication() {
+
+ SWTBotView explorer = open.viewOpen(OpenShiftUI.Explorer.iView);
+
+ account = explorer.bot().tree()
+ .getTreeItem(TestProperties.get("openshift.user.name"))
+ .doubleClick();
+
+ account.getNode(0).contextMenu(OpenShiftUI.Labels.EXPLORER_DELETE_APP)
+ .click();
+
+ bot.waitForShell(OpenShiftUI.Shell.DELETE_APP);
+
+ bot.button(IDELabel.Button.OK).click();
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S + TIME_30S, TIME_1S);
+// TODO: Explorer is not updated??? Cannot find domain
+ assertTrue("Application still present in the OpenShift Console view!",
+ account.getItems().length == 0);
+
+ projectExplorer.show();
+ projectExplorer.bot().tree(0).contextMenu("Delete").click();
+
+ bot.waitForShell("Delete Resources");
+ bot.checkBox().select();
+ bot.button(IDELabel.Button.OK).click();
+
+ assertFalse("The project still exists!",
+ projectExplorer.existsResource(TestProperties
+ .get("openshift.jbossapp.name")));
+ }
+}
Added: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java (rev 0)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -0,0 +1,34 @@
+package org.jboss.tools.openshift.ui.bot.test.explorer;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
+import org.jboss.tools.openshift.ui.bot.util.TestProperties;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
+import org.junit.Test;
+
+public class DeleteDomain extends SWTTestExt {
+
+ @Test
+ public void canDestroyDomain() throws InterruptedException {
+
+ SWTBotView explorer = open.viewOpen(OpenShiftUI.Explorer.iView);
+
+ // refresh first
+ explorer.bot().tree()
+ .getTreeItem(TestProperties.get("openshift.user.name"))
+ .contextMenu(OpenShiftUI.Labels.REFRESH).click();
+
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_UNLIMITED);
+
+ // delete
+ explorer.bot().tree()
+ .getTreeItem(TestProperties.get("openshift.user.name"))
+ .contextMenu(OpenShiftUI.Labels.EXPLORER_DELETE_DOMAIN).click();
+
+ bot.checkBox().select();
+ bot.button("OK").click();
+
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S + TIME_30S);
+ }
+}
Added: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/EmbedCartrides.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/EmbedCartrides.java (rev 0)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/EmbedCartrides.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -0,0 +1,114 @@
+package org.jboss.tools.openshift.ui.bot.test.explorer;
+
+import java.util.StringTokenizer;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.waits.ICondition;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
+import org.jboss.tools.openshift.ui.bot.util.TestProperties;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+public class EmbedCartrides extends SWTTestExt {
+ SWTBotTreeItem account;
+
+ @Test
+ public void canEmbeddCartriges() {
+
+ SWTBotView explorer = open.viewOpen(OpenShiftUI.Explorer.iView);
+
+ account = explorer.bot().tree()
+ .getTreeItem(TestProperties.get("openshift.user.name"))
+ .doubleClick();
+
+ bot.toolbarButtonWithTooltip("Collapse All").click();
+
+ // custom condition to wait for app to show
+ bot.waitUntil(new ICondition() {
+ @Override
+ public boolean test() {
+
+ for (SWTBotTreeItem item : account.getItems()) {
+ if (item.getText().contains(
+ TestProperties.get("openshift.jbossapp.name"))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void init(SWTBot bot) {
+ // keep empty
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return "Application did not appear in user account after reasonable timeout.";
+ }
+
+ }, TIME_60S, TIME_1S);
+
+ account.getNode(0).contextMenu(OpenShiftUI.Labels.EDIT_CARTRIDGES)
+ .click();
+
+ bot.waitForShell("");
+
+ SWTBotTable cartridgeTable = bot.tableInGroup("Embeddable Cartridges");
+
+ selectCartridges(cartridgeTable);
+
+ bot.button(IDELabel.Button.FINISH).click();
+
+ bot.waitForShell("Embedded Cartridges", TIME_60S + TIME_30S);
+ bot.button(IDELabel.Button.OK).click();
+ }
+
+ /*
+ * Jenkins cartridge not supported yet
+ */
+ private void selectCartridges(SWTBotTable cartridgeTable) {
+
+ StringTokenizer tokenizer = new StringTokenizer(
+ TestProperties.get("openshift.jbossapp.cartridges"), ";");
+
+ while (tokenizer.hasMoreTokens()) {
+
+ String cartridge = tokenizer.nextToken();
+
+ if (cartridge.equals("mysql")) {
+ cartridgeTable.getTableItem(OpenShiftUI.Cartridge.MYSQL)
+ .toggleCheck();
+ }
+ if (cartridge.equals("phpmyadmin")) {
+ cartridgeTable.getTableItem(OpenShiftUI.Cartridge.PHPMYADMIN)
+ .toggleCheck();
+ }
+ if (cartridge.equals("cron")) {
+ cartridgeTable.getTableItem(OpenShiftUI.Cartridge.CRON)
+ .toggleCheck();
+ }
+ if (cartridge.equals("postgresql")) {
+ cartridgeTable.getTableItem(OpenShiftUI.Cartridge.POSTGRESQL)
+ .toggleCheck();
+ }
+ if (cartridge.equals("mongodb")) {
+ cartridgeTable.getTableItem(OpenShiftUI.Cartridge.MONGODB)
+ .toggleCheck();
+ }
+ if (cartridge.equals("rockmongo")) {
+ cartridgeTable.getTableItem(OpenShiftUI.Cartridge.ROCKMONGO)
+ .toggleCheck();
+ }
+ if (cartridge.equals("metrics")) {
+ cartridgeTable.getTableItem(OpenShiftUI.Cartridge.METRICS)
+ .toggleCheck();
+ }
+ }
+ }
+
+}
Added: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/RenameDomain.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/RenameDomain.java (rev 0)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/RenameDomain.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -0,0 +1,40 @@
+package org.jboss.tools.openshift.ui.bot.test.explorer;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
+import org.jboss.tools.openshift.ui.bot.util.TestProperties;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+public class RenameDomain extends SWTTestExt {
+
+ @Test
+ public void canRenameDomain() {
+
+ SWTBotView explorer = open.viewOpen(OpenShiftUI.Explorer.iView);
+
+ explorer.bot().tree()
+ .getTreeItem(TestProperties.get("openshift.user.name"))
+ .contextMenu(OpenShiftUI.Labels.EXPLORER_CREATE_EDIT_DOMAIN)
+ .click();
+
+ bot.waitForShell("");
+
+ SWTBotText domainText = bot.text(0);
+
+ assertTrue(
+ "Domain should be set correctly at this stage!",
+ domainText.getText().equals(
+ TestProperties.get("openshift.domain")));
+
+ domainText.setText(TestProperties.get("openshift.domain.new"));
+
+ bot.button(IDELabel.Button.FINISH).click();
+ bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S + TIME_30S);
+
+ }
+
+}
Added: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/wizard/RepublishApp.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/wizard/RepublishApp.java (rev 0)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/wizard/RepublishApp.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -0,0 +1,62 @@
+package org.jboss.tools.openshift.ui.bot.test.wizard;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.jboss.tools.openshift.ui.bot.util.TestProperties;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+public class RepublishApp extends SWTTestExt {
+
+ @Test
+ public void canModifyAndRepublishApp() {
+ SWTBot wiz = open.newObject(ActionItem.NewObject.WebHTMLPage.LABEL);
+
+ bot.waitForShell("New HTML File");
+
+ wiz.text(0).setText(
+ TestProperties.get("openshift.jbossapp.name")
+ + "/src/main/webapp");
+ wiz.text(1).setText("Test.html");
+
+ wiz.button(IDELabel.Button.FINISH).click();
+
+ projectExplorer.show();
+ projectExplorer.bot().tree().select(0);
+ ContextMenuHelper.clickContextMenu(projectExplorer.bot().tree(),
+ "Team", "Commit and Push...");
+
+ // if the auth shell appears click on OK
+ if (bot.waitForShell("Identify Yourself") != null) {
+ bot.button("OK").click();
+ }
+
+ bot.waitForShell("Commit Changes");
+ bot.styledText(0).setText("comment");
+
+ // select all items to commit
+ for (int i = 0; i < bot.table().rowCount(); i++) {
+ bot.table().getTableItem(i).toggleCheck();
+ }
+
+ bot.button("Commit").click();
+
+ bot.waitForShell("Push to Another Repository");
+ bot.button(IDELabel.Button.FINISH).click();
+
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_UNLIMITED, TIME_1S);
+
+ // custom condition to wait for the openshift server to be synchronized
+ /*
+ * servers.show(); assertTrue(servers.getServerPublishStatus(
+ * TestProperties.get("openshift.jbossapp.name") +
+ * " OpenShift Server").equalsIgnoreCase("synchronized"));
+ *
+ * TODO: JIRA? Server not synchornized although it actually is
+ */
+ }
+
+}
Deleted: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/DomainDestroyer.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/DomainDestroyer.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/DomainDestroyer.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -1,61 +0,0 @@
-package org.jboss.tools.openshift.ui.bot.util;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.PostMethod;
-
-/**
- *
- * @author sbunciak
- *
- * Utility class to destroy domain on OpenShift
- */
-public class DomainDestroyer {
-
- /**
- *
- * Destroys registered domain on OpenShift
- *
- * @param domain
- * @param login
- * @param password
- * @return HTTP Response code or 0 if some Exception was caught
- */
- public static int destroyDomain(String domain, String login, String password) {
-
- int resp_code = 0;
- String input = "{\"namespace\": \"" + domain + "\", \"rhlogin\": \""
- + login + "\", \"delete\": true }";
-
- HttpClient client = new HttpClient();
- PostMethod method = new PostMethod(
- "https://openshift.redhat.com/broker/domain");
-
- method.addParameter("json_data", input);
- method.addParameter("password", password);
-
- try {
- resp_code = client.executeMethod(method);
- } catch (Exception e) {
- System.out.println(e);
- } finally {
- method.releaseConnection();
- }
- return resp_code;
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- int resp_code = DomainDestroyer.destroyDomain(
- TestProperties.getProperty("openshift.domain.new"),
- TestProperties.getProperty("openshift.user.name"),
- TestProperties.getProperty("openshift.user.pwd"));
-
- if (resp_code == 200) {
- System.out.println("Domain destroyed.");
- } else {
- System.out.println("Domain was not destroyed. Response code: "+resp_code);
- }
- }
-}
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftUI.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftUI.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftUI.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -20,7 +20,7 @@
* Class representing OpenShift Console View
*
*/
- public static class Console {
+ public static class Explorer {
public static final IView iView = new IView() {
@Override
@@ -92,4 +92,28 @@
public static final String METRICS = "metrics-0.1";
public static final String ROCKMONGO = "rockmongo-1.1";
}
-}
+
+ public static class Labels {
+
+ public static final String CONNECT_TO_OPENSHIFT = "Connect to OpenShift";
+ public static final String EXPLORER_NEW_APP = "New OpenShift Application...";
+ public static final String EXPLORER_CREATE_EDIT_DOMAIN = "Create or Edit Domain...";
+ public static final String EXPLORER_DELETE_DOMAIN = "Delete Domain";
+ public static final String EXPLORER_CREATE_SERVER = "Create a Server Adapter";
+ public static final String EXPLORER_DELETE_APP = "Delete Application(s)";
+ public static final String EDIT_CARTRIDGES = "Edit Embedded Cartridges...";
+ public static final String REFRESH = "Refresh";
+
+ }
+
+ public static class Shell {
+
+ public static final String NO_TITLE = "";
+ public static final String NEW_APP = "New OpenShift Application";
+ public static final String DOMAIN = "";
+ public static final String CREDENTIALS = "";
+ public static final String NEW_SSH = "New ssh key";
+ public static final String DELETE_APP = "Application deletion";
+
+ }
+}
\ No newline at end of file
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/TestProperties.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/TestProperties.java 2012-08-14 15:12:21 UTC (rev 43027)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/TestProperties.java 2012-08-14 15:27:13 UTC (rev 43028)
@@ -5,7 +5,6 @@
import java.io.IOException;
import java.util.Properties;
-import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;
/**
@@ -34,14 +33,8 @@
}
- public static String getProperty(String key) {
- return props.getProperty(key);
+ public static String get(String key) {
+ return props.getProperty(key);
}
-
- public static String getPassphrase() {
- String passphrase = new String(new Base64().decode(TestProperties.getProperty(
- "openshift.ssh.passphrase").getBytes()));
- return passphrase;
- }
-}
+}
\ No newline at end of file
12 years, 5 months
JBoss Tools SVN: r43027 - in trunk/build: jacoco and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-08-14 11:12:21 -0400 (Tue, 14 Aug 2012)
New Revision: 43027
Added:
trunk/build/jacoco/
trunk/build/jacoco/jacoco-reports.xml
trunk/build/jacoco/jacocoant.jar
Log:
JBIDE-10537: Added script to generate Jacoco reports from component
Added: trunk/build/jacoco/jacoco-reports.xml
===================================================================
--- trunk/build/jacoco/jacoco-reports.xml (rev 0)
+++ trunk/build/jacoco/jacoco-reports.xml 2012-08-14 15:12:21 UTC (rev 43027)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="jacoco-reports" default="reports">
+
+ <taskdef name="report" classname="org.jacoco.ant.ReportTask">
+ <classpath path="${basedir}/jacocoant.jar" />
+ </taskdef>
+
+ <!-- =================================
+ target: default
+ ================================= -->
+ <target name="reports">
+ <report>
+ <executiondata>
+ <fileset dir="${user.dir}/target">
+ <include name="*.exec" />
+ </fileset>
+ </executiondata>
+ <structure name="JaCoCo-Multi Project">
+ <group name="JaCoCo-Multi">
+ <classfiles>
+ <dirset dir="${user.dir}/plugins" >
+ <include name="*/target/classes"/>
+ </dirset>
+ <dirset dir="${user.dir}/tests" >
+ <include name="*/target/classes"/>
+ </dirset>
+ </classfiles>
+ <sourcefiles encoding="UTF-8">
+ <dirset dir="${user.dir}/plugins" >
+ <include name="*/src*"/>
+ </dirset>
+ <dirset dir="${user.dir}/tests" >
+ <include name="*/src*"/>
+ </dirset>
+ </sourcefiles>
+ </group>
+ </structure>
+ <html destdir="${user.dir}/target/coverage-report/html" />
+ <xml destfile="${user.dir}/target/coverage-report/coverage-report.xml" />
+ <csv destfile="${user.dir}/target/coverage-report/coverage-report.csv" />
+ </report>
+ </target>
+</project>
Property changes on: trunk/build/jacoco/jacoco-reports.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/jacoco/jacocoant.jar
===================================================================
(Binary files differ)
Property changes on: trunk/build/jacoco/jacocoant.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
12 years, 5 months
JBoss Tools SVN: r43026 - trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2012-08-14 11:05:48 -0400 (Tue, 14 Aug 2012)
New Revision: 43026
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java
Log:
JBIDE-10611
As-you-type CDI validation
Annotations creation is moved to the end of validation/problem reporting.
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java 2012-08-14 14:14:28 UTC (rev 43025)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java 2012-08-14 15:05:48 UTC (rev 43026)
@@ -233,23 +233,30 @@
@Override
public void addMessage(IValidator origin, IMessage message) {
messages.add(message);
- if (isCancelled()) {
+ }
+
+ public void finishReporting() {
+ if (isCancelled() || messages.isEmpty() || getAnnotationModel() == null || fCompilationUnit == null)
return;
- }
- if (message instanceof ValidationMessage && getAnnotationModel() != null) {
+
+ IEditorInput editorInput= fEditor.getEditorInput();
+ if (editorInput == null)
+ return;
+
+ String editorInputName = editorInput.getName();
+ for (IMessage message : messages) {
+ if (!(message instanceof ValidationMessage))
+ continue;
+
ValidationMessage valMessage = (ValidationMessage)message;
- IEditorInput editorInput= fEditor.getEditorInput();
- if (editorInput != null) {
- boolean cleanAllAnnotations = Boolean.TRUE.equals(message.getAttribute(TempMarkerManager.CLEAN_ALL_ANNOTATIONS_ATTRIBUTE));
- Position position = new Position(valMessage.getOffset(), valMessage.getLength());
- TempJavaProblem problem = new TempJavaProblem(valMessage,
- editorInput.getName());
- if (fCompilationUnit != null) {
- TempJavaProblemAnnotation problemAnnotation = new TempJavaProblemAnnotation(problem, fCompilationUnit);
- addAnnotation(problemAnnotation, position, cleanAllAnnotations);
- }
- }
+ boolean cleanAllAnnotations = Boolean.TRUE.equals(message.getAttribute(TempMarkerManager.CLEAN_ALL_ANNOTATIONS_ATTRIBUTE));
+ Position position = new Position(valMessage.getOffset(), valMessage.getLength());
+ TempJavaProblem problem = new TempJavaProblem(valMessage, editorInputName);
+ TempJavaProblemAnnotation problemAnnotation = new TempJavaProblemAnnotation(problem, fCompilationUnit);
+ addAnnotation(problemAnnotation, position, cleanAllAnnotations);
}
+
+ removeAllMessages();
}
}
@@ -446,7 +453,7 @@
}),
fHelper, fReporter);
}
- fReporter.removeAllMessages();
+ fReporter.finishReporting();
}
private boolean isJavaElementValidationRequired() {
12 years, 5 months
JBoss Tools SVN: r43025 - in trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test: META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: sbunciak
Date: 2012-08-14 10:14:28 -0400 (Tue, 14 Aug 2012)
New Revision: 43025
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTests.launch
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftAllBotTests.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/Connection.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteApp.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/EmbedCartrides.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/RenameDomain.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/wizard/RepublishApp.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftUI.java
Log:
Finished OpenShift SWTBot tests refactoring
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/META-INF/MANIFEST.MF 2012-08-14 14:14:28 UTC (rev 43025)
@@ -17,9 +17,6 @@
org.eclipse.swtbot.swt.finder;bundle-version="2.0.5",
org.eclipse.core.resources;bundle-version="3.7.100",
org.eclipse.ui.forms;bundle-version="3.5.100",
- org.eclipse.ui.ide;bundle-version="3.7.0",
- org.apache.commons.httpclient;bundle-version="3.1.0",
- org.apache.commons.logging;bundle-version="1.0.4",
- org.apache.commons.codec;bundle-version="1.3.0"
+ org.eclipse.ui.ide;bundle-version="3.7.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTests.launch
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTests.launch 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTests.launch 2012-08-14 14:14:28 UTC (rev 43025)
@@ -31,7 +31,7 @@
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.openshift.ui.bot.test"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx512m -Dswtbot.test.properties.file=${env_var:HOME}/swtbot.properties -Dusage_reporting_enabled=false"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx512m -Dswtbot.test.properties.file=${project_loc}/resources/swtbot.properties -Dusage_reporting_enabled=false"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="show_selected_only" value="false"/>
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftAllBotTests.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftAllBotTests.java 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftAllBotTests.java 2012-08-14 14:14:28 UTC (rev 43025)
@@ -35,8 +35,8 @@
CreateApp.class,
EmbedCartrides.class,
RepublishApp.class,
+DeleteApp.class,
RenameDomain.class,
-DeleteApp.class,
DeleteDomain.class
})
@RunWith(RequirementAwareSuite.class)
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/Connection.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/Connection.java 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/Connection.java 2012-08-14 14:14:28 UTC (rev 43025)
@@ -2,6 +2,7 @@
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
import org.jboss.tools.openshift.ui.bot.util.TestProperties;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
@@ -22,7 +23,7 @@
.click();
// open credentials dialog
- bot.waitForShell(OpenShiftUI.Shell.CREDENTIALS);
+ SWTBotShell shell = bot.waitForShell(OpenShiftUI.Shell.CREDENTIALS);
// set wrong user credentials
bot.text(0).setText(TestProperties.get("openshift.user.name"));
@@ -34,7 +35,7 @@
finishButton.click();
// wait for credentials validation
- bot.waitUntil(new NonSystemJobRunsCondition());
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_20S);
assertFalse("Finish button shouldn't be enabled.",
finishButton.isEnabled());
@@ -46,7 +47,9 @@
// create connection to OpenShift account
finishButton.click();
- bot.waitUntil(Conditions.shellCloses(bot.activeShell()));
+ // wait for credentials validation
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_20S);
+ bot.waitUntil(Conditions.shellCloses(shell));
log.info("*** OpenShift SWTBot Tests: Credentials validated. ***");
log.info("*** OpenShift SWTBot Tests: Connection to OpenShift established. ***");
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-14 14:14:28 UTC (rev 43025)
@@ -1,5 +1,8 @@
package org.jboss.tools.openshift.ui.bot.test.explorer;
+import java.io.File;
+import java.io.IOException;
+
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
@@ -7,11 +10,31 @@
import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
import org.jboss.tools.openshift.ui.bot.util.TestProperties;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Before;
import org.junit.Test;
public class CreateApp extends SWTTestExt {
+ @Before
+ public void cleanUpProject() {
+ File gitDir = new File(System.getProperty("user.home") + "/git");
+
+ if (gitDir.exists() && gitDir.isDirectory()
+ && gitDir.listFiles().length > 0) {
+ for (File file : gitDir.listFiles()) {
+ if (file.getName().contains(
+ TestProperties.get("openshift.jbossapp.name")))
+ try {
+ delete(file);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
@Test
public void canCreateImportAppFromExplorer() {
SWTBotView openshiftConsole = open.viewOpen(OpenShiftUI.Explorer.iView);
@@ -41,26 +64,67 @@
bot.button(IDELabel.Button.NEXT).click();
+ bot.button(IDELabel.Button.NEXT).click();
+
bot.waitUntil(Conditions.widgetIsEnabled(bot
.button(IDELabel.Button.FINISH)));
bot.button(IDELabel.Button.FINISH).click();
log.info("*** OpenShift SWTBot Tests: Application creation started. ***");
+ // only for the 1st time
+ // bot.waitForShell("Question", 500);
+ // bot.button(IDELabel.Button.YES).click();
+
bot.waitForShell("Information", 500);
bot.text(0).setText(TestProperties.get("openshift.user.pwd"));
bot.button(IDELabel.Button.OK).click();
log.info("*** OpenShift SWTBot Tests: SSH passphrase given. ***");
- bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_20S);
+ bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S);
log.info("*** OpenShift SWTBot Tests: New Application wizard closed. ***");
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S, TIME_1S);
+
servers.serverExists(TestProperties.get("openshift.jbossapp.name")
+ " OpenShift Server");
log.info("*** OpenShift SWTBot Tests: OpenShift Server Adapter created. ***");
}
+
+ private void delete(File file) throws IOException {
+ if (file.isDirectory()) {
+ // directory is empty, then delete it
+ if (file.list().length == 0) {
+ file.delete();
+ log.debug("Directory is deleted : "
+ + file.getAbsolutePath());
+ } else {
+ // list all the directory contents
+ String files[] = file.list();
+
+ for (String temp : files) {
+ // construct the file structure
+ File fileDelete = new File(file, temp);
+ // recursive delete
+ delete(fileDelete);
+ }
+
+ // check the directory again, if empty then delete it
+ if (file.list().length == 0) {
+ file.delete();
+ log.debug("Directory is deleted : "
+ + file.getAbsolutePath());
+ }
+ }
+ } else {
+ // if file, then delete it
+ file.delete();
+ log.debug("File is deleted : " + file.getAbsolutePath());
+ }
+ }
+
}
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java 2012-08-14 14:14:28 UTC (rev 43025)
@@ -8,7 +8,6 @@
import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
import org.jboss.tools.openshift.ui.bot.util.TestProperties;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.junit.Before;
import org.junit.Test;
@@ -85,8 +84,6 @@
bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S);
log.info("*** OpenShift SWTBot Tests: Domain created. ***");
-
- bot.waitUntil(new NonSystemJobRunsCondition(), TIME_20S);
}
}
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteApp.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteApp.java 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteApp.java 2012-08-14 14:14:28 UTC (rev 43025)
@@ -1,12 +1,11 @@
package org.jboss.tools.openshift.ui.bot.test.explorer;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
import org.jboss.tools.openshift.ui.bot.util.TestProperties;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.junit.Test;
@@ -20,7 +19,7 @@
SWTBotView explorer = open.viewOpen(OpenShiftUI.Explorer.iView);
account = explorer.bot().tree()
- .expandNode(TestProperties.get("openshift.user.name"))
+ .getTreeItem(TestProperties.get("openshift.user.name"))
.doubleClick();
account.getNode(0).contextMenu(OpenShiftUI.Labels.EXPLORER_DELETE_APP)
@@ -29,24 +28,8 @@
bot.waitForShell(OpenShiftUI.Shell.DELETE_APP);
bot.button(IDELabel.Button.OK).click();
- bot.waitWhile(new ICondition() {
- @Override
- public boolean test() throws Exception {
- return account.getItems().length > 0;
- }
-
- @Override
- public void init(SWTBot bot) {
- // keep empty
- }
-
- @Override
- public String getFailureMessage() {
- return "Application is still present in user account after reasonable timeout.";
- }
-
- }, TIME_60S, TIME_1S);
-
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S + TIME_30S, TIME_1S);
+// TODO: Explorer is not updated??? Cannot find domain
assertTrue("Application still present in the OpenShift Console view!",
account.getItems().length == 0);
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java 2012-08-14 14:14:28 UTC (rev 43025)
@@ -14,15 +14,21 @@
SWTBotView explorer = open.viewOpen(OpenShiftUI.Explorer.iView);
+ // refresh first
explorer.bot().tree()
.getTreeItem(TestProperties.get("openshift.user.name"))
+ .contextMenu(OpenShiftUI.Labels.REFRESH).click();
+
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_UNLIMITED);
+
+ // delete
+ explorer.bot().tree()
+ .getTreeItem(TestProperties.get("openshift.user.name"))
.contextMenu(OpenShiftUI.Labels.EXPLORER_DELETE_DOMAIN).click();
-
- bot.wait(TIME_5S);
-
- bot.waitUntil(new NonSystemJobRunsCondition());
-
-
+ bot.checkBox().select();
+ bot.button("OK").click();
+
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S + TIME_30S);
}
}
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/EmbedCartrides.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/EmbedCartrides.java 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/EmbedCartrides.java 2012-08-14 14:14:28 UTC (rev 43025)
@@ -22,9 +22,11 @@
SWTBotView explorer = open.viewOpen(OpenShiftUI.Explorer.iView);
account = explorer.bot().tree()
- .expandNode(TestProperties.get("openshift.user.name"))
+ .getTreeItem(TestProperties.get("openshift.user.name"))
.doubleClick();
+ bot.toolbarButtonWithTooltip("Collapse All").click();
+
// custom condition to wait for app to show
bot.waitUntil(new ICondition() {
@Override
@@ -62,7 +64,7 @@
bot.button(IDELabel.Button.FINISH).click();
- bot.waitForShell("Embedded Cartridges");
+ bot.waitForShell("Embedded Cartridges", TIME_60S + TIME_30S);
bot.button(IDELabel.Button.OK).click();
}
@@ -72,13 +74,11 @@
private void selectCartridges(SWTBotTable cartridgeTable) {
StringTokenizer tokenizer = new StringTokenizer(
- TestProperties.get("openshift.jbossapp.cartridges"),
- ";");
+ TestProperties.get("openshift.jbossapp.cartridges"), ";");
while (tokenizer.hasMoreTokens()) {
String cartridge = tokenizer.nextToken();
- System.out.println(cartridge);
if (cartridge.equals("mysql")) {
cartridgeTable.getTableItem(OpenShiftUI.Cartridge.MYSQL)
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/RenameDomain.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/RenameDomain.java 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/RenameDomain.java 2012-08-14 14:14:28 UTC (rev 43025)
@@ -1,7 +1,5 @@
package org.jboss.tools.openshift.ui.bot.test.explorer;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.GetMethod;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
@@ -35,21 +33,8 @@
domainText.setText(TestProperties.get("openshift.domain.new"));
bot.button(IDELabel.Button.FINISH).click();
- bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S);
+ bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S + TIME_30S);
- HttpClient client = new HttpClient();
- GetMethod method = new GetMethod("https://"
- + TestProperties.get("openshift.jbossapp.name") + "-"
- + TestProperties.get("openshift.domain.new")
- + ".rhcloud.com");
-
- try {
- assertTrue(client.executeMethod(method) == 200);
- } catch (Exception e) {
- log.error("File has not been published to the server!", e);
- } finally {
- method.releaseConnection();
- }
}
}
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/wizard/RepublishApp.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/wizard/RepublishApp.java 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/wizard/RepublishApp.java 2012-08-14 14:14:28 UTC (rev 43025)
@@ -1,12 +1,9 @@
package org.jboss.tools.openshift.ui.bot.test.wizard;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.GetMethod;
import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.jboss.tools.openshift.ui.bot.util.TestProperties;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
@@ -17,6 +14,9 @@
@Test
public void canModifyAndRepublishApp() {
SWTBot wiz = open.newObject(ActionItem.NewObject.WebHTMLPage.LABEL);
+
+ bot.waitForShell("New HTML File");
+
wiz.text(0).setText(
TestProperties.get("openshift.jbossapp.name")
+ "/src/main/webapp");
@@ -29,53 +29,34 @@
ContextMenuHelper.clickContextMenu(projectExplorer.bot().tree(),
"Team", "Commit and Push...");
+ // if the auth shell appears click on OK
+ if (bot.waitForShell("Identify Yourself") != null) {
+ bot.button("OK").click();
+ }
+
bot.waitForShell("Commit Changes");
bot.styledText(0).setText("comment");
- bot.table().getTableItem(0).toggleCheck();
- // bot.toolbarButtonWithTooltip("Select All").click();
+ // select all items to commit
+ for (int i = 0; i < bot.table().rowCount(); i++) {
+ bot.table().getTableItem(i).toggleCheck();
+ }
bot.button("Commit").click();
bot.waitForShell("Push to Another Repository");
bot.button(IDELabel.Button.FINISH).click();
- // custom condition to wait for the openshift server to be synchronized
- bot.waitUntil(new ICondition() {
- @Override
- public boolean test() {
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_UNLIMITED, TIME_1S);
- return servers.getServerPublishStatus(
- TestProperties.get("openshift.jbossapp.name")
- + " OpenShift Server").equalsIgnoreCase(
- "synchronized");
- }
-
- @Override
- public void init(SWTBot bot) {
- // keep empty
- }
-
- @Override
- public String getFailureMessage() {
- return "OpenShift server is not synchronized after reasonable timeout.";
- }
-
- }, Timing.time100S(), TIME_1S);
-
- HttpClient client = new HttpClient();
- GetMethod method = new GetMethod("https://"
- + TestProperties.get("openshift.jbossapp.name") + "-"
- + TestProperties.get("openshift.domain")
- + ".rhcloud.com/Test.html");
-
- try {
- assertTrue(client.executeMethod(method) == 200);
- } catch (Exception e) {
- log.error("File has not been published to the server!", e);
- } finally {
- method.releaseConnection();
- }
+ // custom condition to wait for the openshift server to be synchronized
+ /*
+ * servers.show(); assertTrue(servers.getServerPublishStatus(
+ * TestProperties.get("openshift.jbossapp.name") +
+ * " OpenShift Server").equalsIgnoreCase("synchronized"));
+ *
+ * TODO: JIRA? Server not synchornized although it actually is
+ */
}
}
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftUI.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftUI.java 2012-08-14 13:41:57 UTC (rev 43024)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftUI.java 2012-08-14 14:14:28 UTC (rev 43025)
@@ -102,6 +102,7 @@
public static final String EXPLORER_CREATE_SERVER = "Create a Server Adapter";
public static final String EXPLORER_DELETE_APP = "Delete Application(s)";
public static final String EDIT_CARTRIDGES = "Edit Embedded Cartridges...";
+ public static final String REFRESH = "Refresh";
}
12 years, 5 months
JBoss Tools SVN: r43024 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-14 09:41:57 -0400 (Tue, 14 Aug 2012)
New Revision: 43024
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml
Log:
Enhanced explodedBundles section
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml 2012-08-14 13:39:24 UTC (rev 43023)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml 2012-08-14 13:41:57 UTC (rev 43024)
@@ -111,6 +111,13 @@
<testSuite>org.jboss.tools.portlet.ui.bot.test</testSuite>
<testClass>${test.class}</testClass>
<skip>${swtbot.test.skip}</skip>
+ <explodedBundles>
+ <bundle>org.mozilla.xulrunner.carbon.macosx</bundle>
+ <bundle>org.mozilla.xulrunner.cocoa.macosx</bundle>
+ <bundle>org.mozilla.xulrunner.gtk.linux.x86</bundle>
+ <bundle>org.mozilla.xulrunner.gtk.linux.x86_64</bundle>
+ <bundle>org.mozilla.xulrunner.win32.win32.x86</bundle>
+ </explodedBundles>
<dependencies combine.children="append">
<dependency>
<type>p2-installable-unit</type>
12 years, 5 months
JBoss Tools SVN: r43023 - branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-14 09:39:24 -0400 (Tue, 14 Aug 2012)
New Revision: 43023
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml
Log:
added explodeBundles section
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml 2012-08-14 09:12:29 UTC (rev 43022)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/pom.xml 2012-08-14 13:39:24 UTC (rev 43023)
@@ -46,7 +46,11 @@
<testClass>${test.class}</testClass>
<skip>${swtbot.test.skip}</skip>
<explodedBundles>
- <explodedBundle>org.mozilla.xulrunner.gtk.linux.x86_64</explodedBundle>
+ <bundle>org.mozilla.xulrunner.carbon.macosx</bundle>
+ <bundle>org.mozilla.xulrunner.cocoa.macosx</bundle>
+ <bundle>org.mozilla.xulrunner.gtk.linux.x86</bundle>
+ <bundle>org.mozilla.xulrunner.gtk.linux.x86_64</bundle>
+ <bundle>org.mozilla.xulrunner.win32.win32.x86</bundle>
</explodedBundles>
<dependencies combine.children="append">
<dependency>
12 years, 5 months
JBoss Tools SVN: r43022 - trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-08-14 05:12:29 -0400 (Tue, 14 Aug 2012)
New Revision: 43022
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml
Log:
JBIDE-12422: Change for AS bot tests
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml 2012-08-14 05:35:31 UTC (rev 43021)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml 2012-08-14 09:12:29 UTC (rev 43022)
@@ -20,7 +20,7 @@
<additionalSystemProperties></additionalSystemProperties>
<systemProperties>${additionalSystemProperties} -Djbosstools.test.jboss-as-7.1.home=${jbosstools.test.jboss-as-7.1.home} -Dtest.configurations.dir=${configurations.dir} -Dorg.eclipse.swtbot.screenshots.dir=${project.build.directory}/screenshots</systemProperties>
<test.class>org.jboss.ide.eclipse.as.ui.bot.test.AllTestsSuite</test.class>
-
+ <surefire.timeout>7200</surefire.timeout>
</properties>
<profiles>
@@ -71,8 +71,6 @@
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<useUIThread>false</useUIThread>
- <surefire.timeout>7200</surefire.timeout>
- <forkedProcessTimeoutInSeconds>7200</forkedProcessTimeoutInSeconds>
<testSuite>org.jboss.ide.eclipse.as.ui.bot.test</testSuite>
<testClass>${test.class}</testClass>
<skip>${swtbot.test.skip}</skip>
12 years, 5 months
JBoss Tools SVN: r43021 - branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-08-14 01:35:31 -0400 (Tue, 14 Aug 2012)
New Revision: 43021
Modified:
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/.classpath
Log:
JBIDE-12426 to maint
Modified: branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/.classpath
===================================================================
--- branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/.classpath 2012-08-14 05:35:06 UTC (rev 43020)
+++ branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/.classpath 2012-08-14 05:35:31 UTC (rev 43021)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="jbossui"/>
<classpathentry kind="output" path="bin"/>
12 years, 5 months
JBoss Tools SVN: r43020 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-08-14 01:35:06 -0400 (Tue, 14 Aug 2012)
New Revision: 43020
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/.classpath
Log:
JBIDE-12426 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/.classpath
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/.classpath 2012-08-14 02:15:58 UTC (rev 43019)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/.classpath 2012-08-14 05:35:06 UTC (rev 43020)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="jbossui"/>
<classpathentry kind="output" path="bin"/>
12 years, 5 months
JBoss Tools SVN: r43019 - trunk/esb/tests/org.jboss.tools.esb.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ldimaggio
Date: 2012-08-13 22:15:58 -0400 (Mon, 13 Aug 2012)
New Revision: 43019
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/pom.xml
Log:
Updated ESB tests' pom.xml
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/pom.xml
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/pom.xml 2012-08-14 01:18:16 UTC (rev 43018)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/pom.xml 2012-08-14 02:15:58 UTC (rev 43019)
@@ -13,10 +13,10 @@
<packaging>eclipse-test-plugin</packaging>
<properties>
<jbosstools.test.jbossesb.home>${requirementsDirectory}/jbossesb-4.11</jbosstools.test.jbossesb.home>
- <jbosstools.test.jbosssoa.home>${requirementsDirectory}/jboss-soa-p-5.3/jboss-soa-p-5/jboss-as</jbosstools.test.jbosssoa.home>
+ <jbosstools.test.jbosssoa.home>${requirementsDirectory}/jboss-soa-p-5/jboss-as</jbosstools.test.jbosssoa.home>
<swtbot.test.properties.file>./org.jboss.tools.esb.ui.bot.test.properties</swtbot.test.properties.file>
- <systemProperties>-Djbosstools.test.jbossesb.home=${jbosstools.test.jbossesb.home} -Djbosstools.test.jbosssoa.home=${jbosstools.test.jbosssoa.home} -Dswtbot.test.properties.file=${swtbot.test.properties.file}</systemProperties>
- <surefire.timeout>7200</surefire.timeout>
+ <systemProperties>-Djbosstools.test.jbossesb.home=${jbosstools.test.jbossesb.home} -Djbosstools.test.jbosssoa.home=${jbosstools.test.jbosssoa.home} -Dswtbot.test.properties.file=${swtbot.test.properties.file}
+ </systemProperties>
</properties>
<build>
@@ -32,8 +32,8 @@
<goal>wget</goal>
</goals>
<configuration>
- <url>http://jawa05.englab.brq.redhat.com/candidate/soa-5.3.0.ER2/soa-p-5.3.0.E...</url>
- <md5>1f70c15b26a0d812ba2a39a96c6a8c57</md5>
+ <url>http://jawa05.englab.brq.redhat.com/candidate/soa-5.3.0.ER5/soa-p-5.3.0.E...</url>
+ <md5>1c2e329498396762b8dad2c1621308bf</md5>
<unpack>true</unpack>
</configuration>
</execution>
@@ -59,6 +59,7 @@
<skip>${swtbot.test.skip}</skip>
<testSuite>org.jboss.tools.esb.ui.bot.test</testSuite>
<testClass>org.jboss.tools.esb.ui.bot.tests.ESBAllBotTests</testClass>
+ <forkedProcessTimeoutInSeconds>7200</forkedProcessTimeoutInSeconds>
</configuration>
</plugin>
</plugins>
12 years, 5 months