Author: sbunciak
Date: 2012-10-01 07:47:47 -0400 (Mon, 01 Oct 2012)
New Revision: 44171
Added:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftAllBotTests.launch
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftAllBotTestsMaven.launch
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftJenkinsBotTests.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftExplorerView.java
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTestsMaven.launch
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/pom.xml
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/util/OpenShiftUI.java
Log:
Created minimal Jenkins test suite
Added:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftAllBotTests.launch
===================================================================
---
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftAllBotTests.launch
(rev 0)
+++
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftAllBotTests.launch 2012-10-01
11:47:47 UTC (rev 44171)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<launchConfiguration
type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation"
value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location"
value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry
value="/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftAllBotTests.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":1"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER"
value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR"
value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME"
value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND"
value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER"
value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.jboss.tools.openshift.ui.bot.test.OpenShiftAllBotTests"/>
+<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=${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"/>
+<stringAttribute key="templateConfig"
value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
Added:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftAllBotTestsMaven.launch
===================================================================
---
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftAllBotTestsMaven.launch
(rev 0)
+++
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftAllBotTestsMaven.launch 2012-10-01
11:47:47 UTC (rev 44171)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<launchConfiguration
type="org.eclipse.m2e.Maven2LaunchConfigurationType">
+<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
+<stringAttribute key="M2_GOALS" value="clean install"/>
+<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
+<booleanAttribute key="M2_OFFLINE" value="false"/>
+<stringAttribute key="M2_PROFILES" value="default"/>
+<listAttribute key="M2_PROPERTIES">
+<listEntry value="swtbot.test.skip=false"/>
+<listEntry value="configurations.dir=${project_loc}/resources"/>
+<listEntry value="scope=All"/>
+</listAttribute>
+<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
+<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
+<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="true"/>
+<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="true"/>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":${string_prompt}"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY"
value="${workspace_loc:/openshift/tests/org.jboss.tools.openshift.ui.bot.test}"/>
+</launchConfiguration>
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTestsMaven.launch
===================================================================
---
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTestsMaven.launch 2012-10-01
11:04:01 UTC (rev 44170)
+++
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTestsMaven.launch 2012-10-01
11:47:47 UTC (rev 44171)
@@ -8,6 +8,7 @@
<listAttribute key="M2_PROPERTIES">
<listEntry value="swtbot.test.skip=false"/>
<listEntry value="configurations.dir=${project_loc}/resources"/>
+<listEntry value="scope=Jenkins"/>
</listAttribute>
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
@@ -16,5 +17,5 @@
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
<mapEntry key="DISPLAY" value=":${string_prompt}"/>
</mapAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY"
value="${workspace_loc:/openshift/tests/org.jboss.tools.openshift.ui.bot.test}"/>
+<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY"
value="${workspace_loc:/org.jboss.tools.openshift.ui.bot.test}"/>
</launchConfiguration>
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/pom.xml
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/pom.xml 2012-10-01
11:04:01 UTC (rev 44170)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/pom.xml 2012-10-01
11:47:47 UTC (rev 44171)
@@ -6,12 +6,11 @@
<parent>
<groupId>org.jboss.tools.openshift</groupId>
<artifactId>tests</artifactId>
- <version>2.3.0-SNAPSHOT</version>
+ <version>2.4.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.openshift.tests</groupId>
<artifactId>org.jboss.tools.openshift.ui.bot.test</artifactId>
- <version>2.3.0-SNAPSHOT</version>
-
+
<packaging>eclipse-test-plugin</packaging>
<properties>
@@ -28,12 +27,12 @@
<skip>${swtbot.test.skip}</skip>
<useUIThread>false</useUIThread>
<testSuite>org.jboss.tools.openshift.ui.bot.test</testSuite>
- <testClass>org.jboss.tools.openshift.ui.bot.test.OpenShiftAllBotTests</testClass>
+ <testClass>org.jboss.tools.openshift.ui.bot.test.OpenShift${scope}BotTests</testClass>
<dependencies combine.children="append">
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.jboss.tools.openshift.express.feature.feature.group</artifactId>
- <version>2.3.0</version>
+ <version>0.0.0</version>
</dependency>
</dependencies>
</configuration>
Added:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftJenkinsBotTests.java
===================================================================
---
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftJenkinsBotTests.java
(rev 0)
+++
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/OpenShiftJenkinsBotTests.java 2012-10-01
11:47:47 UTC (rev 44171)
@@ -0,0 +1,14 @@
+package org.jboss.tools.openshift.ui.bot.test;
+
+import org.jboss.tools.openshift.ui.bot.test.explorer.Connection;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+@SuiteClasses({
+Connection.class
+})
+(a)RunWith(RequirementAwareSuite.class)
+public class OpenShiftJenkinsBotTests {
+
+}
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-10-01
11:04:01 UTC (rev 44170)
+++
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/Connection.java 2012-10-01
11:47:47 UTC (rev 44171)
@@ -3,6 +3,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.OpenShiftExplorerView;
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;
@@ -16,12 +17,11 @@
@Test
public void canCreateConnectionToOpenShiftAccount() {
- // open OpenShift Explorer
- open.viewOpen(OpenShiftUI.Explorer.iView);
-
- bot.toolbarButtonWithTooltip(OpenShiftUI.Labels.CONNECT_TO_OPENSHIFT)
- .click();
-
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S, TIME_1S);
+
+ OpenShiftExplorerView explorer = new OpenShiftExplorerView();
+ explorer.getConnectionToolButton().click();
+
// open credentials dialog
SWTBotShell shell = bot.waitForShell(OpenShiftUI.Shell.CREDENTIALS);
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-10-01
11:04:01 UTC (rev 44170)
+++
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-10-01
11:47:47 UTC (rev 44171)
@@ -82,11 +82,11 @@
bot.waitForShell("Question", TIME_60S * 3);
bot.button(IDELabel.Button.YES).click();
-
+/*
bot.waitForShell("Information", TIME_60S * 3);
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, TIME_1S);
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-10-01
11:04:01 UTC (rev 44170)
+++
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java 2012-10-01
11:47:47 UTC (rev 44171)
@@ -1,6 +1,7 @@
package org.jboss.tools.openshift.ui.bot.test.explorer;
import java.io.File;
+import java.util.Date;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
@@ -9,6 +10,7 @@
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;
@@ -33,6 +35,7 @@
&& sshDir.listFiles().length > 0) {
for (File file : sshDir.listFiles()) {
if (file.getName().contains("id_rsa"))
+ //keyAvailable = true;
file.delete();
if (file.getName().contains("known_hosts"))
file.delete();
@@ -52,7 +55,7 @@
.contextMenu(OpenShiftUI.Labels.EXPLORER_CREATE_EDIT_DOMAIN)
.click();
- bot.waitForShell(OpenShiftUI.Shell.DOMAIN);
+ bot.waitForShell(OpenShiftUI.Shell.CREATE_DOMAIN);
SWTBotText domainText = bot.text(0);
@@ -64,18 +67,29 @@
SWTBotButton finishBtn = bot.button(IDELabel.Button.FINISH);
+
+ bot.link(0).click();
+
if (keyAvailable) {
+// TODO: add them to the list
+ bot.waitForShell(OpenShiftUI.Shell.SSH_WIZARD);
+ assertTrue("SSH key should be set!", bot.table().columnCount() > 0);
- assertTrue("SSH key should be set!", bot.text(1).getText()
- .contains("id_rsa"));
-
} else {
-
- bot.button(IDELabel.Shell.NEW).click();
+
+ bot.waitForShell(OpenShiftUI.Shell.SSH_WIZARD);
+ bot.buttonInGroup("New...", "SSH Public Keys").click();
bot.waitForShell(OpenShiftUI.Shell.NEW_SSH);
- bot.text(0).setText(TestProperties.get("openshift.user.pwd"));
+
+ bot.textInGroup("New SSH Key", 0).setText("jbtkey" + new Date());
+ bot.textInGroup("New SSH Key", 2).setText("id_rsa");
+ bot.button(IDELabel.Button.FINISH).click();
+
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_20S, TIME_1S);
+ bot.waitForShell(OpenShiftUI.Shell.SSH_WIZARD);
+
bot.button(IDELabel.Button.OK).click();
- bot.waitForShell(OpenShiftUI.Shell.DOMAIN);
+ bot.waitForShell(OpenShiftUI.Shell.CREATE_DOMAIN);
log.info("*** OpenShift SWTBot Tests: SSH Keys created. ***");
}
Added:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftExplorerView.java
===================================================================
---
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftExplorerView.java
(rev 0)
+++
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftExplorerView.java 2012-10-01
11:47:47 UTC (rev 44171)
@@ -0,0 +1,24 @@
+package org.jboss.tools.openshift.ui.bot.util;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton;
+import org.jboss.tools.ui.bot.ext.view.ViewBase;
+
+/**
+ *
+ * @author sbunciak
+ *
+ */
+public class OpenShiftExplorerView extends ViewBase {
+
+ public OpenShiftExplorerView() {
+ super();
+ this.viewObject = OpenShiftUI.Explorer.iView;
+ show();
+
+ }
+
+ public SWTBotToolbarButton getConnectionToolButton() {
+ return this.getToolbarButtonWitTooltip(OpenShiftUI.Labels.CONNECT_TO_OPENSHIFT);
+ }
+
+}
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-10-01
11:04:01 UTC (rev 44170)
+++
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/util/OpenShiftUI.java 2012-10-01
11:47:47 UTC (rev 44171)
@@ -110,9 +110,11 @@
public static final String NO_TITLE = "";
public static final String NEW_APP = "New OpenShift Application";
- public static final String DOMAIN = "";
+ public static final String CREATE_DOMAIN = "Create Domain";
+ public static final String EDIT_DOMAIN = "Edit Domain";
public static final String CREDENTIALS = "";
- public static final String NEW_SSH = "New ssh key";
+ public static final String SSH_WIZARD = "";
+ public static final String NEW_SSH = "";
public static final String DELETE_APP = "Application deletion";
}