JBoss Tools SVN: r33545 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-08-03 10:07:06 -0400 (Wed, 03 Aug 2011)
New Revision: 33545
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
Log:
swtbotext: load property configurations from given dir
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2011-08-03 13:39:14 UTC (rev 33544)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2011-08-03 14:07:06 UTC (rev 33545)
@@ -1,6 +1,7 @@
package org.jboss.tools.ui.bot.ext.config;
import java.io.File;
+import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
@@ -22,9 +23,21 @@
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
import org.jboss.tools.ui.bot.ext.config.requirement.RequirementBase;
+/**
+ * This class is main one for holding all possible configurations to run tests on. For every test class
+ * it's annotations are read and it is decided whether class is planned or not for given {@link TestConfiguration}
+ *
+ * @author lzoubek(a)redhat.com
+ */
public class TestConfigurator {
private static final Logger log = Logger.getLogger(TestConfigurator.class);
public static final String RUNTIME_URL_SUFFIX="_URL";
+ /**
+ * property keys which are handled in configuration files
+ *
+ * @author lzoubek
+ *
+ */
public class Keys {
public static final String SERVER = "SERVER";
public static final String SEAM = "SEAM";
@@ -35,7 +48,11 @@
public static final String RS = "RS";
public static final String SS = "SS";
}
-
+ /**
+ * constant property values which are handled in configuration files
+ * @author lzoubek
+ *
+ */
public class Values {
public static final String SERVER_TYPE_EPP = "EPP";
public static final String SERVER_TYPE_EAP = "EAP";
@@ -43,9 +60,14 @@
public static final String SERVER_TYPE_JBOSSAS = "JBOSS_AS";
public static final String SERVER_WITH_DEFAULT_JAVA = "default";
}
-
+ /**
+ * directory which may contain .properties files to load configurations from
+ */
+ public static final String CONFIGURATIONS_DIR="test.configurations.dir";
+ /**
+ * path to property file which contains either 1 configuration or properties [config name]=[abs path to config property file]
+ */
public static final String SWTBOT_TEST_PROPERTIES_FILE = "swtbot.test.properties.file";
- public static final String SWTBOT_TEST_PROPERTIES_MULTI_FILE = "swtbot.test.properties.multi.file";
public static Properties multiProperties = new Properties();
public static TestConfiguration currentConfig;
static {
@@ -55,23 +77,33 @@
// try to load from file first
String propFile = System.getProperty(SWTBOT_TEST_PROPERTIES_FILE,
null);
- String propMultiFile = System.getProperty(
- SWTBOT_TEST_PROPERTIES_MULTI_FILE, null);
- if (propMultiFile != null) {
- if (new File(propMultiFile).exists()) {
- log.info("Loading exeternaly provided multi-configuration file '"
- + propMultiFile + "'");
- log.warn("Property name '"
- + SWTBOT_TEST_PROPERTIES_MULTI_FILE
- + "' is deprecated and will be removed soon, use '"
- + SWTBOT_TEST_PROPERTIES_FILE
- + "' property instead, file type is now auto-detected by content.");
- multiProperties.load(new FileInputStream(propMultiFile));
+ String configsDir=System.getProperty(CONFIGURATIONS_DIR,null);
+ File configsDirFile=new File(configsDir);
+ if (configsDir != null) {
+ if (!configsDirFile.exists()) {
+ throw new IOException(CONFIGURATIONS_DIR
+ + " " + configsDir + " does not exist!");
+ }
+ if (!configsDirFile.isDirectory()) {
+ throw new IOException(CONFIGURATIONS_DIR
+ + " " + configsDir + " must be a directory");
+ }
+ else {
+ log.info("Loading property config-files from '"
+ + configsDir + "'");
+ File[] propFiles = configsDirFile.listFiles(new FileFilter(){
+
+ @Override
+ public boolean accept(File name) {
+ return name.getName().endsWith(".properties");
+ }});
+ for (File file : propFiles)
+ {
+ log.info("Adding configuration file "+file.getName());
+ multiProperties.put(file.getName().replace(".properties", ""), file.getAbsolutePath());
+ }
loadDefault = false;
- } else {
- throw new IOException(SWTBOT_TEST_PROPERTIES_MULTI_FILE
- + " " + propMultiFile + " does not exist!");
- }
+ }
} else if (propFile != null) {
if (new File(propFile).exists()) {
log.info("Loading exeternaly configuration file '"
@@ -273,8 +305,9 @@
/**
* returns list of requirements if given class (Test) can run, all this is
- * done by exploring class'es annotations (see {@link SWTBotTestRequires} if
- * class cannot run returns null
+ * done by exploring class'es annotations (see {@link SWTBotTestRequires}) and check against
+ * current configuration
+ * if given class does not meet {@link TestConfigurator#currentConfig} method returns null
*/
public static List<RequirementBase> getClassRequirements(Class<?> klass) {
13 years, 5 months
JBoss Tools SVN: r33544 - in trunk/maven: plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators and 18 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-08-03 09:39:14 -0400 (Wed, 03 Aug 2011)
New Revision: 33544
Added:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/JavaUtil.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.classpath
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.project
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.settings/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.settings/org.eclipse.jdt.core.prefs
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.settings/org.eclipse.m2e.core.prefs
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/META-INF/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/META-INF/MANIFEST.MF
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/build.properties
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/plugin_customization.ini
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jboss/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jboss/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jsfapi-12/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jsfapi-12/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jsfapi/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jsfapi/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-mojarra/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-mojarra/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-myfaces/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-myfaces/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/requirements.properties
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JSFConfiguratorTest.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java
trunk/maven/tests/pom.xml
Log:
JBIDE-9242 : add JSF facet based on the JSF classes found in the classpath
Added: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/JavaUtil.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/JavaUtil.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/JavaUtil.java 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,53 @@
+package org.jboss.tools.maven.core;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.util.EclipseJavaUtil;
+
+/**
+ *
+ * @author Fred Bricon
+ *
+ */
+public class JavaUtil {
+
+ private JavaUtil() {
+ }
+
+ /**
+ * Checks if a project has a given class in its classpath.<br/>
+ * @param project : the workspace project
+ * @param className : the fully qualified name of the class to search for
+ * @return true if className is found in the project's classpath (provided the project is a JavaProject and its classpath has been set.)
+ *
+ */
+ public static boolean hasInClassPath(IProject project, String className) {
+ boolean result = false;
+ if (project != null){
+ result = hasInClassPath(JavaCore.create(project), className);
+ }
+ return result;
+ }
+
+ /**
+ * Checks if a java project has a given class in its classpath.<br/>
+ * @param javaProject : the workspace project
+ * @param className : the fully qualified name of the class to search for
+ * @return true if className is found in the project's classpath (provided the project is a JavaProject and its classpath has been set.)
+ *
+ */
+ public static boolean hasInClassPath(IJavaProject javaProject, String className) {
+ boolean result = false;
+ if (javaProject != null) {
+ try {
+ result = EclipseJavaUtil.findType(javaProject, className) != null;
+ } catch (JavaModelException e) {
+ e.printStackTrace();
+ }
+ }
+ return result;
+ }
+
+}
Modified: trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java 2011-08-03 13:28:47 UTC (rev 33543)
+++ trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java 2011-08-03 13:39:14 UTC (rev 33544)
@@ -25,6 +25,10 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
@@ -33,11 +37,13 @@
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.common.util.EclipseJavaUtil;
import org.jboss.tools.maven.core.IJBossMavenConstants;
import org.jboss.tools.maven.core.internal.project.facet.MavenFacetInstallDataModelProvider;
import org.jboss.tools.maven.jsf.MavenJSFActivator;
@@ -61,21 +67,23 @@
protected static final IProjectFacet dynamicWebFacet;
protected static final IProjectFacetVersion dynamicWebVersion;
- protected static final IProjectFacet jsfFacet;
- protected static final IProjectFacetVersion jsfVersion20;
- protected static final IProjectFacetVersion jsfVersion12;
- protected static final IProjectFacetVersion jsfVersion11;
+ public static final IProjectFacet JSF_FACET;
+ public static final IProjectFacetVersion JSF_FACET_VERSION_2_0;
+ public static final IProjectFacetVersion JSF_FACET_VERSION_1_2;
+ public static final IProjectFacetVersion JSF_FACET_VERSION_1_1;
protected static final IProjectFacet m2Facet;
protected static final IProjectFacetVersion m2Version;
- private static final String JSF_VERSION_2_0 = "2.0";
+ public static final String JSF_VERSION_2_0 = "2.0";
+ public static final String JSF_VERSION_1_2 = "1.2";
+ public static final String JSF_VERSION_1_1 = "1.1";
static {
dynamicWebFacet = ProjectFacetsManager.getProjectFacet("jst.web"); //$NON-NLS-1$
dynamicWebVersion = dynamicWebFacet.getVersion("2.5"); //$NON-NLS-1$
- jsfFacet = ProjectFacetsManager.getProjectFacet("jst.jsf"); //$NON-NLS-1$
- jsfVersion20 = jsfFacet.getVersion(JSF_VERSION_2_0);
- jsfVersion12 = jsfFacet.getVersion("1.2"); //$NON-NLS-1$
- jsfVersion11 = jsfFacet.getVersion("1.1"); //$NON-NLS-1$
+ JSF_FACET = ProjectFacetsManager.getProjectFacet("jst.jsf"); //$NON-NLS-1$
+ JSF_FACET_VERSION_2_0 = JSF_FACET.getVersion(JSF_VERSION_2_0);
+ JSF_FACET_VERSION_1_2 = JSF_FACET.getVersion(JSF_VERSION_1_2); //$NON-NLS-1$
+ JSF_FACET_VERSION_1_1 = JSF_FACET.getVersion(JSF_VERSION_1_1); //$NON-NLS-1$
m2Facet = ProjectFacetsManager.getProjectFacet("jboss.m2"); //$NON-NLS-1$
m2Version = m2Facet.getVersion("1.0"); //$NON-NLS-1$
}
@@ -97,13 +105,13 @@
}
final IFacetedProject fproj = ProjectFacetsManager.create(project);
- if (fproj != null && fproj.hasProjectFacet(jsfFacet) && fproj.hasProjectFacet(m2Facet)) {
+ if (fproj != null && fproj.hasProjectFacet(JSF_FACET) && fproj.hasProjectFacet(m2Facet)) {
//everything already installed. Since there's no support for version update -yet- we bail
return;
}
String packaging = mavenProject.getPackaging();
- String jsfVersion = getJSFVersion(mavenProject);
+ String jsfVersion = getJSFVersion(mavenProject, project);
if (fproj != null && jsfVersion != null && "war".equals(packaging)) { //$NON-NLS-1$
installWarFacets(fproj, jsfVersion, mavenProject, monitor);
}
@@ -118,6 +126,15 @@
IProject project = facade.getProject();
if(isWTPProject(project)) {
MavenProject mavenProject = facade.getMavenProject(monitor);
+
+ IMavenProjectFacade oldFacade = event.getOldMavenProject();
+ if (oldFacade != null) {
+ MavenProject oldProject = oldFacade.getMavenProject(monitor);
+ if (oldProject != null && oldProject.getArtifacts().equals(mavenProject.getArtifacts())) {
+ //Nothing changed since last build, no need to lookup for new JSF facets
+ return;
+ }
+ }
configureInternal(mavenProject, project, monitor);
}
}
@@ -155,7 +172,7 @@
String jsfVersionString, MavenProject mavenProject,
IProgressMonitor monitor)
throws CoreException {
- if (!fproj.hasProjectFacet(jsfFacet)) {
+ if (!fproj.hasProjectFacet(JSF_FACET)) {
String warSourceDir = getWarSourceDirectory(mavenProject,fproj.getProject());
IPath facesConfigPath = new Path("WEB-INF/faces-config.xml");
IFile facesConfig = fproj.getProject().getFolder(warSourceDir).getFile(facesConfigPath);
@@ -163,21 +180,22 @@
//faces-config.xml will not be created in the source folder and it doesn't exist yet
// => We'll have to fix it after setting the JSF facet
- boolean shouldFixFacesConfig = !generatedFacesConfig.getLocation().equals(facesConfig.getLocation())
+ boolean shouldFixFacesConfig = generatedFacesConfig != null
+ && !generatedFacesConfig.getLocation().equals(facesConfig.getLocation())
&& !generatedFacesConfig.exists();
- if (jsfVersionString.startsWith("1.1")) { //$NON-NLS-1$
- IDataModel model = MavenJSFActivator.getDefault().createJSFDataModel(fproj,jsfVersion11);
- fproj.installProjectFacet(jsfVersion11, model, monitor);
+ if (jsfVersionString.startsWith(JSF_VERSION_1_1)) {
+ IDataModel model = MavenJSFActivator.getDefault().createJSFDataModel(fproj,JSF_FACET_VERSION_1_1);
+ fproj.installProjectFacet(JSF_FACET_VERSION_1_1, model, monitor);
}
- else if (jsfVersionString.startsWith("1.2")) { //$NON-NLS-1$
- IDataModel model = MavenJSFActivator.getDefault().createJSFDataModel(fproj,jsfVersion12);
- fproj.installProjectFacet(jsfVersion12, model, monitor);
+ else if (jsfVersionString.startsWith(JSF_VERSION_1_2)) {
+ IDataModel model = MavenJSFActivator.getDefault().createJSFDataModel(fproj,JSF_FACET_VERSION_1_2);
+ fproj.installProjectFacet(JSF_FACET_VERSION_1_2, model, monitor);
}
- else if (jsfVersionString.startsWith("2.0")) { //$NON-NLS-1$
- IDataModel model = MavenJSFActivator.getDefault().createJSFDataModel(fproj,jsfVersion20);
+ else if (jsfVersionString.startsWith(JSF_VERSION_2_0)) {
+ IDataModel model = MavenJSFActivator.getDefault().createJSFDataModel(fproj,JSF_FACET_VERSION_2_0);
model.setBooleanProperty(IJSFFacetInstallDataModelProperties.CONFIGURE_SERVLET,configureWebxml());
- fproj.installProjectFacet(jsfVersion20, model, monitor);
+ fproj.installProjectFacet(JSF_FACET_VERSION_2_0, model, monitor);
}
if (shouldFixFacesConfig && generatedFacesConfig.exists()) {
@@ -199,22 +217,14 @@
}
private IFile getFileFromUnderlyingresources(final IProject project, final IPath filePath) {
- IContainer underlyingFolder = ComponentCore.createComponent(project).getRootFolder().getUnderlyingFolder();
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if (component == null) {
+ return null;
+ }
+ IContainer underlyingFolder = component.getRootFolder().getUnderlyingFolder();
return project.getFile(underlyingFolder.getProjectRelativePath().append(filePath));
}
- private IFile getWebXml(IFacetedProject fproj, MavenProject mavenProject) {
- IFile webXml;
- String customWebXml = getCustomWebXml(mavenProject,
- fproj.getProject());
- if (customWebXml == null) {
- webXml = fproj.getProject().getFolder(getWarSourceDirectory(mavenProject,fproj.getProject())).getFile(WEB_XML);
- } else {
- webXml = fproj.getProject().getFile(customWebXml);
- }
- return webXml;
- }
-
private String getWarSourceDirectory(MavenProject mavenProject,
IProject project) {
Plugin plugin = mavenProject
@@ -290,18 +300,57 @@
}
- private String getJSFVersion(MavenProject mavenProject) {
+ private String getJSFVersion(MavenProject mavenProject, IProject project) {
String version = null;
version = Activator.getDefault().getDependencyVersion(mavenProject, JSF_API_GROUP_ID, JSF_API_ARTIFACT_ID);
if (version == null) {
+ //Check if there's a JSF 2 dependency
version = Activator.getDefault().getDependencyVersion(mavenProject, JSF_API2_GROUP_ID, JSF_API_ARTIFACT_ID);
}
if (version == null) {
+ //JBIDE-9242 determine JSF version from classpath
+ version = getJSFVersionFromClasspath(project);
+ }
+ if (version == null) {
version = inferJsfVersionFromDependencies(mavenProject, JSF_API2_GROUP_ID, JSF_API_ARTIFACT_ID, JSF_VERSION_2_0);
}
return version;
}
+ /**
+ * Determines the JSF version by searching for the methods of javax.faces.application.Application
+ * in the project's classpath.
+ * @param project : the java project to analyze
+ * @return the JSF version (1.1, 1.2, 2.0) found in the classpath,
+ * or null if the project doesn't depend on JSF
+ */
+ private String getJSFVersionFromClasspath(IProject project) {
+ String version = null;
+ IJavaProject javaProject = JavaCore.create(project);
+ if (javaProject != null) {
+ IType type = null;
+ try {
+ type = EclipseJavaUtil.findType(javaProject,
+ "javax.faces.application.Application");//$NON-NLS-1$
+ } catch (JavaModelException e) {
+ e.printStackTrace();
+ }
+ if (type != null) {
+ String[] emptyParams = new String[0];
+ if (type.getMethod("getResourceHandler", emptyParams).exists() &&
+ type.getMethod("getProjectStage", emptyParams).exists()) {
+ return JSF_VERSION_2_0;
+ }
+ if (type.getMethod("getELResolver", emptyParams).exists() &&
+ type.getMethod("getExpressionFactory", emptyParams).exists()) {
+ return JSF_VERSION_1_2;
+ }
+ version = JSF_VERSION_1_1;
+ }
+ }
+ return version;
+ }
+
private String inferJsfVersionFromDependencies(MavenProject mavenProject, String groupId, String artifactId, String defaultVersion) {
boolean hasCandidates = false;
String jsfVersion = null;
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.classpath
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.classpath (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.classpath 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,7 @@
+<?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="output" path="target/classes"/>
+</classpath>
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.project
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.project (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.project 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.maven.configurators.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</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.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.settings/org.eclipse.jdt.core.prefs 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,8 @@
+#Tue Aug 02 13:44:10 CEST 2011
+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
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.settings/org.eclipse.m2e.core.prefs (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/.settings/org.eclipse.m2e.core.prefs 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,5 @@
+#Tue Aug 02 13:44:10 CEST 2011
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/META-INF/MANIFEST.MF (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/META-INF/MANIFEST.MF 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JBoss Maven Configurators Tests
+Bundle-SymbolicName: org.jboss.tools.maven.configurators.tests;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.apache.log4j,
+ org.junit4,
+ org.jboss.tools.seam.core,
+ org.jboss.tools.maven.core,
+ org.jboss.tools.maven.hibernate,
+ org.jboss.tools.maven.jsf,
+ org.jboss.tools.maven.portlet,
+ org.jboss.tools.maven.seam,
+ org.jboss.tools.maven.ui,
+ org.eclipse.wst.server.core,
+ org.jboss.tools.common,
+ org.jboss.tools.tests,
+ org.hamcrest,
+ org.eclipse.jst.jee,
+ org.eclipse.jst.jee.ejb,
+ org.eclipse.jst.jee.ui,
+ org.eclipse.jst.jee.web,
+ org.eclipse.m2e.lifecyclemapping.defaults;bundle-version="[1.0,1.1)",
+ org.eclipse.m2e.launching;bundle-version="[1.0,1.1)",
+ org.eclipse.m2e.tests.common;bundle-version="[1.0.0,1.1.0)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Eclipse-RegisterBuddy: org.apache.log4j
+
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/build.properties
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/build.properties (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/build.properties 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/plugin_customization.ini
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/plugin_customization.ini (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/plugin_customization.ini 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1 @@
+org.eclipse.m2e.core/eclipse.m2.updateIndexes=false
\ No newline at end of file
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/pom.xml 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.maven</groupId>
+ <artifactId>tests</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.maven.tests</groupId>
+ <artifactId>org.jboss.tools.maven.configurators.tests</artifactId>
+
+ <packaging>eclipse-test-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-test-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <useUIThread>false</useUIThread>
+ <useUIHarness>true</useUIHarness>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jboss/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jboss/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jboss/pom.xml 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.tools.maven.tests</groupId>
+ <artifactId>jsf-jboss</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.spec.javax.faces</groupId>
+ <artifactId>jboss-jsf-api_2.0_spec</artifactId>
+ <version>1.0.0.Final</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jsfapi/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jsfapi/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jsfapi/pom.xml 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.tools.maven.tests</groupId>
+ <artifactId>jsf-jsfapi</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <!-- not in central, hence requires the JBoss repo -->
+ <artifactId>jsf-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <!-- You should seriously consider using a repository manager or declare repositories in your settings.xml.
+ See http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-p... -->
+ <repository>
+ <!-- The JBoss Public repository is a composite repository of several major repositories.
+ See http://community.jboss.org/wiki/MavenGettingStarted-Users -->
+ <id>jboss-public-repository</id>
+ <url>http://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <!-- You can disable snapshot resolution to speed up your builds -->
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+</project>
+
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jsfapi-12/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jsfapi-12/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-jsfapi-12/pom.xml 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.tools.maven.tests</groupId>
+ <artifactId>jsf-jsfapi-12</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <!-- You should seriously consider using a repository manager or declare repositories in your settings.xml.
+ See http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-p... -->
+ <repository>
+ <!-- The JBoss Public repository is a composite repository of several major repositories.
+ See http://community.jboss.org/wiki/MavenGettingStarted-Users -->
+ <id>jboss-public-repository</id>
+ <url>http://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <!-- You can disable snapshot resolution to speed up your builds -->
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+</project>
+
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-mojarra/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-mojarra/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-mojarra/pom.xml 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.tools.maven.tests</groupId>
+ <artifactId>jsf-mojarra</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>mojarra-jsf-api</artifactId>
+ <version>2.0.0-b04</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <!-- You should seriously consider using a repository manager or declare repositories in your settings.xml.
+ See http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-p... -->
+ <repository>
+ <!-- The JBoss Public repository is a composite repository of several major repositories.
+ See http://community.jboss.org/wiki/MavenGettingStarted-Users -->
+ <id>jboss-public-repository</id>
+ <url>http://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <!-- You can disable snapshot resolution to speed up your builds -->
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+</project>
+
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-myfaces/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-myfaces/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-myfaces/pom.xml 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.tools.maven.tests</groupId>
+ <artifactId>jsf-myfaces</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>myfaces</groupId>
+ <artifactId>myfaces-jsf-api</artifactId>
+ <version>1.0.9</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/requirements.properties
===================================================================
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,17 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.configurators.tests;
+
+import org.eclipse.m2e.tests.common.AbstractMavenProjectTestCase;
+
+public abstract class AbstractMavenConfiguratorTest extends AbstractMavenProjectTestCase {
+
+}
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JSFConfiguratorTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JSFConfiguratorTest.java (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JSFConfiguratorTest.java 2011-08-03 13:39:14 UTC (rev 33544)
@@ -0,0 +1,53 @@
+package org.jboss.tools.maven.configurators.tests;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jst.common.project.facet.core.JavaFacet;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.maven.jsf.configurators.JSFProjectConfigurator;
+import org.junit.Test;
+
+@SuppressWarnings("restriction")
+public class JSFConfiguratorTest extends AbstractMavenConfiguratorTest {
+
+ @Test
+ public void testJBIDE9242_supportMultipleJSFDependencies() throws Exception {
+ IProject[] projects = importProjects("projects/jsf/",
+ new String[]{ "jsf-mojarra/pom.xml",
+ "jsf-jboss/pom.xml",
+ "jsf-jsfapi/pom.xml",
+ "jsf-myfaces/pom.xml",
+ "jsf-jsfapi-12/pom.xml"},
+ new ResolverConfiguration());
+ IProject mojarra = projects[0];
+ assertNoErrors(mojarra);
+ assertIsJSFProject(mojarra, JSFProjectConfigurator.JSF_FACET_VERSION_2_0);
+
+ IProject jboss = projects[1];
+ assertNoErrors(jboss);
+ assertIsJSFProject(jboss, JSFProjectConfigurator.JSF_FACET_VERSION_2_0);
+
+ IProject jsfapi_20 = projects[2];
+ assertNoErrors(jsfapi_20);
+ assertIsJSFProject(jsfapi_20, JSFProjectConfigurator.JSF_FACET_VERSION_2_0);
+
+ IProject myfaces = projects[3];
+ assertNoErrors(myfaces);
+ assertIsJSFProject(myfaces, JSFProjectConfigurator.JSF_FACET_VERSION_1_1);
+
+ IProject jsfapi_12 = projects[4];
+ assertNoErrors(jsfapi_12);
+ assertIsJSFProject(jsfapi_12, JSFProjectConfigurator.JSF_FACET_VERSION_1_2);
+
+
+ }
+
+ private void assertIsJSFProject(IProject project, IProjectFacetVersion expectedJSFVersion) throws Exception {
+ IFacetedProject facetedProject = ProjectFacetsManager.create(project);
+ assertNotNull(project.getName() + " is not a faceted project", facetedProject);
+ assertEquals("Unexpected JSF Version", expectedJSFVersion, facetedProject.getInstalledVersion(JSFProjectConfigurator.JSF_FACET));
+ assertTrue("Java Facet is missing", facetedProject.hasProjectFacet(JavaFacet.FACET));
+ }
+}
Modified: trunk/maven/tests/pom.xml
===================================================================
--- trunk/maven/tests/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
+++ trunk/maven/tests/pom.xml 2011-08-03 13:39:14 UTC (rev 33544)
@@ -13,7 +13,7 @@
<name>maven.tests</name>
<packaging>pom</packaging>
<modules>
- <!--module>org.jboss.tools.maven.configurators.tests</module-->
+ <module>org.jboss.tools.maven.configurators.tests</module>
<module>org.jboss.tools.maven.ui.bot.test</module>
</modules>
13 years, 5 months
JBoss Tools SVN: r33543 - in trunk/maven: features and 28 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-08-03 09:28:47 -0400 (Wed, 03 Aug 2011)
New Revision: 33543
Modified:
trunk/maven/features/
trunk/maven/features/org.jboss.tools.maven.cdi.feature/
trunk/maven/features/org.jboss.tools.maven.cdi.feature/feature.xml
trunk/maven/features/org.jboss.tools.maven.cdi.feature/pom.xml
trunk/maven/features/org.jboss.tools.maven.feature/
trunk/maven/features/org.jboss.tools.maven.feature/feature.xml
trunk/maven/features/org.jboss.tools.maven.feature/pom.xml
trunk/maven/features/org.jboss.tools.maven.hibernate.feature/
trunk/maven/features/org.jboss.tools.maven.hibernate.feature/feature.xml
trunk/maven/features/org.jboss.tools.maven.hibernate.feature/pom.xml
trunk/maven/features/org.jboss.tools.maven.jsf.feature/
trunk/maven/features/org.jboss.tools.maven.jsf.feature/feature.xml
trunk/maven/features/org.jboss.tools.maven.jsf.feature/pom.xml
trunk/maven/features/org.jboss.tools.maven.portlet.feature/
trunk/maven/features/org.jboss.tools.maven.portlet.feature/feature.xml
trunk/maven/features/org.jboss.tools.maven.portlet.feature/pom.xml
trunk/maven/features/org.jboss.tools.maven.project.examples.feature/
trunk/maven/features/org.jboss.tools.maven.project.examples.feature/feature.xml
trunk/maven/features/org.jboss.tools.maven.project.examples.feature/pom.xml
trunk/maven/features/org.jboss.tools.maven.seam.feature/
trunk/maven/features/org.jboss.tools.maven.seam.feature/feature.xml
trunk/maven/features/org.jboss.tools.maven.seam.feature/pom.xml
trunk/maven/features/pom.xml
trunk/maven/plugins/
trunk/maven/plugins/org.jboss.tools.maven.cdi/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.cdi/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.core/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.hibernate/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.hibernate/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.jsf/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.jsf/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.portlet/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.portlet/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.project.examples/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.seam/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.seam/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.ui/pom.xml
trunk/maven/plugins/pom.xml
trunk/maven/pom.xml
trunk/maven/site/
trunk/maven/site/pom.xml
trunk/maven/tests/
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/pom.xml
trunk/maven/tests/pom.xml
Log:
JBIDE-9450 : Bump maven plugins version to 1.3.0.x
Property changes on: trunk/maven/features
___________________________________________________________________
Added: svn:ignore
+ .project
.settings
Property changes on: trunk/maven/features/org.jboss.tools.maven.cdi.feature
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ .settings
target
buildlog.latest.txt
bin
build
Modified: trunk/maven/features/org.jboss.tools.maven.cdi.feature/feature.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.cdi.feature/feature.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.cdi.feature/feature.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.maven.cdi.feature"
label="%featureName"
- version="1.2.0.qualifier"
+ version="1.3.0.qualifier"
provider-name="%providerName"
plugin="org.jboss.tools.maven.cdi">
Modified: trunk/maven/features/org.jboss.tools.maven.cdi.feature/pom.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.cdi.feature/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.cdi.feature/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>features</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.features</groupId>
<artifactId>org.jboss.tools.maven.cdi.feature</artifactId>
Property changes on: trunk/maven/features/org.jboss.tools.maven.feature
___________________________________________________________________
Modified: svn:ignore
- bin
build
target
+ .settings
bin
build
target
Modified: trunk/maven/features/org.jboss.tools.maven.feature/feature.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.feature/feature.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.feature/feature.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.maven.feature"
label="%featureName"
- version="1.2.0.qualifier"
+ version="1.3.0.qualifier"
provider-name="%providerName"
plugin="org.jboss.tools.maven.ui">
@@ -19,7 +19,7 @@
</license>
<requires>
- <import feature="org.eclipse.m2e.feature" version="0.13.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.m2e.feature" version="1.0.0" match="greaterOrEqual"/>
<import feature="org.maven.ide.eclipse.wtp.feature" version="0.13.0" match="greaterOrEqual"/>
</requires>
Modified: trunk/maven/features/org.jboss.tools.maven.feature/pom.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.feature/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.feature/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>features</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.features</groupId>
<artifactId>org.jboss.tools.maven.feature</artifactId>
Property changes on: trunk/maven/features/org.jboss.tools.maven.hibernate.feature
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ .settings
target
buildlog.latest.txt
bin
build
Modified: trunk/maven/features/org.jboss.tools.maven.hibernate.feature/feature.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.hibernate.feature/feature.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.hibernate.feature/feature.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.maven.hibernate.feature"
label="%featureName"
- version="1.2.0.qualifier"
+ version="1.3.0.qualifier"
provider-name="%providerName"
plugin="org.jboss.tools.maven.hibernate">
Modified: trunk/maven/features/org.jboss.tools.maven.hibernate.feature/pom.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.hibernate.feature/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.hibernate.feature/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>features</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.features</groupId>
<artifactId>org.jboss.tools.maven.hibernate.feature</artifactId>
Property changes on: trunk/maven/features/org.jboss.tools.maven.jsf.feature
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ .settings
target
buildlog.latest.txt
bin
build
Modified: trunk/maven/features/org.jboss.tools.maven.jsf.feature/feature.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.jsf.feature/feature.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.jsf.feature/feature.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.maven.jsf.feature"
label="%featureName"
- version="1.2.0.qualifier"
+ version="1.3.0.qualifier"
provider-name="%providerName"
plugin="org.jboss.tools.maven.jsf">
Modified: trunk/maven/features/org.jboss.tools.maven.jsf.feature/pom.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.jsf.feature/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.jsf.feature/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>features</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.features</groupId>
<artifactId>org.jboss.tools.maven.jsf.feature</artifactId>
Property changes on: trunk/maven/features/org.jboss.tools.maven.portlet.feature
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ .settings
target
buildlog.latest.txt
bin
build
Modified: trunk/maven/features/org.jboss.tools.maven.portlet.feature/feature.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.portlet.feature/feature.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.portlet.feature/feature.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.maven.portlet.feature"
label="%featureName"
- version="1.2.0.qualifier"
+ version="1.3.0.qualifier"
provider-name="%providerName"
plugin="org.jboss.tools.maven.portlet">
Modified: trunk/maven/features/org.jboss.tools.maven.portlet.feature/pom.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.portlet.feature/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.portlet.feature/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>features</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.features</groupId>
<artifactId>org.jboss.tools.maven.portlet.feature</artifactId>
Property changes on: trunk/maven/features/org.jboss.tools.maven.project.examples.feature
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ .settings
target
buildlog.latest.txt
bin
build
Modified: trunk/maven/features/org.jboss.tools.maven.project.examples.feature/feature.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.project.examples.feature/feature.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.project.examples.feature/feature.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.maven.project.examples.feature"
label="%featureName"
- version="1.2.0.qualifier"
+ version="1.3.0.qualifier"
provider-name="%providerName"
plugin="org.jboss.tools.maven.project.examples">
Modified: trunk/maven/features/org.jboss.tools.maven.project.examples.feature/pom.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.project.examples.feature/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.project.examples.feature/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>features</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.features</groupId>
<artifactId>org.jboss.tools.maven.project.examples.feature</artifactId>
Property changes on: trunk/maven/features/org.jboss.tools.maven.seam.feature
___________________________________________________________________
Modified: svn:ignore
- bin
build
target
+ .settings
bin
build
target
Modified: trunk/maven/features/org.jboss.tools.maven.seam.feature/feature.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.seam.feature/feature.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.seam.feature/feature.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.maven.seam.feature"
label="%featureName"
- version="1.2.0.qualifier"
+ version="1.3.0.qualifier"
provider-name="%providerName"
plugin="org.jboss.tools.maven.seam">
Modified: trunk/maven/features/org.jboss.tools.maven.seam.feature/pom.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.seam.feature/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/org.jboss.tools.maven.seam.feature/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>features</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.features</groupId>
<artifactId>org.jboss.tools.maven.seam.feature</artifactId>
Modified: trunk/maven/features/pom.xml
===================================================================
--- trunk/maven/features/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/features/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools</groupId>
<artifactId>maven</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>features</artifactId>
Property changes on: trunk/maven/plugins
___________________________________________________________________
Added: svn:ignore
+ .settings
Modified: trunk/maven/plugins/org.jboss.tools.maven.cdi/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.cdi/META-INF/MANIFEST.MF 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.cdi/META-INF/MANIFEST.MF 2011-08-03 13:28:47 UTC (rev 33543)
@@ -1,19 +1,19 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-SymbolicName: org.jboss.tools.maven.cdi;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.jboss.tools.maven.cdi.MavenCDIActivator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.jboss.tools.maven.core,
- org.jboss.tools.maven.ui,
- org.jboss.tools.common.model,
- org.eclipse.jst.j2ee.core,
- org.eclipse.jst.j2ee,
- org.eclipse.wst.common.emfworkbench.integration,
- org.jboss.tools.cdi.core
-Bundle-Localization: plugin
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %Bundle-Vendor
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.cdi;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Activator: org.jboss.tools.maven.cdi.MavenCDIActivator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.maven.core,
+ org.jboss.tools.maven.ui,
+ org.jboss.tools.common.model,
+ org.eclipse.jst.j2ee.core,
+ org.eclipse.jst.j2ee,
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.jboss.tools.cdi.core
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %Bundle-Vendor
Modified: trunk/maven/plugins/org.jboss.tools.maven.cdi/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.cdi/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.cdi/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>plugins</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.plugins</groupId>
<artifactId>org.jboss.tools.maven.cdi</artifactId>
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF 2011-08-03 13:28:47 UTC (rev 33543)
@@ -1,34 +1,34 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-SymbolicName: org.jboss.tools.maven.core; singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Localization: plugin
-Bundle-Activator: org.jboss.tools.maven.core.MavenCoreActivator
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.wst.common.project.facet.core;visibility:=reexport,
- org.eclipse.jst.common.project.facet.core;visibility:=reexport,
- org.eclipse.core.resources;visibility:=reexport,
- org.eclipse.wst.common.frameworks;visibility:=reexport,
- org.eclipse.jst.common.frameworks;visibility:=reexport,
- org.eclipse.wst.common.modulecore;visibility:=reexport,
- org.eclipse.m2e.core;bundle-version="[1.0,1.1)";visibility:=reexport,
- org.eclipse.m2e.maven.runtime;bundle-version="[1.0,1.1)";visibility:=reexport,
- org.eclipse.jdt.core;visibility:=reexport,
- org.eclipse.m2e.jdt;bundle-version="[1.0,1.1)";visibility:=reexport,
- org.eclipse.jst.j2ee;visibility:=reexport,
- org.eclipse.jst.j2ee.web;visibility:=reexport,
- org.jboss.tools.common;visibility:=reexport,
- org.eclipse.jdt.launching;visibility:=reexport,
- org.eclipse.ui.workbench;visibility:=reexport,
- org.eclipse.m2e.model.edit;bundle-version="[1.0,1.1)";visibility:=reexport,
- org.eclipse.core.expressions,
- org.maven.ide.eclipse.wtp;bundle-version="[0.13.0,0.15.0)";visibility:=reexport
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %Bundle-Vendor
-Export-Package: org.jboss.tools.maven.core,
- org.jboss.tools.maven.core.internal.project.facet,
- org.jboss.tools.maven.core.libprov,
- org.jboss.tools.maven.core.profiles,
- org.jboss.tools.maven.core.xpl
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.core; singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Localization: plugin
+Bundle-Activator: org.jboss.tools.maven.core.MavenCoreActivator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.wst.common.project.facet.core;visibility:=reexport,
+ org.eclipse.jst.common.project.facet.core;visibility:=reexport,
+ org.eclipse.core.resources;visibility:=reexport,
+ org.eclipse.wst.common.frameworks;visibility:=reexport,
+ org.eclipse.jst.common.frameworks;visibility:=reexport,
+ org.eclipse.wst.common.modulecore;visibility:=reexport,
+ org.eclipse.m2e.core;bundle-version="[1.0,1.1)";visibility:=reexport,
+ org.eclipse.m2e.maven.runtime;bundle-version="[1.0,1.1)";visibility:=reexport,
+ org.eclipse.jdt.core;visibility:=reexport,
+ org.eclipse.m2e.jdt;bundle-version="[1.0,1.1)";visibility:=reexport,
+ org.eclipse.jst.j2ee;visibility:=reexport,
+ org.eclipse.jst.j2ee.web;visibility:=reexport,
+ org.jboss.tools.common;visibility:=reexport,
+ org.eclipse.jdt.launching;visibility:=reexport,
+ org.eclipse.ui.workbench;visibility:=reexport,
+ org.eclipse.m2e.model.edit;bundle-version="[1.0,1.1)";visibility:=reexport,
+ org.eclipse.core.expressions,
+ org.maven.ide.eclipse.wtp;bundle-version="[0.13.0,0.15.0)";visibility:=reexport
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %Bundle-Vendor
+Export-Package: org.jboss.tools.maven.core,
+ org.jboss.tools.maven.core.internal.project.facet,
+ org.jboss.tools.maven.core.libprov,
+ org.jboss.tools.maven.core.profiles,
+ org.jboss.tools.maven.core.xpl
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>plugins</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.plugins</groupId>
<artifactId>org.jboss.tools.maven.core</artifactId>
Modified: trunk/maven/plugins/org.jboss.tools.maven.hibernate/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.hibernate/META-INF/MANIFEST.MF 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.hibernate/META-INF/MANIFEST.MF 2011-08-03 13:28:47 UTC (rev 33543)
@@ -1,19 +1,19 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-SymbolicName: org.jboss.tools.maven.hibernate;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.jboss.tools.maven.hibernate.MavenHibernateActivator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.jboss.tools.maven.core,
- org.jboss.tools.maven.ui,
- org.jboss.tools.common.model,
- org.eclipse.jst.j2ee.core,
- org.eclipse.jst.j2ee,
- org.eclipse.wst.common.emfworkbench.integration,
- org.hibernate.eclipse.console
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Localization: plugin
-Bundle-Vendor: %Bundle-Vendor
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.hibernate;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Activator: org.jboss.tools.maven.hibernate.MavenHibernateActivator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.maven.core,
+ org.jboss.tools.maven.ui,
+ org.jboss.tools.common.model,
+ org.eclipse.jst.j2ee.core,
+ org.eclipse.jst.j2ee,
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.hibernate.eclipse.console
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Localization: plugin
+Bundle-Vendor: %Bundle-Vendor
Modified: trunk/maven/plugins/org.jboss.tools.maven.hibernate/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.hibernate/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.hibernate/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>plugins</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.plugins</groupId>
<artifactId>org.jboss.tools.maven.hibernate</artifactId>
Modified: trunk/maven/plugins/org.jboss.tools.maven.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jsf/META-INF/MANIFEST.MF 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.jsf/META-INF/MANIFEST.MF 2011-08-03 13:28:47 UTC (rev 33543)
@@ -1,21 +1,21 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-SymbolicName: org.jboss.tools.maven.jsf;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.jboss.tools.maven.jsf.MavenJSFActivator
-Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
- org.eclipse.core.runtime;bundle-version="3.7.0",
- org.jboss.tools.maven.core,
- org.jboss.tools.maven.ui,
- org.jboss.tools.common.model,
- org.eclipse.jst.j2ee.core;bundle-version="1.2.100",
- org.eclipse.jst.j2ee;bundle-version="1.1.500",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.2.100",
- org.eclipse.jst.jsf.core;bundle-version="1.3.4"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %Bundle-Vendor
-Bundle-Localization: plugin
-Export-Package: org.jboss.tools.maven.jsf,
- org.jboss.tools.maven.jsf.configurators
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.jsf;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Activator: org.jboss.tools.maven.jsf.MavenJSFActivator
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.jboss.tools.maven.core,
+ org.jboss.tools.maven.ui,
+ org.jboss.tools.common.model,
+ org.eclipse.jst.j2ee.core;bundle-version="1.2.100",
+ org.eclipse.jst.j2ee;bundle-version="1.1.500",
+ org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.2.100",
+ org.eclipse.jst.jsf.core;bundle-version="1.3.4"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.maven.jsf,
+ org.jboss.tools.maven.jsf.configurators
Modified: trunk/maven/plugins/org.jboss.tools.maven.jsf/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jsf/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.jsf/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>plugins</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.plugins</groupId>
<artifactId>org.jboss.tools.maven.jsf</artifactId>
Modified: trunk/maven/plugins/org.jboss.tools.maven.portlet/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.portlet/META-INF/MANIFEST.MF 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.portlet/META-INF/MANIFEST.MF 2011-08-03 13:28:47 UTC (rev 33543)
@@ -1,19 +1,19 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-SymbolicName: org.jboss.tools.maven.portlet;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.jboss.tools.maven.portlet.MavenPortletActivator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.jboss.tools.maven.core,
- org.jboss.tools.maven.ui,
- org.jboss.tools.portlet.core,
- org.jboss.tools.common.model,
- org.eclipse.jst.j2ee.core,
- org.eclipse.jst.j2ee,
- org.eclipse.wst.common.emfworkbench.integration
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Localization: plugin
-Bundle-Vendor: %Bundle-Vendor
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.portlet;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Activator: org.jboss.tools.maven.portlet.MavenPortletActivator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.maven.core,
+ org.jboss.tools.maven.ui,
+ org.jboss.tools.portlet.core,
+ org.jboss.tools.common.model,
+ org.eclipse.jst.j2ee.core,
+ org.eclipse.jst.j2ee,
+ org.eclipse.wst.common.emfworkbench.integration
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Localization: plugin
+Bundle-Vendor: %Bundle-Vendor
Modified: trunk/maven/plugins/org.jboss.tools.maven.portlet/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.portlet/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.portlet/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>plugins</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.plugins</groupId>
<artifactId>org.jboss.tools.maven.portlet</artifactId>
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF 2011-08-03 13:28:47 UTC (rev 33543)
@@ -1,17 +1,17 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-SymbolicName: org.jboss.tools.maven.project.examples;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.jboss.tools.maven.project.examples.MavenProjectExamplesActivator
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.jboss.tools.maven.core,
- org.jboss.tools.project.examples,
- org.eclipse.ui.ide,
- org.eclipse.m2e.archetype.common;bundle-version="[1.0,1.1)",
- org.eclipse.m2e.core.ui;bundle-version="[1.0,1.1)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Vendor: %Bundle-Vendor
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.project.examples;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Activator: org.jboss.tools.maven.project.examples.MavenProjectExamplesActivator
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.maven.core,
+ org.jboss.tools.project.examples,
+ org.eclipse.ui.ide,
+ org.eclipse.m2e.archetype.common;bundle-version="[1.0,1.1)",
+ org.eclipse.m2e.core.ui;bundle-version="[1.0,1.1)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %Bundle-Vendor
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>plugins</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.plugins</groupId>
<artifactId>org.jboss.tools.maven.project.examples</artifactId>
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/META-INF/MANIFEST.MF 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/META-INF/MANIFEST.MF 2011-08-03 13:28:47 UTC (rev 33543)
@@ -1,22 +1,22 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-SymbolicName: org.jboss.tools.maven.seam;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Localization: plugin
-Bundle-Activator: org.jboss.tools.maven.seam.MavenSeamActivator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.jboss.tools.maven.core,
- org.jboss.tools.maven.ui,
- org.jboss.tools.maven.jsf,
- org.jboss.tools.seam.core,
- org.jboss.tools.seam.ui,
- org.jboss.tools.common.model,
- org.eclipse.jst.j2ee.core,
- org.eclipse.jst.j2ee,
- org.eclipse.wst.common.emfworkbench.integration,
- org.eclipse.jst.jsf.core
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %Bundle-Vendor
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.seam;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Localization: plugin
+Bundle-Activator: org.jboss.tools.maven.seam.MavenSeamActivator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.maven.core,
+ org.jboss.tools.maven.ui,
+ org.jboss.tools.maven.jsf,
+ org.jboss.tools.seam.core,
+ org.jboss.tools.seam.ui,
+ org.jboss.tools.common.model,
+ org.eclipse.jst.j2ee.core,
+ org.eclipse.jst.j2ee,
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.eclipse.jst.jsf.core
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %Bundle-Vendor
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>plugins</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.plugins</groupId>
<artifactId>org.jboss.tools.maven.seam</artifactId>
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF 2011-08-03 13:28:47 UTC (rev 33543)
@@ -1,24 +1,24 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
-Bundle-SymbolicName: org.jboss.tools.maven.ui; singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Localization: plugin
-Bundle-Activator: org.jboss.tools.maven.ui.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.wst.common.project.facet.ui,
- org.eclipse.jst.common.project.facet.ui,
- org.eclipse.wst.common.frameworks.ui,
- org.eclipse.core.resources,
- org.jboss.tools.maven.core,
- org.eclipse.m2e.core.ui;bundle-version="[1.0.0,1.1.0)",
- org.eclipse.ui.ide,
- org.eclipse.jface.text
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %Bundle-Vendor
-Export-Package: org.jboss.tools.maven.ui,
- org.jboss.tools.maven.ui.internal.libprov,
- org.jboss.tools.maven.ui.internal.project.facet,
- org.jboss.tools.maven.ui.preferences
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.ui; singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Localization: plugin
+Bundle-Activator: org.jboss.tools.maven.ui.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.wst.common.project.facet.ui,
+ org.eclipse.jst.common.project.facet.ui,
+ org.eclipse.wst.common.frameworks.ui,
+ org.eclipse.core.resources,
+ org.jboss.tools.maven.core,
+ org.eclipse.m2e.core.ui;bundle-version="[1.0.0,1.1.0)",
+ org.eclipse.ui.ide,
+ org.eclipse.jface.text
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %Bundle-Vendor
+Export-Package: org.jboss.tools.maven.ui,
+ org.jboss.tools.maven.ui.internal.libprov,
+ org.jboss.tools.maven.ui.internal.project.facet,
+ org.jboss.tools.maven.ui.preferences
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>plugins</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.plugins</groupId>
<artifactId>org.jboss.tools.maven.ui</artifactId>
Modified: trunk/maven/plugins/pom.xml
===================================================================
--- trunk/maven/plugins/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/plugins/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools</groupId>
<artifactId>maven</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>plugins</artifactId>
Modified: trunk/maven/pom.xml
===================================================================
--- trunk/maven/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -10,7 +10,7 @@
</parent>
<groupId>org.jboss.tools</groupId>
<artifactId>maven</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
<name>maven.all</name>
<packaging>pom</packaging>
<modules>
@@ -19,5 +19,42 @@
<module>tests</module>
<module>site</module>
</modules>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.apache.maven.plugins
+ </groupId>
+ <artifactId>
+ maven-antrun-plugin
+ </artifactId>
+ <versionRange>
+ [1.3,)
+ </versionRange>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
</project>
Property changes on: trunk/maven/site
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
*.class
screenshots
+ .settings
target
buildlog.latest.txt
bin
build
*.class
screenshots
Modified: trunk/maven/site/pom.xml
===================================================================
--- trunk/maven/site/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/site/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools</groupId>
<artifactId>maven</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>maven.site</artifactId>
Property changes on: trunk/maven/tests
___________________________________________________________________
Added: svn:ignore
+ .project
.settings
Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF 2011-08-03 13:28:47 UTC (rev 33543)
@@ -1,45 +1,45 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: JBoss Maven Integration Tests
-Bundle-SymbolicName: org.jboss.tools.maven.ui.bot.test;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.jboss.tools.maven.ui.bot.test.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.apache.log4j,
- org.eclipse.swtbot.eclipse.core,
- org.eclipse.swtbot.swt.finder,
- org.eclipse.swtbot.eclipse.finder,
- org.eclipse.swtbot.eclipse.ui,
- org.eclipse.swtbot.junit4_x,
- org.eclipse.swtbot.swt.finder,
- org.junit4,
- org.jboss.tools.seam.core,
- org.jboss.tools.maven.core,
- org.jboss.tools.maven.hibernate,
- org.jboss.tools.maven.jsf,
- org.jboss.tools.maven.portlet,
- org.jboss.tools.maven.seam,
- org.jboss.tools.maven.ui,
- org.eclipse.wst.server.core,
- org.eclipse.datatools.connectivity,
- org.eclipse.datatools.connectivity.db.generic,
- org.jboss.tools.common,
- org.jboss.tools.tests,
- org.jboss.ide.eclipse.as.core,
- org.hamcrest,
- org.eclipse.datatools.enablement.hsqldb,
- org.eclipse.datatools.enablement.hsqldb.dbdefinition,
- org.eclipse.datatools.enablement.hsqldb.ui,
- org.eclipse.jst.jee,
- org.eclipse.jst.jee.ejb,
- org.eclipse.jst.jee.ui,
- org.eclipse.jst.jee.web,
- org.eclipse.m2e.lifecyclemapping.defaults;bundle-version="[1.0,1.1)",
- org.eclipse.m2e.launching;bundle-version="[1.0,1.1)",
- org.eclipse.m2e.tests.common;bundle-version="[1.0.0,1.1.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Eclipse-RegisterBuddy: org.apache.log4j
-
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JBoss Maven Integration Tests
+Bundle-SymbolicName: org.jboss.tools.maven.ui.bot.test;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Activator: org.jboss.tools.maven.ui.bot.test.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.apache.log4j,
+ org.eclipse.swtbot.eclipse.core,
+ org.eclipse.swtbot.swt.finder,
+ org.eclipse.swtbot.eclipse.finder,
+ org.eclipse.swtbot.eclipse.ui,
+ org.eclipse.swtbot.junit4_x,
+ org.eclipse.swtbot.swt.finder,
+ org.junit4,
+ org.jboss.tools.seam.core,
+ org.jboss.tools.maven.core,
+ org.jboss.tools.maven.hibernate,
+ org.jboss.tools.maven.jsf,
+ org.jboss.tools.maven.portlet,
+ org.jboss.tools.maven.seam,
+ org.jboss.tools.maven.ui,
+ org.eclipse.wst.server.core,
+ org.eclipse.datatools.connectivity,
+ org.eclipse.datatools.connectivity.db.generic,
+ org.jboss.tools.common,
+ org.jboss.tools.tests,
+ org.jboss.ide.eclipse.as.core,
+ org.hamcrest,
+ org.eclipse.datatools.enablement.hsqldb,
+ org.eclipse.datatools.enablement.hsqldb.dbdefinition,
+ org.eclipse.datatools.enablement.hsqldb.ui,
+ org.eclipse.jst.jee,
+ org.eclipse.jst.jee.ejb,
+ org.eclipse.jst.jee.ui,
+ org.eclipse.jst.jee.web,
+ org.eclipse.m2e.lifecyclemapping.defaults;bundle-version="[1.0,1.1)",
+ org.eclipse.m2e.launching;bundle-version="[1.0,1.1)",
+ org.eclipse.m2e.tests.common;bundle-version="[1.0.0,1.1.0)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Eclipse-RegisterBuddy: org.apache.log4j
+
Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>tests</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven.tests</groupId>
<artifactId>org.jboss.tools.maven.ui.bot.test</artifactId>
Modified: trunk/maven/tests/pom.xml
===================================================================
--- trunk/maven/tests/pom.xml 2011-08-03 12:33:05 UTC (rev 33542)
+++ trunk/maven/tests/pom.xml 2011-08-03 13:28:47 UTC (rev 33543)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.tools</groupId>
<artifactId>maven</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.maven</groupId>
<artifactId>tests</artifactId>
@@ -13,7 +13,24 @@
<name>maven.tests</name>
<packaging>pom</packaging>
<modules>
+ <!--module>org.jboss.tools.maven.configurators.tests</module-->
<module>org.jboss.tools.maven.ui.bot.test</module>
</modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <!-- Need to move that up to one of the parents (highest?) -->
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <configuration>
+ <appArgLine>-pluginCustomization ${basedir}/plugin_customization.ini</appArgLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
</project>
13 years, 5 months
JBoss Tools SVN: r33542 - in trunk: download.jboss.org/jbosstools/examples/nightly and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-08-03 08:33:05 -0400 (Wed, 03 Aug 2011)
New Revision: 33542
Modified:
trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-3.0...
trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-3.1...
trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-jbd...
trunk/download.jboss.org/jbosstools/examples/project-examples-3.0.xml
trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
trunk/download.jboss.org/jbosstools/examples/project-examples-jbds30.xml
trunk/download.jboss.org/jbosstools/examples/project-examples-jbds40.xml
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
Log:
JBIDE-9361 Imported project examples with multiple projects don't have build path set correctly
Modified: trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-3.0...
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-3.0... 2011-08-03 11:58:07 UTC (rev 33541)
+++ trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-3.0... 2011-08-03 12:33:05 UTC (rev 33542)
@@ -447,7 +447,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43</property>
- <property name="eclipse-projects">webservice_consumer1</property>
+ <property name="eclipse-projects">webservice_consumer1, webservice_consumer1_client</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA-P 4.3.0 and the runtime name should be "jboss-soa-p.4.3.0 Runtime"</property>
</fix>
Modified: trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-3.1...
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-3.1... 2011-08-03 11:58:07 UTC (rev 33541)
+++ trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-3.1... 2011-08-03 12:33:05 UTC (rev 33542)
@@ -490,7 +490,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50</property>
- <property name="eclipse-projects">webservice_consumer1</property>
+ <property name="eclipse-projects">webservice_consumer1, webservice_consumer1_client</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA-P 5.0 and the runtime name should be "jboss-soa-p.5.0 Runtime"</property>
</fix>
@@ -709,7 +709,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43</property>
- <property name="eclipse-projects">webservice_consumer1</property>
+ <property name="eclipse-projects">webservice_consumer1, webservice_consumer1_client</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA-P 4.3.0 and the runtime name should be "jboss-soa-p.4.3.0 Runtime"</property>
</fix>
Modified: trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-jbd...
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-jbd... 2011-08-03 11:58:07 UTC (rev 33541)
+++ trunk/download.jboss.org/jbosstools/examples/nightly/project-examples-jbd... 2011-08-03 12:33:05 UTC (rev 33542)
@@ -84,7 +84,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50</property>
- <property name="eclipse-projects">webservice_consumer1</property>
+ <property name="eclipse-projects">webservice_consumer1, webservice_consumer1_client</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA-P 5.0 and the runtime name should be "jboss-soa-p.5.0 Runtime"</property>
</fix>
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-3.0.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-3.0.xml 2011-08-03 11:58:07 UTC (rev 33541)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-3.0.xml 2011-08-03 12:33:05 UTC (rev 33542)
@@ -361,7 +361,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43</property>
- <property name="eclipse-projects">webservice_consumer1</property>
+ <property name="eclipse-projects">webservice_consumer1, webservice_consumer1_client</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA-P 4.3.0 and the runtime name should be "jboss-soa-p.4.3.0 Runtime"</property>
</fix>
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2011-08-03 11:58:07 UTC (rev 33541)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2011-08-03 12:33:05 UTC (rev 33542)
@@ -683,7 +683,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50, org.jboss.ide.eclipse.as.runtime.51</property>
- <property name="eclipse-projects">webservice_consumer1</property>
+ <property name="eclipse-projects">webservice_consumer1,webservice_consumer1_client</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA-P 5.0 and the runtime name should be "jboss-soa-p.5.0 Runtime"</property>
</fix>
@@ -902,7 +902,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43</property>
- <property name="eclipse-projects">webservice_consumer1</property>
+ <property name="eclipse-projects">webservice_consumer1,webservice_consumer1_client</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA-P 4.3.0 and the runtime name should be "jboss-soa-p.4.3.0 Runtime"</property>
</fix>
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-jbds30.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-jbds30.xml 2011-08-03 11:58:07 UTC (rev 33541)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-jbds30.xml 2011-08-03 12:33:05 UTC (rev 33542)
@@ -84,7 +84,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50</property>
- <property name="eclipse-projects">webservice_consumer1</property>
+ <property name="eclipse-projects">webservice_consumer1, webservice_consumer1_client</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA-P 5.0 and the runtime name should be "jboss-soa-p.5.0 Runtime"</property>
</fix>
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-jbds40.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-jbds40.xml 2011-08-03 11:58:07 UTC (rev 33541)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-jbds40.xml 2011-08-03 12:33:05 UTC (rev 33542)
@@ -463,7 +463,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43</property>
- <property name="eclipse-projects">webservice_consumer1</property>
+ <property name="eclipse-projects">webservice_consumer1, webservice_consumer1_client</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss SOA-P 4.3.0 and the runtime name should be "jboss-soa-p.4.3.0 Runtime"</property>
</fix>
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2011-08-03 11:58:07 UTC (rev 33541)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2011-08-03 12:33:05 UTC (rev 33542)
@@ -85,6 +85,7 @@
try {
IFacetedProject facetedProject = ProjectFacetsManager.create(eclipseProject);
if (facetedProject == null) {
+ fixNonFacetedEsbProject(project, fix, eclipseProject);
continue;
}
org.eclipse.wst.common.project.facet.core.runtime.IRuntime wtpRuntime = facetedProject.getPrimaryRuntime();
@@ -97,9 +98,11 @@
wtpRuntime = RuntimeManager.getRuntime(runtime.getId());
facetedProject.addTargetedRuntime(wtpRuntime, monitor);
facetedProject.setPrimaryRuntime(wtpRuntime, monitor);
- fixEsb(eclipseProject, fix, wtpRuntime);
+ fixEsb(eclipseProject, fix, runtime);
}
}
+ } else {
+ fixNonFacetedEsbProject(project, fix, eclipseProject);
}
} catch (CoreException e) {
ProjectExamplesActivator.log(e);
@@ -109,8 +112,16 @@
return ret;
}
+ private void fixNonFacetedEsbProject(Project project, ProjectFix fix,
+ IProject eclipseProject) throws JavaModelException {
+ IRuntime runtime = getBestRuntime(project, fix);
+ if (runtime != null) {
+ fixEsb(eclipseProject, fix, runtime);
+ }
+ }
+
private void fixEsb(IProject eclipseProject,
- ProjectFix fix, org.eclipse.wst.common.project.facet.core.runtime.IRuntime wtpRuntime) throws JavaModelException {
+ ProjectFix fix, IRuntime runtime) throws JavaModelException {
String required_components = fix.getProperties().get(REQUIRED_COMPONENTS);
if (required_components == null) {
return;
@@ -135,7 +146,6 @@
IClasspathEntry[] entries = javaProject.getRawClasspath();
IClasspathEntry[] newEntries = new IClasspathEntry[entries.length];
boolean changed = false;
- IRuntime runtime = getRuntime(wtpRuntime);
for (int i = 0; i < entries.length; i++) {
IClasspathEntry entry = entries[i];
if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
13 years, 5 months
JBoss Tools SVN: r33541 - trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature.
by jbosstools-commits@lists.jboss.org
Author: psrna
Date: 2011-08-03 07:58:07 -0400 (Wed, 03 Aug 2011)
New Revision: 33541
Modified:
trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/feature.xml
Log:
Modified: trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/feature.xml
===================================================================
--- trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/feature.xml 2011-08-03 08:06:17 UTC (rev 33540)
+++ trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/feature.xml 2011-08-03 11:58:07 UTC (rev 33541)
@@ -46,7 +46,7 @@
<plugin id="org.jboss.tools.jbpm.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.jsf.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.jst.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
- <plugin id="org.jboss.tools.maven.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
+<!-- <plugin id="org.jboss.tools.maven.ui.bot.test" download-size="0" install-size="0" version="0.0.0" /> -->
<plugin id="org.jboss.tools.modeshape.rest.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.seam.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.smooks.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
13 years, 5 months
JBoss Tools SVN: r33540 - trunk/build/aggregate/bottests-site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-08-03 04:06:17 -0400 (Wed, 03 Aug 2011)
New Revision: 33540
Modified:
trunk/build/aggregate/bottests-site/pom.xml
Log:
JBIDE-8734 remove default repo for http://download.jboss.org/jbosstools/builds/staging/_composite_/trunk/; make optional using -Pjbosstools-nightly-staging-composite profile flag
Modified: trunk/build/aggregate/bottests-site/pom.xml
===================================================================
--- trunk/build/aggregate/bottests-site/pom.xml 2011-08-03 07:58:35 UTC (rev 33539)
+++ trunk/build/aggregate/bottests-site/pom.xml 2011-08-03 08:06:17 UTC (rev 33540)
@@ -18,19 +18,10 @@
<module>features</module>
<module>site</module>
</modules>
+<!-- to build against locally built sources, use:
+ mvn clean install
- <repositories>
- <repository>
- <id>jbosstools-nightly-staging-composite</id>
- <url>${jbosstools-nightly-staging-composite}</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- </repository>
- </repositories>
-
+ to build against http://download.jboss.org/jbosstools/builds/staging/_composite_/trunk/, use:
+ mvn clean install -Pjbosstools-nightly-staging-composite
+-->
</project>
13 years, 5 months
JBoss Tools SVN: r33538 - trunk/tests/features/org.jboss.tools.test.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-08-03 03:48:43 -0400 (Wed, 03 Aug 2011)
New Revision: 33538
Modified:
trunk/tests/features/org.jboss.tools.test.feature/feature.xml
Log:
JBIDE-8734 tweak file layout
Modified: trunk/tests/features/org.jboss.tools.test.feature/feature.xml
===================================================================
--- trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2011-08-03 07:48:31 UTC (rev 33537)
+++ trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2011-08-03 07:48:43 UTC (rev 33538)
@@ -1,14 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.test.feature"
- label="Tools Tests"
- version="3.2.0.qualifier">
+<feature id="org.jboss.tools.test.feature" label="Tools Tests" version="3.2.0.qualifier">
- <description url="http://www.jboss.org/tools">
+ <description url="http://www.jboss.org/tools">
JBossTools unit tests feature
</description>
- <copyright>
+ <copyright>
Copyright (c) 2007-2010 Exadel, Inc and Red Hat, Inc.
Distributed under license by Red Hat, Inc. All rights reserved.
This program is made available under the terms of the
@@ -18,7 +15,7 @@
Exadel, Inc. and Red Hat, Inc. - initial API and implementation
</copyright>
- <license>
+ <license>
Red Hat, Inc. licenses these features and plugins to you under
certain open source licenses (or aggregations of such licenses), which
in a particular case may include the Eclipse Public License, the GNU
@@ -28,22 +25,8 @@
Raleigh NC 27606 USA.
</license>
- <plugin
- id="org.jboss.tools.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
+ <plugin id="org.jboss.tools.tests" download-size="0" install-size="0" version="0.0.0" />
+ <plugin id="org.jboss.tools.ui.bot.ext" download-size="0" install-size="0" version="0.0.0" />
+ <plugin id="org.jboss.tools.ui.bot.ext.test" download-size="0" install-size="0" version="0.0.0" />
- <plugin
- id="org.jboss.tools.ui.bot.ext"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.ui.bot.ext.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
</feature>
13 years, 5 months
JBoss Tools SVN: r33537 - in trunk/drools/tests: org.jboss.tools.drools.ui.bot.test and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-08-03 03:48:31 -0400 (Wed, 03 Aug 2011)
New Revision: 33537
Removed:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.classpath
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.gitignore
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.project
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/MANIFEST.MF
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/build.properties
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/pom.xml
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties
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/DecisionTableTest.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DomainSpecificLanguageEditorTest.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsRulesEditorTest.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuidedDroolsRulesEditorTest.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java
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/ManageDroolsRules.java
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/OpenDroolsPerspective.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java
trunk/drools/tests/pom.xml
Log:
move org.jboss.tools.drools.ui.bot.test from ~/trunk/drools/tests/org.jboss.tools.drools.ui.bot.test into ~/trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test (JBIDE-8734)
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.classpath
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.classpath 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.classpath 2011-08-03 07:48:31 UTC (rev 33537)
@@ -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/org.jboss.tools.drools.ui.bot.test/.gitignore
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.gitignore 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.gitignore 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1 +0,0 @@
-target
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.project
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.project 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.project 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,34 +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>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
Deleted: 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 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/.settings/org.eclipse.jdt.core.prefs 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,8 +0,0 @@
-#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
Deleted: 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 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/META-INF/MANIFEST.MF 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,21 +0,0 @@
-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,
- org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
- org.eclipse.swtbot.eclipse.finder;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,
- org.drools.eclipse;bundle-version="5.1.0",
- org.eclipse.swtbot.eclipse.gef.finder,
- org.apache.log4j;bundle-version="1.2.13"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: JBoss by Red Hat
-Import-Package: org.eclipse.ui.forms.widgets
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/build.properties
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/build.properties 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/build.properties 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,5 +0,0 @@
-source.. = src/,\
- resources/
-output.. = bin/
-bin.includes = META-INF/,\
- .
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/pom.xml
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/pom.xml 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/pom.xml 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
-
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.2-SNAPSHOT</version>
- </parent>
- <groupId>org.jboss.tools.drools</groupId>
- <artifactId>org.jboss.tools.drools.ui.bot.test</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>maven-osgi-test-plugin</artifactId>
- <version>${tychoVersion}</version>
- <configuration>
- <useUIThread>false</useUIThread>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,3 +0,0 @@
-use-external-drools-runtime=true
-guvnor-repository-url=/jboss-brms/org.drools.guvnor.Guvnor/webdav
-external-drools-runtime-home=/home/vpakan/tmp/drools
Deleted: 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 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/Activator.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,50 +0,0 @@
-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;
- }
-
-}
Deleted: 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 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * 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 java.io.File;
-
-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.DecisionTableTest;
-import org.jboss.tools.drools.ui.bot.test.smoke.DomainSpecificLanguageEditorTest;
-//import org.jboss.tools.drools.ui.bot.test.smoke.GuidedDroolsRulesEditorTest;
-import org.jboss.tools.drools.ui.bot.test.smoke.GuvnorRepositoriesTest;
-import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsRuntime;
-import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsProject;
-import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsRules;
-import org.jboss.tools.drools.ui.bot.test.smoke.DroolsRulesEditorTest;
-import org.jboss.tools.drools.ui.bot.test.smoke.OpenDroolsPerspective;
-import org.jboss.tools.drools.ui.bot.test.smoke.RuleFlowTest;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.SWTUtilExt;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
-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 Drools swtbot test case for JBoss Tools.
- *
- * @author Vladimir Pakan
- *
- */
-(a)RunWith(Suite.class)
-(a)SuiteClasses({OpenDroolsPerspective.class,
- ManageDroolsRuntime.class,
- ManageDroolsProject.class,
- ManageDroolsRules.class,
- DroolsRulesEditorTest.class,
- //GuidedDroolsRulesEditorTest.class,
- DomainSpecificLanguageEditorTest.class,
- RuleFlowTest.class,
- DecisionTableTest.class,
- GuvnorRepositoriesTest.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;
- public static String CREATE_DROOLS_RUNTIME_LOCATION = null;
- public static String SRC_MAIN_JAVA_TREE_NODE = "src/main/java";
- public static String SRC_MAIN_RULES_TREE_NODE = "src/main/rules";
- public static String COM_SAMPLE_TREE_NODE = "com.sample";
- public static String DROOLS_TEST_JAVA_TREE_NODE = "DroolsTest.java";
- public static final String TEST_DROOLS_RULE_NAME = "TestRule.drl";
- public static final String SAMPLE_DROOLS_RULE_NAME = "Sample.drl";
- public static final String GUIDED_DROOLS_RULE_NAME = "GuidedRule.brl";
- public static final String DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME = "DslTest.dsl";
- public static final String RULE_FLOW_JAVA_TEST_FILE_NAME = "ProcessTest.java";
- public static final String RULE_FLOW_RF_FILE_NAME = "ruleflow.rf";
- public static final String DECISION_TABLE_JAVA_TEST_FILE_NAME = "DecisionTableTest.java";
- public static final String USE_EXTERNAL_DROOLS_RUNTIME_PROPERTY_NAME = "use-external-drools-runtime";
- public static final String EXTERNAL_DROOLS_RUTIME_HOME_PROPERTY_NAME = "external-drools-runtime-home";
- public static final String GUVNOR_REPOSITORY_URL_PROPERTY_NAME = "guvnor-repository-url";
- private static boolean USE_EXTERNAL_DROOLS_RUNTIME;
-
- private static String testDroolsRuntimeName = null;
- private static String testDroolsRuntimeLocation = null;
- private static String guvnorRepositoryUrl = null;
- private static String guvnorRepositoryRootTreeItem = "http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/webdav/";
-
- public static String getTestDroolsRuntimeName() {
- return testDroolsRuntimeName;
- }
-
- public static void setTestDroolsRuntimeName(String testDroolsRuntimeName) {
- DroolsAllBotTests.testDroolsRuntimeName = testDroolsRuntimeName;
- }
-
- public static String getTestDroolsRuntimeLocation() {
- return testDroolsRuntimeLocation;
- }
-
- public static void setTestDroolsRuntimeLocation(String testDroolsRuntimeLocation) {
- DroolsAllBotTests.testDroolsRuntimeLocation = testDroolsRuntimeLocation;
- }
-
- public static String getGuvnorRepositoryUrl() {
- return guvnorRepositoryUrl;
- }
-
- private static void setGuvnorRepositoryUrl(String guvnorRepositoryUrl) {
- DroolsAllBotTests.guvnorRepositoryUrl = guvnorRepositoryUrl;
- }
-
- public static String getGuvnorRepositoryRootTreeItem() {
- return guvnorRepositoryRootTreeItem;
- }
-
- private static void setGuvnorRepositoryRootTreeItem(
- String guvnorRepositoryRootTreeItem) {
- DroolsAllBotTests.guvnorRepositoryRootTreeItem = guvnorRepositoryRootTreeItem;
- }
-
- @BeforeClass
- public static void setUpTest() {
- jbt.closeReportUsageWindowIfOpened(false);
- props = util.loadProperties(Activator.PLUGIN_ID);
- String guvnorRepositoryUrl = props.getProperty(DroolsAllBotTests.GUVNOR_REPOSITORY_URL_PROPERTY_NAME);
- if (guvnorRepositoryUrl != null){
- DroolsAllBotTests.setGuvnorRepositoryUrl(guvnorRepositoryUrl);
- DroolsAllBotTests.setGuvnorRepositoryRootTreeItem("http://localhost:8080" + guvnorRepositoryUrl);
- }
- String useExternalDroolRuntime = props.getProperty(DroolsAllBotTests.USE_EXTERNAL_DROOLS_RUNTIME_PROPERTY_NAME);
- DroolsAllBotTests.USE_EXTERNAL_DROOLS_RUNTIME = useExternalDroolRuntime != null && useExternalDroolRuntime.equalsIgnoreCase("true");
- String droolsRuntimeLocation = props.getProperty(DroolsAllBotTests.EXTERNAL_DROOLS_RUTIME_HOME_PROPERTY_NAME);
- String tmpDir = System.getProperty("java.io.tmpdir");
- if (droolsRuntimeLocation == null || droolsRuntimeLocation.length() ==0){
- DroolsAllBotTests.DROOLS_RUNTIME_LOCATION = tmpDir;
- }
- else{
- DroolsAllBotTests.DROOLS_RUNTIME_LOCATION = droolsRuntimeLocation;
- }
- DroolsAllBotTests.CREATE_DROOLS_RUNTIME_LOCATION = tmpDir + File.separator + "drools";
- // Create directory for Drools Runtime which will be created as a part of test
- new File(DroolsAllBotTests.CREATE_DROOLS_RUNTIME_LOCATION).mkdir();
- try{
- SWTBotView welcomeView = eclipse.getBot().viewByTitle(IDELabel.View.WELCOME);
- welcomeView.close();
- } catch (WidgetNotFoundException wnfe){
- // Do nothing ignore this error
- }
- eclipse.openPerspective(PerspectiveType.JAVA);
- eclipse.maximizeActiveShell();
- }
-
- public static boolean useExternalDroolsRuntime() {
- return USE_EXTERNAL_DROOLS_RUNTIME;
- }
-
- @AfterClass
- public static void tearDownTest() {
- // delete created drools runtime
- SWTUtilExt.deleteDirectory(DroolsAllBotTests.CREATE_DROOLS_RUNTIME_LOCATION);
- }
-}
\ No newline at end of file
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DecisionTableTest.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DecisionTableTest.java 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DecisionTableTest.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,53 +0,0 @@
- /*******************************************************************************
- * 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.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.junit.Test;
-/**
- * Tests Decision Table
- * @author Vladimir Pakan
- *
- */
-public class DecisionTableTest extends SWTTestExt{
- /**
- * Tests Decision Table
- */
- @Test
- public void testDecisionTable() {
- runDecisionTable(DroolsAllBotTests.DECISION_TABLE_JAVA_TEST_FILE_NAME);
- }
- /**
- * Runs newly created Drools project and check result
- * @param decisionTableFileName
- */
- private void runDecisionTable(String decisionTableFileName){
- console.clearConsole();
- bot.sleep(5000L);
-
- SWTBotTreeItem tiTestFile = packageExplorer.selectTreeItem(decisionTableFileName,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
- DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
-
- eclipse.runTreeItemAsJavaApplication(tiTestFile);
-
- String consoleText = console.getConsoleText(3*1000L,60*1000L,true);
-
- assertTrue(decisionTableFileName + " didn't run properly.\n" +
- "Console Text was: " + consoleText + "\n" +
- "Expected console text is: Hello World\nGoodbye cruel world\n",
- consoleText.endsWith("Hello World\nGoodbye cruel world\n"));
- }
-}
\ No newline at end of file
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DomainSpecificLanguageEditorTest.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DomainSpecificLanguageEditorTest.java 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DomainSpecificLanguageEditorTest.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,229 +0,0 @@
- /*******************************************************************************
- * 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.eclipse.swt.SWT;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
-import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
-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.view.ProblemsView;
-import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
-import org.junit.Test;
-/**
- * Tests Domain Specific Language Editor
- * @author Vladimir Pakan
- *
- */
-public class DomainSpecificLanguageEditorTest extends SWTTestExt{
- /**
- * Tests Domain Specific Language Editor
- */
- private static final String LANGUAGE_EXRESSION = "Message {msg} of type {t} contains {what}";
- @Test
- public void testDomainSpecificLanguageEditor() {
- createDslFile(DroolsAllBotTests.DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME);
- addDslExpression(DroolsAllBotTests.DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME);
- useDslExpression(DroolsAllBotTests.DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME,
- DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME);
- runDslExpressionCheck(DroolsAllBotTests.DROOLS_TEST_JAVA_TREE_NODE,
- DroolsAllBotTests.DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME);
- }
- /**
- * Creates DSL File
- * @param dslFileName
- */
- private void createDslFile(String dslFileName){
- packageExplorer.show();
- SWTBotTreeItem tiRules = packageExplorer.selectTreeItem(DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME});
-
- tiRules.select();
- eclipse.createNew(EntityType.DSL_DROOLS_FILE);
- bot.textWithLabel(IDELabel.NewDslDroolsFileDialog.FILE_NAME).setText(dslFileName);
- eclipse.selectTreeLocation(DroolsAllBotTests.DROOLS_PROJECT_NAME,
- "src",
- "main",
- "rules");
- bot.button(IDELabel.Button.FINISH).click();
- bot.sleep(Timing.time1S());
- tiRules.expand();
- // Test if new DSL File is within package tree view
- assertTrue("New DSL File was not created properly. It's not present within Package Explorer",
- SWTEclipseExt.containsTreeItemWithLabel(tiRules, dslFileName));
- // Test if new DSL File is opened in editor
- assertTrue("New DSL File was not created properly. File " + dslFileName + " is not opened in editor",
- SWTEclipseExt.existEditorWithLabel(bot,dslFileName));
-
- }
- /**
- * Adds DSL Expression to DSL File
- * @param dslFileName
- */
- private void addDslExpression(String dslFileName){
- SWTBotEditor dslRuleEditor = bot.editorByTitle(dslFileName);
- SWTBot dslRuleEditorBot = dslRuleEditor.bot();
- dslRuleEditorBot
- .button(IDELabel.Button.ADD_WITHOUT_DOTS).click();
- SWTBot dialogBot = dslRuleEditorBot
- .shell(IDELabel.DslDroolsFileEditor.ADD_LANGUAGE_MAPPING_DIALOG_TITLE)
- .activate()
- .bot();
-
- dialogBot.textWithLabel(IDELabel.DslDroolsFileEditor.LANGUAGE_EXPRESSION_TEXT_LABEL)
- .setText(DomainSpecificLanguageEditorTest.LANGUAGE_EXRESSION);
- dialogBot.textWithLabel(IDELabel.DslDroolsFileEditor.RULE_MAPPING_TEXT_LABEL)
- .setText("{msg} : Message(status == {t}, {what} : message)");
- dialogBot.comboBoxWithLabel(IDELabel.DslDroolsFileEditor.SCOPE_COMBO_LABEL)
- .setSelection(IDELabel.DslDroolsFileEditor.SCOPE_COMBO_VALUE);
- dialogBot.button(IDELabel.Button.OK).click();
- dslRuleEditor.save();
-
- assertTrue("DSL table has to containt this Language Expression:\n" +
- DomainSpecificLanguageEditorTest.LANGUAGE_EXRESSION,
- SWTEclipseExt.isItemInTableColumn(dslRuleEditorBot.table(),
- DomainSpecificLanguageEditorTest.LANGUAGE_EXRESSION,
- 0));
-
- }
- /**
- * Use defined language expression in dslFileName file within sampleDrlFileName file
- * @param dslFileName
- * @param sampleDrlFileName
- */
- private void useDslExpression (String dslFileName,String sampleDrlFileName){
- packageExplorer.show();
- SWTBotEclipseEditor drlDroolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME).toTextEditor();
- SWTBotEditorExt ruleEditor = bot.swtBotEditorExtByTitle(DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME);
- ruleEditor.selectPage(IDELabel.DroolsEditor.TEXT_EDITOR_TAB);
- // update drl file
- drlDroolsEditor.insertText(3,0,"\nexpander " +
- dslFileName +
- ";\n");
- int[] linesToIgnoreExpander = new int[]{8,10,11,12,13,20};
- for (int lineNumber : linesToIgnoreExpander){
- drlDroolsEditor.insertText(lineNumber,0,">");
- }
- drlDroolsEditor.selectLine(18);
- bot.sleep(Timing.time1S());
- KeyboardHelper.pressKeyCode(bot.getDisplay(),(int)SWT.DEL);
- bot.sleep(Timing.time1S());
- drlDroolsEditor.insertText(18, 0, " Message m of type Message.GOODBYE contains myMessage");
- drlDroolsEditor.save();
- util.waitForJobs(Timing.time10S(), JobName.BUILDING_WS);
- SWTBotTreeItem[] errors = ProblemsView
- .getFilteredErrorsTreeItems(bot,
- null,
- null,
- sampleDrlFileName,
- null);
- assertTrue("File "
- + sampleDrlFileName
- + " was not udpated properly. There are these errors: "
- + SWTEclipseExt.getFormattedTreeNodesText(bot.tree(), errors),
- errors == null || errors.length == 0);
-
- SWTBotTreeItem[] warnings = ProblemsView
- .getFilteredWarningsTreeItems(bot,
- null,
- null,
- sampleDrlFileName,
- null);
- assertTrue("File "
- + sampleDrlFileName
- + " was not udpated properly. There are these warnings: "
- + SWTEclipseExt.getFormattedTreeNodesText(bot.tree(), warnings),
- warnings == null || warnings.length == 0);
- }
- /**
- * Runs javaFileName testing defined DSL
- * @param javaFileName
- * @param dslFileName
- */
- private void runDslExpressionCheck(String javaFileName,
- String dslFileName){
-
- packageExplorer.show();
- SWTBotEclipseEditor drlDroolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
- DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
- DroolsAllBotTests.COM_SAMPLE_TREE_NODE,
- javaFileName).toTextEditor();
- // Change java file content to support new DSL
- updateJavaTestFile(drlDroolsEditor,dslFileName);
-
- console.clearConsole();
- bot.sleep(Timing.time5S());
-
- SWTBotTreeItem tiTestFile = packageExplorer.selectTreeItem(javaFileName,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
- DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
-
- eclipse.runTreeItemAsJavaApplication(tiTestFile);
-
- String consoleText = console.getConsoleText(3*1000L,60*1000L,true);
-
- assertTrue(javaFileName + " didn't run properly.\n" +
- "Console Text was: " + consoleText + "\n" +
- "Expected console text is: " + "Hello World\nGoodbye cruel world\n",
- "Hello World\nGoodbye cruel world\n".equals(consoleText));
- }
- /**
- * Update properly Java Test file in drlDroolsEditor to be able to run
- * with new DSL definition
- * @param drlDroolsEditor
- * @param dslFileName
- */
- private void updateJavaTestFile(SWTBotEclipseEditor drlDroolsEditor,
- String dslFileName){
- int lineIndex = 0;
- String foundLineText = null;
- while (lineIndex < drlDroolsEditor.getLineCount() && foundLineText == null){
- String lineText = drlDroolsEditor.getTextOnLine(lineIndex);
- if(lineText.trim().startsWith("kbuilder.add")){
- foundLineText = lineText;
- }
- else{
- lineIndex++;
- }
- }
- if (foundLineText != null){
- drlDroolsEditor.insertText(lineIndex,0,
- "kbuilder.add(ResourceFactory.newClassPathResource(\"" +
- dslFileName +
- "\"), ResourceType.DSL);\n");
- lineIndex++;
- drlDroolsEditor.selectLine(lineIndex);
- KeyboardHelper.pressKeyCode(bot.getDisplay(),(int)SWT.DEL);
- drlDroolsEditor.insertText(foundLineText
- .replace("ResourceType.DRL","ResourceType.DSLR") + "\n");
- drlDroolsEditor.save();
- util.waitForJobs(Timing.time10S(), JobName.BUILDING_WS);
- }
- else{
- throw new RuntimeException("File " +
- drlDroolsEditor.getTitle() +
- " has wrong content. It doesn't contain 'kbuilder.add' string.");
- }
- }
-
-}
\ No newline at end of file
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsRulesEditorTest.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsRulesEditorTest.java 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsRulesEditorTest.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,95 +0,0 @@
- /*******************************************************************************
- * 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.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
-import org.eclipse.swtbot.swt.finder.utils.Position;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.parts.ContentAssistBot;
-import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
-import org.junit.Test;
-/**
- * Tests Drools Rule Editor
- * @author Vladimir Pakan
- *
- */
-public class DroolsRulesEditorTest extends SWTTestExt{
- /**
- * Tests Drools Rule Editor
- */
- private static final String CONTENT_ASSIST_IMPORT = "import";
- private static final String CONTENT_ASSIST_MESSAGE = "Message";
- @Test
- public void testDroolsRulesEditor() {
- codeCompletionCheck(DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME);
- reteViewCheck(DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME);
- }
- /**
- * Check code completion for Drools Rule
- * @param droolsRuleName
- */
- private void codeCompletionCheck(String droolsRuleName){
-
- packageExplorer.show();
- packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,droolsRuleName);
- SWTBotEditorExt ruleEditor = bot.swtBotEditorExtByTitle(droolsRuleName);
- ruleEditor.selectPage(IDELabel.DroolsEditor.TEXT_EDITOR_TAB);
- ruleEditor.typeText(3, 0, "i");
- ContentAssistBot contentAssist = ruleEditor.contentAssist();
- contentAssist.checkContentAssist(DroolsRulesEditorTest.CONTENT_ASSIST_IMPORT, true);
- ruleEditor.typeText(6, 0, "m");
- contentAssist.checkContentAssist(DroolsRulesEditorTest.CONTENT_ASSIST_MESSAGE, true);
-
- SWTBotEclipseEditor ruleTextEditor = ruleEditor.toTextEditor();
- String lineText = ruleTextEditor.getTextOnLine(3).trim();
- assertTrue("Content Assist for " + DroolsRulesEditorTest.CONTENT_ASSIST_IMPORT +
- " was not inserted properly.\n" +
- "Inserted text is: " + lineText + "\n" +
- "Expected text is: " + DroolsRulesEditorTest.CONTENT_ASSIST_IMPORT,
- lineText.equals(DroolsRulesEditorTest.CONTENT_ASSIST_IMPORT));
-
- lineText = ruleTextEditor.getTextOnLine(6).trim();
- String messageContentAssistText = DroolsRulesEditorTest.CONTENT_ASSIST_MESSAGE + "( )";
- assertTrue("Content Assist for " + DroolsRulesEditorTest.CONTENT_ASSIST_MESSAGE +
- " was not inserted properly.\n" +
- "Inserted text is: " + lineText + "\n" +
- "Expected text has to stard with: " + messageContentAssistText,
- lineText.startsWith(messageContentAssistText));
-
- Position cursorPosition = ruleTextEditor.cursorPosition();
- assertTrue("Content Assist for " + DroolsRulesEditorTest.CONTENT_ASSIST_MESSAGE +
- " was not inserted properly.\n" +
- "Position of cursor is wrong: " + cursorPosition + "\n" +
- "Expected X cursor position is: " + 9,
- cursorPosition.column == 9);
-
- ruleEditor.close();
-
- }
- /**
- * Check Rete View of Drools Rule
- * @param droolsRuleName
- */
- private void reteViewCheck(String droolsRuleName){
-
- packageExplorer.show();
- packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,droolsRuleName);
- SWTBotEditorExt ruleEditor = bot.swtBotEditorExtByTitle(droolsRuleName);
- ruleEditor.selectPage(IDELabel.DroolsEditor.RETE_TREE_TAB);
-
- }
-}
-
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuidedDroolsRulesEditorTest.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuidedDroolsRulesEditorTest.java 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuidedDroolsRulesEditorTest.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,175 +0,0 @@
- /*******************************************************************************
- * 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.awt.event.KeyEvent;
-
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.helper.ImageHyperlinkHelper;
-import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
-import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
-import org.jboss.tools.ui.bot.ext.types.EntityType;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
-import org.junit.Test;
-/**
- * Tests Guided Drools Rule Editor
- * @author Vladimir Pakan
- *
- */
-public class GuidedDroolsRulesEditorTest extends SWTTestExt{
- private static final String DROOLS_PACKAGE_FILE = "drools.package";
- /**
- * Tests Guided Drools Rule Editor
- */
- @Test
- public void testGuidedDroolsRulesEditorTest() {
- createGuidedDroolsRule(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
- editDroolsPackageFile();
- addGuidedDroolsRuleCondition(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
- removeGuidedDroolsRuleCondition(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
- }
- /**
- * Creates Guided Drools Rule
- * @param guidedDroolsRuleName
- */
- private void createGuidedDroolsRule(String guidedDroolsRuleName){
- packageExplorer.show();
- SWTBotTreeItem tiRules = packageExplorer.selectTreeItem(DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME});
-
- tiRules.select();
- eclipse.createNew(EntityType.GUIDED_DROOLS_RULE);
- bot.textWithLabel(IDELabel.NewGuidedDroolsRuleDialog.FILE_NAME).setText(guidedDroolsRuleName);
- eclipse.selectTreeLocation(DroolsAllBotTests.DROOLS_PROJECT_NAME,
- "src",
- "main",
- "rules");
- bot.button(IDELabel.Button.FINISH).click();
- bot.sleep(Timing.time1S());
- tiRules.expand();
- // Test if new Drools Rule is within package tree view
- assertTrue("New Guided Drools Rule was not created properly. It's not present within Package Explorer",
- SWTEclipseExt.containsTreeItemWithLabel(tiRules, guidedDroolsRuleName));
- // Test if new Drools Rule is opened in editor
- assertTrue("New Guided Drools Rule was not created properly. File " + guidedDroolsRuleName + " is not opened in editor",
- SWTEclipseExt.existEditorWithLabel(bot,guidedDroolsRuleName));
- // Test if drools.package file is within package tree view
- assertTrue("New Guided Drools Rule was not created properly. It's not present within Package Explorer",
- SWTEclipseExt.containsTreeItemWithLabel(tiRules,
- GuidedDroolsRulesEditorTest.DROOLS_PACKAGE_FILE));
- }
- /**
- * Edits drools.package file.
- * Actually only adds import java.util.List to file
- */
- private void editDroolsPackageFile(){
- packageExplorer.show();
- SWTBotEclipseEditor droolsPackageEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- GuidedDroolsRulesEditorTest.DROOLS_PACKAGE_FILE).toTextEditor();
- droolsPackageEditor.setText(droolsPackageEditor.getText() +
- "\nimport java.util.List;");
- droolsPackageEditor.save();
- droolsPackageEditor.close();
- }
-
- private void addGuidedDroolsRuleCondition(String guidedDroolsRuleName){
- packageExplorer.show();
- SWTBotEclipseEditor droolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME).toTextEditor();
- SWTBot droolsEditorBot = droolsEditor.bot();
- droolsEditorBot.toolbarButton().click();
- SWTBotShell dialogShell = droolsEditorBot.shell(IDELabel.GuidedDroolsRuleEditor.WHEN_ADD_DIALOG_TITLE);
- dialogShell.activate();
- dialogShell.bot().comboBoxWithLabel(IDELabel.GuidedDroolsRuleEditor.WHEN_ADD_FACT_COMBO)
- .setSelection("List");
- ImageHyperlinkHelper
- .imageHyperlinkWithTooltip(droolsEditorBot,
- IDELabel.GuidedDroolsRuleEditor.ADD_FIELD_TO_THIS_CONDITION_TOOLTIP)
- .click();
- dialogShell = droolsEditorBot.shell(IDELabel.GuidedDroolsRuleEditor.UPDATE_CONSTRAINTS_DIALOG_TITLE);
- dialogShell.activate();
- dialogShell.bot().comboBox()
- .setSelection(IDELabel.GuidedDroolsRuleEditor.ADD_RESTRICTION_ON_A_FIELD_COMBO_VALUE);
- droolsEditorBot.comboBox()
- .setSelection(IDELabel.GuidedDroolsRuleEditor.WHEN_COMBO_CONSTRAINTS_VALUE);
- ImageHyperlinkHelper
- .imageHyperlinkWithTooltip(droolsEditorBot,
- IDELabel.GuidedDroolsRuleEditor.CHOOSE_VALUE_EDITOR_TYPE_TOOLTIP)
- .click();
- dialogShell = droolsEditorBot.shell(IDELabel.GuidedDroolsRuleEditor.SELECT_VALUE_EDITOR_TYPE_DIALOG_TITLE);
- dialogShell.activate();
- dialogShell.bot().comboBoxWithLabel(IDELabel.GuidedDroolsRuleEditor.SELECT_VALUE_EDITOR_TYPE_COMBO_LABEL)
- .setSelection(IDELabel.GuidedDroolsRuleEditor.SELECT_VALUE_EDITOR_TYPE_COMBO_VALUE);
- droolsEditorBot.comboBox(1).setSelection(IDELabel.GuidedDroolsRuleEditor.FIELD_VALUE_COMBO_VALUE);
- droolsEditor.save();
- droolsEditor.close();
- droolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME).toTextEditor();
- SWTBotEditorExt ruleEditor = bot.swtBotEditorExtByTitle(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
- ruleEditor.selectPage(2);
- String editorContent = droolsEditor.getText();
- assertTrue(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME +
- " has to contain text: List( empty == true )\n" +
- "but it doesn't.\n" +
- "It contains this text: " + editorContent,
- editorContent.replaceAll(" ","").indexOf("List(empty==true)") > 0);
- }
- /**
- * Removes Drools Rule Condition from Guided Drools Rule
- * @param guidedDroolsRuleName
- */
- private void removeGuidedDroolsRuleCondition(String guidedDroolsRuleName){
- packageExplorer.show();
- SWTBotEclipseEditor droolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME).toTextEditor();
- SWTBot droolsEditorBot = droolsEditor.bot();
- SWTBotEditorExt ruleEditor = bot.swtBotEditorExtByTitle(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
- ruleEditor.selectPage(0);
- ImageHyperlinkHelper
- .imageHyperlinkWithTooltip(droolsEditorBot,
- IDELabel.GuidedDroolsRuleEditor.REMOVE_THIS_CONDITION_TOOLTIP)
- .click();
- bot.sleep(Timing.time1S());
- KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_RIGHT);
- KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_RIGHT);
- bot.sleep(Timing.time1S());
- KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_ENTER);
- KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_ENTER);
- bot.sleep(Timing.time1S());
- droolsEditor.save();
- droolsEditor.close();
- droolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME).toTextEditor();
- ruleEditor = bot.swtBotEditorExtByTitle(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
- ruleEditor.selectPage(2);
- String editorContent = droolsEditor.getText();
- assertTrue(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME +
- " has to contain textjak e:\nwhen\nthen\n" +
- "but it doesn't.\n" +
- "It contains this text: " + editorContent,
- ruleEditor.getTextOnLine(2).trim().equals("when") &&
- ruleEditor.getTextOnLine(3).trim().equals("then"));
- }
-
-}
\ No newline at end of file
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,542 +0,0 @@
- /*******************************************************************************
- * 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 static org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.syncExec;
-
-import java.awt.event.KeyEvent;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory;
-import org.eclipse.swtbot.swt.finder.results.StringResult;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.hamcrest.Matcher;
-import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
-import org.jboss.tools.ui.bot.ext.config.requirement.PrepareViews;
-import org.jboss.tools.ui.bot.ext.config.requirement.RequirementNotFulfilledException;
-import org.jboss.tools.ui.bot.ext.config.requirement.StartServer;
-import org.jboss.tools.ui.bot.ext.config.requirement.StopServer;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.GuvnorGuvnorResourceHistory;
-import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-import org.jboss.tools.ui.bot.ext.helper.DragAndDropHelper;
-import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
-import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
-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.PerspectiveType;
-import org.jboss.tools.ui.bot.ext.view.GuvnorRepositories;
-import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.SWTUtilExt;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.junit.Test;
-/**
- * Tests Guvnor Repositories
- * @author Vladimir Pakan
- *
- */
-public class GuvnorRepositoriesTest extends SWTTestExt{
- @SuppressWarnings("unused")
- private static final Logger log = Logger.getLogger(GuvnorRepositoriesTest.class);
- private static final String GUVNOR_TEST_FILE = "Dummy rule.drl";
- private static final String GUVNOR_REPOSITORY_IMPORT_TEST_FILE = "Underage.brl";
- private static final String GUVNOR_REPOSITORY_HISTORY_TEST_FILE = "MortgageModel.model.drl";
- private static final String GUVNOR_USER_NAME = "admin";
- private static final String GUVNOR_PASSWORD = "admin";
- private GuvnorRepositories guvnorRepositories = new GuvnorRepositories();
-
- /**
- * Tests Guvnor Repositories
- */
- @Test
- public void testGuvnorRepositories() {
- startGuvnor();
- addGuvnorRepository();
- deleteGuvnorRepository();
- addGuvnorRepository();
- openGuvnorConsole();
- drillIntoFunctionalityCheck();
- browseGuvnorRepository(GuvnorRepositoriesTest.GUVNOR_TEST_FILE);
- guvnorFunctionalityCheck(GuvnorRepositoriesTest.GUVNOR_TEST_FILE,
- DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME,
- GuvnorRepositoriesTest.GUVNOR_REPOSITORY_IMPORT_TEST_FILE);
- repositoryHistoryCheck(GuvnorRepositoriesTest.GUVNOR_REPOSITORY_HISTORY_TEST_FILE);
- stopGuvnor();
- }
-
- /**
- * Adds Guvnor Repository
- */
- private void addGuvnorRepository(){
- eclipse.openPerspective(PerspectiveType.GUVNOR_REPOSITORY_EXPLORING);
- SWTBot guvnorRepositoriesBot = guvnorRepositories.show().bot();
- SWTUtilExt.getViewToolbarButtonWithTooltip(
- guvnorRepositories.show(),
- IDELabel.GuvnorRepositories.ADD_GUVNOR_REPOSITORY_TOOLTIP)
- .click();
- eclipse.waitForShell("");
- SWTBot addGuvnorRepositoryDialog = guvnorRepositoriesBot.activeShell().bot();
- String guvnorRepositoryUrl = DroolsAllBotTests.getGuvnorRepositoryUrl();
- if (guvnorRepositoryUrl != null && guvnorRepositoryUrl.length() > 0){
- addGuvnorRepositoryDialog.textWithLabel(IDELabel.GuvnorAddRepositoryDialog.REPOSITORY)
- .setText(guvnorRepositoryUrl);
- }
- addGuvnorRepositoryDialog.button(IDELabel.Button.FINISH).click();
- assertTrue("Guvnor repository was not created properly",
- guvnorRepositoriesBot.tree().rowCount() == 1);
- }
- /**
- * Deletes Guvnor Repostiry
- */
- private void deleteGuvnorRepository(){
- SWTBot guvnorRepositoriesBot = guvnorRepositories.show().bot();;
- SWTBotTree guvnorRepositoryTree = guvnorRepositoriesBot.tree();
- guvnorRepositoryTree.select(0);
- SWTUtilExt.getViewToolbarButtonWithTooltip(
- guvnorRepositories.show(),
- IDELabel.GuvnorRepositories.REMOVE_GUVNOR_REPOSITORY_TOOLTIP)
- .click();
- guvnorRepositoriesBot.shell(IDELabel.GuvnorRepositories.REMOVE_GUVNOR_REPOSITORY_DIALOG_TITLE)
- .activate();
- bot.button(IDELabel.Button.OK).click();
- assertTrue("Guvnor repository was not deleted properly",
- guvnorRepositoriesBot.tree().rowCount() == 0);
- }
- /**
- * Opens Guvnor Console
- */
- private void openGuvnorConsole(){
- SWTBot guvnorRepositoriesBot = guvnorRepositories.show().bot();
- SWTBotTree guvnorRepositoryTree = guvnorRepositoriesBot.tree();
- SWTBotTreeItem tiGuvnorRepository = guvnorRepositoryTree.getAllItems()[0];
- ContextMenuHelper.prepareTreeItemForContextMenu(guvnorRepositoryTree, tiGuvnorRepository);
- new SWTBotMenu(ContextMenuHelper.getContextMenu(guvnorRepositoryTree,
- IDELabel.Menu.OPEN_GUVNOR_CONSOLE, false)).click();
- bot.sleep(Timing.time5S());
- SWTBotBrowserExt browser = bot.browserByTitle(IDELabel.GuvnorConsole.GUVNOR_CONSOLE_TITLE);
- browser.setInputTextViaJavaScript(GuvnorRepositoriesTest.GUVNOR_USER_NAME, 0, bot);
- browser.setInputTextViaJavaScript(GuvnorRepositoriesTest.GUVNOR_PASSWORD, 1, bot);
- browser.clickOnButtonViaJavaScript(0, bot);
- browser.clickOnButtonViaJavaScript(IDELabel.GuvnorConsole.BUTTON_YES_INSTALL_SAMPLES, bot);
- bot.sleep(Timing.time1S());
- KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_RIGHT);
- KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_RIGHT);
- bot.sleep(Timing.time1S());
- KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_ENTER);
- KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_ENTER);
- bot.sleep(Timing.time10S());
- KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_ENTER);
- KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_ENTER);
- }
- /**
- * Browse Guvnor Repository and open fileToOpenFile
- * @param fileToOpen
- */
- private void browseGuvnorRepository(String fileToOpen){
-
- guvnorRepositories.show();
-
- guvnorRepositories.openFile(Timing.time3S(),DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
- IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
- IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM,
- fileToOpen);
-
- assertTrue("File from Guvnor Repository was not opened properly. File " + fileToOpen + " is not opened in editor",
- SWTEclipseExt.existEditorWithLabel(bot,fileToOpen + " (Read only)"));
-
- }
- /**
- * Starts Guvnor AS
- */
- private void startGuvnor(){
- try {
- new StartServer().fulfill();
- new PrepareViews().fulfill();
- } catch (RequirementNotFulfilledException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Stops Guvnor AS
- */
- private void stopGuvnor(){
- try {
- new StopServer().fulfill();
- } catch (RequirementNotFulfilledException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Imports file with fileName to Drools project and check update and commit Guvnor functionality
- * @param fileName
- * @param sampleFileName
- * @param importFileName
- */
- private void guvnorFunctionalityCheck(String fileName, String sampleFileName, String importFileName){
- eclipse.openPerspective(PerspectiveType.JAVA);
- guvnorRepositories.show().bot();
- SWTBotTreeItem tiGuvnorFile = guvnorRepositories.selectTreeItem(Timing.time3S(),fileName,
- new String[]{DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
- IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
- IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM});
- tiGuvnorFile.select();
- SWTBot packageExplorerBot = packageExplorer.show().bot();
- SWTBotTreeItem tiDroolRuleDir = packageExplorer.selectTreeItem(DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME});
- DragAndDropHelper.dragAndDropOnTo(tiGuvnorFile.widget,tiDroolRuleDir.widget);
- bot.sleep(Timing.time5S());
- bot.shell(IDELabel.Shell.COPY_FILE_FROM_GUVNOR_TO_PACKAGE_EXPLORER).activate();
- bot.button(IDELabel.Button.OK).click();
- SWTBotTree packageExplorerTree = packageExplorerBot.tree();
- // File is renamed because there is appended Guvnor info to Tree Item Label
- // So we need to get real label of Tree Item and use it later
- SWTBotTreeItem tiDroolRuleFile = SWTEclipseExt.getTreeItemOnPathStartsWith(packageExplorerBot,
- packageExplorerTree,
- Timing.time1S(),
- fileName,
- new String[]{DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE});
- SWTBotEditor editor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- tiDroolRuleFile.getText());
-
- assertTrue("File moved from Guvnor Repository to Drools project was not opened properly. File " + fileName + " is not opened in editor",
- SWTEclipseExt.existEditorWithLabel(bot,fileName));
- // Test Update from Guvnor Repository
- final String changeText = "#$%SWTBot Change#$%";
- final String originalEditorText = editor.toTextEditor().getText();
- editor.toTextEditor().insertText(0, 0, changeText);
- editor.save();
- bot.sleep(Timing.time1S());
- ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiDroolRuleFile);
- ContextMenuHelper.clickContextMenu(packageExplorerTree,
- IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_UPDATE);
- bot.sleep(Timing.time5S());
- assertTrue("Update from Guvnor Repository was not successful. File " + fileName + " has not updated content.",
- editor.toTextEditor().getText().equals(originalEditorText));
- // Test commit to Guvnor Repository
- editor.toTextEditor().insertText(0, 0, changeText);
- editor.save();
- bot.sleep(Timing.time1S());
- ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiDroolRuleFile);
- ContextMenuHelper.clickContextMenu(packageExplorerTree,
- IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_COMMIT);
- bot.sleep(Timing.time5S());
- editor.close();
- editor = guvnorRepositories.openFile(Timing.time2S(),DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
- IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
- IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM,
- fileName);
- assertTrue("Commit to Guvnor Repository was not successful. File " + fileName + " was not commited properly." +
- "\nIt has content: " + editor.toTextEditor().getText() +
- "\nExpected content: " + changeText + originalEditorText,
- editor.toTextEditor().getText().equals(changeText + originalEditorText));
- // Test Add To Repository
- SWTBotTreeItem tiSampleFile = packageExplorer.selectTreeItem(sampleFileName,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE});
- ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiSampleFile);
- ContextMenuHelper.clickContextMenu(packageExplorerTree,
- IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_ADD);
- eclipse.waitForShell("");
- SWTBotShell addToGuvnorShell = packageExplorerBot.activeShell();
- SWTBot addToGuvnorDialogBot = addToGuvnorShell.bot();
- addToGuvnorDialogBot.button(IDELabel.Button.NEXT).click();
- SWTEclipseExt.getTreeItemOnPath(addToGuvnorDialogBot,
- addToGuvnorDialogBot.tree(),
- Timing.time3S(),
- IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM,
- new String[]{DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
- IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM})
- .select();
- bot.sleep(Timing.time5S());
- addToGuvnorDialogBot.button(IDELabel.Button.FINISH).click();
- eclipse.waitForClosedShell(addToGuvnorShell);
- boolean isAddedToGuvnorRepository = false;
- try{
- guvnorRepositories.selectTreeItem(Timing.time2S(),sampleFileName,
- new String[]{DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
- IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
- IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM});
- isAddedToGuvnorRepository = true;
- } catch (WidgetNotFoundException wnfe){
- isAddedToGuvnorRepository = false;
- }
-
- assertTrue("File " + sampleFileName + " was not added to Guvnor Repository.",
- isAddedToGuvnorRepository);
- // Test Deleting from Guvnor Repository file is already selected in Guvnor Repository Tree
- packageExplorerBot = packageExplorer.show().bot();
- packageExplorerTree = packageExplorerBot.tree();
- packageExplorerBot.sleep(Timing.time2S());
- ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiSampleFile);
- ContextMenuHelper.clickContextMenu(packageExplorerTree,
- IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_DELETE);
- SWTBot dialogBot = packageExplorerBot.shell(IDELabel.Shell.CONFIRM_DELETE).activate().bot();
- dialogBot.button(IDELabel.Button.OK).click();
- packageExplorerBot.sleep(Timing.time2S());
- boolean isRemovedFromGuvnorRepository = false;
- try{
- guvnorRepositories.selectTreeItem(Timing.time2S(),sampleFileName,
- new String[]{DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
- IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
- IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM});
- isRemovedFromGuvnorRepository = false;
- } catch (WidgetNotFoundException wnfe){
- isRemovedFromGuvnorRepository = true;
- }
- assertTrue("File " + sampleFileName + " was not removed from Guvnor Repository.",
- isRemovedFromGuvnorRepository);
- // Import File From Repository
- eclipse.createNew(EntityType.RESOURCES_FROM_GUVNOR);
- bot.button(IDELabel.Button.NEXT).click();
- bot.sleep(Timing.time2S());
- SWTEclipseExt.getTreeItemOnPath(
- bot,
- bot.tree(),
- Timing.time5S(),
- importFileName,
- new String[] {
- DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
- IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
- IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM }).select();
- bot.button(IDELabel.Button.NEXT).click();
- SWTEclipseExt.getTreeItemOnPath(bot,
- bot.tree(),
- Timing.time1S(),
- "rules",
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,"src","main"}).select();
- bot.button(IDELabel.Button.FINISH).click();
- util.waitForJobs(Timing.time5S(),JobName.BUILDING_WS);
- bot.sleep(Timing.time1S());
- packageExplorerBot = packageExplorer.show().bot();
- packageExplorerTree = packageExplorerBot.tree();
- boolean isAddedFromGuvnorRepository = false;
- SWTBotTreeItem tiImportRuleFile = null;
- try{
- tiImportRuleFile = SWTEclipseExt.getTreeItemOnPathStartsWith(packageExplorerBot,
- packageExplorerTree,
- Timing.time1S(),
- importFileName,
- new String[]{DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE});
- isAddedFromGuvnorRepository = true;
- } catch (WidgetNotFoundException wnfe){
- isAddedFromGuvnorRepository = false;
- }
- assertTrue("File " + importFileName + " was not added from Guvnor Repository.",
- isAddedFromGuvnorRepository);
-
- ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiImportRuleFile);
- ContextMenuHelper.clickContextMenu(packageExplorerTree,
- IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_DISCONNECT);
- bot.sleep(Timing.time1S());
- // name of the file has to be without Guvnor information appended to end of file name
- // when imported from Guvnor repository
- assertTrue("File " + importFileName + " was not disconnected from Guvnor Repository.",
- tiImportRuleFile.getText().trim().equals(importFileName));
- }
- private void drillIntoFunctionalityCheck(){
- SWTBotView guvnorReposioryView = guvnorRepositories.show();
- SWTBotTreeItem tiRoot = guvnorRepositories.selectTreeItem(DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),null)
- .doubleClick();
- bot.sleep(Timing.time5S());
- SWTBotShell activeShell = bot.activeShell();
- SWTBot dialogBot = null;
- if (activeShell.getText().length() != 0){
- dialogBot = bot.shell("").activate().bot();
- }
- else{
- dialogBot = activeShell.bot();
- }
-
- dialogBot.textWithLabel(IDELabel.GuvnorConsoleLoginDialog.USER_NAME).setText(
- GuvnorRepositoriesTest.GUVNOR_USER_NAME);
- dialogBot.textWithLabel(IDELabel.GuvnorConsoleLoginDialog.PASSWORD).setText(
- GuvnorRepositoriesTest.GUVNOR_PASSWORD);
- dialogBot.button(IDELabel.Button.OK).click();
- tiRoot.expand();
- bot.sleep(Timing.time2S());
- tiRoot.select(IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM);
- SWTUtilExt.getViewToolbarButtonWithTooltip(guvnorReposioryView,
- IDELabel.GuvnorRepositories.GO_INTO_GUVNOR_REPOSITORY_TOOLTIP)
- .click();
- SWTBot guvnorRepositoryBot = guvnorReposioryView.bot();
- SWTBotTree guvnorRepositoryTree = guvnorRepositoryBot.tree();
- guvnorRepositoryBot.sleep(Timing.time3S());
- assertTrue("Guvnor repository Go Into functionality doesn't work properly.\n" +
- "Expected First Tree Item in Guvnor Repository is " + IDELabel.GuvnorRepositories.DEFAULT_PACKAGE_TREE_ITEM +
- "\nBut it was " + guvnorRepositoryTree.getAllItems()[0].getText(),
- IDELabel.GuvnorRepositories.DEFAULT_PACKAGE_TREE_ITEM.equals(guvnorRepositoryTree.getAllItems()[0].getText()));
-
- guvnorRepositories.selectTreeItem(Timing.time2S(), IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM,
- null);
- SWTUtilExt.getViewToolbarButtonWithTooltip(guvnorReposioryView,
- IDELabel.GuvnorRepositories.GO_INTO_GUVNOR_REPOSITORY_TOOLTIP)
- .click();
- guvnorRepositoryBot.sleep(Timing.time3S());
- assertTrue("Guvnor repository Go Into functionality doesn't work properly.\n" +
- "Expected First Tree Item in Guvnor Repository is " + IDELabel.GuvnorRepositories.APPLICANTDSL_DSL_TREE_ITEM +
- "\nBut it was " + guvnorRepositoryTree.getAllItems()[0].getText(),
- IDELabel.GuvnorRepositories.APPLICANTDSL_DSL_TREE_ITEM.equals(guvnorRepositoryTree.getAllItems()[0].getText()));
-
- SWTUtilExt.getViewToolbarButtonWithTooltip(guvnorReposioryView,
- IDELabel.GuvnorRepositories.BACK_GUVNOR_REPOSITORY_TOOLTIP)
- .click();
- guvnorRepositoryBot.sleep(Timing.time3S());
- assertTrue("Guvnor repository Back functionality doesn't work properly.\n" +
- "Expected First Tree Item in Guvnor Repository is " + IDELabel.GuvnorRepositories.DEFAULT_PACKAGE_TREE_ITEM +
- "\nBut it was " + guvnorRepositoryTree.getAllItems()[0].getText(),
- IDELabel.GuvnorRepositories.DEFAULT_PACKAGE_TREE_ITEM.equals(guvnorRepositoryTree.getAllItems()[0].getText()));
-
- SWTUtilExt.getViewToolbarButtonWithTooltip(guvnorReposioryView,
- IDELabel.GuvnorRepositories.HOME_GUVNOR_REPOSITORY_TOOLTIP)
- .click();
- guvnorRepositoryBot.sleep(Timing.time3S());
- assertTrue("Guvnor repository Home functionality doesn't work properly.\n" +
- "Expected First Tree Item in Guvnor Repository is " + DroolsAllBotTests.getGuvnorRepositoryRootTreeItem() +
- "\nBut it was " + guvnorRepositoryTree.getAllItems()[0].getText(),
- DroolsAllBotTests.getGuvnorRepositoryRootTreeItem().equals(guvnorRepositoryTree.getAllItems()[0].getText()));
- }
- /**
- * Check Repository History Functionality
- * @param testFileName
- */
- private void repositoryHistoryCheck (String testFileName){
- // Import File From Repository
- eclipse.createNew(EntityType.RESOURCES_FROM_GUVNOR);
- bot.button(IDELabel.Button.NEXT).click();
- SWTEclipseExt.getTreeItemOnPath(
- bot,
- bot.tree(),
- Timing.time5S(),
- testFileName,
- new String[] {
- DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
- IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
- IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM }).select();
- bot.button(IDELabel.Button.NEXT).click();
- SWTEclipseExt.getTreeItemOnPath(bot,
- bot.tree(),
- Timing.time1S(),
- "rules",
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,"src","main"}).select();
- bot.button(IDELabel.Button.FINISH).click();
- util.waitForJobs(Timing.time5S(),JobName.BUILDING_WS);
- bot.sleep(Timing.time1S());
- SWTBot packageExplorerBot = packageExplorer.show().bot();
- SWTBotTree packageExplorerTree = packageExplorerBot.tree();
- // File is renamed because there is appended Guvnor info to Tree Item Label
- // So we need to get real label of Tree Item and use it later
- SWTBotTreeItem tiTestRuleFile = SWTEclipseExt.getTreeItemOnPathStartsWith(packageExplorerBot,
- packageExplorerTree,
- Timing.time1S(),
- testFileName,
- new String[]{DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE});
- SWTBotEditor editor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- tiTestRuleFile.getText());
- // change test file
- String addedChange = "SWTBOT Change!@#$asdfghjkl)(*&^";
- editor.toTextEditor().insertText(0,0,addedChange);
- editor.save();
- bot.sleep(Timing.time1S());
- // commit changes
- ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiTestRuleFile);
- ContextMenuHelper.clickContextMenu(packageExplorerTree,
- IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_COMMIT);
- bot.sleep(Timing.time5S());
- // check history
- ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiTestRuleFile);
- ContextMenuHelper.clickContextMenu(packageExplorerTree,
- IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_SHOW_HISTORY);
- bot.sleep(Timing.time5S());
- SWTBotView guvnorResourceHistoryView = open.viewOpen(GuvnorGuvnorResourceHistory.LABEL);
- SWTBot guvnorResourceHistoryBot = guvnorResourceHistoryView.bot();
- SWTBotTable guvnorResourceHistoryTable = guvnorResourceHistoryView.bot().table();
- assertTrue("Guvnor Resource History table for file " + testFileName +
- " has to contain at least one record but is empty.",
- guvnorResourceHistoryTable.rowCount() > 0);
- // Compare Revisions
- String secondAddedChange = "222222" + addedChange;
- editor.toTextEditor().insertText(0,0,secondAddedChange);
- editor.saveAndClose();
- bot.sleep(Timing.time1S());
- ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiTestRuleFile);
- ContextMenuHelper.clickContextMenu(packageExplorerTree,
- IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_COMPARE_WITH_VERSION);
- eclipse.waitForShell("");
- guvnorResourceHistoryBot.activeShell().bot().button(IDELabel.Button.OK).click();
- SWTBotEditor compareEditor = bot.editorByTitle("Compare");
- Matcher<StyledText> widgetOfTypeMatcher = WidgetMatcherFactory.widgetOfType(StyledText.class);
- final List<?> styledTexts = compareEditor.bot().widgets(widgetOfTypeMatcher,compareEditor.getWidget());
- String newVersionEditorText = syncExec(new StringResult() {
- public String run() {
- return ((StyledText)styledTexts.get(0)).getText();
- }
- });
- String revisionEditorText = syncExec(new StringResult() {
- public String run() {
- return ((StyledText)styledTexts.get(1)).getText();
- }
- });
- compareEditor.close();
- assertTrue("Actual version of file opened within compare editor has wrong content.\n" +
- "Content should start with " + secondAddedChange +
- "\n but is " + newVersionEditorText,newVersionEditorText.startsWith(secondAddedChange));
- assertTrue("File stored in Guvnor Repository opened within compare editor has wrong content.\n" +
- "Content should start with " + addedChange +
- "\n but is " + revisionEditorText,revisionEditorText.startsWith(addedChange));
- // Open Revision
- guvnorResourceHistoryView.show();
- guvnorResourceHistoryTable.setFocus();
- bot.sleep(Timing.time1S());
- guvnorResourceHistoryTable.select(0);
- bot.sleep(Timing.time1S());
- KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_ENTER);
- KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_ENTER);
- bot.sleep(Timing.time1S());
- SWTBotEditor revisonFileEditor = eclipse.editorStartsWith(testFileName);
- String revisionFileText = revisonFileEditor.toTextEditor().getText();
- revisonFileEditor.close();
- assertTrue("File stored in Guvnor Repository has wrong content.\n" +
- "Content should start with " + addedChange +
- "\n but is " + revisionFileText,revisionFileText.startsWith(addedChange));
- // Switch to version
- editor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- tiTestRuleFile.getText());
- ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiTestRuleFile);
- ContextMenuHelper.clickContextMenu(packageExplorerTree,
- IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_SWITCH_TO_VERSION);
- eclipse.waitForShell("");
- guvnorResourceHistoryBot.activeShell().bot().button(IDELabel.Button.OK).click();
- bot.sleep(Timing.time3S());
- String editorText = editor.toTextEditor().getText();
- assertTrue("Switched version of file has wrong content.\n" +
- "Content should start with " + addedChange +
- "\n but is " + editorText,editorText.startsWith(addedChange));
- }
-
-}
\ No newline at end of file
Deleted: 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 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,156 +0,0 @@
- /*******************************************************************************
- * 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.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.helper.FileRenameHelper;
-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.ViewType;
-import org.jboss.tools.ui.bot.ext.view.ProblemsView;
-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;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-/**
- * Test managing of Drools Project
- * @author Vladimir Pakan
- *
- */
-public class ManageDroolsProject extends SWTTestExt{
- /**
- * Test manage Drools project
- */
- private static final String RENAMED_DROOLS_PROJECT = DroolsAllBotTests.DROOLS_PROJECT_NAME + "-renamed";
- @Test
- public void testManageDroolsProject() {
- createDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
- runNewDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
- renameDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME, ManageDroolsProject.RENAMED_DROOLS_PROJECT);
- deleteDroolsProject (ManageDroolsProject.RENAMED_DROOLS_PROJECT);
- createDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
- }
- /**
- * Creates new Drools project
- * @param droolsProjectName
- */
- 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.waitForAll(30*1000L);
- bot.sleep(Timing.time10S());
- assertTrue("Project "
- + droolsProjectName
- + " was not created properly.",SWTEclipseExt.isProjectInPackageExplorer(bot,droolsProjectName));
- String projectPath = File.separator + droolsProjectName;
- SWTBotTreeItem[] errors = ProblemsView.getFilteredErrorsTreeItems(bot,null ,projectPath, null,null);
- assertTrue("Project "
- + droolsProjectName
- + " was not created properly. There are these errors: "
- + SWTEclipseExt.getFormattedTreeNodesText(bot.tree(), errors),
- errors == null || errors.length == 0);
- SWTBotTreeItem[] warnings = ProblemsView.getFilteredWarningsTreeItems(bot,null ,projectPath, null,null);
- assertTrue("Project "
- + droolsProjectName
- + " was not created properly. There are these warnings: "
- + SWTEclipseExt.getFormattedTreeNodesText(bot.tree(), warnings),
- warnings == null || warnings.length == 0);
-
- }
- /**
- * Runs newly created Drools project and check result
- * @param droolsProjectName
- */
- private void runNewDroolsProject(String droolsProjectName){
- console.clearConsole();
- bot.sleep(5000L);
-
- SWTBotTreeItem tiTestFile = packageExplorer.selectTreeItem(DroolsAllBotTests.DROOLS_TEST_JAVA_TREE_NODE,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
- DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
-
- eclipse.runTreeItemAsJavaApplication(tiTestFile);
-
- String consoleText = console.getConsoleText(3*1000L,60*1000L,true);
-
- assertTrue("DroolsTest.java class didn't run properly.\n" +
- "Console Text was: " + consoleText + "\n" +
- "Expected console text is: " + "Hello World\nGoodbye cruel world\n",
- "Hello World\nGoodbye cruel world\n".equals(consoleText));
- }
- /**
- * Renames Drools project and check result
- * @param droolsProjectName
- * @param renamedProjectName
- */
- private void renameDroolsProject(String droolsProjectName, String renamedProjectName){
- packageExplorer.show();
-
- bot.sleep(TIME_1S);
-
- SWTBot webProjects = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
- SWTBotTree tree = webProjects.tree();
-
- tree.setFocus();
- String checkResult = FileRenameHelper.checkProjectRenamingWithinPackageExplorer(bot,
- DroolsAllBotTests.DROOLS_PROJECT_NAME,
- ManageDroolsProject.RENAMED_DROOLS_PROJECT,
- IDELabel.Shell.RENAME_JAVA_PROJECT);
- assertNull(checkResult,checkResult);
- }
- /**
- * Deletes Drools project and check result
- * @param droolsProjectName
- */
- private void deleteDroolsProject(String droolsProjectName){
-
- packageExplorer.deleteProject(droolsProjectName, true);
- boolean notFound = false;
- try{
- packageExplorer.selectProject(droolsProjectName);
- }catch (WidgetNotFoundException wnf){
- notFound = true;
- }
- assertTrue("Drools project: " + droolsProjectName +
- " was not deleted properly",notFound);
- }
-}
-
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,119 +0,0 @@
- /*******************************************************************************
- * 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.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-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.ViewType;
-import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
-import org.junit.Test;
-/**
- * Test managing of Drools Rules
- * @author Vladimir Pakan
- *
- */
-public class ManageDroolsRules extends SWTTestExt{
- /**
- * Test manage Drools Rules
- */
- @Test
- public void testManageDroolsRules() {
- createDroolsRule (DroolsAllBotTests.TEST_DROOLS_RULE_NAME);
- bot.sleep(Timing.time3S());
- debugDroolsRule (DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME);
- }
- /**
- * Creates Drools Rule and checks result
- * @param droolsRuletName
- */
- private void createDroolsRule(String droolsRuleName){
-
- packageExplorer.show();
- SWTBotTreeItem tiDroolsRules = packageExplorer.selectTreeItem(DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME});
-
- tiDroolsRules.select();
- eclipse.createNew(EntityType.DROOLS_RULE);
-
- bot.textWithLabel(IDELabel.NewDroolsRuleDialog.FILE_NAME).setText(droolsRuleName);
- bot.textWithLabel(IDELabel.NewDroolsRuleDialog.RULE_PACKAGE_NAME).setText(DroolsAllBotTests.COM_SAMPLE_TREE_NODE);
- bot.button(IDELabel.Button.FINISH).click();
- bot.sleep(Timing.time1S());
- tiDroolsRules.expand();
- // Test if new Drools Rule is within package tree view
- boolean isRuleCreated = true;
- try{
- tiDroolsRules.getNode(droolsRuleName);
- } catch (WidgetNotFoundException wnfe){
- isRuleCreated = false;
- }
- assertTrue("New Drools Rule was not created properly. It's not present within Package Explorer",isRuleCreated);
- // Test if new Drools Rule is opened in editor
- isRuleCreated = true;
- try{
- bot.editorByTitle(droolsRuleName);
- } catch (WidgetNotFoundException wnfe){
- isRuleCreated = false;
- }
- assertTrue("New Drools Rule was not created properly. File " + droolsRuleName + " is not opened in editor",isRuleCreated);
- }
- /**
- * Debug Drools Rule and checks result
- * @param droolsRuletName
- */
- private void debugDroolsRule(String droolsRuleName){
- packageExplorer.show();
- SWTBotTreeItem tiDroolsRule = packageExplorer.selectTreeItem(DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE});
- SWTBot packageExplorerBot = bot.viewByTitle(ViewType.PACKAGE_EXPLORER.getViewLabel()).bot();
- SWTBotTree tree = packageExplorerBot.tree();
- // Select and Open Rule File
- ContextMenuHelper.prepareTreeItemForContextMenu(tree , tiDroolsRule);
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.OPEN, true)).click();
- SWTBotEclipseEditor ruleEditor = bot.editorByTitle(droolsRuleName).toTextEditor();
- ruleEditor.selectRange(8, 0, 0);
- bot.menu(IDELabel.Menu.RUN).menu(IDELabel.Menu.TOGGLE_BREAKPOINT).click();
- SWTBotTreeItem tiDroolsTest = packageExplorer.selectTreeItem(DroolsAllBotTests.DROOLS_TEST_JAVA_TREE_NODE,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
- DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
- console.clearConsole();
- eclipse.debugTreeItemAsDroolsApplication(tiDroolsTest);
- bot.sleep(Timing.time10S());
- eclipse.closeConfirmPerspectiveSwitchShellIfOpened(false);
- String consoleText = console.getConsoleText(3*1000L,3*1000L,true);
- assertTrue("Drools Rule was not debuged properly.\nConsole content should have been empty but is:\n" + consoleText,
- consoleText.length() == 0);
- SWTBotView debugView = bot.viewByTitle(ViewType.DEBUG.getViewLabel());
- debugView.toolbarButton(IDELabel.DebugView.BUTTON_STEP_OVER_TOOLTIP).click();
- consoleText = console.getConsoleText(3*1000L,60*1000L,true);
- assertTrue("Drools Rule was not debuged properly.\nConsole content should be:\n'Hello World\n' but is:\n" + consoleText,
- consoleText.equals("Hello World\n"));
- debugView.toolbarButton(IDELabel.DebugView.BUTTON_RESUME_TOOLTIP).click();
- consoleText = console.getConsoleText(3*1000L,60*1000L,true);
- assertTrue("Drools Rule was not debuged properly.\nConsole content should be:Hello World\nGoodbye cruel world\n" + consoleText,
- consoleText.equals("Hello World\nGoodbye cruel world\n"));
- }
-
-}
-
Deleted: 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 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,180 +0,0 @@
- /*******************************************************************************
- * 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{
- /**
- * Test manage Drools Runtime
- */
- @Test
- public void testManageDroolsRuntime() {
- addDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME,DroolsAllBotTests.DROOLS_RUNTIME_LOCATION,true);
- editDroolsRuntime(DroolsAllBotTests.getTestDroolsRuntimeName(),
- DroolsAllBotTests.getTestDroolsRuntimeLocation(),
- "edited" , "testedit");
- removeDroolsRuntime(DroolsAllBotTests.getTestDroolsRuntimeName());
- createDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME,DroolsAllBotTests.CREATE_DROOLS_RUNTIME_LOCATION);
- if (DroolsAllBotTests.useExternalDroolsRuntime()){
- removeDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME);
- addDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME,DroolsAllBotTests.DROOLS_RUNTIME_LOCATION,true);
- }
- }
- /**
- * Adds Drools Runtime
- * @param runtimeName
- * @param runtimeLocation
- * @param setAsDefault
- */
- private void addDroolsRuntime(String runtimeName, String runtimeLocation, boolean setAsDefault){
- 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);
- // Set new runtime as default
- if (setAsDefault){
- table.getTableItem(0).check();
- }
- bot.button(IDELabel.Button.OK).click();
- assertTrue("Drools Runtime with name [" + runtimeName +
- "] and location [" + runtimeLocation +
- "] was not added properly.",droolsRuntimeAdded);
- DroolsAllBotTests.setTestDroolsRuntimeName(runtimeName);
- DroolsAllBotTests.setTestDroolsRuntimeLocation(runtimeLocation);
- SWTEclipseExt.hideWarningIfDisplayed(bot);
- }
- /**
- * Selects Drools Preferences within Preferences Dialog
- */
- private void selectDroolsPreferences(){
- jbt.delay();
- 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);
- DroolsAllBotTests.setTestDroolsRuntimeName(editedDroolsRuntimeName);
- DroolsAllBotTests.setTestDroolsRuntimeLocation(editedDroolsRuntimeLocation);
- SWTEclipseExt.hideWarningIfDisplayed(bot);
- }
-
- /**
- * 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 (!DroolsAllBotTests.getTestDroolsRuntimeName().equals(DroolsAllBotTests.DROOLS_RUNTIME_NAME)){
- File tempDir = new File (DroolsAllBotTests.getTestDroolsRuntimeLocation());
- if (tempDir.isDirectory()){
- tempDir.delete();
- }
- }
- DroolsAllBotTests.setTestDroolsRuntimeName(null);
- DroolsAllBotTests.setTestDroolsRuntimeLocation(null);
- SWTEclipseExt.hideWarningIfDisplayed(bot);
- }
- /**
- * Creates Drools Runtime
- * @param runtimeName
- * @param runtimeLocation
- */
- private void createDroolsRuntime(String runtimeName, String runtimeLocation){
- DroolsRuntimeManager.createDefaultRuntime(runtimeLocation);
- DroolsRuntime droolsRuntime = new DroolsRuntime();
- droolsRuntime.setName(runtimeName);
- droolsRuntime.setPath(runtimeLocation);
- droolsRuntime.setDefault(true);
- DroolsRuntimeManager.setDroolsRuntimes(new DroolsRuntime[]{droolsRuntime});
- // Test if Drools runtime is defined
- assertTrue("Drools Runtime was not properly created on location: " + runtimeLocation,
- new File (runtimeLocation + File.separator + "drools-core.jar").exists());
- selectDroolsPreferences();
- SWTBotTable table = bot.table();
- boolean droolsRuntimeCreated =
- SWTEclipseExt.isItemInTableColumn(table,runtimeName,IDELabel.DroolsRuntimeDialog.COLUMN_NAME_INDEX)
- && SWTEclipseExt.isItemInTableColumn(table,runtimeLocation,IDELabel.DroolsRuntimeDialog.COLUMN_LOCATION_INDEX);
- bot.button(IDELabel.Button.OK).click();
- SWTEclipseExt.hideWarningIfDisplayed(bot);
- assertTrue("Drools Runtime with name [" + runtimeName +
- "] and location [" + runtimeLocation +
- "] was not created properly.",droolsRuntimeCreated);
- DroolsAllBotTests.setTestDroolsRuntimeName(runtimeName);
- DroolsAllBotTests.setTestDroolsRuntimeLocation(runtimeLocation);
-
- }
-
-}
-
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,50 +0,0 @@
- /*******************************************************************************
- * 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.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-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.PerspectiveType;
-import org.junit.Test;
-/**
- * Test opening perspective
- * @author Vladimir Pakan
- *
- */
-public class OpenDroolsPerspective extends SWTTestExt{
- /**
- * Test Opening Drools Rules
- */
- @Test
- public void testOpenDroolsPerspective() {
- openDroolsPerspective();
- }
- /**
- * Open Drools Perspective
- */
- private void openDroolsPerspective(){
- eclipse.openPerspective(PerspectiveType.DROOLS);
- boolean wasFound = false;
- try{
- bot.toolbarDropDownButtonWithTooltip(IDELabel.Button.DROOLS_WORKBENCH);
- wasFound = true;
- } catch (WidgetNotFoundException wnfe){
- wasFound = false;
- }
- eclipse.openPerspective(PerspectiveType.JAVA);
- assertTrue("Drools Perspective was not opened properly. Button " +
- IDELabel.Button.DROOLS_WORKBENCH + " is not present in Workbench",
- wasFound);
- }
-}
-
Deleted: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,491 +0,0 @@
- /*******************************************************************************
- * 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.awt.event.KeyEvent;
-import java.io.File;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
-import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
-import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.SWTUtilExt;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.ui.bot.ext.types.ViewType;
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-/**
- * Tests Rule Flow
- * @author Vladimir Pakan
- *
- */
-public class RuleFlowTest extends SWTTestExt{
- private static final String RULE_FLOW_FILE_DIRECTORY = "src" + File.separator +
- "main" + File.separator +
- "rules";
- private static final String ROOT_NODE_NAME = "process";
- private static final String HEADER_NODE_NAME = "header";
- private static final String NODES_NODE_NAME = "nodes";
- private static final String CONNECTIONS_NODE_NAME = "connections";
- private static final String CONNECTION_NODE_NAME = "connection";
- private static final int NODES_NODE_CHILDREN_COUNT = 7;
- private static final int CONNECTIONS_NODE_CHILDREN_COUNT = 1;
- private static final int ROOT_NODE_CHILDREN_COUNT = 3;
-
- private boolean isEditorMaximized = false;
- /**
- * Tests Rule Flow
- */
- @Test
- public void testRuleFlow() {
- runRuleFlowCheck(DroolsAllBotTests.RULE_FLOW_JAVA_TEST_FILE_NAME);
- ruleFlowEditorCheck(DroolsAllBotTests.RULE_FLOW_RF_FILE_NAME);
- }
- /**
- * Runs newly created Drools project and check result
- * @param droolsProjectName
- */
- private void runRuleFlowCheck(String droolsRuleTestFileName){
- console.clearConsole();
- bot.sleep(5000L);
-
- SWTBotTreeItem tiTestFile = packageExplorer.selectTreeItem(droolsRuleTestFileName,
- new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
- DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
-
- eclipse.runTreeItemAsJavaApplication(tiTestFile);
-
- String consoleText = console.getConsoleText(3*1000L,60*1000L,true);
-
- assertTrue(droolsRuleTestFileName + " didn't run properly.\n" +
- "Console Text was: " + consoleText + "\n" +
- "Expected console text is: " + "Hello World\n",
- "Hello World\n".equals(consoleText));
- }
- /**
- * Add all possible object to RF diagram and then remove them
- * @param ruleFlowRfFileName
- */
- private void ruleFlowEditorCheck (String ruleFlowFileName){
- packageExplorer.show();
- packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
- DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
- DroolsAllBotTests.RULE_FLOW_RF_FILE_NAME);
- // Test if Rule Flow RF File is opened in editor
- assertTrue("Rule Flow RF File is not opened properly. File " + ruleFlowFileName + " is not opened in editor",
- SWTEclipseExt.existEditorWithLabel(bot,ruleFlowFileName));
- // Maximize editor
- bot.menu(IDELabel.Menu.WINDOW)
- .menu(IDELabel.Menu.NAVIGATION)
- .menu(IDELabel.Menu.MAXIMIZE_ACTIVE_VIEW_OR_EDITOR)
- .click();
- isEditorMaximized = true;
- SWTGefBot gefBot = new SWTGefBot();
- SWTBotGefEditor gefEditor = gefBot.gefEditor(ruleFlowFileName);
- // Clear Editor
- gefEditor.setFocus();
- deleteAllObjectsFromRFFile(gefEditor,
- DroolsAllBotTests.DROOLS_PROJECT_NAME,
- DroolsAllBotTests.RULE_FLOW_RF_FILE_NAME);
- // Draw each component
- String[] tools = new String[]{"Start Event","End Event","Rule Task",
- "Gateway [diverge]","Gateway [converge]","Reusable Sub-Process",
- "Script Task"
- };
- int xspacing = 100;
- int xoffset = 10;
- int yspacing = 100;
- int yoffset = 10;
- for (int toolIndex = 0;toolIndex < tools.length;toolIndex++){
- gefEditor.activateTool(tools[toolIndex]);
- gefEditor.click(xspacing * (toolIndex % 3) + xoffset,
- yspacing * (toolIndex / 3) + yoffset);
- }
- // Add Sequence Flow between Start and End Node
- gefEditor.activateTool("Sequence Flow");
- // Click on Start Node
- gefEditor.click(xoffset + 5, yoffset + 5);
- // Click on End Node
- gefEditor.click(xspacing + xoffset + 5, yoffset + 5);
- gefEditor.save();
- checkFullRFFile(DroolsAllBotTests.DROOLS_PROJECT_NAME , ruleFlowFileName);
- // check synchronization with Properties View
- gefEditor.activateTool("Select");
- gefEditor.click(xoffset + 5, yoffset + 5);
- SWTBotTree tree = eclipse.showView(ViewType.PROPERTIES).tree();
- String id = tree.getTreeItem("Id").cell(1);
- String name = tree.getTreeItem("Name").cell(1);
- assertTrue("First editor element has to have Id=1 and Name=Start." +
- "\nBut it has Id=" + id +
- " Name=" + name, id.equals("1") && name.equals("Start"));
- // Delete each component
- gefEditor.activateTool("Select");
- for (int toolIndex = 0;toolIndex < tools.length;toolIndex++){
- gefEditor.click(xspacing * (toolIndex % 3) + xoffset + 10,
- yspacing * (toolIndex / 3) + yoffset + 10);
- gefEditor.setFocus();
- bot.sleep(Timing.time1S());
- KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_DELETE);
- }
- // Restore maximized editor
- bot.menu(IDELabel.Menu.WINDOW)
- .menu(IDELabel.Menu.NAVIGATION)
- .menu(IDELabel.Menu.MAXIMIZE_ACTIVE_VIEW_OR_EDITOR)
- .click();
- isEditorMaximized = false;
- gefEditor.save();
- gefEditor.close();
- checkEmptyRFFile(DroolsAllBotTests.DROOLS_PROJECT_NAME , ruleFlowFileName);
- }
- /**
- * Check content of Rule Flow file containing all possible objects
- *
- * @param projectName
- * @param ruleFlowFileName
- */
- private void checkFullRFFile(String projectName, String ruleFlowFileName) {
-
- Document doc = loadXmlFile(SWTUtilExt.getPathToProject(projectName)
- + File.separator + RuleFlowTest.RULE_FLOW_FILE_DIRECTORY
- + File.separator + ruleFlowFileName);
-
- String errorDescription = null;
- Element rootNode = doc.getDocumentElement();
- doc.normalizeDocument();
- if (rootNode.getNodeName().equals(ROOT_NODE_NAME)) {
- NodeList rootNodeList = rootNode.getChildNodes();
- List<Node> rootNodes = removeTextNodes(rootNodeList);
- if (rootNodes.size() == ROOT_NODE_CHILDREN_COUNT) {
- Node header = rootNodes.get(0);
- errorDescription = checkEmptyFileNode(header, HEADER_NODE_NAME);
- if (errorDescription == null) {
- Node nodesNode = rootNodes.get(1);
- errorDescription = checkNodeName(nodesNode, NODES_NODE_NAME);
- if (errorDescription == null) {
- errorDescription = checkNodesFileNodes(removeTextNodes(nodesNode
- .getChildNodes()));
- if (errorDescription == null) {
- Node connectionsNode = rootNodes.get(2);
- errorDescription = checkNodeName(connectionsNode,
- CONNECTIONS_NODE_NAME);
- if (errorDescription == null) {
- errorDescription = checkConnectionsFileNodes(removeTextNodes(connectionsNode
- .getChildNodes()));
- }
- }
- }
- }
- } else {
- errorDescription = "Root node has to have " + ROOT_NODE_CHILDREN_COUNT
- + " child nodes but it has " + rootNodeList.getLength();
- }
- } else {
- errorDescription = "Root node has to have name '" + ROOT_NODE_NAME
- + "' but it has name '" + rootNode.getNodeName() + "'";
- }
- assertNull(errorDescription,errorDescription);
- }
- /**
- * Check content of empty Rule Flow file
- * @param projectName
- * @param ruleFlowRfFileName
- */
- private void checkEmptyRFFile(String projectName, String ruleFlowFileName){
-
- Document doc = loadXmlFile(SWTUtilExt.getPathToProject(projectName) +
- File.separator + RuleFlowTest.RULE_FLOW_FILE_DIRECTORY + File.separator +
- ruleFlowFileName);
-
- String errorDescription = null;
-
- Element rootNode = doc.getDocumentElement();
- doc.normalizeDocument();
- if (rootNode.getNodeName().equals(ROOT_NODE_NAME)) {
- NodeList rootNodeList = rootNode.getChildNodes();
- List<Node> nodes = removeTextNodes(rootNodeList);
- if (nodes.size() == ROOT_NODE_CHILDREN_COUNT) {
- Node header = nodes.get(0);
- errorDescription = checkEmptyFileNode(header, HEADER_NODE_NAME);
- if (errorDescription == null) {
- Node nodesNode = nodes.get(1);
- errorDescription = checkEmptyFileNode(nodesNode, NODES_NODE_NAME);
- if (errorDescription == null) {
- Node connnections = nodes.get(2);
- errorDescription = checkEmptyFileNode(connnections, CONNECTIONS_NODE_NAME);
- }
- }
- } else {
- errorDescription = "Root node has to have " +
- ROOT_NODE_CHILDREN_COUNT +
- " child nodes but it has " +
- rootNodeList.getLength();
- }
- } else {
- errorDescription = "Root node has to have name '" + ROOT_NODE_NAME
- + "' but it has name '" + rootNode.getNodeName() + "'";
- }
- assertNull(errorDescription,errorDescription);
-
- }
- /**
- * Loads and parse XML file with fileName from file system
- * @param fileName - full path to XML file
- * @return
- */
- private Document loadXmlFile (String fileName){
- File file = new File(fileName);
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- DocumentBuilder db;
- Document doc = null;
- try {
- db = dbf.newDocumentBuilder();
- doc = db.parse(file);
- } catch (ParserConfigurationException pce) {
- throw new RuntimeException(pce);
- } catch (SAXException saxe) {
- throw new RuntimeException(saxe);
- } catch (IOException ioe) {
- throw new RuntimeException(ioe);
- }
- return doc;
- }
- private static List<Node> removeTextNodes(NodeList rootNodeList){
- LinkedList<Node> nodes = new LinkedList<Node>();
- for (int index = 0 ; index < rootNodeList.getLength(); index++){
- Node node = rootNodeList.item(index);
- if (!node.getNodeName().equals("#text")){
- nodes.add(node);
- }
- }
- return nodes;
- }
- /**
- * Check if node is correct for empty file
- * @param node
- * @param expectedNodeName
- * @return
- */
- private static String checkEmptyFileNode (Node node,String expectedNodeName){
- String errorDescription = null;
- if (node.getNodeName().equals(expectedNodeName)){
- if (removeTextNodes(node.getChildNodes()).size() == 0){
- if(node.getTextContent().trim().length() != 0){
- errorDescription = expectedNodeName + " node has to have no text value but it has " +
- node.getTextContent();
- }
- }
- else{
- errorDescription = expectedNodeName + " node has to have no children but is has " +
- removeTextNodes(node.getChildNodes()).size();
-
- }
- }
- else{
- errorDescription = checkNodeName(node, expectedNodeName);
- }
-
- return errorDescription;
-
- }
- /**
- * Check nodes of Nodes children.
- * @param nodes - list of nodes of nodes node stripped from text nodes
- * @return
- */
- private static String checkNodesFileNodes(List<Node> nodes){
- String errorDescription = null;
-
- if (nodes.size() == NODES_NODE_CHILDREN_COUNT){
- List<String> mandatoryNodes = getMandatoryNodesOfNodesNode();
- int index = 0;
- Iterator<Node> iterator = nodes.iterator();
- while (index < nodes.size() && errorDescription == null){
- String nodeName = iterator.next().getNodeName();
- if (mandatoryNodes.contains(nodeName)){
- mandatoryNodes.remove(nodeName);
- }
- else{
- errorDescription = "Nodes node cannot contain node " + nodeName;
- }
- index++;
- }
- if (errorDescription == null && mandatoryNodes.size() > 0) {
- StringBuilder sb = new StringBuilder("");
- for (String nodeName : mandatoryNodes){
- if (sb.length() != 0){
- sb.append(", ");
- }
- sb.append(nodeName);
- }
- errorDescription = "Nodes node doesn't contain all necesarry nodes.\n" +
- "These node(s) are missing within nodes node: " +
- sb.toString();
- }
- }
- else{
- errorDescription = "Nodes node has to have " +
- NODES_NODE_CHILDREN_COUNT +
- " child nodes but it has " +
- nodes.size();
- }
-
- return errorDescription;
- }
- /**
- * Returns list of mandatory nodes of nodes node
- * @return
- */
- private static List<String> getMandatoryNodesOfNodesNode(){
- LinkedList<String> allowedNodes = new LinkedList<String>();
- allowedNodes.add("split");
- /*
- allowedNodes.add("timerNode");
- allowedNodes.add("humanTask");
- */
- allowedNodes.add("ruleSet");
- allowedNodes.add("actionNode");
- /*
- allowedNodes.add("composite");
- */
- allowedNodes.add("end");
- /*
- allowedNodes.add("workItem");
- allowedNodes.add("fault");
- */
- allowedNodes.add("subProcess");
- allowedNodes.add("start");
- /*
- allowedNodes.add("workItem");
- allowedNodes.add("eventNode");
- */
- allowedNodes.add("join");
-
- return allowedNodes;
- }
-
- /**
- * Check nodes of connections children.
- * @param nodes - list of nodes of connections node stripped from text nodes
- * @return
- */
- private static String checkConnectionsFileNodes(List<Node> nodes){
- String errorDescription = null;
-
- if (nodes.size() == CONNECTIONS_NODE_CHILDREN_COUNT){
- Node connectioNode = nodes.get(0);
- errorDescription = checkEmptyFileNode(connectioNode, CONNECTION_NODE_NAME);
- }
- else{
- errorDescription = "Conections node has to have " +
- CONNECTIONS_NODE_CHILDREN_COUNT +
- " child nodes but it has " +
- nodes.size();
- }
-
- return errorDescription;
- }
- /**
- * Check if node has expected name
- * @param node
- * @param expectedNodeName
- * @return
- */
- private static String checkNodeName (Node node, String expectedNodeName){
- String errorDescription = null;
-
- if (!node.getNodeName().equals(expectedNodeName)){
- errorDescription = "Node has to have name '" +
- expectedNodeName + "' but it has name '" +
- node.getNodeName() + "'";
- }
-
- return errorDescription;
- }
-
- protected void tearDown(){
- if (isEditorMaximized){
- // Restore maximized editor
- bot.menu(IDELabel.Menu.WINDOW)
- .menu(IDELabel.Menu.NAVIGATION)
- .menu(IDELabel.Menu.MAXIMIZE_ACTIVE_VIEW_OR_EDITOR)
- .click();
- isEditorMaximized = false;
- }
- try {
- super.tearDown();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- /**
- * Delete all objects from RF File
- * @param gefEditor
- * @param projectName
- * @param ruleFlowFileName
- */
- private void deleteAllObjectsFromRFFile(SWTBotGefEditor gefEditor, String projectName, String ruleFlowFileName) {
-
- Document doc = loadXmlFile(SWTUtilExt.getPathToProject(projectName)
- + File.separator + RuleFlowTest.RULE_FLOW_FILE_DIRECTORY
- + File.separator + ruleFlowFileName);
-
- String errorDescription = null;
- Element rootNode = doc.getDocumentElement();
- doc.normalizeDocument();
- if (rootNode.getNodeName().equals(ROOT_NODE_NAME)) {
- NodeList rootNodeList = rootNode.getChildNodes();
- List<Node> rootNodes = removeTextNodes(rootNodeList);
- if (rootNodes.size() == ROOT_NODE_CHILDREN_COUNT) {
- Node nodesNode = rootNodes.get(1);
- errorDescription = checkNodeName(nodesNode, NODES_NODE_NAME);
- if (errorDescription == null) {
- List<Node> nodes = removeTextNodes(nodesNode.getChildNodes());
- for (Node node : nodes){
- NamedNodeMap attributes = node.getAttributes();
- int xPos = Integer.parseInt(attributes.getNamedItem("x").getNodeValue());
- int yPos = Integer.parseInt(attributes.getNamedItem("y").getNodeValue());
- gefEditor.click(xPos + 3, yPos + 3);
- bot.sleep(Timing.time1S());
- KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_DELETE);
- bot.sleep(Timing.time1S());
- }
- }
- } else {
- errorDescription = "'" + NODES_NODE_NAME + "'" +" was not found on expected location within RF file." +
- " RF file structure has been changed";
- }
- } else {
- errorDescription = "Root Node has to have name '" + ROOT_NODE_NAME + "'. RF file structure has been changed.";
- }
- assertNull(errorDescription,errorDescription);
- }
-
-}
\ No newline at end of file
Deleted: trunk/drools/tests/pom.xml
===================================================================
--- trunk/drools/tests/pom.xml 2011-08-03 07:47:59 UTC (rev 33536)
+++ trunk/drools/tests/pom.xml 2011-08-03 07:48:31 UTC (rev 33537)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
-
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.2-SNAPSHOT</version>
- </parent>
- <groupId>org.jboss.tools.drools</groupId>
- <artifactId>org.jboss.tools.drools.tests</artifactId>
- <name>org.jboss.tools.drools.tests</name>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>pom</packaging>
- <modules>
- <module>org.jboss.tools.drools.ui.bot.test</module>
- </modules>
-</project>
\ No newline at end of file
13 years, 5 months
JBoss Tools SVN: r33536 - in trunk/build/aggregate/bottests-site: features and 16 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-08-03 03:47:59 -0400 (Wed, 03 Aug 2011)
New Revision: 33536
Added:
trunk/build/aggregate/bottests-site/tests/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/.classpath
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/.gitignore
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/META-INF/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/META-INF/MANIFEST.MF
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/build.properties
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/pom.xml
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/resources/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/Activator.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DecisionTableTest.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DomainSpecificLanguageEditorTest.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsRulesEditorTest.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuidedDroolsRulesEditorTest.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java
trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java
trunk/build/aggregate/bottests-site/tests/pom.xml
Modified:
trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/feature.xml
trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/pom.xml
trunk/build/aggregate/bottests-site/features/pom.xml
trunk/build/aggregate/bottests-site/plugins/pom.xml
trunk/build/aggregate/bottests-site/pom.xml
trunk/build/aggregate/bottests-site/site/pom.xml
Log:
move org.jboss.tools.drools.ui.bot.test from ~/trunk/drools/tests/org.jboss.tools.drools.ui.bot.test into ~/trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test; add maven bot test to site (JBIDE-8734)
Modified: trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/feature.xml
===================================================================
--- trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/feature.xml 2011-08-03 07:47:24 UTC (rev 33535)
+++ trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/feature.xml 2011-08-03 07:47:59 UTC (rev 33536)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<feature id="org.jboss.tools.bot.test.feature" label="Tools Bot Tests" version="3.1.0.qualifier">
+<feature id="org.jboss.tools.bot.test.feature" label="JBoss Tools Bot Tests" version="3.1.0.qualifier">
<description url="http://www.jboss.org/tools">
- JBossTools unit tests feature
+ JBoss Tools Bot Tests
</description>
<copyright>
@@ -26,16 +26,17 @@
</license>
<!-- depends on upstream components being built,
- including tests, common, bpel, cdi, deltacloud, etc. -->
- <requires>
- <import plugin="org.jboss.tools.tests" />
- <import plugin="org.jboss.tools.ui.bot.ext" />
- <import plugin="org.jboss.tools.ui.bot.ext.test" />
- </requires>
+ including tests, common, bpel, cdi, deltacloud, etc.
+ Can source these from http://download.jboss.org/jbosstools/builds/staging/_composite_/trunk/
+ -->
<!-- bpmn is not yet being built so this can't be available upstream -->
<!-- <plugin id="org.jboss.tools.bpmn.ui.bot.test" download-size="0" install-size="0" version="0.0.0" /> -->
+ <plugin id="org.jboss.tools.tests" download-size="0" install-size="0" version="0.0.0" />
+ <plugin id="org.jboss.tools.ui.bot.ext" download-size="0" install-size="0" version="0.0.0" />
+ <plugin id="org.jboss.tools.ui.bot.ext.test" download-size="0" install-size="0" version="0.0.0" />
+
<plugin id="org.jboss.tools.bpel.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.cdi.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.deltacloud.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
@@ -45,7 +46,7 @@
<plugin id="org.jboss.tools.jbpm.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.jsf.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.jst.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
-<!-- <plugin id="org.jboss.tools.maven.ui.bot.test" download-size="0" install-size="0" version="0.0.0" /> -->
+ <plugin id="org.jboss.tools.maven.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.modeshape.rest.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.seam.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
<plugin id="org.jboss.tools.smooks.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
Modified: trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/pom.xml
===================================================================
--- trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/pom.xml 2011-08-03 07:47:24 UTC (rev 33535)
+++ trunk/build/aggregate/bottests-site/features/org.jboss.tools.bot.test.feature/pom.xml 2011-08-03 07:47:59 UTC (rev 33536)
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.tools.bottests</groupId>
- <artifactId>features</artifactId>
+ <artifactId>org.jboss.tools.bottests.features</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools</groupId>
Modified: trunk/build/aggregate/bottests-site/features/pom.xml
===================================================================
--- trunk/build/aggregate/bottests-site/features/pom.xml 2011-08-03 07:47:24 UTC (rev 33535)
+++ trunk/build/aggregate/bottests-site/features/pom.xml 2011-08-03 07:47:59 UTC (rev 33536)
@@ -7,9 +7,8 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.bottests</groupId>
- <artifactId>features</artifactId>
+ <artifactId>org.jboss.tools.bottests.features</artifactId>
<version>0.0.1-SNAPSHOT</version>
- <name>bottests.features</name>
<packaging>pom</packaging>
<modules>
<module>org.jboss.tools.bot.test.feature</module>
Modified: trunk/build/aggregate/bottests-site/plugins/pom.xml
===================================================================
--- trunk/build/aggregate/bottests-site/plugins/pom.xml 2011-08-03 07:47:24 UTC (rev 33535)
+++ trunk/build/aggregate/bottests-site/plugins/pom.xml 2011-08-03 07:47:59 UTC (rev 33536)
@@ -6,9 +6,8 @@
<artifactId>bottests</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.tests.plugins</artifactId>
- <name>org.jboss.tools.tests.plugins</name>
+ <groupId>org.jboss.tools.bottests</groupId>
+ <artifactId>org.jboss.tools.bottests.plugins</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
Modified: trunk/build/aggregate/bottests-site/pom.xml
===================================================================
--- trunk/build/aggregate/bottests-site/pom.xml 2011-08-03 07:47:24 UTC (rev 33535)
+++ trunk/build/aggregate/bottests-site/pom.xml 2011-08-03 07:47:59 UTC (rev 33536)
@@ -15,6 +15,7 @@
<packaging>pom</packaging>
<modules>
<module>plugins</module>
+ <module>tests</module>
<module>features</module>
<module>site</module>
</modules>
Modified: trunk/build/aggregate/bottests-site/site/pom.xml
===================================================================
--- trunk/build/aggregate/bottests-site/site/pom.xml 2011-08-03 07:47:24 UTC (rev 33535)
+++ trunk/build/aggregate/bottests-site/site/pom.xml 2011-08-03 07:47:59 UTC (rev 33536)
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -7,9 +6,8 @@
<artifactId>bottests</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>bottests.site</artifactId>
- <name>bottests.site</name>
+ <groupId>org.jboss.tools.bottests</groupId>
+ <artifactId>org.jboss.tools.bottests.site</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>eclipse-update-site</packaging>
</project>
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/.classpath
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/.classpath (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/.classpath 2011-08-03 07:47:59 UTC (rev 33536)
@@ -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>
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/.gitignore
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/.gitignore (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/.gitignore 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1 @@
+target
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/META-INF/MANIFEST.MF 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,21 @@
+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,
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.finder;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,
+ org.drools.eclipse;bundle-version="5.1.0",
+ org.eclipse.swtbot.eclipse.gef.finder,
+ org.apache.log4j;bundle-version="1.2.13"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: JBoss by Red Hat
+Import-Package: org.eclipse.ui.forms.widgets
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/build.properties
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/build.properties (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/build.properties 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,5 @@
+source.. = src/,\
+ resources/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/pom.xml
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/pom.xml (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/pom.xml 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.bottests</groupId>
+ <artifactId>org.jboss.tools.bottests.tests</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.drools</groupId>
+ <artifactId>org.jboss.tools.drools.ui.bot.test</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-test-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <useUIThread>false</useUIThread>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/resources/project.properties 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,3 @@
+use-external-drools-runtime=true
+guvnor-repository-url=/jboss-brms/org.drools.guvnor.Guvnor/webdav
+external-drools-runtime-home=/home/vpakan/tmp/drools
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/Activator.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/Activator.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/Activator.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -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;
+ }
+
+}
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/DroolsAllBotTests.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * 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 java.io.File;
+
+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.DecisionTableTest;
+import org.jboss.tools.drools.ui.bot.test.smoke.DomainSpecificLanguageEditorTest;
+//import org.jboss.tools.drools.ui.bot.test.smoke.GuidedDroolsRulesEditorTest;
+import org.jboss.tools.drools.ui.bot.test.smoke.GuvnorRepositoriesTest;
+import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsRuntime;
+import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsProject;
+import org.jboss.tools.drools.ui.bot.test.smoke.ManageDroolsRules;
+import org.jboss.tools.drools.ui.bot.test.smoke.DroolsRulesEditorTest;
+import org.jboss.tools.drools.ui.bot.test.smoke.OpenDroolsPerspective;
+import org.jboss.tools.drools.ui.bot.test.smoke.RuleFlowTest;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
+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 Drools swtbot test case for JBoss Tools.
+ *
+ * @author Vladimir Pakan
+ *
+ */
+(a)RunWith(Suite.class)
+(a)SuiteClasses({OpenDroolsPerspective.class,
+ ManageDroolsRuntime.class,
+ ManageDroolsProject.class,
+ ManageDroolsRules.class,
+ DroolsRulesEditorTest.class,
+ //GuidedDroolsRulesEditorTest.class,
+ DomainSpecificLanguageEditorTest.class,
+ RuleFlowTest.class,
+ DecisionTableTest.class,
+ GuvnorRepositoriesTest.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;
+ public static String CREATE_DROOLS_RUNTIME_LOCATION = null;
+ public static String SRC_MAIN_JAVA_TREE_NODE = "src/main/java";
+ public static String SRC_MAIN_RULES_TREE_NODE = "src/main/rules";
+ public static String COM_SAMPLE_TREE_NODE = "com.sample";
+ public static String DROOLS_TEST_JAVA_TREE_NODE = "DroolsTest.java";
+ public static final String TEST_DROOLS_RULE_NAME = "TestRule.drl";
+ public static final String SAMPLE_DROOLS_RULE_NAME = "Sample.drl";
+ public static final String GUIDED_DROOLS_RULE_NAME = "GuidedRule.brl";
+ public static final String DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME = "DslTest.dsl";
+ public static final String RULE_FLOW_JAVA_TEST_FILE_NAME = "ProcessTest.java";
+ public static final String RULE_FLOW_RF_FILE_NAME = "ruleflow.rf";
+ public static final String DECISION_TABLE_JAVA_TEST_FILE_NAME = "DecisionTableTest.java";
+ public static final String USE_EXTERNAL_DROOLS_RUNTIME_PROPERTY_NAME = "use-external-drools-runtime";
+ public static final String EXTERNAL_DROOLS_RUTIME_HOME_PROPERTY_NAME = "external-drools-runtime-home";
+ public static final String GUVNOR_REPOSITORY_URL_PROPERTY_NAME = "guvnor-repository-url";
+ private static boolean USE_EXTERNAL_DROOLS_RUNTIME;
+
+ private static String testDroolsRuntimeName = null;
+ private static String testDroolsRuntimeLocation = null;
+ private static String guvnorRepositoryUrl = null;
+ private static String guvnorRepositoryRootTreeItem = "http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/webdav/";
+
+ public static String getTestDroolsRuntimeName() {
+ return testDroolsRuntimeName;
+ }
+
+ public static void setTestDroolsRuntimeName(String testDroolsRuntimeName) {
+ DroolsAllBotTests.testDroolsRuntimeName = testDroolsRuntimeName;
+ }
+
+ public static String getTestDroolsRuntimeLocation() {
+ return testDroolsRuntimeLocation;
+ }
+
+ public static void setTestDroolsRuntimeLocation(String testDroolsRuntimeLocation) {
+ DroolsAllBotTests.testDroolsRuntimeLocation = testDroolsRuntimeLocation;
+ }
+
+ public static String getGuvnorRepositoryUrl() {
+ return guvnorRepositoryUrl;
+ }
+
+ private static void setGuvnorRepositoryUrl(String guvnorRepositoryUrl) {
+ DroolsAllBotTests.guvnorRepositoryUrl = guvnorRepositoryUrl;
+ }
+
+ public static String getGuvnorRepositoryRootTreeItem() {
+ return guvnorRepositoryRootTreeItem;
+ }
+
+ private static void setGuvnorRepositoryRootTreeItem(
+ String guvnorRepositoryRootTreeItem) {
+ DroolsAllBotTests.guvnorRepositoryRootTreeItem = guvnorRepositoryRootTreeItem;
+ }
+
+ @BeforeClass
+ public static void setUpTest() {
+ jbt.closeReportUsageWindowIfOpened(false);
+ props = util.loadProperties(Activator.PLUGIN_ID);
+ String guvnorRepositoryUrl = props.getProperty(DroolsAllBotTests.GUVNOR_REPOSITORY_URL_PROPERTY_NAME);
+ if (guvnorRepositoryUrl != null){
+ DroolsAllBotTests.setGuvnorRepositoryUrl(guvnorRepositoryUrl);
+ DroolsAllBotTests.setGuvnorRepositoryRootTreeItem("http://localhost:8080" + guvnorRepositoryUrl);
+ }
+ String useExternalDroolRuntime = props.getProperty(DroolsAllBotTests.USE_EXTERNAL_DROOLS_RUNTIME_PROPERTY_NAME);
+ DroolsAllBotTests.USE_EXTERNAL_DROOLS_RUNTIME = useExternalDroolRuntime != null && useExternalDroolRuntime.equalsIgnoreCase("true");
+ String droolsRuntimeLocation = props.getProperty(DroolsAllBotTests.EXTERNAL_DROOLS_RUTIME_HOME_PROPERTY_NAME);
+ String tmpDir = System.getProperty("java.io.tmpdir");
+ if (droolsRuntimeLocation == null || droolsRuntimeLocation.length() ==0){
+ DroolsAllBotTests.DROOLS_RUNTIME_LOCATION = tmpDir;
+ }
+ else{
+ DroolsAllBotTests.DROOLS_RUNTIME_LOCATION = droolsRuntimeLocation;
+ }
+ DroolsAllBotTests.CREATE_DROOLS_RUNTIME_LOCATION = tmpDir + File.separator + "drools";
+ // Create directory for Drools Runtime which will be created as a part of test
+ new File(DroolsAllBotTests.CREATE_DROOLS_RUNTIME_LOCATION).mkdir();
+ try{
+ SWTBotView welcomeView = eclipse.getBot().viewByTitle(IDELabel.View.WELCOME);
+ welcomeView.close();
+ } catch (WidgetNotFoundException wnfe){
+ // Do nothing ignore this error
+ }
+ eclipse.openPerspective(PerspectiveType.JAVA);
+ eclipse.maximizeActiveShell();
+ }
+
+ public static boolean useExternalDroolsRuntime() {
+ return USE_EXTERNAL_DROOLS_RUNTIME;
+ }
+
+ @AfterClass
+ public static void tearDownTest() {
+ // delete created drools runtime
+ SWTUtilExt.deleteDirectory(DroolsAllBotTests.CREATE_DROOLS_RUNTIME_LOCATION);
+ }
+}
\ No newline at end of file
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DecisionTableTest.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DecisionTableTest.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DecisionTableTest.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,53 @@
+ /*******************************************************************************
+ * 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.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.junit.Test;
+/**
+ * Tests Decision Table
+ * @author Vladimir Pakan
+ *
+ */
+public class DecisionTableTest extends SWTTestExt{
+ /**
+ * Tests Decision Table
+ */
+ @Test
+ public void testDecisionTable() {
+ runDecisionTable(DroolsAllBotTests.DECISION_TABLE_JAVA_TEST_FILE_NAME);
+ }
+ /**
+ * Runs newly created Drools project and check result
+ * @param decisionTableFileName
+ */
+ private void runDecisionTable(String decisionTableFileName){
+ console.clearConsole();
+ bot.sleep(5000L);
+
+ SWTBotTreeItem tiTestFile = packageExplorer.selectTreeItem(decisionTableFileName,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
+ DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
+
+ eclipse.runTreeItemAsJavaApplication(tiTestFile);
+
+ String consoleText = console.getConsoleText(3*1000L,60*1000L,true);
+
+ assertTrue(decisionTableFileName + " didn't run properly.\n" +
+ "Console Text was: " + consoleText + "\n" +
+ "Expected console text is: Hello World\nGoodbye cruel world\n",
+ consoleText.endsWith("Hello World\nGoodbye cruel world\n"));
+ }
+}
\ No newline at end of file
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DomainSpecificLanguageEditorTest.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DomainSpecificLanguageEditorTest.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DomainSpecificLanguageEditorTest.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,229 @@
+ /*******************************************************************************
+ * 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.eclipse.swt.SWT;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+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.view.ProblemsView;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.junit.Test;
+/**
+ * Tests Domain Specific Language Editor
+ * @author Vladimir Pakan
+ *
+ */
+public class DomainSpecificLanguageEditorTest extends SWTTestExt{
+ /**
+ * Tests Domain Specific Language Editor
+ */
+ private static final String LANGUAGE_EXRESSION = "Message {msg} of type {t} contains {what}";
+ @Test
+ public void testDomainSpecificLanguageEditor() {
+ createDslFile(DroolsAllBotTests.DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME);
+ addDslExpression(DroolsAllBotTests.DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME);
+ useDslExpression(DroolsAllBotTests.DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME,
+ DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME);
+ runDslExpressionCheck(DroolsAllBotTests.DROOLS_TEST_JAVA_TREE_NODE,
+ DroolsAllBotTests.DOMAIN_SPECIFIC_LANGUAGE_FILE_NAME);
+ }
+ /**
+ * Creates DSL File
+ * @param dslFileName
+ */
+ private void createDslFile(String dslFileName){
+ packageExplorer.show();
+ SWTBotTreeItem tiRules = packageExplorer.selectTreeItem(DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME});
+
+ tiRules.select();
+ eclipse.createNew(EntityType.DSL_DROOLS_FILE);
+ bot.textWithLabel(IDELabel.NewDslDroolsFileDialog.FILE_NAME).setText(dslFileName);
+ eclipse.selectTreeLocation(DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ "src",
+ "main",
+ "rules");
+ bot.button(IDELabel.Button.FINISH).click();
+ bot.sleep(Timing.time1S());
+ tiRules.expand();
+ // Test if new DSL File is within package tree view
+ assertTrue("New DSL File was not created properly. It's not present within Package Explorer",
+ SWTEclipseExt.containsTreeItemWithLabel(tiRules, dslFileName));
+ // Test if new DSL File is opened in editor
+ assertTrue("New DSL File was not created properly. File " + dslFileName + " is not opened in editor",
+ SWTEclipseExt.existEditorWithLabel(bot,dslFileName));
+
+ }
+ /**
+ * Adds DSL Expression to DSL File
+ * @param dslFileName
+ */
+ private void addDslExpression(String dslFileName){
+ SWTBotEditor dslRuleEditor = bot.editorByTitle(dslFileName);
+ SWTBot dslRuleEditorBot = dslRuleEditor.bot();
+ dslRuleEditorBot
+ .button(IDELabel.Button.ADD_WITHOUT_DOTS).click();
+ SWTBot dialogBot = dslRuleEditorBot
+ .shell(IDELabel.DslDroolsFileEditor.ADD_LANGUAGE_MAPPING_DIALOG_TITLE)
+ .activate()
+ .bot();
+
+ dialogBot.textWithLabel(IDELabel.DslDroolsFileEditor.LANGUAGE_EXPRESSION_TEXT_LABEL)
+ .setText(DomainSpecificLanguageEditorTest.LANGUAGE_EXRESSION);
+ dialogBot.textWithLabel(IDELabel.DslDroolsFileEditor.RULE_MAPPING_TEXT_LABEL)
+ .setText("{msg} : Message(status == {t}, {what} : message)");
+ dialogBot.comboBoxWithLabel(IDELabel.DslDroolsFileEditor.SCOPE_COMBO_LABEL)
+ .setSelection(IDELabel.DslDroolsFileEditor.SCOPE_COMBO_VALUE);
+ dialogBot.button(IDELabel.Button.OK).click();
+ dslRuleEditor.save();
+
+ assertTrue("DSL table has to containt this Language Expression:\n" +
+ DomainSpecificLanguageEditorTest.LANGUAGE_EXRESSION,
+ SWTEclipseExt.isItemInTableColumn(dslRuleEditorBot.table(),
+ DomainSpecificLanguageEditorTest.LANGUAGE_EXRESSION,
+ 0));
+
+ }
+ /**
+ * Use defined language expression in dslFileName file within sampleDrlFileName file
+ * @param dslFileName
+ * @param sampleDrlFileName
+ */
+ private void useDslExpression (String dslFileName,String sampleDrlFileName){
+ packageExplorer.show();
+ SWTBotEclipseEditor drlDroolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME).toTextEditor();
+ SWTBotEditorExt ruleEditor = bot.swtBotEditorExtByTitle(DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME);
+ ruleEditor.selectPage(IDELabel.DroolsEditor.TEXT_EDITOR_TAB);
+ // update drl file
+ drlDroolsEditor.insertText(3,0,"\nexpander " +
+ dslFileName +
+ ";\n");
+ int[] linesToIgnoreExpander = new int[]{8,10,11,12,13,20};
+ for (int lineNumber : linesToIgnoreExpander){
+ drlDroolsEditor.insertText(lineNumber,0,">");
+ }
+ drlDroolsEditor.selectLine(18);
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.pressKeyCode(bot.getDisplay(),(int)SWT.DEL);
+ bot.sleep(Timing.time1S());
+ drlDroolsEditor.insertText(18, 0, " Message m of type Message.GOODBYE contains myMessage");
+ drlDroolsEditor.save();
+ util.waitForJobs(Timing.time10S(), JobName.BUILDING_WS);
+ SWTBotTreeItem[] errors = ProblemsView
+ .getFilteredErrorsTreeItems(bot,
+ null,
+ null,
+ sampleDrlFileName,
+ null);
+ assertTrue("File "
+ + sampleDrlFileName
+ + " was not udpated properly. There are these errors: "
+ + SWTEclipseExt.getFormattedTreeNodesText(bot.tree(), errors),
+ errors == null || errors.length == 0);
+
+ SWTBotTreeItem[] warnings = ProblemsView
+ .getFilteredWarningsTreeItems(bot,
+ null,
+ null,
+ sampleDrlFileName,
+ null);
+ assertTrue("File "
+ + sampleDrlFileName
+ + " was not udpated properly. There are these warnings: "
+ + SWTEclipseExt.getFormattedTreeNodesText(bot.tree(), warnings),
+ warnings == null || warnings.length == 0);
+ }
+ /**
+ * Runs javaFileName testing defined DSL
+ * @param javaFileName
+ * @param dslFileName
+ */
+ private void runDslExpressionCheck(String javaFileName,
+ String dslFileName){
+
+ packageExplorer.show();
+ SWTBotEclipseEditor drlDroolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
+ DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
+ DroolsAllBotTests.COM_SAMPLE_TREE_NODE,
+ javaFileName).toTextEditor();
+ // Change java file content to support new DSL
+ updateJavaTestFile(drlDroolsEditor,dslFileName);
+
+ console.clearConsole();
+ bot.sleep(Timing.time5S());
+
+ SWTBotTreeItem tiTestFile = packageExplorer.selectTreeItem(javaFileName,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
+ DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
+
+ eclipse.runTreeItemAsJavaApplication(tiTestFile);
+
+ String consoleText = console.getConsoleText(3*1000L,60*1000L,true);
+
+ assertTrue(javaFileName + " didn't run properly.\n" +
+ "Console Text was: " + consoleText + "\n" +
+ "Expected console text is: " + "Hello World\nGoodbye cruel world\n",
+ "Hello World\nGoodbye cruel world\n".equals(consoleText));
+ }
+ /**
+ * Update properly Java Test file in drlDroolsEditor to be able to run
+ * with new DSL definition
+ * @param drlDroolsEditor
+ * @param dslFileName
+ */
+ private void updateJavaTestFile(SWTBotEclipseEditor drlDroolsEditor,
+ String dslFileName){
+ int lineIndex = 0;
+ String foundLineText = null;
+ while (lineIndex < drlDroolsEditor.getLineCount() && foundLineText == null){
+ String lineText = drlDroolsEditor.getTextOnLine(lineIndex);
+ if(lineText.trim().startsWith("kbuilder.add")){
+ foundLineText = lineText;
+ }
+ else{
+ lineIndex++;
+ }
+ }
+ if (foundLineText != null){
+ drlDroolsEditor.insertText(lineIndex,0,
+ "kbuilder.add(ResourceFactory.newClassPathResource(\"" +
+ dslFileName +
+ "\"), ResourceType.DSL);\n");
+ lineIndex++;
+ drlDroolsEditor.selectLine(lineIndex);
+ KeyboardHelper.pressKeyCode(bot.getDisplay(),(int)SWT.DEL);
+ drlDroolsEditor.insertText(foundLineText
+ .replace("ResourceType.DRL","ResourceType.DSLR") + "\n");
+ drlDroolsEditor.save();
+ util.waitForJobs(Timing.time10S(), JobName.BUILDING_WS);
+ }
+ else{
+ throw new RuntimeException("File " +
+ drlDroolsEditor.getTitle() +
+ " has wrong content. It doesn't contain 'kbuilder.add' string.");
+ }
+ }
+
+}
\ No newline at end of file
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsRulesEditorTest.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsRulesEditorTest.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/DroolsRulesEditorTest.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,95 @@
+ /*******************************************************************************
+ * 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.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.utils.Position;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.parts.ContentAssistBot;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.junit.Test;
+/**
+ * Tests Drools Rule Editor
+ * @author Vladimir Pakan
+ *
+ */
+public class DroolsRulesEditorTest extends SWTTestExt{
+ /**
+ * Tests Drools Rule Editor
+ */
+ private static final String CONTENT_ASSIST_IMPORT = "import";
+ private static final String CONTENT_ASSIST_MESSAGE = "Message";
+ @Test
+ public void testDroolsRulesEditor() {
+ codeCompletionCheck(DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME);
+ reteViewCheck(DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME);
+ }
+ /**
+ * Check code completion for Drools Rule
+ * @param droolsRuleName
+ */
+ private void codeCompletionCheck(String droolsRuleName){
+
+ packageExplorer.show();
+ packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,droolsRuleName);
+ SWTBotEditorExt ruleEditor = bot.swtBotEditorExtByTitle(droolsRuleName);
+ ruleEditor.selectPage(IDELabel.DroolsEditor.TEXT_EDITOR_TAB);
+ ruleEditor.typeText(3, 0, "i");
+ ContentAssistBot contentAssist = ruleEditor.contentAssist();
+ contentAssist.checkContentAssist(DroolsRulesEditorTest.CONTENT_ASSIST_IMPORT, true);
+ ruleEditor.typeText(6, 0, "m");
+ contentAssist.checkContentAssist(DroolsRulesEditorTest.CONTENT_ASSIST_MESSAGE, true);
+
+ SWTBotEclipseEditor ruleTextEditor = ruleEditor.toTextEditor();
+ String lineText = ruleTextEditor.getTextOnLine(3).trim();
+ assertTrue("Content Assist for " + DroolsRulesEditorTest.CONTENT_ASSIST_IMPORT +
+ " was not inserted properly.\n" +
+ "Inserted text is: " + lineText + "\n" +
+ "Expected text is: " + DroolsRulesEditorTest.CONTENT_ASSIST_IMPORT,
+ lineText.equals(DroolsRulesEditorTest.CONTENT_ASSIST_IMPORT));
+
+ lineText = ruleTextEditor.getTextOnLine(6).trim();
+ String messageContentAssistText = DroolsRulesEditorTest.CONTENT_ASSIST_MESSAGE + "( )";
+ assertTrue("Content Assist for " + DroolsRulesEditorTest.CONTENT_ASSIST_MESSAGE +
+ " was not inserted properly.\n" +
+ "Inserted text is: " + lineText + "\n" +
+ "Expected text has to stard with: " + messageContentAssistText,
+ lineText.startsWith(messageContentAssistText));
+
+ Position cursorPosition = ruleTextEditor.cursorPosition();
+ assertTrue("Content Assist for " + DroolsRulesEditorTest.CONTENT_ASSIST_MESSAGE +
+ " was not inserted properly.\n" +
+ "Position of cursor is wrong: " + cursorPosition + "\n" +
+ "Expected X cursor position is: " + 9,
+ cursorPosition.column == 9);
+
+ ruleEditor.close();
+
+ }
+ /**
+ * Check Rete View of Drools Rule
+ * @param droolsRuleName
+ */
+ private void reteViewCheck(String droolsRuleName){
+
+ packageExplorer.show();
+ packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,droolsRuleName);
+ SWTBotEditorExt ruleEditor = bot.swtBotEditorExtByTitle(droolsRuleName);
+ ruleEditor.selectPage(IDELabel.DroolsEditor.RETE_TREE_TAB);
+
+ }
+}
+
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuidedDroolsRulesEditorTest.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuidedDroolsRulesEditorTest.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuidedDroolsRulesEditorTest.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,175 @@
+ /*******************************************************************************
+ * 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.awt.event.KeyEvent;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.ImageHyperlinkHelper;
+import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+import org.jboss.tools.ui.bot.ext.types.EntityType;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.junit.Test;
+/**
+ * Tests Guided Drools Rule Editor
+ * @author Vladimir Pakan
+ *
+ */
+public class GuidedDroolsRulesEditorTest extends SWTTestExt{
+ private static final String DROOLS_PACKAGE_FILE = "drools.package";
+ /**
+ * Tests Guided Drools Rule Editor
+ */
+ @Test
+ public void testGuidedDroolsRulesEditorTest() {
+ createGuidedDroolsRule(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
+ editDroolsPackageFile();
+ addGuidedDroolsRuleCondition(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
+ removeGuidedDroolsRuleCondition(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
+ }
+ /**
+ * Creates Guided Drools Rule
+ * @param guidedDroolsRuleName
+ */
+ private void createGuidedDroolsRule(String guidedDroolsRuleName){
+ packageExplorer.show();
+ SWTBotTreeItem tiRules = packageExplorer.selectTreeItem(DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME});
+
+ tiRules.select();
+ eclipse.createNew(EntityType.GUIDED_DROOLS_RULE);
+ bot.textWithLabel(IDELabel.NewGuidedDroolsRuleDialog.FILE_NAME).setText(guidedDroolsRuleName);
+ eclipse.selectTreeLocation(DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ "src",
+ "main",
+ "rules");
+ bot.button(IDELabel.Button.FINISH).click();
+ bot.sleep(Timing.time1S());
+ tiRules.expand();
+ // Test if new Drools Rule is within package tree view
+ assertTrue("New Guided Drools Rule was not created properly. It's not present within Package Explorer",
+ SWTEclipseExt.containsTreeItemWithLabel(tiRules, guidedDroolsRuleName));
+ // Test if new Drools Rule is opened in editor
+ assertTrue("New Guided Drools Rule was not created properly. File " + guidedDroolsRuleName + " is not opened in editor",
+ SWTEclipseExt.existEditorWithLabel(bot,guidedDroolsRuleName));
+ // Test if drools.package file is within package tree view
+ assertTrue("New Guided Drools Rule was not created properly. It's not present within Package Explorer",
+ SWTEclipseExt.containsTreeItemWithLabel(tiRules,
+ GuidedDroolsRulesEditorTest.DROOLS_PACKAGE_FILE));
+ }
+ /**
+ * Edits drools.package file.
+ * Actually only adds import java.util.List to file
+ */
+ private void editDroolsPackageFile(){
+ packageExplorer.show();
+ SWTBotEclipseEditor droolsPackageEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ GuidedDroolsRulesEditorTest.DROOLS_PACKAGE_FILE).toTextEditor();
+ droolsPackageEditor.setText(droolsPackageEditor.getText() +
+ "\nimport java.util.List;");
+ droolsPackageEditor.save();
+ droolsPackageEditor.close();
+ }
+
+ private void addGuidedDroolsRuleCondition(String guidedDroolsRuleName){
+ packageExplorer.show();
+ SWTBotEclipseEditor droolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME).toTextEditor();
+ SWTBot droolsEditorBot = droolsEditor.bot();
+ droolsEditorBot.toolbarButton().click();
+ SWTBotShell dialogShell = droolsEditorBot.shell(IDELabel.GuidedDroolsRuleEditor.WHEN_ADD_DIALOG_TITLE);
+ dialogShell.activate();
+ dialogShell.bot().comboBoxWithLabel(IDELabel.GuidedDroolsRuleEditor.WHEN_ADD_FACT_COMBO)
+ .setSelection("List");
+ ImageHyperlinkHelper
+ .imageHyperlinkWithTooltip(droolsEditorBot,
+ IDELabel.GuidedDroolsRuleEditor.ADD_FIELD_TO_THIS_CONDITION_TOOLTIP)
+ .click();
+ dialogShell = droolsEditorBot.shell(IDELabel.GuidedDroolsRuleEditor.UPDATE_CONSTRAINTS_DIALOG_TITLE);
+ dialogShell.activate();
+ dialogShell.bot().comboBox()
+ .setSelection(IDELabel.GuidedDroolsRuleEditor.ADD_RESTRICTION_ON_A_FIELD_COMBO_VALUE);
+ droolsEditorBot.comboBox()
+ .setSelection(IDELabel.GuidedDroolsRuleEditor.WHEN_COMBO_CONSTRAINTS_VALUE);
+ ImageHyperlinkHelper
+ .imageHyperlinkWithTooltip(droolsEditorBot,
+ IDELabel.GuidedDroolsRuleEditor.CHOOSE_VALUE_EDITOR_TYPE_TOOLTIP)
+ .click();
+ dialogShell = droolsEditorBot.shell(IDELabel.GuidedDroolsRuleEditor.SELECT_VALUE_EDITOR_TYPE_DIALOG_TITLE);
+ dialogShell.activate();
+ dialogShell.bot().comboBoxWithLabel(IDELabel.GuidedDroolsRuleEditor.SELECT_VALUE_EDITOR_TYPE_COMBO_LABEL)
+ .setSelection(IDELabel.GuidedDroolsRuleEditor.SELECT_VALUE_EDITOR_TYPE_COMBO_VALUE);
+ droolsEditorBot.comboBox(1).setSelection(IDELabel.GuidedDroolsRuleEditor.FIELD_VALUE_COMBO_VALUE);
+ droolsEditor.save();
+ droolsEditor.close();
+ droolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME).toTextEditor();
+ SWTBotEditorExt ruleEditor = bot.swtBotEditorExtByTitle(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
+ ruleEditor.selectPage(2);
+ String editorContent = droolsEditor.getText();
+ assertTrue(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME +
+ " has to contain text: List( empty == true )\n" +
+ "but it doesn't.\n" +
+ "It contains this text: " + editorContent,
+ editorContent.replaceAll(" ","").indexOf("List(empty==true)") > 0);
+ }
+ /**
+ * Removes Drools Rule Condition from Guided Drools Rule
+ * @param guidedDroolsRuleName
+ */
+ private void removeGuidedDroolsRuleCondition(String guidedDroolsRuleName){
+ packageExplorer.show();
+ SWTBotEclipseEditor droolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME).toTextEditor();
+ SWTBot droolsEditorBot = droolsEditor.bot();
+ SWTBotEditorExt ruleEditor = bot.swtBotEditorExtByTitle(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
+ ruleEditor.selectPage(0);
+ ImageHyperlinkHelper
+ .imageHyperlinkWithTooltip(droolsEditorBot,
+ IDELabel.GuidedDroolsRuleEditor.REMOVE_THIS_CONDITION_TOOLTIP)
+ .click();
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_RIGHT);
+ KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_RIGHT);
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_ENTER);
+ KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_ENTER);
+ bot.sleep(Timing.time1S());
+ droolsEditor.save();
+ droolsEditor.close();
+ droolsEditor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME).toTextEditor();
+ ruleEditor = bot.swtBotEditorExtByTitle(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME);
+ ruleEditor.selectPage(2);
+ String editorContent = droolsEditor.getText();
+ assertTrue(DroolsAllBotTests.GUIDED_DROOLS_RULE_NAME +
+ " has to contain textjak e:\nwhen\nthen\n" +
+ "but it doesn't.\n" +
+ "It contains this text: " + editorContent,
+ ruleEditor.getTextOnLine(2).trim().equals("when") &&
+ ruleEditor.getTextOnLine(3).trim().equals("then"));
+ }
+
+}
\ No newline at end of file
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,542 @@
+ /*******************************************************************************
+ * 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 static org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.syncExec;
+
+import java.awt.event.KeyEvent;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory;
+import org.eclipse.swtbot.swt.finder.results.StringResult;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.hamcrest.Matcher;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.jboss.tools.ui.bot.ext.config.requirement.PrepareViews;
+import org.jboss.tools.ui.bot.ext.config.requirement.RequirementNotFulfilledException;
+import org.jboss.tools.ui.bot.ext.config.requirement.StartServer;
+import org.jboss.tools.ui.bot.ext.config.requirement.StopServer;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.GuvnorGuvnorResourceHistory;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.helper.DragAndDropHelper;
+import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
+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.PerspectiveType;
+import org.jboss.tools.ui.bot.ext.view.GuvnorRepositories;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.junit.Test;
+/**
+ * Tests Guvnor Repositories
+ * @author Vladimir Pakan
+ *
+ */
+public class GuvnorRepositoriesTest extends SWTTestExt{
+ @SuppressWarnings("unused")
+ private static final Logger log = Logger.getLogger(GuvnorRepositoriesTest.class);
+ private static final String GUVNOR_TEST_FILE = "Dummy rule.drl";
+ private static final String GUVNOR_REPOSITORY_IMPORT_TEST_FILE = "Underage.brl";
+ private static final String GUVNOR_REPOSITORY_HISTORY_TEST_FILE = "MortgageModel.model.drl";
+ private static final String GUVNOR_USER_NAME = "admin";
+ private static final String GUVNOR_PASSWORD = "admin";
+ private GuvnorRepositories guvnorRepositories = new GuvnorRepositories();
+
+ /**
+ * Tests Guvnor Repositories
+ */
+ @Test
+ public void testGuvnorRepositories() {
+ startGuvnor();
+ addGuvnorRepository();
+ deleteGuvnorRepository();
+ addGuvnorRepository();
+ openGuvnorConsole();
+ drillIntoFunctionalityCheck();
+ browseGuvnorRepository(GuvnorRepositoriesTest.GUVNOR_TEST_FILE);
+ guvnorFunctionalityCheck(GuvnorRepositoriesTest.GUVNOR_TEST_FILE,
+ DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME,
+ GuvnorRepositoriesTest.GUVNOR_REPOSITORY_IMPORT_TEST_FILE);
+ repositoryHistoryCheck(GuvnorRepositoriesTest.GUVNOR_REPOSITORY_HISTORY_TEST_FILE);
+ stopGuvnor();
+ }
+
+ /**
+ * Adds Guvnor Repository
+ */
+ private void addGuvnorRepository(){
+ eclipse.openPerspective(PerspectiveType.GUVNOR_REPOSITORY_EXPLORING);
+ SWTBot guvnorRepositoriesBot = guvnorRepositories.show().bot();
+ SWTUtilExt.getViewToolbarButtonWithTooltip(
+ guvnorRepositories.show(),
+ IDELabel.GuvnorRepositories.ADD_GUVNOR_REPOSITORY_TOOLTIP)
+ .click();
+ eclipse.waitForShell("");
+ SWTBot addGuvnorRepositoryDialog = guvnorRepositoriesBot.activeShell().bot();
+ String guvnorRepositoryUrl = DroolsAllBotTests.getGuvnorRepositoryUrl();
+ if (guvnorRepositoryUrl != null && guvnorRepositoryUrl.length() > 0){
+ addGuvnorRepositoryDialog.textWithLabel(IDELabel.GuvnorAddRepositoryDialog.REPOSITORY)
+ .setText(guvnorRepositoryUrl);
+ }
+ addGuvnorRepositoryDialog.button(IDELabel.Button.FINISH).click();
+ assertTrue("Guvnor repository was not created properly",
+ guvnorRepositoriesBot.tree().rowCount() == 1);
+ }
+ /**
+ * Deletes Guvnor Repostiry
+ */
+ private void deleteGuvnorRepository(){
+ SWTBot guvnorRepositoriesBot = guvnorRepositories.show().bot();;
+ SWTBotTree guvnorRepositoryTree = guvnorRepositoriesBot.tree();
+ guvnorRepositoryTree.select(0);
+ SWTUtilExt.getViewToolbarButtonWithTooltip(
+ guvnorRepositories.show(),
+ IDELabel.GuvnorRepositories.REMOVE_GUVNOR_REPOSITORY_TOOLTIP)
+ .click();
+ guvnorRepositoriesBot.shell(IDELabel.GuvnorRepositories.REMOVE_GUVNOR_REPOSITORY_DIALOG_TITLE)
+ .activate();
+ bot.button(IDELabel.Button.OK).click();
+ assertTrue("Guvnor repository was not deleted properly",
+ guvnorRepositoriesBot.tree().rowCount() == 0);
+ }
+ /**
+ * Opens Guvnor Console
+ */
+ private void openGuvnorConsole(){
+ SWTBot guvnorRepositoriesBot = guvnorRepositories.show().bot();
+ SWTBotTree guvnorRepositoryTree = guvnorRepositoriesBot.tree();
+ SWTBotTreeItem tiGuvnorRepository = guvnorRepositoryTree.getAllItems()[0];
+ ContextMenuHelper.prepareTreeItemForContextMenu(guvnorRepositoryTree, tiGuvnorRepository);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(guvnorRepositoryTree,
+ IDELabel.Menu.OPEN_GUVNOR_CONSOLE, false)).click();
+ bot.sleep(Timing.time5S());
+ SWTBotBrowserExt browser = bot.browserByTitle(IDELabel.GuvnorConsole.GUVNOR_CONSOLE_TITLE);
+ browser.setInputTextViaJavaScript(GuvnorRepositoriesTest.GUVNOR_USER_NAME, 0, bot);
+ browser.setInputTextViaJavaScript(GuvnorRepositoriesTest.GUVNOR_PASSWORD, 1, bot);
+ browser.clickOnButtonViaJavaScript(0, bot);
+ browser.clickOnButtonViaJavaScript(IDELabel.GuvnorConsole.BUTTON_YES_INSTALL_SAMPLES, bot);
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_RIGHT);
+ KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_RIGHT);
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_ENTER);
+ KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_ENTER);
+ bot.sleep(Timing.time10S());
+ KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_ENTER);
+ KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_ENTER);
+ }
+ /**
+ * Browse Guvnor Repository and open fileToOpenFile
+ * @param fileToOpen
+ */
+ private void browseGuvnorRepository(String fileToOpen){
+
+ guvnorRepositories.show();
+
+ guvnorRepositories.openFile(Timing.time3S(),DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
+ IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
+ IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM,
+ fileToOpen);
+
+ assertTrue("File from Guvnor Repository was not opened properly. File " + fileToOpen + " is not opened in editor",
+ SWTEclipseExt.existEditorWithLabel(bot,fileToOpen + " (Read only)"));
+
+ }
+ /**
+ * Starts Guvnor AS
+ */
+ private void startGuvnor(){
+ try {
+ new StartServer().fulfill();
+ new PrepareViews().fulfill();
+ } catch (RequirementNotFulfilledException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ /**
+ * Stops Guvnor AS
+ */
+ private void stopGuvnor(){
+ try {
+ new StopServer().fulfill();
+ } catch (RequirementNotFulfilledException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ /**
+ * Imports file with fileName to Drools project and check update and commit Guvnor functionality
+ * @param fileName
+ * @param sampleFileName
+ * @param importFileName
+ */
+ private void guvnorFunctionalityCheck(String fileName, String sampleFileName, String importFileName){
+ eclipse.openPerspective(PerspectiveType.JAVA);
+ guvnorRepositories.show().bot();
+ SWTBotTreeItem tiGuvnorFile = guvnorRepositories.selectTreeItem(Timing.time3S(),fileName,
+ new String[]{DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
+ IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
+ IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM});
+ tiGuvnorFile.select();
+ SWTBot packageExplorerBot = packageExplorer.show().bot();
+ SWTBotTreeItem tiDroolRuleDir = packageExplorer.selectTreeItem(DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME});
+ DragAndDropHelper.dragAndDropOnTo(tiGuvnorFile.widget,tiDroolRuleDir.widget);
+ bot.sleep(Timing.time5S());
+ bot.shell(IDELabel.Shell.COPY_FILE_FROM_GUVNOR_TO_PACKAGE_EXPLORER).activate();
+ bot.button(IDELabel.Button.OK).click();
+ SWTBotTree packageExplorerTree = packageExplorerBot.tree();
+ // File is renamed because there is appended Guvnor info to Tree Item Label
+ // So we need to get real label of Tree Item and use it later
+ SWTBotTreeItem tiDroolRuleFile = SWTEclipseExt.getTreeItemOnPathStartsWith(packageExplorerBot,
+ packageExplorerTree,
+ Timing.time1S(),
+ fileName,
+ new String[]{DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE});
+ SWTBotEditor editor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ tiDroolRuleFile.getText());
+
+ assertTrue("File moved from Guvnor Repository to Drools project was not opened properly. File " + fileName + " is not opened in editor",
+ SWTEclipseExt.existEditorWithLabel(bot,fileName));
+ // Test Update from Guvnor Repository
+ final String changeText = "#$%SWTBot Change#$%";
+ final String originalEditorText = editor.toTextEditor().getText();
+ editor.toTextEditor().insertText(0, 0, changeText);
+ editor.save();
+ bot.sleep(Timing.time1S());
+ ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiDroolRuleFile);
+ ContextMenuHelper.clickContextMenu(packageExplorerTree,
+ IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_UPDATE);
+ bot.sleep(Timing.time5S());
+ assertTrue("Update from Guvnor Repository was not successful. File " + fileName + " has not updated content.",
+ editor.toTextEditor().getText().equals(originalEditorText));
+ // Test commit to Guvnor Repository
+ editor.toTextEditor().insertText(0, 0, changeText);
+ editor.save();
+ bot.sleep(Timing.time1S());
+ ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiDroolRuleFile);
+ ContextMenuHelper.clickContextMenu(packageExplorerTree,
+ IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_COMMIT);
+ bot.sleep(Timing.time5S());
+ editor.close();
+ editor = guvnorRepositories.openFile(Timing.time2S(),DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
+ IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
+ IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM,
+ fileName);
+ assertTrue("Commit to Guvnor Repository was not successful. File " + fileName + " was not commited properly." +
+ "\nIt has content: " + editor.toTextEditor().getText() +
+ "\nExpected content: " + changeText + originalEditorText,
+ editor.toTextEditor().getText().equals(changeText + originalEditorText));
+ // Test Add To Repository
+ SWTBotTreeItem tiSampleFile = packageExplorer.selectTreeItem(sampleFileName,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE});
+ ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiSampleFile);
+ ContextMenuHelper.clickContextMenu(packageExplorerTree,
+ IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_ADD);
+ eclipse.waitForShell("");
+ SWTBotShell addToGuvnorShell = packageExplorerBot.activeShell();
+ SWTBot addToGuvnorDialogBot = addToGuvnorShell.bot();
+ addToGuvnorDialogBot.button(IDELabel.Button.NEXT).click();
+ SWTEclipseExt.getTreeItemOnPath(addToGuvnorDialogBot,
+ addToGuvnorDialogBot.tree(),
+ Timing.time3S(),
+ IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM,
+ new String[]{DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
+ IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM})
+ .select();
+ bot.sleep(Timing.time5S());
+ addToGuvnorDialogBot.button(IDELabel.Button.FINISH).click();
+ eclipse.waitForClosedShell(addToGuvnorShell);
+ boolean isAddedToGuvnorRepository = false;
+ try{
+ guvnorRepositories.selectTreeItem(Timing.time2S(),sampleFileName,
+ new String[]{DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
+ IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
+ IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM});
+ isAddedToGuvnorRepository = true;
+ } catch (WidgetNotFoundException wnfe){
+ isAddedToGuvnorRepository = false;
+ }
+
+ assertTrue("File " + sampleFileName + " was not added to Guvnor Repository.",
+ isAddedToGuvnorRepository);
+ // Test Deleting from Guvnor Repository file is already selected in Guvnor Repository Tree
+ packageExplorerBot = packageExplorer.show().bot();
+ packageExplorerTree = packageExplorerBot.tree();
+ packageExplorerBot.sleep(Timing.time2S());
+ ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiSampleFile);
+ ContextMenuHelper.clickContextMenu(packageExplorerTree,
+ IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_DELETE);
+ SWTBot dialogBot = packageExplorerBot.shell(IDELabel.Shell.CONFIRM_DELETE).activate().bot();
+ dialogBot.button(IDELabel.Button.OK).click();
+ packageExplorerBot.sleep(Timing.time2S());
+ boolean isRemovedFromGuvnorRepository = false;
+ try{
+ guvnorRepositories.selectTreeItem(Timing.time2S(),sampleFileName,
+ new String[]{DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
+ IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
+ IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM});
+ isRemovedFromGuvnorRepository = false;
+ } catch (WidgetNotFoundException wnfe){
+ isRemovedFromGuvnorRepository = true;
+ }
+ assertTrue("File " + sampleFileName + " was not removed from Guvnor Repository.",
+ isRemovedFromGuvnorRepository);
+ // Import File From Repository
+ eclipse.createNew(EntityType.RESOURCES_FROM_GUVNOR);
+ bot.button(IDELabel.Button.NEXT).click();
+ bot.sleep(Timing.time2S());
+ SWTEclipseExt.getTreeItemOnPath(
+ bot,
+ bot.tree(),
+ Timing.time5S(),
+ importFileName,
+ new String[] {
+ DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
+ IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
+ IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM }).select();
+ bot.button(IDELabel.Button.NEXT).click();
+ SWTEclipseExt.getTreeItemOnPath(bot,
+ bot.tree(),
+ Timing.time1S(),
+ "rules",
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,"src","main"}).select();
+ bot.button(IDELabel.Button.FINISH).click();
+ util.waitForJobs(Timing.time5S(),JobName.BUILDING_WS);
+ bot.sleep(Timing.time1S());
+ packageExplorerBot = packageExplorer.show().bot();
+ packageExplorerTree = packageExplorerBot.tree();
+ boolean isAddedFromGuvnorRepository = false;
+ SWTBotTreeItem tiImportRuleFile = null;
+ try{
+ tiImportRuleFile = SWTEclipseExt.getTreeItemOnPathStartsWith(packageExplorerBot,
+ packageExplorerTree,
+ Timing.time1S(),
+ importFileName,
+ new String[]{DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE});
+ isAddedFromGuvnorRepository = true;
+ } catch (WidgetNotFoundException wnfe){
+ isAddedFromGuvnorRepository = false;
+ }
+ assertTrue("File " + importFileName + " was not added from Guvnor Repository.",
+ isAddedFromGuvnorRepository);
+
+ ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiImportRuleFile);
+ ContextMenuHelper.clickContextMenu(packageExplorerTree,
+ IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_DISCONNECT);
+ bot.sleep(Timing.time1S());
+ // name of the file has to be without Guvnor information appended to end of file name
+ // when imported from Guvnor repository
+ assertTrue("File " + importFileName + " was not disconnected from Guvnor Repository.",
+ tiImportRuleFile.getText().trim().equals(importFileName));
+ }
+ private void drillIntoFunctionalityCheck(){
+ SWTBotView guvnorReposioryView = guvnorRepositories.show();
+ SWTBotTreeItem tiRoot = guvnorRepositories.selectTreeItem(DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),null)
+ .doubleClick();
+ bot.sleep(Timing.time5S());
+ SWTBotShell activeShell = bot.activeShell();
+ SWTBot dialogBot = null;
+ if (activeShell.getText().length() != 0){
+ dialogBot = bot.shell("").activate().bot();
+ }
+ else{
+ dialogBot = activeShell.bot();
+ }
+
+ dialogBot.textWithLabel(IDELabel.GuvnorConsoleLoginDialog.USER_NAME).setText(
+ GuvnorRepositoriesTest.GUVNOR_USER_NAME);
+ dialogBot.textWithLabel(IDELabel.GuvnorConsoleLoginDialog.PASSWORD).setText(
+ GuvnorRepositoriesTest.GUVNOR_PASSWORD);
+ dialogBot.button(IDELabel.Button.OK).click();
+ tiRoot.expand();
+ bot.sleep(Timing.time2S());
+ tiRoot.select(IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM);
+ SWTUtilExt.getViewToolbarButtonWithTooltip(guvnorReposioryView,
+ IDELabel.GuvnorRepositories.GO_INTO_GUVNOR_REPOSITORY_TOOLTIP)
+ .click();
+ SWTBot guvnorRepositoryBot = guvnorReposioryView.bot();
+ SWTBotTree guvnorRepositoryTree = guvnorRepositoryBot.tree();
+ guvnorRepositoryBot.sleep(Timing.time3S());
+ assertTrue("Guvnor repository Go Into functionality doesn't work properly.\n" +
+ "Expected First Tree Item in Guvnor Repository is " + IDELabel.GuvnorRepositories.DEFAULT_PACKAGE_TREE_ITEM +
+ "\nBut it was " + guvnorRepositoryTree.getAllItems()[0].getText(),
+ IDELabel.GuvnorRepositories.DEFAULT_PACKAGE_TREE_ITEM.equals(guvnorRepositoryTree.getAllItems()[0].getText()));
+
+ guvnorRepositories.selectTreeItem(Timing.time2S(), IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM,
+ null);
+ SWTUtilExt.getViewToolbarButtonWithTooltip(guvnorReposioryView,
+ IDELabel.GuvnorRepositories.GO_INTO_GUVNOR_REPOSITORY_TOOLTIP)
+ .click();
+ guvnorRepositoryBot.sleep(Timing.time3S());
+ assertTrue("Guvnor repository Go Into functionality doesn't work properly.\n" +
+ "Expected First Tree Item in Guvnor Repository is " + IDELabel.GuvnorRepositories.APPLICANTDSL_DSL_TREE_ITEM +
+ "\nBut it was " + guvnorRepositoryTree.getAllItems()[0].getText(),
+ IDELabel.GuvnorRepositories.APPLICANTDSL_DSL_TREE_ITEM.equals(guvnorRepositoryTree.getAllItems()[0].getText()));
+
+ SWTUtilExt.getViewToolbarButtonWithTooltip(guvnorReposioryView,
+ IDELabel.GuvnorRepositories.BACK_GUVNOR_REPOSITORY_TOOLTIP)
+ .click();
+ guvnorRepositoryBot.sleep(Timing.time3S());
+ assertTrue("Guvnor repository Back functionality doesn't work properly.\n" +
+ "Expected First Tree Item in Guvnor Repository is " + IDELabel.GuvnorRepositories.DEFAULT_PACKAGE_TREE_ITEM +
+ "\nBut it was " + guvnorRepositoryTree.getAllItems()[0].getText(),
+ IDELabel.GuvnorRepositories.DEFAULT_PACKAGE_TREE_ITEM.equals(guvnorRepositoryTree.getAllItems()[0].getText()));
+
+ SWTUtilExt.getViewToolbarButtonWithTooltip(guvnorReposioryView,
+ IDELabel.GuvnorRepositories.HOME_GUVNOR_REPOSITORY_TOOLTIP)
+ .click();
+ guvnorRepositoryBot.sleep(Timing.time3S());
+ assertTrue("Guvnor repository Home functionality doesn't work properly.\n" +
+ "Expected First Tree Item in Guvnor Repository is " + DroolsAllBotTests.getGuvnorRepositoryRootTreeItem() +
+ "\nBut it was " + guvnorRepositoryTree.getAllItems()[0].getText(),
+ DroolsAllBotTests.getGuvnorRepositoryRootTreeItem().equals(guvnorRepositoryTree.getAllItems()[0].getText()));
+ }
+ /**
+ * Check Repository History Functionality
+ * @param testFileName
+ */
+ private void repositoryHistoryCheck (String testFileName){
+ // Import File From Repository
+ eclipse.createNew(EntityType.RESOURCES_FROM_GUVNOR);
+ bot.button(IDELabel.Button.NEXT).click();
+ SWTEclipseExt.getTreeItemOnPath(
+ bot,
+ bot.tree(),
+ Timing.time5S(),
+ testFileName,
+ new String[] {
+ DroolsAllBotTests.getGuvnorRepositoryRootTreeItem(),
+ IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM,
+ IDELabel.GuvnorRepositories.MORTGAGE_TREE_ITEM }).select();
+ bot.button(IDELabel.Button.NEXT).click();
+ SWTEclipseExt.getTreeItemOnPath(bot,
+ bot.tree(),
+ Timing.time1S(),
+ "rules",
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,"src","main"}).select();
+ bot.button(IDELabel.Button.FINISH).click();
+ util.waitForJobs(Timing.time5S(),JobName.BUILDING_WS);
+ bot.sleep(Timing.time1S());
+ SWTBot packageExplorerBot = packageExplorer.show().bot();
+ SWTBotTree packageExplorerTree = packageExplorerBot.tree();
+ // File is renamed because there is appended Guvnor info to Tree Item Label
+ // So we need to get real label of Tree Item and use it later
+ SWTBotTreeItem tiTestRuleFile = SWTEclipseExt.getTreeItemOnPathStartsWith(packageExplorerBot,
+ packageExplorerTree,
+ Timing.time1S(),
+ testFileName,
+ new String[]{DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE});
+ SWTBotEditor editor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ tiTestRuleFile.getText());
+ // change test file
+ String addedChange = "SWTBOT Change!@#$asdfghjkl)(*&^";
+ editor.toTextEditor().insertText(0,0,addedChange);
+ editor.save();
+ bot.sleep(Timing.time1S());
+ // commit changes
+ ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiTestRuleFile);
+ ContextMenuHelper.clickContextMenu(packageExplorerTree,
+ IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_COMMIT);
+ bot.sleep(Timing.time5S());
+ // check history
+ ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiTestRuleFile);
+ ContextMenuHelper.clickContextMenu(packageExplorerTree,
+ IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_SHOW_HISTORY);
+ bot.sleep(Timing.time5S());
+ SWTBotView guvnorResourceHistoryView = open.viewOpen(GuvnorGuvnorResourceHistory.LABEL);
+ SWTBot guvnorResourceHistoryBot = guvnorResourceHistoryView.bot();
+ SWTBotTable guvnorResourceHistoryTable = guvnorResourceHistoryView.bot().table();
+ assertTrue("Guvnor Resource History table for file " + testFileName +
+ " has to contain at least one record but is empty.",
+ guvnorResourceHistoryTable.rowCount() > 0);
+ // Compare Revisions
+ String secondAddedChange = "222222" + addedChange;
+ editor.toTextEditor().insertText(0,0,secondAddedChange);
+ editor.saveAndClose();
+ bot.sleep(Timing.time1S());
+ ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiTestRuleFile);
+ ContextMenuHelper.clickContextMenu(packageExplorerTree,
+ IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_COMPARE_WITH_VERSION);
+ eclipse.waitForShell("");
+ guvnorResourceHistoryBot.activeShell().bot().button(IDELabel.Button.OK).click();
+ SWTBotEditor compareEditor = bot.editorByTitle("Compare");
+ Matcher<StyledText> widgetOfTypeMatcher = WidgetMatcherFactory.widgetOfType(StyledText.class);
+ final List<?> styledTexts = compareEditor.bot().widgets(widgetOfTypeMatcher,compareEditor.getWidget());
+ String newVersionEditorText = syncExec(new StringResult() {
+ public String run() {
+ return ((StyledText)styledTexts.get(0)).getText();
+ }
+ });
+ String revisionEditorText = syncExec(new StringResult() {
+ public String run() {
+ return ((StyledText)styledTexts.get(1)).getText();
+ }
+ });
+ compareEditor.close();
+ assertTrue("Actual version of file opened within compare editor has wrong content.\n" +
+ "Content should start with " + secondAddedChange +
+ "\n but is " + newVersionEditorText,newVersionEditorText.startsWith(secondAddedChange));
+ assertTrue("File stored in Guvnor Repository opened within compare editor has wrong content.\n" +
+ "Content should start with " + addedChange +
+ "\n but is " + revisionEditorText,revisionEditorText.startsWith(addedChange));
+ // Open Revision
+ guvnorResourceHistoryView.show();
+ guvnorResourceHistoryTable.setFocus();
+ bot.sleep(Timing.time1S());
+ guvnorResourceHistoryTable.select(0);
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.pressKeyCodeUsingAWT(KeyEvent.VK_ENTER);
+ KeyboardHelper.releaseKeyCodeUsingAWT(KeyEvent.VK_ENTER);
+ bot.sleep(Timing.time1S());
+ SWTBotEditor revisonFileEditor = eclipse.editorStartsWith(testFileName);
+ String revisionFileText = revisonFileEditor.toTextEditor().getText();
+ revisonFileEditor.close();
+ assertTrue("File stored in Guvnor Repository has wrong content.\n" +
+ "Content should start with " + addedChange +
+ "\n but is " + revisionFileText,revisionFileText.startsWith(addedChange));
+ // Switch to version
+ editor = packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ tiTestRuleFile.getText());
+ ContextMenuHelper.prepareTreeItemForContextMenu(packageExplorerTree, tiTestRuleFile);
+ ContextMenuHelper.clickContextMenu(packageExplorerTree,
+ IDELabel.Menu.GUVNOR,IDELabel.Menu.GUVNOR_SWITCH_TO_VERSION);
+ eclipse.waitForShell("");
+ guvnorResourceHistoryBot.activeShell().bot().button(IDELabel.Button.OK).click();
+ bot.sleep(Timing.time3S());
+ String editorText = editor.toTextEditor().getText();
+ assertTrue("Switched version of file has wrong content.\n" +
+ "Content should start with " + addedChange +
+ "\n but is " + editorText,editorText.startsWith(addedChange));
+ }
+
+}
\ No newline at end of file
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,156 @@
+ /*******************************************************************************
+ * 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.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.FileRenameHelper;
+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.ViewType;
+import org.jboss.tools.ui.bot.ext.view.ProblemsView;
+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;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+/**
+ * Test managing of Drools Project
+ * @author Vladimir Pakan
+ *
+ */
+public class ManageDroolsProject extends SWTTestExt{
+ /**
+ * Test manage Drools project
+ */
+ private static final String RENAMED_DROOLS_PROJECT = DroolsAllBotTests.DROOLS_PROJECT_NAME + "-renamed";
+ @Test
+ public void testManageDroolsProject() {
+ createDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
+ runNewDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
+ renameDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME, ManageDroolsProject.RENAMED_DROOLS_PROJECT);
+ deleteDroolsProject (ManageDroolsProject.RENAMED_DROOLS_PROJECT);
+ createDroolsProject (DroolsAllBotTests.DROOLS_PROJECT_NAME);
+ }
+ /**
+ * Creates new Drools project
+ * @param droolsProjectName
+ */
+ 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.waitForAll(30*1000L);
+ bot.sleep(Timing.time10S());
+ assertTrue("Project "
+ + droolsProjectName
+ + " was not created properly.",SWTEclipseExt.isProjectInPackageExplorer(bot,droolsProjectName));
+ String projectPath = File.separator + droolsProjectName;
+ SWTBotTreeItem[] errors = ProblemsView.getFilteredErrorsTreeItems(bot,null ,projectPath, null,null);
+ assertTrue("Project "
+ + droolsProjectName
+ + " was not created properly. There are these errors: "
+ + SWTEclipseExt.getFormattedTreeNodesText(bot.tree(), errors),
+ errors == null || errors.length == 0);
+ SWTBotTreeItem[] warnings = ProblemsView.getFilteredWarningsTreeItems(bot,null ,projectPath, null,null);
+ assertTrue("Project "
+ + droolsProjectName
+ + " was not created properly. There are these warnings: "
+ + SWTEclipseExt.getFormattedTreeNodesText(bot.tree(), warnings),
+ warnings == null || warnings.length == 0);
+
+ }
+ /**
+ * Runs newly created Drools project and check result
+ * @param droolsProjectName
+ */
+ private void runNewDroolsProject(String droolsProjectName){
+ console.clearConsole();
+ bot.sleep(5000L);
+
+ SWTBotTreeItem tiTestFile = packageExplorer.selectTreeItem(DroolsAllBotTests.DROOLS_TEST_JAVA_TREE_NODE,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
+ DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
+
+ eclipse.runTreeItemAsJavaApplication(tiTestFile);
+
+ String consoleText = console.getConsoleText(3*1000L,60*1000L,true);
+
+ assertTrue("DroolsTest.java class didn't run properly.\n" +
+ "Console Text was: " + consoleText + "\n" +
+ "Expected console text is: " + "Hello World\nGoodbye cruel world\n",
+ "Hello World\nGoodbye cruel world\n".equals(consoleText));
+ }
+ /**
+ * Renames Drools project and check result
+ * @param droolsProjectName
+ * @param renamedProjectName
+ */
+ private void renameDroolsProject(String droolsProjectName, String renamedProjectName){
+ packageExplorer.show();
+
+ bot.sleep(TIME_1S);
+
+ SWTBot webProjects = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = webProjects.tree();
+
+ tree.setFocus();
+ String checkResult = FileRenameHelper.checkProjectRenamingWithinPackageExplorer(bot,
+ DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ ManageDroolsProject.RENAMED_DROOLS_PROJECT,
+ IDELabel.Shell.RENAME_JAVA_PROJECT);
+ assertNull(checkResult,checkResult);
+ }
+ /**
+ * Deletes Drools project and check result
+ * @param droolsProjectName
+ */
+ private void deleteDroolsProject(String droolsProjectName){
+
+ packageExplorer.deleteProject(droolsProjectName, true);
+ boolean notFound = false;
+ try{
+ packageExplorer.selectProject(droolsProjectName);
+ }catch (WidgetNotFoundException wnf){
+ notFound = true;
+ }
+ assertTrue("Drools project: " + droolsProjectName +
+ " was not deleted properly",notFound);
+ }
+}
+
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRules.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,119 @@
+ /*******************************************************************************
+ * 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.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+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.ViewType;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.junit.Test;
+/**
+ * Test managing of Drools Rules
+ * @author Vladimir Pakan
+ *
+ */
+public class ManageDroolsRules extends SWTTestExt{
+ /**
+ * Test manage Drools Rules
+ */
+ @Test
+ public void testManageDroolsRules() {
+ createDroolsRule (DroolsAllBotTests.TEST_DROOLS_RULE_NAME);
+ bot.sleep(Timing.time3S());
+ debugDroolsRule (DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME);
+ }
+ /**
+ * Creates Drools Rule and checks result
+ * @param droolsRuletName
+ */
+ private void createDroolsRule(String droolsRuleName){
+
+ packageExplorer.show();
+ SWTBotTreeItem tiDroolsRules = packageExplorer.selectTreeItem(DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME});
+
+ tiDroolsRules.select();
+ eclipse.createNew(EntityType.DROOLS_RULE);
+
+ bot.textWithLabel(IDELabel.NewDroolsRuleDialog.FILE_NAME).setText(droolsRuleName);
+ bot.textWithLabel(IDELabel.NewDroolsRuleDialog.RULE_PACKAGE_NAME).setText(DroolsAllBotTests.COM_SAMPLE_TREE_NODE);
+ bot.button(IDELabel.Button.FINISH).click();
+ bot.sleep(Timing.time1S());
+ tiDroolsRules.expand();
+ // Test if new Drools Rule is within package tree view
+ boolean isRuleCreated = true;
+ try{
+ tiDroolsRules.getNode(droolsRuleName);
+ } catch (WidgetNotFoundException wnfe){
+ isRuleCreated = false;
+ }
+ assertTrue("New Drools Rule was not created properly. It's not present within Package Explorer",isRuleCreated);
+ // Test if new Drools Rule is opened in editor
+ isRuleCreated = true;
+ try{
+ bot.editorByTitle(droolsRuleName);
+ } catch (WidgetNotFoundException wnfe){
+ isRuleCreated = false;
+ }
+ assertTrue("New Drools Rule was not created properly. File " + droolsRuleName + " is not opened in editor",isRuleCreated);
+ }
+ /**
+ * Debug Drools Rule and checks result
+ * @param droolsRuletName
+ */
+ private void debugDroolsRule(String droolsRuleName){
+ packageExplorer.show();
+ SWTBotTreeItem tiDroolsRule = packageExplorer.selectTreeItem(DroolsAllBotTests.SAMPLE_DROOLS_RULE_NAME,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE});
+ SWTBot packageExplorerBot = bot.viewByTitle(ViewType.PACKAGE_EXPLORER.getViewLabel()).bot();
+ SWTBotTree tree = packageExplorerBot.tree();
+ // Select and Open Rule File
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree , tiDroolsRule);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.OPEN, true)).click();
+ SWTBotEclipseEditor ruleEditor = bot.editorByTitle(droolsRuleName).toTextEditor();
+ ruleEditor.selectRange(8, 0, 0);
+ bot.menu(IDELabel.Menu.RUN).menu(IDELabel.Menu.TOGGLE_BREAKPOINT).click();
+ SWTBotTreeItem tiDroolsTest = packageExplorer.selectTreeItem(DroolsAllBotTests.DROOLS_TEST_JAVA_TREE_NODE,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
+ DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
+ console.clearConsole();
+ eclipse.debugTreeItemAsDroolsApplication(tiDroolsTest);
+ bot.sleep(Timing.time10S());
+ eclipse.closeConfirmPerspectiveSwitchShellIfOpened(false);
+ String consoleText = console.getConsoleText(3*1000L,3*1000L,true);
+ assertTrue("Drools Rule was not debuged properly.\nConsole content should have been empty but is:\n" + consoleText,
+ consoleText.length() == 0);
+ SWTBotView debugView = bot.viewByTitle(ViewType.DEBUG.getViewLabel());
+ debugView.toolbarButton(IDELabel.DebugView.BUTTON_STEP_OVER_TOOLTIP).click();
+ consoleText = console.getConsoleText(3*1000L,60*1000L,true);
+ assertTrue("Drools Rule was not debuged properly.\nConsole content should be:\n'Hello World\n' but is:\n" + consoleText,
+ consoleText.equals("Hello World\n"));
+ debugView.toolbarButton(IDELabel.DebugView.BUTTON_RESUME_TOOLTIP).click();
+ consoleText = console.getConsoleText(3*1000L,60*1000L,true);
+ assertTrue("Drools Rule was not debuged properly.\nConsole content should be:Hello World\nGoodbye cruel world\n" + consoleText,
+ consoleText.equals("Hello World\nGoodbye cruel world\n"));
+ }
+
+}
+
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsRuntime.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,180 @@
+ /*******************************************************************************
+ * 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{
+ /**
+ * Test manage Drools Runtime
+ */
+ @Test
+ public void testManageDroolsRuntime() {
+ addDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME,DroolsAllBotTests.DROOLS_RUNTIME_LOCATION,true);
+ editDroolsRuntime(DroolsAllBotTests.getTestDroolsRuntimeName(),
+ DroolsAllBotTests.getTestDroolsRuntimeLocation(),
+ "edited" , "testedit");
+ removeDroolsRuntime(DroolsAllBotTests.getTestDroolsRuntimeName());
+ createDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME,DroolsAllBotTests.CREATE_DROOLS_RUNTIME_LOCATION);
+ if (DroolsAllBotTests.useExternalDroolsRuntime()){
+ removeDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME);
+ addDroolsRuntime(DroolsAllBotTests.DROOLS_RUNTIME_NAME,DroolsAllBotTests.DROOLS_RUNTIME_LOCATION,true);
+ }
+ }
+ /**
+ * Adds Drools Runtime
+ * @param runtimeName
+ * @param runtimeLocation
+ * @param setAsDefault
+ */
+ private void addDroolsRuntime(String runtimeName, String runtimeLocation, boolean setAsDefault){
+ 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);
+ // Set new runtime as default
+ if (setAsDefault){
+ table.getTableItem(0).check();
+ }
+ bot.button(IDELabel.Button.OK).click();
+ assertTrue("Drools Runtime with name [" + runtimeName +
+ "] and location [" + runtimeLocation +
+ "] was not added properly.",droolsRuntimeAdded);
+ DroolsAllBotTests.setTestDroolsRuntimeName(runtimeName);
+ DroolsAllBotTests.setTestDroolsRuntimeLocation(runtimeLocation);
+ SWTEclipseExt.hideWarningIfDisplayed(bot);
+ }
+ /**
+ * Selects Drools Preferences within Preferences Dialog
+ */
+ private void selectDroolsPreferences(){
+ jbt.delay();
+ 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);
+ DroolsAllBotTests.setTestDroolsRuntimeName(editedDroolsRuntimeName);
+ DroolsAllBotTests.setTestDroolsRuntimeLocation(editedDroolsRuntimeLocation);
+ SWTEclipseExt.hideWarningIfDisplayed(bot);
+ }
+
+ /**
+ * 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 (!DroolsAllBotTests.getTestDroolsRuntimeName().equals(DroolsAllBotTests.DROOLS_RUNTIME_NAME)){
+ File tempDir = new File (DroolsAllBotTests.getTestDroolsRuntimeLocation());
+ if (tempDir.isDirectory()){
+ tempDir.delete();
+ }
+ }
+ DroolsAllBotTests.setTestDroolsRuntimeName(null);
+ DroolsAllBotTests.setTestDroolsRuntimeLocation(null);
+ SWTEclipseExt.hideWarningIfDisplayed(bot);
+ }
+ /**
+ * Creates Drools Runtime
+ * @param runtimeName
+ * @param runtimeLocation
+ */
+ private void createDroolsRuntime(String runtimeName, String runtimeLocation){
+ DroolsRuntimeManager.createDefaultRuntime(runtimeLocation);
+ DroolsRuntime droolsRuntime = new DroolsRuntime();
+ droolsRuntime.setName(runtimeName);
+ droolsRuntime.setPath(runtimeLocation);
+ droolsRuntime.setDefault(true);
+ DroolsRuntimeManager.setDroolsRuntimes(new DroolsRuntime[]{droolsRuntime});
+ // Test if Drools runtime is defined
+ assertTrue("Drools Runtime was not properly created on location: " + runtimeLocation,
+ new File (runtimeLocation + File.separator + "drools-core.jar").exists());
+ selectDroolsPreferences();
+ SWTBotTable table = bot.table();
+ boolean droolsRuntimeCreated =
+ SWTEclipseExt.isItemInTableColumn(table,runtimeName,IDELabel.DroolsRuntimeDialog.COLUMN_NAME_INDEX)
+ && SWTEclipseExt.isItemInTableColumn(table,runtimeLocation,IDELabel.DroolsRuntimeDialog.COLUMN_LOCATION_INDEX);
+ bot.button(IDELabel.Button.OK).click();
+ SWTEclipseExt.hideWarningIfDisplayed(bot);
+ assertTrue("Drools Runtime with name [" + runtimeName +
+ "] and location [" + runtimeLocation +
+ "] was not created properly.",droolsRuntimeCreated);
+ DroolsAllBotTests.setTestDroolsRuntimeName(runtimeName);
+ DroolsAllBotTests.setTestDroolsRuntimeLocation(runtimeLocation);
+
+ }
+
+}
+
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/OpenDroolsPerspective.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,50 @@
+ /*******************************************************************************
+ * 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.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+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.PerspectiveType;
+import org.junit.Test;
+/**
+ * Test opening perspective
+ * @author Vladimir Pakan
+ *
+ */
+public class OpenDroolsPerspective extends SWTTestExt{
+ /**
+ * Test Opening Drools Rules
+ */
+ @Test
+ public void testOpenDroolsPerspective() {
+ openDroolsPerspective();
+ }
+ /**
+ * Open Drools Perspective
+ */
+ private void openDroolsPerspective(){
+ eclipse.openPerspective(PerspectiveType.DROOLS);
+ boolean wasFound = false;
+ try{
+ bot.toolbarDropDownButtonWithTooltip(IDELabel.Button.DROOLS_WORKBENCH);
+ wasFound = true;
+ } catch (WidgetNotFoundException wnfe){
+ wasFound = false;
+ }
+ eclipse.openPerspective(PerspectiveType.JAVA);
+ assertTrue("Drools Perspective was not opened properly. Button " +
+ IDELabel.Button.DROOLS_WORKBENCH + " is not present in Workbench",
+ wasFound);
+ }
+}
+
Added: trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java
===================================================================
--- trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/RuleFlowTest.java 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,491 @@
+ /*******************************************************************************
+ * 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.awt.event.KeyEvent;
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.drools.ui.bot.test.DroolsAllBotTests;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+/**
+ * Tests Rule Flow
+ * @author Vladimir Pakan
+ *
+ */
+public class RuleFlowTest extends SWTTestExt{
+ private static final String RULE_FLOW_FILE_DIRECTORY = "src" + File.separator +
+ "main" + File.separator +
+ "rules";
+ private static final String ROOT_NODE_NAME = "process";
+ private static final String HEADER_NODE_NAME = "header";
+ private static final String NODES_NODE_NAME = "nodes";
+ private static final String CONNECTIONS_NODE_NAME = "connections";
+ private static final String CONNECTION_NODE_NAME = "connection";
+ private static final int NODES_NODE_CHILDREN_COUNT = 7;
+ private static final int CONNECTIONS_NODE_CHILDREN_COUNT = 1;
+ private static final int ROOT_NODE_CHILDREN_COUNT = 3;
+
+ private boolean isEditorMaximized = false;
+ /**
+ * Tests Rule Flow
+ */
+ @Test
+ public void testRuleFlow() {
+ runRuleFlowCheck(DroolsAllBotTests.RULE_FLOW_JAVA_TEST_FILE_NAME);
+ ruleFlowEditorCheck(DroolsAllBotTests.RULE_FLOW_RF_FILE_NAME);
+ }
+ /**
+ * Runs newly created Drools project and check result
+ * @param droolsProjectName
+ */
+ private void runRuleFlowCheck(String droolsRuleTestFileName){
+ console.clearConsole();
+ bot.sleep(5000L);
+
+ SWTBotTreeItem tiTestFile = packageExplorer.selectTreeItem(droolsRuleTestFileName,
+ new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.SRC_MAIN_JAVA_TREE_NODE,
+ DroolsAllBotTests.COM_SAMPLE_TREE_NODE});
+
+ eclipse.runTreeItemAsJavaApplication(tiTestFile);
+
+ String consoleText = console.getConsoleText(3*1000L,60*1000L,true);
+
+ assertTrue(droolsRuleTestFileName + " didn't run properly.\n" +
+ "Console Text was: " + consoleText + "\n" +
+ "Expected console text is: " + "Hello World\n",
+ "Hello World\n".equals(consoleText));
+ }
+ /**
+ * Add all possible object to RF diagram and then remove them
+ * @param ruleFlowRfFileName
+ */
+ private void ruleFlowEditorCheck (String ruleFlowFileName){
+ packageExplorer.show();
+ packageExplorer.openFile(DroolsAllBotTests.DROOLS_PROJECT_NAME ,
+ DroolsAllBotTests.SRC_MAIN_RULES_TREE_NODE,
+ DroolsAllBotTests.RULE_FLOW_RF_FILE_NAME);
+ // Test if Rule Flow RF File is opened in editor
+ assertTrue("Rule Flow RF File is not opened properly. File " + ruleFlowFileName + " is not opened in editor",
+ SWTEclipseExt.existEditorWithLabel(bot,ruleFlowFileName));
+ // Maximize editor
+ bot.menu(IDELabel.Menu.WINDOW)
+ .menu(IDELabel.Menu.NAVIGATION)
+ .menu(IDELabel.Menu.MAXIMIZE_ACTIVE_VIEW_OR_EDITOR)
+ .click();
+ isEditorMaximized = true;
+ SWTGefBot gefBot = new SWTGefBot();
+ SWTBotGefEditor gefEditor = gefBot.gefEditor(ruleFlowFileName);
+ // Clear Editor
+ gefEditor.setFocus();
+ deleteAllObjectsFromRFFile(gefEditor,
+ DroolsAllBotTests.DROOLS_PROJECT_NAME,
+ DroolsAllBotTests.RULE_FLOW_RF_FILE_NAME);
+ // Draw each component
+ String[] tools = new String[]{"Start Event","End Event","Rule Task",
+ "Gateway [diverge]","Gateway [converge]","Reusable Sub-Process",
+ "Script Task"
+ };
+ int xspacing = 100;
+ int xoffset = 10;
+ int yspacing = 100;
+ int yoffset = 10;
+ for (int toolIndex = 0;toolIndex < tools.length;toolIndex++){
+ gefEditor.activateTool(tools[toolIndex]);
+ gefEditor.click(xspacing * (toolIndex % 3) + xoffset,
+ yspacing * (toolIndex / 3) + yoffset);
+ }
+ // Add Sequence Flow between Start and End Node
+ gefEditor.activateTool("Sequence Flow");
+ // Click on Start Node
+ gefEditor.click(xoffset + 5, yoffset + 5);
+ // Click on End Node
+ gefEditor.click(xspacing + xoffset + 5, yoffset + 5);
+ gefEditor.save();
+ checkFullRFFile(DroolsAllBotTests.DROOLS_PROJECT_NAME , ruleFlowFileName);
+ // check synchronization with Properties View
+ gefEditor.activateTool("Select");
+ gefEditor.click(xoffset + 5, yoffset + 5);
+ SWTBotTree tree = eclipse.showView(ViewType.PROPERTIES).tree();
+ String id = tree.getTreeItem("Id").cell(1);
+ String name = tree.getTreeItem("Name").cell(1);
+ assertTrue("First editor element has to have Id=1 and Name=Start." +
+ "\nBut it has Id=" + id +
+ " Name=" + name, id.equals("1") && name.equals("Start"));
+ // Delete each component
+ gefEditor.activateTool("Select");
+ for (int toolIndex = 0;toolIndex < tools.length;toolIndex++){
+ gefEditor.click(xspacing * (toolIndex % 3) + xoffset + 10,
+ yspacing * (toolIndex / 3) + yoffset + 10);
+ gefEditor.setFocus();
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_DELETE);
+ }
+ // Restore maximized editor
+ bot.menu(IDELabel.Menu.WINDOW)
+ .menu(IDELabel.Menu.NAVIGATION)
+ .menu(IDELabel.Menu.MAXIMIZE_ACTIVE_VIEW_OR_EDITOR)
+ .click();
+ isEditorMaximized = false;
+ gefEditor.save();
+ gefEditor.close();
+ checkEmptyRFFile(DroolsAllBotTests.DROOLS_PROJECT_NAME , ruleFlowFileName);
+ }
+ /**
+ * Check content of Rule Flow file containing all possible objects
+ *
+ * @param projectName
+ * @param ruleFlowFileName
+ */
+ private void checkFullRFFile(String projectName, String ruleFlowFileName) {
+
+ Document doc = loadXmlFile(SWTUtilExt.getPathToProject(projectName)
+ + File.separator + RuleFlowTest.RULE_FLOW_FILE_DIRECTORY
+ + File.separator + ruleFlowFileName);
+
+ String errorDescription = null;
+ Element rootNode = doc.getDocumentElement();
+ doc.normalizeDocument();
+ if (rootNode.getNodeName().equals(ROOT_NODE_NAME)) {
+ NodeList rootNodeList = rootNode.getChildNodes();
+ List<Node> rootNodes = removeTextNodes(rootNodeList);
+ if (rootNodes.size() == ROOT_NODE_CHILDREN_COUNT) {
+ Node header = rootNodes.get(0);
+ errorDescription = checkEmptyFileNode(header, HEADER_NODE_NAME);
+ if (errorDescription == null) {
+ Node nodesNode = rootNodes.get(1);
+ errorDescription = checkNodeName(nodesNode, NODES_NODE_NAME);
+ if (errorDescription == null) {
+ errorDescription = checkNodesFileNodes(removeTextNodes(nodesNode
+ .getChildNodes()));
+ if (errorDescription == null) {
+ Node connectionsNode = rootNodes.get(2);
+ errorDescription = checkNodeName(connectionsNode,
+ CONNECTIONS_NODE_NAME);
+ if (errorDescription == null) {
+ errorDescription = checkConnectionsFileNodes(removeTextNodes(connectionsNode
+ .getChildNodes()));
+ }
+ }
+ }
+ }
+ } else {
+ errorDescription = "Root node has to have " + ROOT_NODE_CHILDREN_COUNT
+ + " child nodes but it has " + rootNodeList.getLength();
+ }
+ } else {
+ errorDescription = "Root node has to have name '" + ROOT_NODE_NAME
+ + "' but it has name '" + rootNode.getNodeName() + "'";
+ }
+ assertNull(errorDescription,errorDescription);
+ }
+ /**
+ * Check content of empty Rule Flow file
+ * @param projectName
+ * @param ruleFlowRfFileName
+ */
+ private void checkEmptyRFFile(String projectName, String ruleFlowFileName){
+
+ Document doc = loadXmlFile(SWTUtilExt.getPathToProject(projectName) +
+ File.separator + RuleFlowTest.RULE_FLOW_FILE_DIRECTORY + File.separator +
+ ruleFlowFileName);
+
+ String errorDescription = null;
+
+ Element rootNode = doc.getDocumentElement();
+ doc.normalizeDocument();
+ if (rootNode.getNodeName().equals(ROOT_NODE_NAME)) {
+ NodeList rootNodeList = rootNode.getChildNodes();
+ List<Node> nodes = removeTextNodes(rootNodeList);
+ if (nodes.size() == ROOT_NODE_CHILDREN_COUNT) {
+ Node header = nodes.get(0);
+ errorDescription = checkEmptyFileNode(header, HEADER_NODE_NAME);
+ if (errorDescription == null) {
+ Node nodesNode = nodes.get(1);
+ errorDescription = checkEmptyFileNode(nodesNode, NODES_NODE_NAME);
+ if (errorDescription == null) {
+ Node connnections = nodes.get(2);
+ errorDescription = checkEmptyFileNode(connnections, CONNECTIONS_NODE_NAME);
+ }
+ }
+ } else {
+ errorDescription = "Root node has to have " +
+ ROOT_NODE_CHILDREN_COUNT +
+ " child nodes but it has " +
+ rootNodeList.getLength();
+ }
+ } else {
+ errorDescription = "Root node has to have name '" + ROOT_NODE_NAME
+ + "' but it has name '" + rootNode.getNodeName() + "'";
+ }
+ assertNull(errorDescription,errorDescription);
+
+ }
+ /**
+ * Loads and parse XML file with fileName from file system
+ * @param fileName - full path to XML file
+ * @return
+ */
+ private Document loadXmlFile (String fileName){
+ File file = new File(fileName);
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db;
+ Document doc = null;
+ try {
+ db = dbf.newDocumentBuilder();
+ doc = db.parse(file);
+ } catch (ParserConfigurationException pce) {
+ throw new RuntimeException(pce);
+ } catch (SAXException saxe) {
+ throw new RuntimeException(saxe);
+ } catch (IOException ioe) {
+ throw new RuntimeException(ioe);
+ }
+ return doc;
+ }
+ private static List<Node> removeTextNodes(NodeList rootNodeList){
+ LinkedList<Node> nodes = new LinkedList<Node>();
+ for (int index = 0 ; index < rootNodeList.getLength(); index++){
+ Node node = rootNodeList.item(index);
+ if (!node.getNodeName().equals("#text")){
+ nodes.add(node);
+ }
+ }
+ return nodes;
+ }
+ /**
+ * Check if node is correct for empty file
+ * @param node
+ * @param expectedNodeName
+ * @return
+ */
+ private static String checkEmptyFileNode (Node node,String expectedNodeName){
+ String errorDescription = null;
+ if (node.getNodeName().equals(expectedNodeName)){
+ if (removeTextNodes(node.getChildNodes()).size() == 0){
+ if(node.getTextContent().trim().length() != 0){
+ errorDescription = expectedNodeName + " node has to have no text value but it has " +
+ node.getTextContent();
+ }
+ }
+ else{
+ errorDescription = expectedNodeName + " node has to have no children but is has " +
+ removeTextNodes(node.getChildNodes()).size();
+
+ }
+ }
+ else{
+ errorDescription = checkNodeName(node, expectedNodeName);
+ }
+
+ return errorDescription;
+
+ }
+ /**
+ * Check nodes of Nodes children.
+ * @param nodes - list of nodes of nodes node stripped from text nodes
+ * @return
+ */
+ private static String checkNodesFileNodes(List<Node> nodes){
+ String errorDescription = null;
+
+ if (nodes.size() == NODES_NODE_CHILDREN_COUNT){
+ List<String> mandatoryNodes = getMandatoryNodesOfNodesNode();
+ int index = 0;
+ Iterator<Node> iterator = nodes.iterator();
+ while (index < nodes.size() && errorDescription == null){
+ String nodeName = iterator.next().getNodeName();
+ if (mandatoryNodes.contains(nodeName)){
+ mandatoryNodes.remove(nodeName);
+ }
+ else{
+ errorDescription = "Nodes node cannot contain node " + nodeName;
+ }
+ index++;
+ }
+ if (errorDescription == null && mandatoryNodes.size() > 0) {
+ StringBuilder sb = new StringBuilder("");
+ for (String nodeName : mandatoryNodes){
+ if (sb.length() != 0){
+ sb.append(", ");
+ }
+ sb.append(nodeName);
+ }
+ errorDescription = "Nodes node doesn't contain all necesarry nodes.\n" +
+ "These node(s) are missing within nodes node: " +
+ sb.toString();
+ }
+ }
+ else{
+ errorDescription = "Nodes node has to have " +
+ NODES_NODE_CHILDREN_COUNT +
+ " child nodes but it has " +
+ nodes.size();
+ }
+
+ return errorDescription;
+ }
+ /**
+ * Returns list of mandatory nodes of nodes node
+ * @return
+ */
+ private static List<String> getMandatoryNodesOfNodesNode(){
+ LinkedList<String> allowedNodes = new LinkedList<String>();
+ allowedNodes.add("split");
+ /*
+ allowedNodes.add("timerNode");
+ allowedNodes.add("humanTask");
+ */
+ allowedNodes.add("ruleSet");
+ allowedNodes.add("actionNode");
+ /*
+ allowedNodes.add("composite");
+ */
+ allowedNodes.add("end");
+ /*
+ allowedNodes.add("workItem");
+ allowedNodes.add("fault");
+ */
+ allowedNodes.add("subProcess");
+ allowedNodes.add("start");
+ /*
+ allowedNodes.add("workItem");
+ allowedNodes.add("eventNode");
+ */
+ allowedNodes.add("join");
+
+ return allowedNodes;
+ }
+
+ /**
+ * Check nodes of connections children.
+ * @param nodes - list of nodes of connections node stripped from text nodes
+ * @return
+ */
+ private static String checkConnectionsFileNodes(List<Node> nodes){
+ String errorDescription = null;
+
+ if (nodes.size() == CONNECTIONS_NODE_CHILDREN_COUNT){
+ Node connectioNode = nodes.get(0);
+ errorDescription = checkEmptyFileNode(connectioNode, CONNECTION_NODE_NAME);
+ }
+ else{
+ errorDescription = "Conections node has to have " +
+ CONNECTIONS_NODE_CHILDREN_COUNT +
+ " child nodes but it has " +
+ nodes.size();
+ }
+
+ return errorDescription;
+ }
+ /**
+ * Check if node has expected name
+ * @param node
+ * @param expectedNodeName
+ * @return
+ */
+ private static String checkNodeName (Node node, String expectedNodeName){
+ String errorDescription = null;
+
+ if (!node.getNodeName().equals(expectedNodeName)){
+ errorDescription = "Node has to have name '" +
+ expectedNodeName + "' but it has name '" +
+ node.getNodeName() + "'";
+ }
+
+ return errorDescription;
+ }
+
+ protected void tearDown(){
+ if (isEditorMaximized){
+ // Restore maximized editor
+ bot.menu(IDELabel.Menu.WINDOW)
+ .menu(IDELabel.Menu.NAVIGATION)
+ .menu(IDELabel.Menu.MAXIMIZE_ACTIVE_VIEW_OR_EDITOR)
+ .click();
+ isEditorMaximized = false;
+ }
+ try {
+ super.tearDown();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ /**
+ * Delete all objects from RF File
+ * @param gefEditor
+ * @param projectName
+ * @param ruleFlowFileName
+ */
+ private void deleteAllObjectsFromRFFile(SWTBotGefEditor gefEditor, String projectName, String ruleFlowFileName) {
+
+ Document doc = loadXmlFile(SWTUtilExt.getPathToProject(projectName)
+ + File.separator + RuleFlowTest.RULE_FLOW_FILE_DIRECTORY
+ + File.separator + ruleFlowFileName);
+
+ String errorDescription = null;
+ Element rootNode = doc.getDocumentElement();
+ doc.normalizeDocument();
+ if (rootNode.getNodeName().equals(ROOT_NODE_NAME)) {
+ NodeList rootNodeList = rootNode.getChildNodes();
+ List<Node> rootNodes = removeTextNodes(rootNodeList);
+ if (rootNodes.size() == ROOT_NODE_CHILDREN_COUNT) {
+ Node nodesNode = rootNodes.get(1);
+ errorDescription = checkNodeName(nodesNode, NODES_NODE_NAME);
+ if (errorDescription == null) {
+ List<Node> nodes = removeTextNodes(nodesNode.getChildNodes());
+ for (Node node : nodes){
+ NamedNodeMap attributes = node.getAttributes();
+ int xPos = Integer.parseInt(attributes.getNamedItem("x").getNodeValue());
+ int yPos = Integer.parseInt(attributes.getNamedItem("y").getNodeValue());
+ gefEditor.click(xPos + 3, yPos + 3);
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_DELETE);
+ bot.sleep(Timing.time1S());
+ }
+ }
+ } else {
+ errorDescription = "'" + NODES_NODE_NAME + "'" +" was not found on expected location within RF file." +
+ " RF file structure has been changed";
+ }
+ } else {
+ errorDescription = "Root Node has to have name '" + ROOT_NODE_NAME + "'. RF file structure has been changed.";
+ }
+ assertNull(errorDescription,errorDescription);
+ }
+
+}
\ No newline at end of file
Copied: trunk/build/aggregate/bottests-site/tests/pom.xml (from rev 33534, trunk/build/aggregate/bottests-site/features/pom.xml)
===================================================================
--- trunk/build/aggregate/bottests-site/tests/pom.xml (rev 0)
+++ trunk/build/aggregate/bottests-site/tests/pom.xml 2011-08-03 07:47:59 UTC (rev 33536)
@@ -0,0 +1,16 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>bottests</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.bottests</groupId>
+ <artifactId>org.jboss.tools.bottests.tests</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.jboss.tools.drools.ui.bot.test</module>
+ </modules>
+</project>
13 years, 5 months