JBoss Tools SVN: r35772 - trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-18 16:14:23 -0400 (Tue, 18 Oct 2011)
New Revision: 35772
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/FeedsEntry.java
Log:
JBIDE-9368 Dashboard(s) for easy news aggregation, twitter and easy additional/3rd party plugin installation and project template/creation
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/FeedsEntry.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/FeedsEntry.java 2011-10-18 19:53:17 UTC (rev 35771)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/FeedsEntry.java 2011-10-18 20:14:23 UTC (rev 35772)
@@ -89,10 +89,10 @@
buffer.append("<a href=\"");
buffer.append(link);
buffer.append("\">");
- buffer.append(StringEscapeUtils.unescapeXml(title));
+ buffer.append(StringEscapeUtils.unescapeHtml(title));
buffer.append("</a>");
} else {
- buffer.append(title);
+ buffer.append(StringEscapeUtils.unescapeHtml(title));
}
//buffer.append("<br/>");
boolean cr = false;
@@ -113,7 +113,7 @@
buffer.append("</span>");
buffer.append(" ");
buffer.append("<span color=\"author\" font=\"author\">");
- buffer.append(StringEscapeUtils.unescapeXml(author));
+ buffer.append(StringEscapeUtils.unescapeHtml(author));
buffer.append("</span>");
cr = true;
}
13 years, 2 months
JBoss Tools SVN: r35771 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-18 15:53:17 -0400 (Tue, 18 Oct 2011)
New Revision: 35771
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java
Log:
JBIDE-9917
https://issues.jboss.org/browse/JBIDE-9917
Method synchronization.
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java 2011-10-18 18:02:11 UTC (rev 35770)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java 2011-10-18 19:53:17 UTC (rev 35771)
@@ -137,18 +137,16 @@
}
}
- public void unlockJar() {
- synchronized (this) {
- jarLock--;
- if(jarLock > 0 || jar == null) return;
- if(jar != null && jarLock == 0) {
- try {
- jar.close();
- } catch (IOException e) {
- //ignore
- } finally {
- jar = null;
- }
+ public synchronized void unlockJar() {
+ jarLock--;
+ if(jarLock > 0 || jar == null) return;
+ if(jar != null && jarLock == 0) {
+ try {
+ jar.close();
+ } catch (IOException e) {
+ //ignore
+ } finally {
+ jar = null;
}
}
}
@@ -183,7 +181,7 @@
set.add(parsed[1] + XModelObjectConstants.SEPARATOR);
}
- public String[] getChildren(String path) {
+ public synchronized String[] getChildren(String path) {
HashSet<String> set = map.get(path);
return (set == null) ? new String[0] : set.toArray(new String[0]);
}
@@ -263,11 +261,11 @@
return FileUtil.isText(b);
}
- boolean hasFolder(String path) {
- return map.get(path) != null;
+ synchronized boolean hasFolder(String path) {
+ return map.containsKey(path);
}
- boolean hasFile(String path) {
+ synchronized boolean hasFile(String path) {
if (path == null)
return false;
int i = path.lastIndexOf('/');
@@ -289,7 +287,7 @@
return (timeStamp != f.lastModified() || size != f.length());
}
- public void invalidate() {
+ public synchronized void invalidate() {
exists = false;
map.clear();
timeStamp = -1;
13 years, 2 months
JBoss Tools SVN: r35770 - trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-10-18 14:02:11 -0400 (Tue, 18 Oct 2011)
New Revision: 35770
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
Log:
JBIDE-9863 : ProjectExamplesFix assumes the Eclipse project name is identical to the Example name, which is wrong in case of archetype-based projects, so need to check if project exists before looking for error markers.
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2011-10-18 17:58:45 UTC (rev 35769)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2011-10-18 18:02:11 UTC (rev 35770)
@@ -223,13 +223,17 @@
String projectName) throws CoreException {
IProject eclipseProject = ResourcesPlugin.getWorkspace()
.getRoot().getProject(projectName);
- IMarker[] projectMarkers = eclipseProject.findMarkers(
- IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
- for (int i = 0; i < projectMarkers.length; i++) {
- if (projectMarkers[i].getAttribute(IMarker.SEVERITY,
- IMarker.SEVERITY_ERROR) == IMarker.SEVERITY_ERROR) {
- markers.add(projectMarkers[i]);
+ if (eclipseProject.isAccessible()) {
+ IMarker[] projectMarkers = eclipseProject.findMarkers(
+ IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
+ for (int i = 0; i < projectMarkers.length; i++) {
+ if (projectMarkers[i].getAttribute(IMarker.SEVERITY,
+ IMarker.SEVERITY_ERROR) == IMarker.SEVERITY_ERROR) {
+ markers.add(projectMarkers[i]);
+ }
}
+ } else {
+ log(projectName + " is inaccessible");
}
return markers;
}
13 years, 2 months
JBoss Tools SVN: r35769 - trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-10-18 13:58:45 -0400 (Tue, 18 Oct 2011)
New Revision: 35769
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java
Log:
JBIDE-9774 : use the workspace root as default location when creating new Archetype-based projects
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java 2011-10-18 17:54:32 UTC (rev 35768)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java 2011-10-18 17:58:45 UTC (rev 35769)
@@ -15,12 +15,10 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
@@ -46,11 +44,11 @@
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
IPath rootPath = workspaceRoot.getLocation();
IPath mavenProjectsRoot = rootPath; //.append(JBOSS_TOOLS_MAVEN_PROJECTS);
- String projectName = projectDescription.getName();
- if (projectName == null || projectName.isEmpty()) {
- projectName = UNNAMED_PROJECTS;
- }
- IPath path = mavenProjectsRoot.append(projectName);
+// String projectName = projectDescription.getName();
+// if (projectName == null || projectName.isEmpty()) {
+// projectName = UNNAMED_PROJECTS;
+// }
+ IPath path = mavenProjectsRoot; //.append(projectName);
final File destination = new File(path.toOSString());
Display.getDefault().syncExec(new Runnable() {
13 years, 2 months
JBoss Tools SVN: r35768 - in trunk: download.jboss.org/jbosstools/examples and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-10-18 13:54:32 -0400 (Tue, 18 Oct 2011)
New Revision: 35768
Modified:
trunk/central/plugins/org.jboss.tools.central/plugin.xml
trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml
Log:
JBIDE-9774 : Fixed invalid category & order for EE6 quickstarts
Modified: trunk/central/plugins/org.jboss.tools.central/plugin.xml
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/plugin.xml 2011-10-18 17:47:13 UTC (rev 35767)
+++ trunk/central/plugins/org.jboss.tools.central/plugin.xml 2011-10-18 17:54:32 UTC (rev 35768)
@@ -255,14 +255,14 @@
type="projectExample"
priority="1"
icon="icons/jbossas7.png"
- reference="JBoss AS 7 Quickstarts::jboss-javaee6-webapp"/>
+ reference="Java EE 6 Quickstarts::jboss-javaee6-webapp"/>
<tutorial
id="org.jboss.tools.central.jbossas.quickstart.jbossJavaee6Ear"
categoryId="org.jboss.tools.central.javaee6.quickstart"
name="Java EE 6 Enterprise Application"
type="projectExample"
- priority="1"
+ priority="2"
icon="icons/jbossas7.png"
reference="Java EE 6 Quickstarts::multi-javaee6-archetype"/>
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml 2011-10-18 17:47:13 UTC (rev 35767)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml 2011-10-18 17:54:32 UTC (rev 35768)
@@ -305,9 +305,9 @@
<category>Java EE 6 Quickstarts</category>
<name>multi-javaee6-archetype</name>
<included-projects>multi-javaee6-archetype</included-projects>
- <shortDescription>Java EE 6 example (Maven archetype)</shortDescription>
+ <shortDescription>Java EE 6 Multi Module application(Maven archetype)</shortDescription>
<description>Experimental multi-module Java EE 6 project. It's composed of a parent pom project and 4 nested modules : Java Utility, EJB 3.1, Web 3.0 and EAR 6.0</description>
- <size>8192</size>
+ <size>13806</size>
<url/>
<fixes>
<fix type="wtpruntime">
13 years, 2 months
JBoss Tools SVN: r35767 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-10-18 13:47:13 -0400 (Tue, 18 Oct 2011)
New Revision: 35767
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccessFactory.java
Log:
https://issues.jboss.org/browse/JBIDE-9917 Deadlock in JarAccessFactory.getJarAccess()
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccessFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccessFactory.java 2011-10-18 17:38:59 UTC (rev 35766)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccessFactory.java 2011-10-18 17:47:13 UTC (rev 35767)
@@ -5,7 +5,7 @@
public class JarAccessFactory {
- static Map<String, JarAccess> jars = new HashMap<String, JarAccess>();
+ private static Map<String, JarAccess> jars = new HashMap<String, JarAccess>();
public synchronized static JarAccess getJarAccess(String location, JarSystemImpl context) {
JarAccess jar = jars.get(location);
13 years, 2 months
JBoss Tools SVN: r35766 - in trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central: model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-18 13:38:59 -0400 (Tue, 18 Oct 2011)
New Revision: 35766
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/FeedsEntry.java
Log:
JBIDE-9368 Dashboard(s) for easy news aggregation, twitter and easy additional/3rd party plugin installation and project template/creation
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-18 16:25:50 UTC (rev 35765)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-18 17:38:59 UTC (rev 35766)
@@ -61,6 +61,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -905,11 +906,12 @@
return;
}
String text = entry.getFormString();
- final FormText formText = toolkit.createFormText(composite, true);
+ FormText formText = toolkit.createFormText(composite, true);
TableWrapData td = new TableWrapData();
td.indent = 2;
- Point size = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point size = newsScrollComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
td.maxWidth = size.x - 2;
+ formText.setLayoutData(td);
try {
// to avoid illegal argumentexception on formtext fields.
// we replace the HTML entity with the standard xml version
@@ -918,7 +920,15 @@
formText.setText(text, true, true);
} catch(IllegalArgumentException se) {
- formText.setText("Problem rendering entry - " + se.getMessage(),false,false);
+ formText.dispose();
+ formText = toolkit.createFormText(composite, false);
+ formText.setLayoutData(td);
+ try {
+ formText.setText("Problem rendering entry - " + StringEscapeUtils.unescapeXml(se.getMessage()), false, false);
+ } catch (Exception e1) {
+ JBossCentralActivator.log(se);
+ }
+ continue;
}
//Display display = Display.getCurrent();
//formText.setFont(getLinkFont(display));
@@ -949,13 +959,20 @@
}
pageBook.showPage(composite);
+ composite.layout(true, true);
form.reflow(true);
form.redraw();
recomputeScrollComposite(scrollable, pageBook);
}
protected void resize() {
- Point size = form.getBody().getSize();
+ Point size;
+ if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ size = form.getSize();
+ size.y = form.getBody().getSize().y;
+ } else {
+ size = form.getBody().getSize();
+ }
GridData gd;
Point computedSize;
int widthHint = size.x/2 - 40;
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/FeedsEntry.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/FeedsEntry.java 2011-10-18 16:25:50 UTC (rev 35765)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/FeedsEntry.java 2011-10-18 17:38:59 UTC (rev 35766)
@@ -113,7 +113,7 @@
buffer.append("</span>");
buffer.append(" ");
buffer.append("<span color=\"author\" font=\"author\">");
- buffer.append(author);
+ buffer.append(StringEscapeUtils.unescapeXml(author));
buffer.append("</span>");
cr = true;
}
@@ -125,7 +125,7 @@
cr = false;
if (shortDescription != null && !shortDescription.isEmpty()) {
buffer.append("<span font=\"description\">");
- buffer.append(shortDescription);
+ buffer.append(StringEscapeUtils.unescapeHtml(shortDescription));
buffer.append("</span>");
cr = true;
}
13 years, 2 months
JBoss Tools SVN: r35765 - trunk/jst/plugins/org.jboss.tools.jst.jsp.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-10-18 12:25:50 -0400 (Tue, 18 Oct 2011)
New Revision: 35765
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
Log:
JBIDE-9872 Html editor should be able to show html files even though they don't end in .html
PHP files are enabled to be opened byJBoss Tools JSP/HTML editors in the same way as it's done for *.inc files
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2011-10-18 15:03:51 UTC (rev 35764)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2011-10-18 16:25:50 UTC (rev 35765)
@@ -544,7 +544,7 @@
name="%ContentType_JBossToolsINC"
base-type="org.eclipse.jst.jsp.core.jspsource"
describer="org.jboss.tools.jst.jsp.jspeditor.JSPIncludeContentDescriber"
- file-extensions="inc"
+ file-extensions="inc, php"
priority="high"/>
<file-association
13 years, 2 months
JBoss Tools SVN: r35764 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test: resources/cdi and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-10-18 11:03:51 -0400 (Tue, 18 Oct 2011)
New Revision: 35764
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/DisposerProducerBean.java.cdi
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/CdiATWizardTest.launch
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java
Log:
added OpenOn test for disposer and producer method
Deleted: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/CdiATWizardTest.launch
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/CdiATWizardTest.launch 2011-10-18 13:46:55 UTC (rev 35763)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/CdiATWizardTest.launch 2011-10-18 15:03:51 UTC (rev 35764)
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<mapAttribute key="org.eclipse.debug.core.environmentVariables">
-<mapEntry key="DISPLAY" value=":1"/>
-</mapAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<stringAttribute key="org.eclipse.jdt.launching.JAVA_COMMAND" value="java"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.cdi.bot.test.wizard.CdiATWizardTest"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.cdi.bot.test"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Djava.library.path=${env_var:JAVA_HOME}/jre/lib/i386/client:${env_var:JAVA_HOME}/jre/lib/i386:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/java/packages/lib/i386:/lib:/usr/lib:/usr/lib/jni -Xms512m -Xmx1024m -Dswtbot.test.properties.file=${env_var:HOME}/swtbot.properties -Dusage_reporting_enabled=false"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.epp.package.jee.product"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="true"/>
-</launchConfiguration>
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/DisposerProducerBean.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/DisposerProducerBean.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/DisposerProducerBean.java.cdi 2011-10-18 15:03:51 UTC (rev 35764)
@@ -0,0 +1,25 @@
+package org.cdi.test;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+public class Disposes1 {
+
+ @Inject
+ MyBean mybean;
+
+ public Disposes1() {
+
+ }
+
+ public void disposeMethod(@Disposes MyBean myBean) {
+
+ }
+
+ @Produces
+ public MyBean produceMethod() {
+ return mybean;
+ }
+
+}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java 2011-10-18 13:46:55 UTC (rev 35763)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java 2011-10-18 15:03:51 UTC (rev 35764)
@@ -124,26 +124,22 @@
* https://issues.jboss.org/browse/JBIDE-6251
*/
@Test
- public void testDisposerOpenOn() {
- /*
- * not implemented yet
- */
+ public void testDisposerProducerOpenOn() {
- }
-
- /*
- * https://issues.jboss.org/browse/JBIDE-6311
- * https://issues.jboss.org/browse/JBIDE-6251
- * https://issues.jboss.org/browse/JBIDE-5928
- */
- @Test
- public void testProducerOpenOn() {
- /*
- * not implemented yet
- */
+ String testedBean = "DisposerProducerBean";
+ createComponent(CDICOMPONENT.BEAN, "MyBean", PACKAGE_NAME, null);
+ createComponent(CDICOMPONENT.BEAN, testedBean, PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDIOpenOnTest.class
+ .getResourceAsStream("/resources/cdi/" + testedBean + ".java.cdi"),
+ false);
+ openOn("disposeMethod", testedBean + ".java", "Open Bound Producer");
+ assertTrue(getEd().toTextEditor().getSelection().equals("produceMethod"));
+ openOn("produceMethod", testedBean + ".java", "Open Bound Disposer");
+ assertTrue(getEd().toTextEditor().getSelection().equals("disposeMethod"));
}
+
@Test
public void testObserverOpenOn() {
/*
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java 2011-10-18 13:46:55 UTC (rev 35763)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java 2011-10-18 15:03:51 UTC (rev 35764)
@@ -15,6 +15,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
@@ -22,6 +23,7 @@
import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIBase;
import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIUtil;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
@@ -62,6 +64,7 @@
/*
* https://issues.jboss.org/browse/JBIDE-8202
*/
+
@Test
public void testResourceOpenOn() {
@@ -218,67 +221,66 @@
checkThirdOpenOnAndGeneric();
}
- private void checkMyGenericBean() {
-
+ private void checkMyGenericBean() {
+
}
private void checkMyGenericBean2() {
}
private void checkFirstOpenOnAndGeneric() {
- checkOpenOnAndGeneric("first1", "Generic Configuration Point",
+ checkOpenOnAndGeneric("first1", "MyBeanInjections.java", "Generic Configuration Point",
"MyConfigurationProducer.java", "getOneConfig");
- checkOpenOnAndGeneric("first1", "@Inject Bean",
+ checkOpenOnAndGeneric("first1", "MyBeanInjections.java", "@Inject Bean",
"MyGenericBean.java", "createMyFirstBean");
- checkOpenOnAndGeneric("first2", "Generic Configuration Point",
+ checkOpenOnAndGeneric("first2", "MyBeanInjections.java", "Generic Configuration Point",
"MyConfigurationProducer.java", "getSecondConfig");
- checkOpenOnAndGeneric("first2", "@Inject Bean",
+ checkOpenOnAndGeneric("first2", "MyBeanInjections.java", "@Inject Bean",
"MyGenericBean.java", "createMyFirstBean");
- checkOpenOnAndGeneric("first3", "Generic Configuration Point",
+ checkOpenOnAndGeneric("first3", "MyBeanInjections.java", "Generic Configuration Point",
"MyExtendedConfiguration.java", "MyExtendedConfiguration");
- checkOpenOnAndGeneric("first3", "@Inject Bean",
+ checkOpenOnAndGeneric("first3", "MyBeanInjections.java", "@Inject Bean",
"MyGenericBean.java", "createMyFirstBean");
}
private void checkSecondOpenOnAndGeneric() {
- checkOpenOnAndGeneric("second1", "Generic Configuration Point",
+ checkOpenOnAndGeneric("second1", "MyBeanInjections.java", "Generic Configuration Point",
"MyConfigurationProducer.java", "getOneConfig");
- checkOpenOnAndGeneric("second1", "@Inject Bean",
+ checkOpenOnAndGeneric("second1", "MyBeanInjections.java", "@Inject Bean",
"MyGenericBean2.java", "createMySecondBean");
- checkOpenOnAndGeneric("second2", "Generic Configuration Point",
+ checkOpenOnAndGeneric("second2", "MyBeanInjections.java", "Generic Configuration Point",
"MyConfigurationProducer.java", "getSecondConfig");
- checkOpenOnAndGeneric("second2", "@Inject Bean",
+ checkOpenOnAndGeneric("second2", "MyBeanInjections.java", "@Inject Bean",
"MyGenericBean2.java", "createMySecondBean");
- checkOpenOnAndGeneric("second3", "Generic Configuration Point",
+ checkOpenOnAndGeneric("second3", "MyBeanInjections.java", "Generic Configuration Point",
"MyExtendedConfiguration.java", "MyExtendedConfiguration");
- checkOpenOnAndGeneric("second3", "@Inject Bean",
+ checkOpenOnAndGeneric("second3", "MyBeanInjections.java", "@Inject Bean",
"MyGenericBean2.java", "createMySecondBean");
}
private void checkThirdOpenOnAndGeneric() {
- checkOpenOnAndGeneric("third1", "Generic Configuration Point",
+ checkOpenOnAndGeneric("third1", "MyBeanInjections.java", "Generic Configuration Point",
"MyConfigurationProducer.java", "getOneConfig");
- checkOpenOnAndGeneric("third1", "@Inject Bean",
+ checkOpenOnAndGeneric("third1", "MyBeanInjections.java", "@Inject Bean",
"MyGenericBean.java", "myThirdBean");
- checkOpenOnAndGeneric("third2", "Generic Configuration Point",
+ checkOpenOnAndGeneric("third2", "MyBeanInjections.java", "Generic Configuration Point",
"MyConfigurationProducer.java", "getSecondConfig");
- checkOpenOnAndGeneric("third2", "@Inject Bean",
+ checkOpenOnAndGeneric("third2", "MyBeanInjections.java", "@Inject Bean",
"MyGenericBean.java", "myThirdBean");
- checkOpenOnAndGeneric("third3", "Generic Configuration Point",
+ checkOpenOnAndGeneric("third3", "MyBeanInjections.java", "Generic Configuration Point",
"MyExtendedConfiguration.java", "MyExtendedConfiguration");
- checkOpenOnAndGeneric("third3", "@Inject Bean",
+ checkOpenOnAndGeneric("third3", "MyBeanInjections.java", "@Inject Bean",
"MyGenericBean.java", "myThirdBean");
}
- private void checkOpenOnAndGeneric(String openOnString, String chosenOption,
- String afterOpenOnTitleName, String injectSelectionAtribute) {
- String titleName = "MyBeanInjections.java";
+ private void checkOpenOnAndGeneric(String openOnString, String titleName, String chosenOption,
+ String afterOpenOnTitleName, String injectSelectionAtribute) {
openOn(openOnString, titleName, chosenOption);
String activeEditor = bot.activeEditor().getTitle();
String selectedString = bot.activeEditor().toTextEditor().getSelection();
13 years, 2 months
JBoss Tools SVN: r35763 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test: resources/generic and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-10-18 09:46:55 -0400 (Tue, 18 Oct 2011)
New Revision: 35763
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyBean.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyBeanInjections.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyConfigProd.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyExtendConfig.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericBean.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericBean2.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericType.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/PluginActivator.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java
Log:
Big refactoring of CDI Bot tests + seam3 generic openon test added
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyBean.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyBean.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyBean.java.cdi 2011-10-18 13:46:55 UTC (rev 35763)
@@ -0,0 +1,7 @@
+package org.cdi.generic;
+
+public class MyBeanX {
+
+ public MyBeanX(String s) {}
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyBeanInjections.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyBeanInjections.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyBeanInjections.java.cdi 2011-10-18 13:46:55 UTC (rev 35763)
@@ -0,0 +1,82 @@
+package org.cdi.generic;
+
+import javax.inject.Inject;
+
+public class MyBeanInjections {
+
+ /**
+ * Injected method producer MyGenericBean.createMyFirstBean()
+ * Configuration produced by MyConfigurationProducer.getOneConfig()
+ */
+ @Inject
+ MyBean first1;
+
+ /**
+ * Injected method producer MyGenericBean.createMyFirstBean()
+ * Configuration produced by MyConfigurationProducer.getSecondConfig()
+ */
+ @Inject
+ @Qualifier1
+ MyBean first2;
+
+ /**
+ * Injected method producer MyGenericBean.createMyFirstBean()
+ * Configuration produced by MyExtendedConfiguration
+ */
+ @Inject
+ @Qualifier2
+ MyBean first3;
+
+
+
+
+ /**
+ * Injected method producer MyGenericBean.createMySecondBean()
+ * Configuration produced by MyConfigurationProducer.getOneConfig()
+ */
+ @Inject
+ MyBean2 second1;
+
+ /**
+ * Injected method producer MyGenericBean.createMySecondBean()
+ * Configuration produced by MyConfigurationProducer.getSecondConfig()
+ */
+ @Inject
+ @Qualifier1
+ MyBean2 second2;
+
+ /**
+ * Injected method producer MyGenericBean.createMySecondBean()
+ * Configuration produced by MyExtendedConfiguration
+ */
+ @Inject
+ @Qualifier2
+ MyBean2 second3;
+
+
+
+
+ /**
+ * Injected field producer MyGenericBean.myThirdBean
+ * Configuration produced by MyConfigurationProducer.getOneConfig()
+ */
+ @Inject
+ MyBean3 third1;
+
+ /**
+ * Injected field producer MyGenericBean.myThirdBean
+ * Configuration produced by MyConfigurationProducer.getSecondConfig()
+ */
+ @Inject
+ @Qualifier1
+ MyBean3 third2;
+
+ /**
+ * Injected field producer MyGenericBean.myThirdBean
+ * Configuration produced by MyExtendedConfiguration
+ */
+ @Inject
+ @Qualifier2
+ MyBean3 third3;
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyConfigProd.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyConfigProd.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyConfigProd.java.cdi 2011-10-18 13:46:55 UTC (rev 35763)
@@ -0,0 +1,29 @@
+package org.cdi.generic;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Default;
+import javax.enterprise.inject.Produces;
+
+public class MyConfigurationProducer {
+
+ /**
+ * Configuration created by field producer.
+ */
+ @Produces
+ @MyGenericType("first")
+ @Default
+ MyConfiguration getOneConfig() {
+ return null;
+ }
+
+ /**
+ * Configuration created by method producer with specified scope.
+ */
+ @Produces
+ @MyGenericType("second")
+ @Qualifier1
+ @SessionScoped
+ MyConfiguration getSecondConfig() {
+ return null;
+ }
+}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyExtendConfig.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyExtendConfig.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyExtendConfig.java.cdi 2011-10-18 13:46:55 UTC (rev 35763)
@@ -0,0 +1,9 @@
+package org.cdi.generic;
+
+@MyGenericType("third")
+@Qualifier2
+public class MyExtendedConfiguration extends MyConfiguration {
+ public MyExtendedConfiguration() {
+ super("");
+ }
+}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericBean.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericBean.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericBean.java.cdi 2011-10-18 13:46:55 UTC (rev 35763)
@@ -0,0 +1,27 @@
+package org.cdi.generic;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+import org.jboss.seam.solder.bean.generic.ApplyScope;
+import org.jboss.seam.solder.bean.generic.Generic;
+import org.jboss.seam.solder.bean.generic.GenericConfiguration;
+
+(a)GenericConfiguration(MyGenericType.class)
+public class MyGenericBean {
+ @Inject
+ @Generic
+ MyConfiguration config;
+
+ @Inject
+ MyGenericType type;
+
+ @Produces @ApplyScope
+ MyBean createMyFirstBean() {
+ return new MyBean("bean1");
+ }
+
+ @Produces @ApplyScope
+ MyBean3 myThirdBean = new MyBean3("bean3");
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericBean2.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericBean2.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericBean2.java.cdi 2011-10-18 13:46:55 UTC (rev 35763)
@@ -0,0 +1,35 @@
+package org.cdi.generic;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+import org.jboss.seam.solder.bean.generic.Generic;
+import org.jboss.seam.solder.bean.generic.GenericConfiguration;
+
+(a)GenericConfiguration(MyGenericType.class)
+public class MyGenericBean2 {
+ @Inject
+ @Generic
+ MyConfiguration config;
+
+ @Inject
+ @Generic
+ MyBean c;
+
+ @Inject
+ void setMyBean(@Generic MyBean c) {}
+
+ @Inject
+ @Generic
+ MyBean2 c2;
+
+ @Inject
+ @Generic
+ MyBean3 c3;
+
+ @Produces
+ MyBean2 createMySecondBean() {
+ return new MyBean2("");
+ }
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericType.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericType.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/MyGenericType.java.cdi 2011-10-18 13:46:55 UTC (rev 35763)
@@ -0,0 +1,8 @@
+package org.cdi.generic;
+
+import org.jboss.seam.solder.bean.generic.GenericType;
+
+(a)GenericType(MyConfiguration.class)
+public @interface MyGenericType {
+ String value();
+}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2011-10-18 13:26:50 UTC (rev 35762)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2011-10-18 13:46:55 UTC (rev 35763)
@@ -13,8 +13,13 @@
import org.jboss.tools.cdi.bot.test.editor.BeansEditorTest;
import org.jboss.tools.cdi.bot.test.openon.CDIOpenOnTest;
import org.jboss.tools.cdi.bot.test.quickfix.CDIQuickFixTest;
+import org.jboss.tools.cdi.bot.test.seam3.CDISeam3Test;
+import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIBase;
+import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIUtil;
import org.jboss.tools.cdi.bot.test.wizard.CdiATWizardTest;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
+import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@@ -34,7 +39,7 @@
* JAVA=1.6,/space/java/sdk/jdk1.6.0_22
*
*
- * Suite duration: aprox. 12min
+ * Suite duration: aprox. 14min
*
* @author Lukas Jungmann
* @author Jaroslav Jankovic
@@ -44,7 +49,20 @@
CdiATWizardTest.class,
BeansEditorTest.class,
CDIQuickFixTest.class,
- CDIOpenOnTest.class
+ CDIOpenOnTest.class,
+ CDISeam3Test.class
})
-public class CDIAllBotTests {
+public class CDIAllBotTests extends CDIBase{
+
+
+ /*
+ * init method "setup()" shows a project explorer view as default,
+ * disable folding (due to easier source code editing)
+ */
+ @BeforeClass
+ public static void setUpSuite() {
+ eclipse.showView(ViewType.PROJECT_EXPLORER);
+ CDIUtil.disableFolding(bot, util);
+ }
+
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/PluginActivator.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/PluginActivator.java 2011-10-18 13:26:50 UTC (rev 35762)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/PluginActivator.java 2011-10-18 13:46:55 UTC (rev 35763)
@@ -1,13 +1,13 @@
- /*******************************************************************************
- * 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
- ******************************************************************************/
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.bot.test;
import org.eclipse.ui.plugin.AbstractUIPlugin;
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java 2011-10-18 13:26:50 UTC (rev 35762)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java 2011-10-18 13:46:55 UTC (rev 35763)
@@ -1,11 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.bot.test.openon;
-import java.io.IOException;
-import java.util.logging.Level;
import java.util.logging.Logger;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.quickfix.CDIQuickFixTest;
import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIBase;
@@ -14,24 +20,21 @@
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
-import org.jboss.tools.ui.bot.ext.helper.TreeHelper;
-import org.jboss.tools.ui.bot.ext.types.ViewType;
import org.junit.After;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
/*
- * Test operates on hyperlinks-openons
+ * Test operates on hyperlinks-openons using CDI tools
*
* @author Jaroslav Jankovic
*
*
* TO DO
*
- * - OpenOn for Disposer/Produce and for injection point works
* - Classes indication for Open Injected Class works
+ * - https://issues.jboss.org/browse/JBIDE-6179
*
*
*/
@@ -44,12 +47,7 @@
private static final Logger LOGGER = Logger.getLogger(CDIQuickFixTest.class.getName());
private static final String PROJECT_NAME = "CDIProject3";
private static final String PACKAGE_NAME = "org.cdi.test";
-
- @BeforeClass
- public static void setup() {
- eclipse.showView(ViewType.PROJECT_EXPLORER);
- }
-
+
@After
public void waitForJobs() {
util.waitForNonIgnoredJobs();
@@ -61,7 +59,7 @@
}
@Test
- public void testInjectOpenOn() {
+ public void testBeanInjectOpenOn() {
createComponent(CDICOMPONENT.BEAN, "Animal", PACKAGE_NAME, null);
@@ -70,18 +68,27 @@
CDIUtil.copyResourceToClass(getEd(), CDIOpenOnTest.class
.getResourceAsStream("/resources/cdi/BrokenFarm.java.cdi"),
false);
+ LOGGER.info("Content of \"BrokenFarm.java.cdi\" copied to BrokenFarm");
openOn("@Inject", "BrokenFarm.java", "@Inject");
assertTrue("ERROR: redirected to " + getEd().getTitle(), getEd()
.getTitle().equals("Animal.java"));
}
+ /*
+ * https://issues.jboss.org/browse/JBIDE-7025
+ */
@Test
public void testBeansXMLClassesOpenOn() {
-
- // https://issues.jboss.org/browse/JBIDE-7025
- createComponent(CDICOMPONENT.BEANSXML, null, PROJECT_NAME
- + "/WebContent/WEB-INF", null);
+ /*
+ * check if beans.xml was not created in previous tests. If so, I cannot create
+ * beans.xml into PROJECT_NAME/WebContent/WEB-INF/beans.xml.
+ */
+ if (!projectExplorer.isFilePresent(PROJECT_NAME, "WebContent/META-INF/beans.xml") &&
+ !projectExplorer.isFilePresent(PROJECT_NAME, "WebContent/WEB-INF/beans.xml")) {
+ createComponent(CDICOMPONENT.BEANSXML, null, PROJECT_NAME + "/WebContent/WEB-INF", null);
+ }
+
createComponent(CDICOMPONENT.DECORATOR, "D1", PACKAGE_NAME,
"java.util.Set");
bot.editorByTitle("beans.xml").show();
@@ -112,70 +119,49 @@
getEd().getTitle().equals("S1.java"));
}
-
+
+ /*
+ * https://issues.jboss.org/browse/JBIDE-6251
+ */
@Test
- public void testResourceOpenOn() {
-
- // https://issues.jboss.org/browse/JBIDE-8202
- addLibrary("seam-solder.jar");
-
- createComponent(CDICOMPONENT.BEAN, "B2", PACKAGE_NAME, null);
- CDIUtil.copyResourceToClass(getEd(), CDIQuickFixTest.class
- .getResourceAsStream("/resources/cdi/B2.java.cdi"), false);
- openOn("beansXml", "B2.java", "Open Resource");
- String destinationFile = getEd().getTitle();
- assertTrue("ERROR: redirected to " + destinationFile,
- destinationFile.equals("beans.xml"));
-
- moveFileInProjectExplorer("beans.xml", PROJECT_NAME + "/WebContent/WEB-INF",
- PROJECT_NAME + "/WebContent/META-INF");
- LOGGER.info("bean.xml was moved to META-INF");
+ public void testDisposerOpenOn() {
+ /*
+ * not implemented yet
+ */
- setEd(bot.swtBotEditorExtByTitle("B2.java"));
- CDIUtil.replaceInEditor(getEd(), bot, "WEB", "META");
- openOn("beansXml", "B2.java", "Open Resource");
-
- destinationFile = getEd().getTitle();
- assertTrue("ERROR: redirected to " + destinationFile,
- destinationFile.equals("beans.xml"));
-
}
+ /*
+ * https://issues.jboss.org/browse/JBIDE-6311
+ * https://issues.jboss.org/browse/JBIDE-6251
+ * https://issues.jboss.org/browse/JBIDE-5928
+ */
@Test
- public void testGenericOpenOn() {
-
- // https://issues.jboss.org/browse/JBIDE-8692
-
+ public void testProducerOpenOn() {
/*
- * copy files from project which is mentioned in JIRA, then it will be easy
+ * not implemented yet
*/
+
}
- private void moveFileInProjectExplorer(String file, String sourceFolder, String destFolder) {
- SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem item = projectExplorer.selectTreeItem(file, sourceFolder.split("/"));
+ @Test
+ public void testObserverOpenOn() {
+ /*
+ * not implemented yet
+ *
+ * Bean 1
+ * @Inject
+ * @Qualifier1
+ * Event<MyBean> event2;
+ *
+ * Bean 2
+ * void myObserver(@Observes MyBean bean) {
+ *
+ * }
+ *
+ */
- CDIUtil.nodeContextMenu(tree, item, "Move...").click();
-
- assertFalse(bot.button("OK").isEnabled());
-
- tree = bot.tree();
- tree.collapseNode(destFolder.split("/")[0]);
-
- TreeHelper.expandNode(bot, destFolder.split("/")).select();
-
- assertTrue(bot.button("OK").isEnabled());
- bot.button("OK").click();
}
- private void addLibrary(String libraryName) {
- try {
- addLibraryIntoProject(PROJECT_NAME, libraryName);
- LOGGER.info("Library: \"" + libraryName + "\" copied");
- addLibraryToProjectsClassPath(PROJECT_NAME, libraryName);
- } catch (IOException exc) {
- LOGGER.log(Level.SEVERE, "Error while adding seam solder library into project");
- }
- }
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java 2011-10-18 13:26:50 UTC (rev 35762)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java 2011-10-18 13:46:55 UTC (rev 35763)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.bot.test.quickfix;
@@ -10,10 +20,8 @@
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
-import org.jboss.tools.ui.bot.ext.types.ViewType;
import org.jboss.tools.ui.bot.ext.view.ProblemsView;
import org.junit.After;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@@ -35,17 +43,6 @@
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
/*
- * init method "setup()" shows a project explorer view as default,
- * disable folding (due to easier source code editing) and add
- * cdi extension
- */
- @BeforeClass
- public static void setup() {
- eclipse.showView(ViewType.PROJECT_EXPLORER);
- CDIUtil.disableFolding(bot, util);
- }
-
- /*
* check problems (warnings and errors in Problems View)
*/
@After
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java 2011-10-18 13:46:55 UTC (rev 35763)
@@ -0,0 +1,290 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.bot.test.seam3;
+
+
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
+import org.jboss.tools.cdi.bot.test.quickfix.CDIQuickFixTest;
+import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIBase;
+import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIUtil;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.helper.TreeHelper;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+/*
+ * Test operates on seam3 features using CDI tools
+ *
+ * @author Jaroslav Jankovic
+ */
+
+@Require(perspective = "Java EE", server = @Server(state = ServerState.NotRunning, version = "6.0", operator = ">="))
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ CDIAllBotTests.class })
+public class CDISeam3Test extends CDIBase {
+
+ private static final Logger LOGGER = Logger.getLogger(CDISeam3Test.class.getName());
+ private static final String PROJECT_NAME = "CDISeamProject";
+ private static final String PACKAGE_NAME = "org.cdi.test";
+ private static final String GENERIC_PACKAGE_NAME = "org.cdi.generic";
+
+ @After
+ public void waitForJobs() {
+ util.waitForNonIgnoredJobs();
+ }
+
+ @Test
+ public void testCreateProjectWithSeamLibraries() {
+ createAndCheckCDIProject(bot, util, projectExplorer, PROJECT_NAME);
+ addLibrary("seam-solder.jar");
+ checkLibrary("seam-solder.jar");
+ }
+
+ /*
+ * https://issues.jboss.org/browse/JBIDE-8202
+ */
+ @Test
+ public void testResourceOpenOn() {
+
+ createComponent(CDICOMPONENT.BEANSXML, "beans.xml", PROJECT_NAME + "/WebContent/WEB-INF", null);
+
+ createComponent(CDICOMPONENT.BEAN, "B2", PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDIQuickFixTest.class
+ .getResourceAsStream("/resources/cdi/B2.java.cdi"), false);
+ LOGGER.info("Content of \"B2.java.cdi\" copied to B2");
+ openOn("beansXml", "B2.java", "Open Resource");
+ String destinationFile = getEd().getTitle();
+ assertTrue("ERROR: redirected to " + destinationFile,
+ destinationFile.equals("beans.xml"));
+
+ moveFileInProjectExplorer("beans.xml", PROJECT_NAME + "/WebContent/WEB-INF",
+ PROJECT_NAME + "/WebContent/META-INF");
+ LOGGER.info("bean.xml was moved to META-INF");
+
+ setEd(bot.swtBotEditorExtByTitle("B2.java"));
+ CDIUtil.replaceInEditor(getEd(), bot, "WEB", "META");
+ openOn("beansXml", "B2.java", "Open Resource");
+
+ destinationFile = getEd().getTitle();
+ assertTrue("ERROR: redirected to " + destinationFile,
+ destinationFile.equals("beans.xml"));
+
+ }
+
+ /*
+ * https://issues.jboss.org/browse/JBIDE-8692
+ */
+ @Test
+ public void testGenericOpenOn() {
+
+ /*
+ * create all necessary components
+ */
+ prepareGenericOpenOn();
+ /*
+ * test openon for inject and generic
+ * configuration point in class "MyBeanInjections"
+ */
+ checkMyBeanInjections();
+ /*
+ * not implemented yet
+ */
+ checkMyGenericBean();
+ /*
+ * not implemented yet
+ */
+ checkMyGenericBean2();
+
+ /*
+ * what will I test:
+ * 2. MyBeanInjections - three beany with different generic configuration
+ * 3. MyGenericBean - atribute config - Show all Generic Configuration Type
+ * 4. MyGenericBean2 - atributes config, c1, c2, c3 + set Method
+ */
+ }
+
+
+ private void moveFileInProjectExplorer(String file, String sourceFolder, String destFolder) {
+ SWTBotTree tree = projectExplorer.bot().tree();
+ SWTBotTreeItem item = projectExplorer.selectTreeItem(file, sourceFolder.split("/"));
+
+ CDIUtil.nodeContextMenu(tree, item, "Move...").click();
+
+ assertFalse(bot.button("OK").isEnabled());
+
+ tree = bot.tree();
+ tree.collapseNode(destFolder.split("/")[0]);
+
+ TreeHelper.expandNode(bot, destFolder.split("/")).select();
+
+ assertTrue(bot.button("OK").isEnabled());
+ bot.button("OK").click();
+ }
+
+ private void addLibrary(String libraryName) {
+ try {
+ addLibraryIntoProject(PROJECT_NAME, libraryName);
+ LOGGER.info("Library: \"" + libraryName + "\" copied");
+ addLibraryToProjectsClassPath(PROJECT_NAME, libraryName);
+ LOGGER.info("Library: \"" + libraryName + "\" on class path of project\"" + PROJECT_NAME + "\"");
+ } catch (IOException exc) {
+ LOGGER.log(Level.SEVERE, "Error while adding seam solder library into project");
+ }
+ }
+
+ private void checkLibrary(String libraryName) {
+ isLibraryInProjectClassPath(PROJECT_NAME, libraryName);
+ }
+
+ private void prepareGenericOpenOn() {
+ /*
+ * injectable beans + qualifiers + generic configuration components
+ */
+ createComponent(CDICOMPONENT.BEAN, "MyBean", GENERIC_PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDISeam3Test.class
+ .getResourceAsStream("/resources/generic/MyBean.java.cdi"), false);
+ CDIUtil.replaceInEditor(getEd(), bot, "MyBeanX", "MyBean");
+
+ createComponent(CDICOMPONENT.BEAN, "MyBean2", GENERIC_PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDISeam3Test.class
+ .getResourceAsStream("/resources/generic/MyBean.java.cdi"), false);
+ CDIUtil.replaceInEditor(getEd(), bot, "MyBeanX", "MyBean2");
+
+ createComponent(CDICOMPONENT.BEAN, "MyBean3", GENERIC_PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDISeam3Test.class
+ .getResourceAsStream("/resources/generic/MyBean.java.cdi"), false);
+ CDIUtil.replaceInEditor(getEd(), bot, "MyBeanX", "MyBean3");
+
+ createComponent(CDICOMPONENT.BEAN, "MyConfiguration", GENERIC_PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDISeam3Test.class
+ .getResourceAsStream("/resources/generic/MyBean.java.cdi"), false);
+ CDIUtil.replaceInEditor(getEd(), bot, "MyBeanX", "MyConfiguration");
+
+ createComponent(CDICOMPONENT.BEAN, "MyGenericType", GENERIC_PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDISeam3Test.class
+ .getResourceAsStream("/resources/generic/MyGenericType.java.cdi"), false);
+
+ createComponent(CDICOMPONENT.QUALIFIER, "Qualifier1", GENERIC_PACKAGE_NAME, null);
+ createComponent(CDICOMPONENT.QUALIFIER, "Qualifier2", GENERIC_PACKAGE_NAME, null);
+
+ createComponent(CDICOMPONENT.BEAN, "MyExtendedConfiguration", GENERIC_PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDISeam3Test.class
+ .getResourceAsStream("/resources/generic/MyExtendConfig.java.cdi"), false);
+
+ createComponent(CDICOMPONENT.BEAN, "MyConfigurationProducer", GENERIC_PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDISeam3Test.class
+ .getResourceAsStream("/resources/generic/MyConfigProd.java.cdi"), false);
+
+ /*
+ * beans which include atributes suggesting opening all the available
+ * generic configurations
+ */
+
+ createComponent(CDICOMPONENT.BEAN, "MyBeanInjections", GENERIC_PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDISeam3Test.class
+ .getResourceAsStream("/resources/generic/MyBeanInjections.java.cdi"), false);
+
+ createComponent(CDICOMPONENT.BEAN, "MyGenericBean", GENERIC_PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDISeam3Test.class
+ .getResourceAsStream("/resources/generic/MyGenericBean.java.cdi"), false);
+
+ createComponent(CDICOMPONENT.BEAN, "MyGenericBean2", GENERIC_PACKAGE_NAME, null);
+ CDIUtil.copyResourceToClass(getEd(), CDISeam3Test.class
+ .getResourceAsStream("/resources/generic/MyGenericBean2.java.cdi"), false);
+ }
+
+ private void checkMyBeanInjections() {
+ checkFirstOpenOnAndGeneric();
+ checkSecondOpenOnAndGeneric();
+ checkThirdOpenOnAndGeneric();
+ }
+
+ private void checkMyGenericBean() {
+
+ }
+
+ private void checkMyGenericBean2() {
+
+ }
+ private void checkFirstOpenOnAndGeneric() {
+ checkOpenOnAndGeneric("first1", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getOneConfig");
+ checkOpenOnAndGeneric("first1", "@Inject Bean",
+ "MyGenericBean.java", "createMyFirstBean");
+
+ checkOpenOnAndGeneric("first2", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getSecondConfig");
+ checkOpenOnAndGeneric("first2", "@Inject Bean",
+ "MyGenericBean.java", "createMyFirstBean");
+
+ checkOpenOnAndGeneric("first3", "Generic Configuration Point",
+ "MyExtendedConfiguration.java", "MyExtendedConfiguration");
+ checkOpenOnAndGeneric("first3", "@Inject Bean",
+ "MyGenericBean.java", "createMyFirstBean");
+ }
+
+ private void checkSecondOpenOnAndGeneric() {
+ checkOpenOnAndGeneric("second1", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getOneConfig");
+ checkOpenOnAndGeneric("second1", "@Inject Bean",
+ "MyGenericBean2.java", "createMySecondBean");
+
+ checkOpenOnAndGeneric("second2", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getSecondConfig");
+ checkOpenOnAndGeneric("second2", "@Inject Bean",
+ "MyGenericBean2.java", "createMySecondBean");
+
+ checkOpenOnAndGeneric("second3", "Generic Configuration Point",
+ "MyExtendedConfiguration.java", "MyExtendedConfiguration");
+ checkOpenOnAndGeneric("second3", "@Inject Bean",
+ "MyGenericBean2.java", "createMySecondBean");
+ }
+
+ private void checkThirdOpenOnAndGeneric() {
+ checkOpenOnAndGeneric("third1", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getOneConfig");
+ checkOpenOnAndGeneric("third1", "@Inject Bean",
+ "MyGenericBean.java", "myThirdBean");
+
+ checkOpenOnAndGeneric("third2", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getSecondConfig");
+ checkOpenOnAndGeneric("third2", "@Inject Bean",
+ "MyGenericBean.java", "myThirdBean");
+
+ checkOpenOnAndGeneric("third3", "Generic Configuration Point",
+ "MyExtendedConfiguration.java", "MyExtendedConfiguration");
+ checkOpenOnAndGeneric("third3", "@Inject Bean",
+ "MyGenericBean.java", "myThirdBean");
+ }
+
+ private void checkOpenOnAndGeneric(String openOnString, String chosenOption,
+ String afterOpenOnTitleName, String injectSelectionAtribute) {
+ String titleName = "MyBeanInjections.java";
+ openOn(openOnString, titleName, chosenOption);
+ String activeEditor = bot.activeEditor().getTitle();
+ String selectedString = bot.activeEditor().toTextEditor().getSelection();
+ assertTrue(activeEditor, activeEditor.equals(afterOpenOnTitleName));
+ assertTrue(selectedString, selectedString.equals(injectSelectionAtribute));
+ }
+
+}
+
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java 2011-10-18 13:26:50 UTC (rev 35762)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java 2011-10-18 13:46:55 UTC (rev 35763)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.bot.test.uiutils.actions;
import java.io.File;
@@ -9,8 +19,10 @@
import org.eclipse.core.runtime.Platform;
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.keyboard.Keystrokes;
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;
@@ -51,8 +63,14 @@
} else {
createCDIComponent(component, name, packageName, necessaryParam);
}
- util.waitForNonIgnoredJobs();
- setEd(bot.activeEditor().toTextEditor());
+ util.waitForNonIgnoredJobs();
+ /*
+ * if beans.xml is created as first component in project,
+ * it is not opened as default ==> there is no active editor
+ */
+ if (component != CDICOMPONENT.BEANSXML) {
+ setEd(bot.activeEditor().toTextEditor());
+ }
}
private void createCDIComponent(CDICOMPONENT component, String name,
@@ -212,5 +230,36 @@
if (inChannel != null) inChannel.close();
if (outChannel != null) outChannel.close();
}
+
+ /*
+ * check if library with name libraryName is set on classpath of project with name
+ * projectName
+ */
+ public static void isLibraryInProjectClassPath(String projectName, String libraryName) {
+ SWTBotTree tree = projectExplorer.bot().tree();
+
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,"Properties",false)).click();
+
+ SWTBotShell shell = bot.shell("Properties for " + projectName);
+ SWTBot bot = shell.bot();
+
+ bot.tree().expandNode("Java Build Path").select();
+
+ bot.tabItem("Libraries").activate();
+
+ boolean libraryInProject = false;
+ for (int i = 0; i < bot.tree(1).rowCount(); i++) {
+ if (bot.tree(1).getAllItems()[i].getText().contains(libraryName)) {
+ libraryInProject = true;
+ break;
+ }
+ }
+ assertTrue("Library " + libraryName + "is not on classPath of project "
+ + projectName,libraryInProject);
+
+ bot.button(IDELabel.Button.CANCEL).click();
+ bot.sleep(TIME_1S);
+ }
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java 2011-10-18 13:26:50 UTC (rev 35762)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java 2011-10-18 13:46:55 UTC (rev 35763)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.bot.test.uiutils.actions;
import java.io.InputStream;
@@ -42,16 +52,16 @@
String code = readStream(resource);
st.setText(code);
classEdit.save();
- if (closeEdit)
+ if (closeEdit) {
classEdit.close();
+ }
}
public static void replaceInEditor(SWTBotEclipseEditor ed, SWTBotExt bot,
String target, String replacement) {
ed.selectRange(0, 0, ed.getText().length());
ed.setText(ed.getText().replace(
- target
- + (replacement.equals("") ? System
+ target + (replacement.equals("") ? System
.getProperty("line.separator") : ""),
replacement));
bot.sleep(Timing.time1S());
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java 2011-10-18 13:26:50 UTC (rev 35762)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java 2011-10-18 13:46:55 UTC (rev 35763)
@@ -19,6 +19,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.jboss.tools.ui.bot.ext.Timing;
public class CDIWizard extends Wizard {
@@ -312,7 +313,7 @@
bot().button("Add...", 0).click();
SWTBotShell sh = bot().activeShell();
sh.bot().text().setText(intf);
- sh.bot().sleep(1000);
+ sh.bot().sleep(Timing.time2S());
sh.bot().table().getTableItem(0).select();
sh.bot().button("OK").click();
setFocus();
@@ -337,7 +338,7 @@
}
SWTBotShell sh = bot().activeShell();
sh.bot().text().setText(qualifier);
- sh.bot().sleep(1000);
+ sh.bot().sleep(Timing.time2S());
sh.bot().table().getTableItem(0).select();
sh.bot().button("OK").click();
setFocus();
13 years, 2 months