JBoss Tools SVN: r21325 - trunk/drools/tests/org.jboss.tools.drools.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-04-07 11:57:05 -0400 (Wed, 07 Apr 2010)
New Revision: 21325
Modified:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/
Log:
Initial version of Drools SWTBot Tests
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test
___________________________________________________________________
Name: svn:ignore
+ bin
14 years, 9 months
JBoss Tools SVN: r21324 - in trunk/drools/tests/org.jboss.tools.drools.ui.bot.test: .settings and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-04-07 11:51:44 -0400 (Wed, 07 Apr 2010)
New Revision: 21324
Added:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.classpath
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.project
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.settings/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/META-INF/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/META-INF/MANIFEST.MF
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/build.properties
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/resources/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/Activator.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java
Log:
Initial version of Drools SWTBot Tests
Added: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.classpath
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.classpath (rev 0)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.classpath 2010-04-07 15:51:44 UTC (rev 21324)
@@ -0,0 +1,8 @@
+<?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.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.project
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.project (rev 0)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.project 2010-04-07 15:51:44 UTC (rev 21324)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.drools.ui.bot.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.settings/org.eclipse.jdt.core.prefs 2010-04-07 15:51:44 UTC (rev 21324)
@@ -0,0 +1,8 @@
+#Tue Apr 06 13:22:27 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/META-INF/MANIFEST.MF 2010-04-07 15:51:44 UTC (rev 21324)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Drools UI SWTBot Tests
+Bundle-SymbolicName: org.jboss.tools.drools.ui.bot.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.drools.ui.bot.test.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.jst.ui.bot.test;bundle-version="1.0.0",
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.spy;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.0",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
+ org.junit4;bundle-version="4.5.0",
+ org.jboss.tools.ui.bot.ext;bundle-version="1.0.0",
+ org.drools.eclipse;bundle-version="5.1.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: JBoss by Red Hat
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/build.properties
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/build.properties (rev 0)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/build.properties 2010-04-07 15:51:44 UTC (rev 21324)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties
===================================================================
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/Activator.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/Activator.java (rev 0)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/Activator.java 2010-04-07 15:51:44 UTC (rev 21324)
@@ -0,0 +1,50 @@
+package org.jboss.tools.drools.ui.bot.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.drools.ui.bot.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/Activator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java (rev 0)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java 2010-04-07 15:51:44 UTC (rev 21324)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.drools.ui.bot.test;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsRuntime;
+import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsProject;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ *
+ * This is struts swtbot testcase for JBoss Tools.
+ *
+ * @author Vladimir Pakan
+ *
+ */
+(a)RunWith(Suite.class)
+(a)SuiteClasses({ManageDroolsRuntime.class,
+ ManageDroolsProject.class})
+public class DroolsAllBotTests extends SWTTestExt {
+ public static final String DROOLS_PROJECT_NAME = "droolsTest";
+ public static final String DROOLS_RUNTIME_NAME = "Drools Test Runtime";
+ public static String DROOLS_RUNTIME_LOCATION = null;
+ @BeforeClass
+ public static void setUpTest() {
+ DROOLS_RUNTIME_LOCATION = System.getProperty("java.io.tmpdir");
+ properties = util.loadProperties(Activator.PLUGIN_ID);
+ try{
+ SWTBotView welcomeView = eclipse.getBot().viewByTitle(IDELabel.View.WELCOME);
+ welcomeView.close();
+ } catch (WidgetNotFoundException wnfe){
+ // Do nothing ignore this error
+ }
+
+ }
+
+ @AfterClass
+ public static void tearDownTest() {
+ // Ready for later usage
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java (rev 0)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java 2010-04-07 15:51:44 UTC (rev 21324)
@@ -0,0 +1,78 @@
+ /*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.drools.ui.bot.test.smoke;
+
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.EntityType;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.JobName;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
+import org.jboss.tools.ui.bot.test.WidgetVariables;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.junit.Test;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+/**
+ * Test managing of Drools Project
+ * @author Vladimir Pakan
+ *
+ */
+public class ManageDroolsProject extends SWTTestExt{
+ /**
+ * Test manage Drools project
+ */
+ @Test
+ public void testManageDroolsProject() {
+ createDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
+ }
+
+ private void createDroolsProject(String droolsProjectName){
+ eclipse.showView(ViewType.PACKAGE_EXPLORER);
+ eclipse.createNew(EntityType.DROOLS_PROJECT);
+ bot.textWithLabel(IDELabel.NewDroolsProjectDialog.NAME).setText(droolsProjectName);
+ bot.button(IDELabel.Button.NEXT).click();
+ // check all buttons
+ int index = 0;
+ boolean checkBoxExists = true;
+ while (checkBoxExists){
+ try{
+ SWTBotCheckBox checkBox = bot.checkBox(index);
+ if (!checkBox.isChecked()){
+ checkBox.click();
+ }
+ index++;
+ }catch (WidgetNotFoundException wnfe){
+ checkBoxExists = false;
+ }catch (IndexOutOfBoundsException ioobe){
+ checkBoxExists = false;
+ }
+ }
+ bot.button(IDELabel.Button.NEXT).click();
+ bot.button(IDELabel.Button.FINISH).click();
+ SWTTestExt.util.waitForAllExcept(100*1000L, new String[]{JobName.USAGE_DATA_EVENT_CONSUMER});
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ boolean isOk = false;
+ try {
+ tree.getTreeItem(droolsProjectName);
+ isOk = true;
+ } catch (WidgetNotFoundException e) {
+ }
+ assertTrue("Project "
+ + droolsProjectName
+ + " was not created properly.",isOk);
+ }
+
+}
+
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java (rev 0)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java 2010-04-07 15:51:44 UTC (rev 21324)
@@ -0,0 +1,169 @@
+ /*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.drools.ui.bot.test.smoke;
+
+import java.io.File;
+
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.IDELabel.PreferencesDialog;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.junit.Test;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.drools.eclipse.util.DroolsRuntimeManager;
+import org.drools.eclipse.util.DroolsRuntime;
+/**
+ * Test managing of Drools Runtime
+ * @author Vladimir Pakan
+ *
+ */
+public class ManageDroolsRuntime extends SWTTestExt{
+ private String testDroolsRuntimeName = null;
+ private String testDroolsRuntimeLocation = null;
+ /**
+ * Test manage Drools Runtime
+ */
+ @Test
+ public void testManageDroolsRuntime() {
+ addDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME,DroolsAllBotTests.DROOLS_RUNTIME_LOCATION);
+ editDroolsRuntime(testDroolsRuntimeName,testDroolsRuntimeLocation, "edited" , "testedit");
+ removeDroolsRuntime(testDroolsRuntimeName);
+ createDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME,DroolsAllBotTests.DROOLS_RUNTIME_LOCATION);
+ }
+ /**
+ * Adds Drools Runtime
+ * @param runtimeName
+ * @param runtimeLocation
+ */
+ private void addDroolsRuntime(String runtimeName, String runtimeLocation){
+ selectDroolsPreferences();
+ bot.button(IDELabel.Button.ADD).click();
+ bot.shell(IDELabel.Shell.DROOLS_RUNTIME).activate();
+ bot.textWithLabel(IDELabel.DroolsRuntimeDialog.NAME).setText(runtimeName);
+ bot.textWithLabel(IDELabel.DroolsRuntimeDialog.PATH).setText(runtimeLocation);
+ bot.button(IDELabel.Button.OK).click();
+ bot.shell(IDELabel.Shell.PREFERENCES).activate();
+ SWTBotTable table = bot.table();
+ boolean droolsRuntimeAdded =
+ SWTEclipseExt.isItemInTableColumn(table,runtimeName,IDELabel.DroolsRuntimeDialog.COLUMN_NAME_INDEX)
+ && SWTEclipseExt.isItemInTableColumn(table,runtimeLocation,IDELabel.DroolsRuntimeDialog.COLUMN_LOCATION_INDEX);
+ bot.button(IDELabel.Button.OK).click();
+ assertTrue("Drools Runtime with name [" + runtimeName +
+ "] and location [" + runtimeLocation +
+ "] was not added properly.",droolsRuntimeAdded);
+ testDroolsRuntimeName = runtimeName;
+ testDroolsRuntimeLocation = runtimeLocation;
+ }
+ /**
+ * Selects Drools Preferences within Preferences Dialog
+ */
+ private void selectDroolsPreferences(){
+ bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click();
+ bot.shell(IDELabel.Shell.PREFERENCES).activate();
+ SWTBotTreeItem tiDroolsGroup = bot.tree().expandNode(IDELabel.PreferencesDialog.DROOLS_GROUP);
+ tiDroolsGroup.select(PreferencesDialog.INSTALLED_DROOLS_RUNTIMES);
+ }
+ /**
+ * Edits Drools Runtime
+ * @param runtimeName
+ * @param runtimeLocation
+ * @param nameSuffix
+ * @param locationSuffix
+ */
+ private void editDroolsRuntime(String runtimeName, String runtimeLocation, String nameSuffix, String locationSuffix){
+ selectDroolsPreferences();
+ SWTBotTable table = bot.table();
+ table.getTableItem(runtimeName).select();
+ bot.button(IDELabel.Button.EDIT).click();
+ bot.shell(IDELabel.Shell.DROOLS_RUNTIME).activate();
+ SWTBotText txName = bot.textWithLabel(IDELabel.DroolsRuntimeDialog.NAME);
+ SWTBotText txPath = bot.textWithLabel(IDELabel.DroolsRuntimeDialog.PATH);
+ String editedDroolsRuntimeName = txName.getText() + " " + nameSuffix;
+ String editedDroolsRuntimeLocation = txPath.getText() + File.separator + nameSuffix;
+ new File(editedDroolsRuntimeLocation).mkdir();
+ txName.setText(editedDroolsRuntimeName);
+ txPath.setText(editedDroolsRuntimeLocation);
+ bot.button(IDELabel.Button.OK).click();
+ bot.shell(IDELabel.Shell.PREFERENCES).activate();
+ boolean droolsRuntimeEdited =
+ SWTEclipseExt.isItemInTableColumn(table,editedDroolsRuntimeName,IDELabel.DroolsRuntimeDialog.COLUMN_NAME_INDEX)
+ && SWTEclipseExt.isItemInTableColumn(table,editedDroolsRuntimeLocation,IDELabel.DroolsRuntimeDialog.COLUMN_LOCATION_INDEX);
+ bot.button(IDELabel.Button.OK).click();
+ assertTrue("Drools Runtime with name [" + runtimeName +
+ "] and location [" + runtimeLocation +
+ "] was not renamed properly.",droolsRuntimeEdited);
+ testDroolsRuntimeName = editedDroolsRuntimeName;
+ testDroolsRuntimeLocation = editedDroolsRuntimeLocation;
+ }
+
+ /**
+ * Removes Drools Runtime
+ * @param runtimeName
+ * @param runtimeLocation
+ */
+ private void removeDroolsRuntime(String runtimeName){
+ selectDroolsPreferences();
+ SWTBotTable table = bot.table();
+ table.getTableItem(runtimeName).select();
+ bot.button(IDELabel.Button.REMOVE).click();
+ boolean droolsRuntimeRemoved = !SWTEclipseExt.isItemInTableColumn(table,runtimeName,
+ IDELabel.DroolsRuntimeDialog.COLUMN_NAME_INDEX);
+ bot.button(IDELabel.Button.OK).click();
+ assertTrue("Drools Runtime with name [" + runtimeName +
+ "] was not removed properly.",droolsRuntimeRemoved);
+ // Remove temporary directory created within editDroolsRuntime() method
+ if (!testDroolsRuntimeLocation.equals(DroolsAllBotTests.DROOLS_RUNTIME_NAME)){
+ File tempDir = new File (testDroolsRuntimeLocation);
+ if (tempDir.isDirectory()){
+ tempDir.delete();
+ }
+ }
+ testDroolsRuntimeName = null;
+ testDroolsRuntimeLocation = null;
+ }
+ /**
+ * Creates Drools Runtime
+ * @param runtimeName
+ * @param runtimeLocation
+ */
+ private void createDroolsRuntime(String runtimeName, String runtimeLocation){
+ String newDroolsRuntimeLocation = runtimeLocation + File.separator + "drools";
+ new File(newDroolsRuntimeLocation).mkdir();
+ DroolsRuntimeManager.createDefaultRuntime(newDroolsRuntimeLocation);
+ DroolsRuntime droolsRuntime = new DroolsRuntime();
+ droolsRuntime.setName(runtimeName);
+ droolsRuntime.setPath(newDroolsRuntimeLocation);
+ droolsRuntime.setDefault(true);
+ DroolsRuntimeManager.setDroolsRuntimes(new DroolsRuntime[]{droolsRuntime});
+ // Test if Drools runtime is defined
+ assertTrue("Drools Runtime was not properly created on location: " + newDroolsRuntimeLocation,
+ new File (newDroolsRuntimeLocation + File.separator + "drools-api.jar").exists());
+ selectDroolsPreferences();
+ SWTBotTable table = bot.table();
+ boolean droolsRuntimeCreated =
+ SWTEclipseExt.isItemInTableColumn(table,runtimeName,IDELabel.DroolsRuntimeDialog.COLUMN_NAME_INDEX)
+ && SWTEclipseExt.isItemInTableColumn(table,newDroolsRuntimeLocation,IDELabel.DroolsRuntimeDialog.COLUMN_LOCATION_INDEX);
+ bot.button(IDELabel.Button.OK).click();
+ SWTEclipseExt.hideWarningIfDisplayed(bot);
+ assertTrue("Drools Runtime with name [" + runtimeName +
+ "] and location [" + newDroolsRuntimeLocation +
+ "] was not created properly.",droolsRuntimeCreated);
+ testDroolsRuntimeName = runtimeName;
+ testDroolsRuntimeLocation = newDroolsRuntimeLocation;
+
+ }
+
+}
+
Property changes on: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss Tools SVN: r21323 - in branches/modular_build/modeshape/releng: maps and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-07 11:51:28 -0400 (Wed, 07 Apr 2010)
New Revision: 21323
Modified:
branches/modular_build/modeshape/releng/build.properties
branches/modular_build/modeshape/releng/maps/project.map
branches/modular_build/modeshape/releng/maps/test.common.map
branches/modular_build/modeshape/releng/psfs/project.subclipse.psf
branches/modular_build/modeshape/releng/psfs/project.subversive.psf
branches/modular_build/modeshape/releng/psfs/test.common.subclipse.psf
branches/modular_build/modeshape/releng/psfs/test.common.subversive.psf
Log:
switch to modular_build branch
Modified: branches/modular_build/modeshape/releng/build.properties
===================================================================
--- branches/modular_build/modeshape/releng/build.properties 2010-04-07 15:48:13 UTC (rev 21322)
+++ branches/modular_build/modeshape/releng/build.properties 2010-04-07 15:51:28 UTC (rev 21323)
@@ -14,7 +14,7 @@
# to (re)generate map and psfs, use these settings
#build.steps=dir2svnmap,map2psf
#dir2map.reporoot = http://anonsvn.jboss.org/repos
-#dir2map.repopath = jbosstools/trunk/modeshape
+#dir2map.repopath = jbosstools/branches/modular_build/modeshape
#dir2map.dir = /home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/modeshape
#dir2map.map = /home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/modeshape/releng/maps/project.map
Modified: branches/modular_build/modeshape/releng/maps/project.map
===================================================================
--- branches/modular_build/modeshape/releng/maps/project.map 2010-04-07 15:48:13 UTC (rev 21322)
+++ branches/modular_build/modeshape/releng/maps/project.map 2010-04-07 15:51:28 UTC (rev 21323)
@@ -1,5 +1,5 @@
!*** Generated with org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml#dir2svnmap task
-feature@org.jboss.tools.modeshape.rest.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/modeshape/features/org.jboss.tools.modeshape.rest.feature
-feature@org.jboss.tools.modeshape.rest.test.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/modeshape/features/org.jboss.tools.modeshape.rest.test.feature
-plugin@org.jboss.tools.modeshape.rest=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/modeshape/plugins/org.jboss.tools.modeshape.rest
-plugin@org.jboss.tools.modeshape.rest.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test
+feature@org.jboss.tools.modeshape.rest.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.feature
+feature@org.jboss.tools.modeshape.rest.test.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.feature
+plugin@org.jboss.tools.modeshape.rest=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/branches/modular_build/modeshape/plugins/org.jboss.tools.modeshape.rest
+plugin@org.jboss.tools.modeshape.rest.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/branches/modular_build/modeshape/tests/org.jboss.tools.modeshape.rest.test
Modified: branches/modular_build/modeshape/releng/maps/test.common.map
===================================================================
--- branches/modular_build/modeshape/releng/maps/test.common.map 2010-04-07 15:48:13 UTC (rev 21322)
+++ branches/modular_build/modeshape/releng/maps/test.common.map 2010-04-07 15:51:28 UTC (rev 21323)
@@ -1,5 +1,5 @@
!*** required to run tests
-plugin@org.jboss.tools.common=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/common/plugins/org.jboss.tools.common
-plugin@org.jboss.tools.common.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/common/tests/org.jboss.tools.common.test
+plugin@org.jboss.tools.common=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/branches/modular_build/common/plugins/org.jboss.tools.common
+plugin@org.jboss.tools.common.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/branches/modular_build/common/tests/org.jboss.tools.common.test
-plugin@org.jboss.tools.tests=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/tests/tests/org.jboss.tools.tests
+plugin@org.jboss.tools.tests=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/branches/modular_build/tests/tests/org.jboss.tools.tests
Modified: branches/modular_build/modeshape/releng/psfs/project.subclipse.psf
===================================================================
--- branches/modular_build/modeshape/releng/psfs/project.subclipse.psf 2010-04-07 15:48:13 UTC (rev 21322)
+++ branches/modular_build/modeshape/releng/psfs/project.subclipse.psf 2010-04-07 15:51:28 UTC (rev 21323)
@@ -3,10 +3,10 @@
<provider id="org.tigris.subversion.subclipse.core.svnnature">
<!-- !*** Generated with org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml#dir2svnmap task -->
- <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/trunk/modeshape/features/..."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/trunk/modeshape/features/..."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/trunk/modeshape/plugins/o..."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/trunk/modeshape/tests/org..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/mo..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/mo..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/mo..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/mo..."/>
</provider>
</psf>
Modified: branches/modular_build/modeshape/releng/psfs/project.subversive.psf
===================================================================
--- branches/modular_build/modeshape/releng/psfs/project.subversive.psf 2010-04-07 15:48:13 UTC (rev 21322)
+++ branches/modular_build/modeshape/releng/psfs/project.subversive.psf 2010-04-07 15:51:28 UTC (rev 21323)
@@ -3,10 +3,10 @@
<provider id="org.eclipse.team.svn.core.svnnature">
<!-- !*** Generated with org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml#dir2svnmap task -->
- <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/trunk/modeshape/features/..."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/trunk/modeshape/features/..."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/trunk/modeshape/plugins/o..."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/trunk/modeshape/tests/org..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/mo..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/mo..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/mo..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/mo..."/>
</provider>
</psf>
Modified: branches/modular_build/modeshape/releng/psfs/test.common.subclipse.psf
===================================================================
--- branches/modular_build/modeshape/releng/psfs/test.common.subclipse.psf 2010-04-07 15:48:13 UTC (rev 21322)
+++ branches/modular_build/modeshape/releng/psfs/test.common.subclipse.psf 2010-04-07 15:51:28 UTC (rev 21323)
@@ -3,10 +3,10 @@
<provider id="org.tigris.subversion.subclipse.core.svnnature">
<!-- !*** required to run tests -->
- <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/trunk/common/plugins/org...."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/trunk/common/tests/org.jb..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/co..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/co..."/>
- <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/trunk/tests/tests/org.jbo..."/>
+ <project reference="0.9.3,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/te..."/>
</provider>
</psf>
Modified: branches/modular_build/modeshape/releng/psfs/test.common.subversive.psf
===================================================================
--- branches/modular_build/modeshape/releng/psfs/test.common.subversive.psf 2010-04-07 15:48:13 UTC (rev 21322)
+++ branches/modular_build/modeshape/releng/psfs/test.common.subversive.psf 2010-04-07 15:51:28 UTC (rev 21323)
@@ -3,10 +3,10 @@
<provider id="org.eclipse.team.svn.core.svnnature">
<!-- !*** required to run tests -->
- <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/trunk/common/plugins/org...."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/trunk/common/tests/org.jb..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/co..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/co..."/>
- <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/trunk/tests/tests/org.jbo..."/>
+ <project reference="1.0.1,http://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/te..."/>
</provider>
</psf>
14 years, 9 months
JBoss Tools SVN: r21322 - branches/modular_build/modeshape/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-07 11:48:13 -0400 (Wed, 07 Apr 2010)
New Revision: 21322
Modified:
branches/modular_build/modeshape/releng/build.properties
Log:
split tests into core feature and Athena-friendly SDK feature (includes o.e.test and other reqs)
Modified: branches/modular_build/modeshape/releng/build.properties
===================================================================
--- branches/modular_build/modeshape/releng/build.properties 2010-04-07 15:47:59 UTC (rev 21321)
+++ branches/modular_build/modeshape/releng/build.properties 2010-04-07 15:48:13 UTC (rev 21322)
@@ -9,7 +9,7 @@
#TODO: create mainFeatureToBuildID=org.jboss.tools.modeshape.rest.sdk.feature
mainFeatureToBuildID=org.jboss.tools.modeshape.rest.feature
-testFeatureToBuildID=org.jboss.tools.modeshape.rest.test.feature
+testFeatureToBuildID=org.jboss.tools.modeshape.rest.test.sdk.feature
# to (re)generate map and psfs, use these settings
#build.steps=dir2svnmap,map2psf
14 years, 9 months
JBoss Tools SVN: r21321 - in branches/modular_build/modeshape/features: org.jboss.tools.modeshape.rest.test.feature and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-07 11:47:59 -0400 (Wed, 07 Apr 2010)
New Revision: 21321
Added:
branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/
branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/.project
branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/build.properties
branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml
Modified:
branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.feature/feature.xml
Log:
split tests into core feature and Athena-friendly SDK feature (includes o.e.test and other reqs)
Modified: branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.feature/feature.xml
===================================================================
--- branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.feature/feature.xml 2010-04-07 15:45:00 UTC (rev 21320)
+++ branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.feature/feature.xml 2010-04-07 15:47:59 UTC (rev 21321)
@@ -3,7 +3,7 @@
id="org.jboss.tools.modeshape.rest.test.feature"
label="ModeShape Tests Feature"
version="1.0.0"
- provider-name="JBoss by RedHat">
+ provider-name="JBoss by Red Hat">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
@@ -24,17 +24,4 @@
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.eclipse.ant.optional.junit"
- download-size="0"
- install-size="0"
- version="0.0.0"
- fragment="true"/>
-
- <plugin
- id="org.eclipse.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
</feature>
Added: branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/.project
===================================================================
--- branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/.project (rev 0)
+++ branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/.project 2010-04-07 15:47:59 UTC (rev 21321)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.modeshape.rest.test.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Property changes on: branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/build.properties
===================================================================
--- branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/build.properties (rev 0)
+++ branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/build.properties 2010-04-07 15:47:59 UTC (rev 21321)
@@ -0,0 +1 @@
+bin.includes = feature.xml
Property changes on: branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml
===================================================================
--- branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml (rev 0)
+++ branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml 2010-04-07 15:47:59 UTC (rev 21321)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.modeshape.rest.test.feature"
+ label="ModeShape Tests SDK Feature"
+ version="1.0.0"
+ provider-name="JBoss by Red Hat">
+
+ <description url="http://www.example.com/description">
+ [Enter Feature Description here.]
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <includes
+ id="org.jboss.tools.modeshapre.rest.test.feature"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.ant.optional.junit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"/>
+
+ <plugin
+ id="org.eclipse.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
Property changes on: branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss Tools SVN: r21320 - trunk/drools/tests.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-04-07 11:45:00 -0400 (Wed, 07 Apr 2010)
New Revision: 21320
Added:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/
Log:
Initial version of Drools SWTBot Tests
14 years, 9 months
JBoss Tools SVN: r21319 - trunk/drools/tests.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-04-07 11:42:36 -0400 (Wed, 07 Apr 2010)
New Revision: 21319
Removed:
trunk/drools/tests/.classpath
trunk/drools/tests/.project
trunk/drools/tests/.settings/
trunk/drools/tests/META-INF/
trunk/drools/tests/build.properties
trunk/drools/tests/screenshots/
trunk/drools/tests/src/
Log:
Commited to wrong place
Deleted: trunk/drools/tests/.classpath
===================================================================
--- trunk/drools/tests/.classpath 2010-04-07 15:39:40 UTC (rev 21318)
+++ trunk/drools/tests/.classpath 2010-04-07 15:42:36 UTC (rev 21319)
@@ -1,8 +0,0 @@
-<?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.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="resources"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
Deleted: trunk/drools/tests/.project
===================================================================
--- trunk/drools/tests/.project 2010-04-07 15:39:40 UTC (rev 21318)
+++ trunk/drools/tests/.project 2010-04-07 15:42:36 UTC (rev 21319)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.jboss.tools.drools.ui.bot.test</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
Deleted: trunk/drools/tests/build.properties
===================================================================
--- trunk/drools/tests/build.properties 2010-04-07 15:39:40 UTC (rev 21318)
+++ trunk/drools/tests/build.properties 2010-04-07 15:42:36 UTC (rev 21319)
@@ -1,4 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
14 years, 9 months
JBoss Tools SVN: r21318 - in trunk/drools/tests: .settings and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-04-07 11:39:40 -0400 (Wed, 07 Apr 2010)
New Revision: 21318
Added:
trunk/drools/tests/.classpath
trunk/drools/tests/.project
trunk/drools/tests/.settings/
trunk/drools/tests/.settings/org.eclipse.jdt.core.prefs
trunk/drools/tests/META-INF/
trunk/drools/tests/META-INF/MANIFEST.MF
trunk/drools/tests/build.properties
trunk/drools/tests/screenshots/
trunk/drools/tests/screenshots/screenshot-ManageDroolsProject.testManageDroolsProject.jpeg
trunk/drools/tests/screenshots/screenshot-ManageDroolsRuntime.testManageDroolsRuntime.jpeg
trunk/drools/tests/src/
trunk/drools/tests/src/org/
trunk/drools/tests/src/org/jboss/
trunk/drools/tests/src/org/jboss/tools/
trunk/drools/tests/src/org/jboss/tools/drools/
trunk/drools/tests/src/org/jboss/tools/drools/ui/
trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/
trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/
trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/Activator.java
trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/
trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java
Log:
Initial version of Drools SWTBot Tests
Added: trunk/drools/tests/.classpath
===================================================================
--- trunk/drools/tests/.classpath (rev 0)
+++ trunk/drools/tests/.classpath 2010-04-07 15:39:40 UTC (rev 21318)
@@ -0,0 +1,8 @@
+<?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.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/drools/tests/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/.project
===================================================================
--- trunk/drools/tests/.project (rev 0)
+++ trunk/drools/tests/.project 2010-04-07 15:39:40 UTC (rev 21318)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.drools.ui.bot.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/drools/tests/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/drools/tests/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/drools/tests/.settings/org.eclipse.jdt.core.prefs 2010-04-07 15:39:40 UTC (rev 21318)
@@ -0,0 +1,8 @@
+#Tue Apr 06 13:22:27 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/drools/tests/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/drools/tests/META-INF/MANIFEST.MF (rev 0)
+++ trunk/drools/tests/META-INF/MANIFEST.MF 2010-04-07 15:39:40 UTC (rev 21318)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Drools UI SWTBot Tests
+Bundle-SymbolicName: org.jboss.tools.drools.ui.bot.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.drools.ui.bot.test.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.jst.ui.bot.test;bundle-version="1.0.0",
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.spy;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.0",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
+ org.junit4;bundle-version="4.5.0",
+ org.jboss.tools.ui.bot.ext;bundle-version="1.0.0",
+ org.drools.eclipse;bundle-version="5.1.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: JBoss by Red Hat
Property changes on: trunk/drools/tests/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/build.properties
===================================================================
--- trunk/drools/tests/build.properties (rev 0)
+++ trunk/drools/tests/build.properties 2010-04-07 15:39:40 UTC (rev 21318)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Property changes on: trunk/drools/tests/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/screenshots/screenshot-ManageDroolsProject.testManageDroolsProject.jpeg
===================================================================
(Binary files differ)
Property changes on: trunk/drools/tests/screenshots/screenshot-ManageDroolsProject.testManageDroolsProject.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/tests/screenshots/screenshot-ManageDroolsRuntime.testManageDroolsRuntime.jpeg
===================================================================
(Binary files differ)
Property changes on: trunk/drools/tests/screenshots/screenshot-ManageDroolsRuntime.testManageDroolsRuntime.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/Activator.java
===================================================================
--- trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/Activator.java (rev 0)
+++ trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/Activator.java 2010-04-07 15:39:40 UTC (rev 21318)
@@ -0,0 +1,50 @@
+package org.jboss.tools.drools.ui.bot.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.drools.ui.bot.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Property changes on: trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/Activator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
===================================================================
--- trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java (rev 0)
+++ trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java 2010-04-07 15:39:40 UTC (rev 21318)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.drools.ui.bot.test;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsRuntime;
+import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsProject;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ *
+ * This is struts swtbot testcase for JBoss Tools.
+ *
+ * @author Vladimir Pakan
+ *
+ */
+(a)RunWith(Suite.class)
+(a)SuiteClasses({ManageDroolsRuntime.class,
+ ManageDroolsProject.class})
+public class DroolsAllBotTests extends SWTTestExt {
+ public static final String DROOLS_PROJECT_NAME = "droolsTest";
+ public static final String DROOLS_RUNTIME_NAME = "Drools Test Runtime";
+ public static String DROOLS_RUNTIME_LOCATION = null;
+ @BeforeClass
+ public static void setUpTest() {
+ DROOLS_RUNTIME_LOCATION = System.getProperty("java.io.tmpdir");
+ properties = util.loadProperties(Activator.PLUGIN_ID);
+ try{
+ SWTBotView welcomeView = eclipse.getBot().viewByTitle(IDELabel.View.WELCOME);
+ welcomeView.close();
+ } catch (WidgetNotFoundException wnfe){
+ // Do nothing ignore this error
+ }
+
+ }
+
+ @AfterClass
+ public static void tearDownTest() {
+ // Ready for later usage
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
===================================================================
--- trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java (rev 0)
+++ trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java 2010-04-07 15:39:40 UTC (rev 21318)
@@ -0,0 +1,78 @@
+ /*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.drools.ui.bot.test.smoke;
+
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.EntityType;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.JobName;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
+import org.jboss.tools.ui.bot.test.WidgetVariables;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.junit.Test;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+/**
+ * Test managing of Drools Project
+ * @author Vladimir Pakan
+ *
+ */
+public class ManageDroolsProject extends SWTTestExt{
+ /**
+ * Test manage Drools project
+ */
+ @Test
+ public void testManageDroolsProject() {
+ createDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
+ }
+
+ private void createDroolsProject(String droolsProjectName){
+ eclipse.showView(ViewType.PACKAGE_EXPLORER);
+ eclipse.createNew(EntityType.DROOLS_PROJECT);
+ bot.textWithLabel(IDELabel.NewDroolsProjectDialog.NAME).setText(droolsProjectName);
+ bot.button(IDELabel.Button.NEXT).click();
+ // check all buttons
+ int index = 0;
+ boolean checkBoxExists = true;
+ while (checkBoxExists){
+ try{
+ SWTBotCheckBox checkBox = bot.checkBox(index);
+ if (!checkBox.isChecked()){
+ checkBox.click();
+ }
+ index++;
+ }catch (WidgetNotFoundException wnfe){
+ checkBoxExists = false;
+ }catch (IndexOutOfBoundsException ioobe){
+ checkBoxExists = false;
+ }
+ }
+ bot.button(IDELabel.Button.NEXT).click();
+ bot.button(IDELabel.Button.FINISH).click();
+ SWTTestExt.util.waitForAllExcept(100*1000L, new String[]{JobName.USAGE_DATA_EVENT_CONSUMER});
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ boolean isOk = false;
+ try {
+ tree.getTreeItem(droolsProjectName);
+ isOk = true;
+ } catch (WidgetNotFoundException e) {
+ }
+ assertTrue("Project "
+ + droolsProjectName
+ + " was not created properly.",isOk);
+ }
+
+}
+
Property changes on: trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java
===================================================================
--- trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java (rev 0)
+++ trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java 2010-04-07 15:39:40 UTC (rev 21318)
@@ -0,0 +1,169 @@
+ /*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.drools.ui.bot.test.smoke;
+
+import java.io.File;
+
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.IDELabel.PreferencesDialog;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.junit.Test;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.drools.eclipse.util.DroolsRuntimeManager;
+import org.drools.eclipse.util.DroolsRuntime;
+/**
+ * Test managing of Drools Runtime
+ * @author Vladimir Pakan
+ *
+ */
+public class ManageDroolsRuntime extends SWTTestExt{
+ private String testDroolsRuntimeName = null;
+ private String testDroolsRuntimeLocation = null;
+ /**
+ * Test manage Drools Runtime
+ */
+ @Test
+ public void testManageDroolsRuntime() {
+ addDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME,DroolsAllBotTests.DROOLS_RUNTIME_LOCATION);
+ editDroolsRuntime(testDroolsRuntimeName,testDroolsRuntimeLocation, "edited" , "testedit");
+ removeDroolsRuntime(testDroolsRuntimeName);
+ createDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME,DroolsAllBotTests.DROOLS_RUNTIME_LOCATION);
+ }
+ /**
+ * Adds Drools Runtime
+ * @param runtimeName
+ * @param runtimeLocation
+ */
+ private void addDroolsRuntime(String runtimeName, String runtimeLocation){
+ selectDroolsPreferences();
+ bot.button(IDELabel.Button.ADD).click();
+ bot.shell(IDELabel.Shell.DROOLS_RUNTIME).activate();
+ bot.textWithLabel(IDELabel.DroolsRuntimeDialog.NAME).setText(runtimeName);
+ bot.textWithLabel(IDELabel.DroolsRuntimeDialog.PATH).setText(runtimeLocation);
+ bot.button(IDELabel.Button.OK).click();
+ bot.shell(IDELabel.Shell.PREFERENCES).activate();
+ SWTBotTable table = bot.table();
+ boolean droolsRuntimeAdded =
+ SWTEclipseExt.isItemInTableColumn(table,runtimeName,IDELabel.DroolsRuntimeDialog.COLUMN_NAME_INDEX)
+ && SWTEclipseExt.isItemInTableColumn(table,runtimeLocation,IDELabel.DroolsRuntimeDialog.COLUMN_LOCATION_INDEX);
+ bot.button(IDELabel.Button.OK).click();
+ assertTrue("Drools Runtime with name [" + runtimeName +
+ "] and location [" + runtimeLocation +
+ "] was not added properly.",droolsRuntimeAdded);
+ testDroolsRuntimeName = runtimeName;
+ testDroolsRuntimeLocation = runtimeLocation;
+ }
+ /**
+ * Selects Drools Preferences within Preferences Dialog
+ */
+ private void selectDroolsPreferences(){
+ bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click();
+ bot.shell(IDELabel.Shell.PREFERENCES).activate();
+ SWTBotTreeItem tiDroolsGroup = bot.tree().expandNode(IDELabel.PreferencesDialog.DROOLS_GROUP);
+ tiDroolsGroup.select(PreferencesDialog.INSTALLED_DROOLS_RUNTIMES);
+ }
+ /**
+ * Edits Drools Runtime
+ * @param runtimeName
+ * @param runtimeLocation
+ * @param nameSuffix
+ * @param locationSuffix
+ */
+ private void editDroolsRuntime(String runtimeName, String runtimeLocation, String nameSuffix, String locationSuffix){
+ selectDroolsPreferences();
+ SWTBotTable table = bot.table();
+ table.getTableItem(runtimeName).select();
+ bot.button(IDELabel.Button.EDIT).click();
+ bot.shell(IDELabel.Shell.DROOLS_RUNTIME).activate();
+ SWTBotText txName = bot.textWithLabel(IDELabel.DroolsRuntimeDialog.NAME);
+ SWTBotText txPath = bot.textWithLabel(IDELabel.DroolsRuntimeDialog.PATH);
+ String editedDroolsRuntimeName = txName.getText() + " " + nameSuffix;
+ String editedDroolsRuntimeLocation = txPath.getText() + File.separator + nameSuffix;
+ new File(editedDroolsRuntimeLocation).mkdir();
+ txName.setText(editedDroolsRuntimeName);
+ txPath.setText(editedDroolsRuntimeLocation);
+ bot.button(IDELabel.Button.OK).click();
+ bot.shell(IDELabel.Shell.PREFERENCES).activate();
+ boolean droolsRuntimeEdited =
+ SWTEclipseExt.isItemInTableColumn(table,editedDroolsRuntimeName,IDELabel.DroolsRuntimeDialog.COLUMN_NAME_INDEX)
+ && SWTEclipseExt.isItemInTableColumn(table,editedDroolsRuntimeLocation,IDELabel.DroolsRuntimeDialog.COLUMN_LOCATION_INDEX);
+ bot.button(IDELabel.Button.OK).click();
+ assertTrue("Drools Runtime with name [" + runtimeName +
+ "] and location [" + runtimeLocation +
+ "] was not renamed properly.",droolsRuntimeEdited);
+ testDroolsRuntimeName = editedDroolsRuntimeName;
+ testDroolsRuntimeLocation = editedDroolsRuntimeLocation;
+ }
+
+ /**
+ * Removes Drools Runtime
+ * @param runtimeName
+ * @param runtimeLocation
+ */
+ private void removeDroolsRuntime(String runtimeName){
+ selectDroolsPreferences();
+ SWTBotTable table = bot.table();
+ table.getTableItem(runtimeName).select();
+ bot.button(IDELabel.Button.REMOVE).click();
+ boolean droolsRuntimeRemoved = !SWTEclipseExt.isItemInTableColumn(table,runtimeName,
+ IDELabel.DroolsRuntimeDialog.COLUMN_NAME_INDEX);
+ bot.button(IDELabel.Button.OK).click();
+ assertTrue("Drools Runtime with name [" + runtimeName +
+ "] was not removed properly.",droolsRuntimeRemoved);
+ // Remove temporary directory created within editDroolsRuntime() method
+ if (!testDroolsRuntimeLocation.equals(DroolsAllBotTests.DROOLS_RUNTIME_NAME)){
+ File tempDir = new File (testDroolsRuntimeLocation);
+ if (tempDir.isDirectory()){
+ tempDir.delete();
+ }
+ }
+ testDroolsRuntimeName = null;
+ testDroolsRuntimeLocation = null;
+ }
+ /**
+ * Creates Drools Runtime
+ * @param runtimeName
+ * @param runtimeLocation
+ */
+ private void createDroolsRuntime(String runtimeName, String runtimeLocation){
+ String newDroolsRuntimeLocation = runtimeLocation + File.separator + "drools";
+ new File(newDroolsRuntimeLocation).mkdir();
+ DroolsRuntimeManager.createDefaultRuntime(newDroolsRuntimeLocation);
+ DroolsRuntime droolsRuntime = new DroolsRuntime();
+ droolsRuntime.setName(runtimeName);
+ droolsRuntime.setPath(newDroolsRuntimeLocation);
+ droolsRuntime.setDefault(true);
+ DroolsRuntimeManager.setDroolsRuntimes(new DroolsRuntime[]{droolsRuntime});
+ // Test if Drools runtime is defined
+ assertTrue("Drools Runtime was not properly created on location: " + newDroolsRuntimeLocation,
+ new File (newDroolsRuntimeLocation + File.separator + "drools-api.jar").exists());
+ selectDroolsPreferences();
+ SWTBotTable table = bot.table();
+ boolean droolsRuntimeCreated =
+ SWTEclipseExt.isItemInTableColumn(table,runtimeName,IDELabel.DroolsRuntimeDialog.COLUMN_NAME_INDEX)
+ && SWTEclipseExt.isItemInTableColumn(table,newDroolsRuntimeLocation,IDELabel.DroolsRuntimeDialog.COLUMN_LOCATION_INDEX);
+ bot.button(IDELabel.Button.OK).click();
+ SWTEclipseExt.hideWarningIfDisplayed(bot);
+ assertTrue("Drools Runtime with name [" + runtimeName +
+ "] and location [" + newDroolsRuntimeLocation +
+ "] was not created properly.",droolsRuntimeCreated);
+ testDroolsRuntimeName = runtimeName;
+ testDroolsRuntimeLocation = newDroolsRuntimeLocation;
+
+ }
+
+}
+
Property changes on: trunk/drools/tests/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss Tools SVN: r21317 - trunk/drools.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-04-07 11:33:26 -0400 (Wed, 07 Apr 2010)
New Revision: 21317
Added:
trunk/drools/tests/
Log:
Folder for Drools Tests
14 years, 9 months
JBoss Tools SVN: r21316 - in trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext: types and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-04-07 11:28:05 -0400 (Wed, 07 Apr 2010)
New Revision: 21316
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Added constants for Drools SWTBot tests and new methods.
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2010-04-07 15:22:49 UTC (rev 21315)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2010-04-07 15:28:05 UTC (rev 21316)
@@ -11,7 +11,6 @@
package org.jboss.tools.ui.bot.ext;
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.List;
@@ -50,7 +49,7 @@
@Override
public SWTBotMenu menu(String text) {
- log.info("Menu \"" + text + "\" secleted");
+ log.info("Menu \"" + text + "\" selected");
return super.menu(text);
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-04-07 15:22:49 UTC (rev 21315)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-04-07 15:28:05 UTC (rev 21316)
@@ -523,5 +523,44 @@
boolean pressContinueButton) {
closeWarningWindowIfOpened(bot, pressContinueButton);
}
+ /**
+ * Returns true if table column specified by column parameter contains item
+ * @param table
+ * @param item
+ * @param column
+ * @return
+ */
+ public static boolean isItemInTableColumn (SWTBotTable table , String item, int column){
+ boolean found = false;
+
+ int rowIndex = 0;
+ while (!found && rowIndex < table.rowCount()){
+ if (table.cell(rowIndex, column).trim().equals(item.trim())){
+ found = true;
+ }
+ else{
+ rowIndex++;
+ }
+ }
+ return found;
+ }
+
+ /**
+ * Hide Warning Message if displayed static version
+ */
+ public static void hideWarningIfDisplayed(SWTBotExt bot) {
+ try {
+ bot.shell(IDELabel.Shell.WARNING).activate();
+ bot.button(IDELabel.Button.OK).click();
+ } catch (WidgetNotFoundException wnfe) {
+ // do nothing
+ }
+ }
+ /**
+ * Hide Warning Message if displayed
+ */
+ public void hideWarningIfDisplayed() {
+ SWTEclipseExt.hideWarningIfDisplayed(bot);
+ }
-}
+}
\ No newline at end of file
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2010-04-07 15:22:49 UTC (rev 21315)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/EntityType.java 2010-04-07 15:28:05 UTC (rev 21316)
@@ -21,7 +21,7 @@
*/
public enum EntityType {
HIBERNATE_MAPPING_FILE, JAVA_PROJECT, JAVA_CLASS, HIBERNATE_REVERSE_FILE, HIBERNATE_CONSOLE,
- HIBERNATE_CONFIGURATION_FILE, STRUTS_PROJECT, JPA_PROJECT;
+ HIBERNATE_CONFIGURATION_FILE, STRUTS_PROJECT, JPA_PROJECT, DROOLS_PROJECT;
public List<String> getGroupsLabels() {
List<String> groupLabel = new LinkedList<String>();
@@ -35,6 +35,7 @@
case HIBERNATE_CONSOLE: groupLabel.add(IDELabel.EntityGroup.HIBERNATE); break;
case STRUTS_PROJECT: groupLabel.add(IDELabel.EntityGroup.JBOSS_TOOLS_WEB); groupLabel.add(IDELabel.EntityGroup.STRUTS);break;
case JPA_PROJECT: groupLabel.add(IDELabel.EntityGroup.JPA);break;
+ case DROOLS_PROJECT: groupLabel.add(IDELabel.EntityGroup.DROOLS);break;
default: fail("Unknown Entity Type");
}
@@ -57,6 +58,7 @@
case JAVA_CLASS: entityLabel = IDELabel.EntityLabel.JAVA_CLASS; break;
case STRUTS_PROJECT: entityLabel = IDELabel.EntityLabel.STRUTS_PROJECT; break;
case JPA_PROJECT: entityLabel = IDELabel.EntityLabel.JPA_PROJECT; break;
+ case DROOLS_PROJECT: entityLabel = IDELabel.EntityLabel.DROOLS_PROJECT; break;
default: fail("Unknown Entity Type");
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-04-07 15:22:49 UTC (rev 21315)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-04-07 15:28:05 UTC (rev 21316)
@@ -78,6 +78,8 @@
public static final String ADD = "Add...";
public static final String NEW = "New...";
public static final String CONTINUE = "Continue";
+ public static final String REMOVE = "Remove";
+ public static final String EDIT = "Edit...";
}
public class Shell {
@@ -106,6 +108,8 @@
public static final String NEW_SERVER = "New Server";
public static final String RUN_ON_SERVER = "Run On Server";
public static final String WARNING = "Warning";
+ public static final String DROOLS_RUNTIME = "Drools Runtime";
+ public static final String NEW_DROOLS_PROJECT = "";
}
public class EntityGroup {
@@ -115,6 +119,7 @@
public static final String STRUTS = "Struts";
public static final String JBOSS_TOOLS_WEB = "JBoss Tools Web";
public static final String JPA = "JPA";
+ public static final String DROOLS = "Drools";
}
public class EntityLabel {
@@ -127,6 +132,7 @@
public static final String HIBERNATE_CONFIGURATION_FILE = "Hibernate Configuration File (cfg.xml)";
public static final String STRUTS_PROJECT = "Struts Project";
public static final String JPA_PROJECT = "JPA Project";
+ public static final String DROOLS_PROJECT = "Drools Project";
}
public class JavaProjectWizard {
@@ -293,6 +299,8 @@
public static final String SERVER_GROUP = "Server";
public static final String RUNTIME_ENVIRONMENTS = "Runtime Environments";
+ public static final String DROOLS_GROUP = "Drools";
+ public static final String INSTALLED_DROOLS_RUNTIMES = "Installed Drools Runtimes";
}
@@ -320,4 +328,17 @@
public static final String JBOSS_EAP_5_0 = "JBoss Enterprise Application Platform 5.0";
}
+ public static final class DroolsRuntimeDialog {
+
+ public static final String NAME = "Name: ";
+ public static final String PATH = "Path: ";
+ public static final int COLUMN_NAME_INDEX = 0;
+ public static final int COLUMN_LOCATION_INDEX = 1;
+
+ }
+ public static final class NewDroolsProjectDialog {
+
+ public static final String NAME = "Project name:";
+
+ }
}
14 years, 9 months