JBoss Tools SVN: r43069 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition.
by jbosstools-commits@lists.jboss.org
Author: rhopp
Date: 2012-08-16 05:00:22 -0400 (Thu, 16 Aug 2012)
New Revision: 43069
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/BrowserIsLoaded.java
Log:
Fixed Documentation section test on Windows slaves.
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/BrowserIsLoaded.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/BrowserIsLoaded.java 2012-08-16 08:31:14 UTC (rev 43068)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/BrowserIsLoaded.java 2012-08-16 09:00:22 UTC (rev 43069)
@@ -20,10 +20,15 @@
SWTBot bot;
private SWTBotBrowserExt browser;
+ private boolean loadedAlreadyOnStart = false;
public BrowserIsLoaded(SWTBotBrowserExt browser){
- browser.addProgressListenerToBrowser();
- this.browser = browser;
+ if (!browser.getText().isEmpty()){
+ loadedAlreadyOnStart = true; //no need for listener
+ }else{
+ browser.addProgressListenerToBrowser();
+ this.browser = browser;
+ }
}
@Override
@@ -35,7 +40,7 @@
}catch(WidgetNotFoundException wnfe){
}
- return browser.isPageLoaded();
+ return loadedAlreadyOnStart ? true : browser.isPageLoaded();
}
@Override
12 years, 4 months
JBoss Tools SVN: r43068 - in branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot: matcher/browser/portlet and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-16 04:31:14 -0400 (Thu, 16 Aug 2012)
New Revision: 43068
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/BrowserUrlMatcher.java
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/PageSourceMatcher.java
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/portlet/PortletLoadsInJBPortalMatcher.java
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/factory/PortletMatchersFactory.java
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentGateinTemplate.java
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunAsLoadsPortalURLTemplate.java
Log:
Added timetouts to some matchers
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/BrowserUrlMatcher.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/BrowserUrlMatcher.java 2012-08-16 08:30:51 UTC (rev 43067)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/BrowserUrlMatcher.java 2012-08-16 08:31:14 UTC (rev 43068)
@@ -2,9 +2,13 @@
import java.util.Arrays;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
+import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
import org.hamcrest.Description;
import org.jboss.tools.portlet.ui.bot.matcher.AbstractSWTMatcher;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
/**
* Checks if the URL of the page laoded in the browser is one of the accepted URLs.
@@ -15,11 +19,21 @@
public class BrowserUrlMatcher extends AbstractSWTMatcher<String[]> {
private String realURL;
-
+
+ private long timeout;
+
+ public BrowserUrlMatcher(TaskDuration duration){
+ timeout = duration.getTimeout();
+ }
+
@Override
public boolean matchesSafely(String[] acceptedURL) {
- realURL = SWTBotFactory.getBot().browser().getUrl();
- return Arrays.asList(acceptedURL).contains(realURL);
+ try {
+ SWTBotFactory.getBot().waitUntil(new BrowserContainsUrlCondition(acceptedURL, realURL), timeout);
+ return true;
+ } catch (TimeoutException e){
+ return false;
+ }
}
@Override
@@ -27,4 +41,31 @@
description.appendText("are the only allowed loaded URLs but it was:");
description.appendValue(realURL);
}
+
+ private class BrowserContainsUrlCondition extends DefaultCondition {
+
+ private String[] acceptedURL;
+
+ private String realURL;
+
+ public BrowserContainsUrlCondition(String[] acceptedURL, String realURL) {
+ this.acceptedURL = acceptedURL;
+ this.realURL = realURL;
+ }
+
+ @Override
+ public boolean test() throws Exception {
+ try {
+ realURL = SWTBotFactory.getBot().browser().getUrl();
+ return Arrays.asList(acceptedURL).contains(realURL);
+ } catch (WidgetNotFoundException e){
+ return false;
+ }
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return null;
+ }
+ }
}
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/PageSourceMatcher.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/PageSourceMatcher.java 2012-08-16 08:30:51 UTC (rev 43067)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/PageSourceMatcher.java 2012-08-16 08:31:14 UTC (rev 43068)
@@ -1,8 +1,12 @@
package org.jboss.tools.portlet.ui.bot.matcher.browser;
+import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
+import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
import org.hamcrest.Description;
import org.jboss.tools.portlet.ui.bot.matcher.AbstractSWTMatcher;
-import org.jboss.tools.portlet.ui.bot.task.browser.LoadBrowserPageTask;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
/**
* Checks if the given page contains specified text.
@@ -12,20 +16,41 @@
*/
public class PageSourceMatcher extends AbstractSWTMatcher<String> {
+ private String pageText;
+
private String url;
- private String pageText;
+ private long timeout;
- public PageSourceMatcher(String url) {
+ public PageSourceMatcher() {
super();
+ timeout = 0;
+ }
+
+ public PageSourceMatcher(TaskDuration timeout) {
+ super();
+ this.timeout = timeout.getTimeout();
+ }
+
+ public PageSourceMatcher(String url, TaskDuration duration) {
+ this();
this.url = url;
+ this.timeout = duration.getTimeout();
}
-
+
@Override
public boolean matchesSafely(String item) {
- performInnerTask(new LoadBrowserPageTask(url));
- pageText = getBot().browser().getText();
- return pageText.contains(item);
+ SWTBotBrowserExt browser = SWTBotFactory.getBot().browserExt();
+ if (url != null){
+ browser.loadUrlToBrowser(url, SWTBotFactory.getBot());
+ }
+
+ try {
+ SWTBotFactory.getBot().waitUntil(new PageContainsTextCondition(browser, item), timeout);
+ return true;
+ } catch (TimeoutException e){
+ return false;
+ }
}
@Override
@@ -33,4 +58,30 @@
description.appendText("is on the page, but there was instead: ");
description.appendValue(pageText);
}
+
+ private class PageContainsTextCondition extends DefaultCondition {
+
+ private SWTBotBrowserExt browser;
+
+ private String expectedText;
+
+ public PageContainsTextCondition(SWTBotBrowserExt browser, String item) {
+ this.browser = browser;
+ this.expectedText = item;
+ }
+
+ @Override
+ public boolean test() throws Exception {
+ pageText = browser.getText();
+ if ("".equals(expectedText)){
+ return pageText.equals(expectedText);
+ }
+ return pageText.contains(expectedText);
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return null;
+ }
+ }
}
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/portlet/PortletLoadsInJBPortalMatcher.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/portlet/PortletLoadsInJBPortalMatcher.java 2012-08-16 08:30:51 UTC (rev 43067)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/portlet/PortletLoadsInJBPortalMatcher.java 2012-08-16 08:31:14 UTC (rev 43068)
@@ -4,6 +4,7 @@
import org.jboss.tools.portlet.ui.bot.entity.PortletDefinition;
import org.jboss.tools.portlet.ui.bot.matcher.AbstractSWTMatcher;
import org.jboss.tools.portlet.ui.bot.matcher.browser.PageSourceMatcher;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
/**
* Check if the given portlet can be loaded in EPP 4.x runtime.
@@ -17,9 +18,15 @@
private PageSourceMatcher pageMatcher;
+ private TaskDuration duration;
+
+ public PortletLoadsInJBPortalMatcher(TaskDuration duration){
+ this.duration = duration;
+ }
+
@Override
public boolean matchesSafely(PortletDefinition portletTitle) {
- pageMatcher = new PageSourceMatcher(PORTAL_URL + portletTitle.getPage());
+ pageMatcher = new PageSourceMatcher(PORTAL_URL + portletTitle.getPage(), duration);
pageMatcher.setBot(getBot());
return pageMatcher.matchesSafely("<span class=\"portlet-titlebar-title\">" + portletTitle.getDisplayName() + "</span>");
}
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java 2012-08-16 08:30:51 UTC (rev 43067)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java 2012-08-16 08:31:14 UTC (rev 43068)
@@ -2,6 +2,7 @@
import org.hamcrest.Description;
import org.jboss.tools.portlet.ui.bot.matcher.AbstractSWTMatcher;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
/**
* Checks if the console contains specified text.
@@ -17,6 +18,10 @@
wrappedMatcher = new org.jboss.tools.ui.bot.ext.matcher.console.ConsoleOutputMatcher();
}
+ public ConsoleOutputMatcher(TaskDuration duration) {
+ wrappedMatcher = new org.jboss.tools.ui.bot.ext.matcher.console.ConsoleOutputMatcher(duration);
+ }
+
@Override
public boolean matchesSafely(String item) {
return wrappedMatcher.matchesSafely(item);
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/factory/PortletMatchersFactory.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/factory/PortletMatchersFactory.java 2012-08-16 08:30:51 UTC (rev 43067)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/factory/PortletMatchersFactory.java 2012-08-16 08:31:14 UTC (rev 43068)
@@ -3,6 +3,7 @@
import org.jboss.tools.portlet.ui.bot.entity.PortletDefinition;
import org.jboss.tools.portlet.ui.bot.matcher.SWTMatcher;
import org.jboss.tools.portlet.ui.bot.matcher.browser.portlet.PortletLoadsInJBPortalMatcher;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
public class PortletMatchersFactory {
@@ -11,6 +12,6 @@
}
public static SWTMatcher<PortletDefinition> canLoadAt4xRuntime(){
- return new PortletLoadsInJBPortalMatcher();
+ return new PortletLoadsInJBPortalMatcher(TaskDuration.NORMAL);
}
}
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentGateinTemplate.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentGateinTemplate.java 2012-08-16 08:30:51 UTC (rev 43067)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentGateinTemplate.java 2012-08-16 08:31:14 UTC (rev 43068)
@@ -7,6 +7,7 @@
import org.jboss.tools.portlet.ui.bot.task.editor.CloseAllEditors;
import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.AbstractPortletCreationTask;
import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
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;
@@ -31,7 +32,7 @@
doPerform(new ConsoleClearingTask());
doPerform(createPortlet());
- assertThatInWorkspace("undeploy, ctxPath=/" + getProjectName(), new ConsoleOutputMatcher());
- assertThatInWorkspace("deploy, ctxPath=/" + getProjectName(), new ConsoleOutputMatcher());
+ assertThatInWorkspace("undeploy, ctxPath=/" + getProjectName(), new ConsoleOutputMatcher(TaskDuration.LONG));
+ assertThatInWorkspace("deploy, ctxPath=/" + getProjectName(), new ConsoleOutputMatcher(TaskDuration.LONG));
}
}
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunAsLoadsPortalURLTemplate.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunAsLoadsPortalURLTemplate.java 2012-08-16 08:30:51 UTC (rev 43067)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunAsLoadsPortalURLTemplate.java 2012-08-16 08:31:14 UTC (rev 43068)
@@ -11,6 +11,7 @@
import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JBossPortletCapabilitiesWizardPageFillingTask;
import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
import org.junit.Test;
/**
@@ -32,7 +33,7 @@
doPerform(createJavaPortletTask());
doPerform(runOnServerTask());
- doAssertThatInWorkspace(getExpectedURLs(), new BrowserUrlMatcher());
+ doAssertThatInWorkspace(getExpectedURLs(), new BrowserUrlMatcher(TaskDuration.NORMAL));
}
private SWTTask createJavaPortletTask() {
12 years, 4 months
JBoss Tools SVN: r43067 - branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/prepare_workspace.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-16 04:30:51 -0400 (Thu, 16 Aug 2012)
New Revision: 43067
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/prepare_workspace/portlets_prepare_workspace.launch
Log:
Use embedded maven
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/prepare_workspace/portlets_prepare_workspace.launch
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/prepare_workspace/portlets_prepare_workspace.launch 2012-08-16 07:38:38 UTC (rev 43066)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/prepare_workspace/portlets_prepare_workspace.launch 2012-08-16 08:30:51 UTC (rev 43067)
@@ -14,7 +14,7 @@
<listEntry value="jbosstools.test.jboss-seam-2.0.home=${folder_prompt:Seam 2.0 installation directory}"/>
<listEntry value="jbosstools.test.jboss-portlet-bridge.home=${folder_prompt:JBoss Portlet Bridge installation directory}"/>
</listAttribute>
-<stringAttribute key="M2_RUNTIME" value="/home/ljelinko/programs/apache-maven-3.0.3"/>
+<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
12 years, 4 months
JBoss Tools SVN: r43066 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-08-16 03:38:38 -0400 (Thu, 16 Aug 2012)
New Revision: 43066
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/pom.xml
Log:
Configuration dir fixed in hb ui bo test pom
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/pom.xml
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/pom.xml 2012-08-16 07:29:10 UTC (rev 43065)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/pom.xml 2012-08-16 07:38:38 UTC (rev 43066)
@@ -13,7 +13,7 @@
<packaging>eclipse-test-plugin</packaging>
<properties>
- <systemProperties>-Dtest.configurations.dir=/home/jpeterka/etc/hb</systemProperties>
+ <systemProperties>-Dtest.configurations.dir=${project.basedir}/properties/</systemProperties>
</properties>
<build>
12 years, 4 months
JBoss Tools SVN: r43065 - in trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test: src/org/jboss/tools/hb/ui/bot/suite and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-08-16 03:29:10 -0400 (Thu, 16 Aug 2012)
New Revision: 43065
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/JenkinsSuite.java
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/pom.xml
Log:
Suite for jenkins test and profile added & pom update
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/pom.xml
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/pom.xml 2012-08-16 07:28:24 UTC (rev 43064)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/pom.xml 2012-08-16 07:29:10 UTC (rev 43065)
@@ -1,18 +1,19 @@
<?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>
+<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.hibernatetools</groupId>
<artifactId>tests</artifactId>
<version>3.6.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.hibernatetools.tests</groupId>
- <artifactId>org.jboss.tools.hibernate.ui.bot.test</artifactId>
+ <artifactId>org.jboss.tools.hibernate.ui.bot.test</artifactId>
<packaging>eclipse-test-plugin</packaging>
-
+
<properties>
- <systemProperties>-Dtest.configurations.dir=./properties/</systemProperties>
+ <systemProperties>-Dtest.configurations.dir=/home/jpeterka/etc/hb</systemProperties>
</properties>
<build>
@@ -23,15 +24,42 @@
<configuration>
<useUIThread>false</useUIThread>
<skip>${swtbot.test.skip}</skip>
+ <testSuite>org.jboss.tools.hibernate.ui.bot.test</testSuite>
+ <!-- <testClass>org.jboss.tools.hb.ui.bot.suite.ViewSuite</testClass> --> -->
+ <testClass>${test.suite.class}</testClass>
<dependencies combine.children="append">
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.eclipse.datatools.enablement.hsqldb.feature.feature.group</artifactId>
<version>0.0.0</version>
</dependency>
- </dependencies>
+ <!--
+ <dependency>
+ <type>p2-installable-unit</type>
+ <artifactId>org.eclipse.jpt.jpa.feature.feature.group</artifactId>
+ <version>0.0.0</version>
+ </dependency>-->
+ </dependencies>
</configuration>
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>mvn-debug</id>
+ <properties>
+ <systemProperties>-Xdebug
+ -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y</systemProperties>
+ </properties>
+ </profile>
+ <profile>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <id>jenkins</id>
+ <properties>
+ <test.suite.class>org.jboss.tools.hb.ui.bot.suite.JenkinsSuite</test.suite.class>
+ </properties>
+ </profile>
+ </profiles>
</project>
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/JenkinsSuite.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/JenkinsSuite.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/JenkinsSuite.java 2012-08-16 07:29:10 UTC (rev 43065)
@@ -0,0 +1,20 @@
+package org.jboss.tools.hb.ui.bot.suite;
+
+import org.jboss.tools.hb.ui.bot.test.perspective.PerspectiveTest;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * Suite of tests for to be executed on jenkins slave
+ * Same test from Hibernate suite are not here because of known issues
+ * @author jpeterka
+ *
+ */
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({
+ PerspectiveTest.class
+ })
+public class JenkinsSuite {
+
+}
12 years, 4 months
JBoss Tools SVN: r43064 - in trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test: configuration and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-08-16 03:28:24 -0400 (Thu, 16 Aug 2012)
New Revision: 43064
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/completion/AnnotationCodeCompletionTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/configuration/CreateConfigurationFileTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/RunSchemaExportTest.java
Log:
Hibernate ui bot test methods name refactoring and javadoc added
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/completion/AnnotationCodeCompletionTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/completion/AnnotationCodeCompletionTest.java 2012-08-16 04:30:54 UTC (rev 43063)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/completion/AnnotationCodeCompletionTest.java 2012-08-16 07:28:24 UTC (rev 43064)
@@ -1,12 +1,7 @@
package org.jboss.tools.hb.ui.bot.test.completion;
-import java.util.List;
-
import org.eclipse.swt.graphics.Point;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-import org.jboss.tools.hb.ui.bot.common.JPAEntity;
import org.jboss.tools.hb.ui.bot.common.Tree;
import org.jboss.tools.hb.ui.bot.test.HibernateBaseTest;
import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
@@ -17,7 +12,7 @@
import org.junit.Test;
/**
- * Create JPA Entity ui bot test
+ * Hibernate annotation test. Annotation code completion functionality is checked in Entity class
*/
@Require(db = @DB, clearProjects = true)
public class AnnotationCodeCompletionTest extends HibernateBaseTest {
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/configuration/CreateConfigurationFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/configuration/CreateConfigurationFileTest.java 2012-08-16 04:30:54 UTC (rev 43063)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/configuration/CreateConfigurationFileTest.java 2012-08-16 07:28:24 UTC (rev 43064)
@@ -14,6 +14,9 @@
@Require(clearProjects = true)
public class CreateConfigurationFileTest extends HibernateBaseTest {
+ /**
+ * Basic Hibernate Configuration is created
+ */
@Test
public void configurationFileTest() {
emptyErrorLog();
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/RunSchemaExportTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/RunSchemaExportTest.java 2012-08-16 04:30:54 UTC (rev 43063)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/RunSchemaExportTest.java 2012-08-16 07:28:24 UTC (rev 43064)
@@ -27,7 +27,7 @@
final String hc = "pre-hibernate40";
@Test
- public void showMappingDiagram() {
+ public void runSchemaExportTest() {
importTestProject("/resources/prj/hibernatelib");
importTestProject("/resources/prj/hibernate40");
util.waitForAll();
12 years, 4 months
JBoss Tools SVN: r43062 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-08-15 20:28:31 -0400 (Wed, 15 Aug 2012)
New Revision: 43062
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-10611 As-you-type CDI validation
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-08-16 00:18:27 UTC (rev 43061)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-08-16 00:28:31 UTC (rev 43062)
@@ -668,7 +668,7 @@
validateProducer(context, (IProducer) bean);
}
- Collection<IInjectionPoint> points = bean.getInjectionPoints();
+ Collection<IInjectionPoint> points = bean instanceof IClassBean? ((IClassBean)bean).getInjectionPoints(false):bean.getInjectionPoints();
for (IInjectionPoint point : points) {
if(!isAsYouTypeValidation()) {
IType type = getTypeOfInjection(point);
12 years, 5 months
JBoss Tools SVN: r43061 - trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-15 20:18:27 -0400 (Wed, 15 Aug 2012)
New Revision: 43061
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIProject.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Replaced Set by Collection in interfaces.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java 2012-08-16 00:17:47 UTC (rev 43060)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java 2012-08-16 00:18:27 UTC (rev 43061)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.ui.test.testmodel;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -69,7 +70,7 @@
}
@Override
- public Set<IStereotypeDeclaration> getStereotypeDeclarations() {
+ public Collection<IStereotypeDeclaration> getStereotypeDeclarations() {
return null;
}
@@ -221,7 +222,7 @@
}
@Override
- public Set<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations(
+ public Collection<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations(
boolean includeInherited) {
return null;
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIProject.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIProject.java 2012-08-16 00:17:47 UTC (rev 43060)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIProject.java 2012-08-16 00:18:27 UTC (rev 43061)
@@ -11,6 +11,7 @@
package org.jboss.tools.cdi.ui.test.testmodel;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -227,7 +228,7 @@
}
@Override
- public Set<IBean> resolve(Set<IBean> beans) {
+ public Set<IBean> resolve(Collection<IBean> beans) {
return null;
}
12 years, 5 months
JBoss Tools SVN: r43060 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui: refactoring and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-15 20:17:47 -0400 (Wed, 15 Aug 2012)
New Revision: 43060
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllOtherAnnotationsFromParametersMarkerResolution.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/CDIBeanQueryParticipant.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanWizardPage.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/OpenCDINamedBeanDialog.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Replaced Set by Collection in interfaces.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2012-08-16 00:16:55 UTC (rev 43059)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2012-08-16 00:17:47 UTC (rev 43060)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.ui.marker;
import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -273,10 +273,9 @@
ICDIProject cdiProject = CDIUtil.getCDIProject((IFile)compilationUnit.getUnderlyingResource(), cdiNature, asYouType);
if(cdiProject != null){
- Set<IBean> beans = cdiProject.getBeans(field.getUnderlyingResource().getFullPath());
- Iterator<IBean> iter = beans.iterator();
- if(iter.hasNext()){
- IBean bean = iter.next();
+ Collection<IBean> beans = cdiProject.getBeans(field.getUnderlyingResource().getFullPath());
+ if(!beans.isEmpty()){
+ IBean bean = beans.iterator().next();
if(field != null){
return new IQuickFix[] {
new MakeFieldProtectedMarkerResolution(field),
@@ -625,7 +624,7 @@
return resolutions;
}
- Set<IBean> allBeans = CDIUtil.getFilteredBeans(cdiProject, compilationUnit.getUnderlyingResource().getFullPath());
+ Collection<IBean> allBeans = CDIUtil.getFilteredBeans(cdiProject, compilationUnit.getUnderlyingResource().getFullPath());
IInjectionPoint ip = CDIUtil.findInjectionPoint(allBeans, parameter, start);
if(ip != null){
@@ -808,7 +807,7 @@
return null;
}
- Set<IBean> allBeans = CDIUtil.getFilteredBeans(cdiProject, compilationUnit.getUnderlyingResource().getFullPath());
+ Collection<IBean> allBeans = CDIUtil.getFilteredBeans(cdiProject, compilationUnit.getUnderlyingResource().getFullPath());
IInjectionPoint ip = CDIUtil.findInjectionPoint(allBeans, element, start);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllOtherAnnotationsFromParametersMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllOtherAnnotationsFromParametersMarkerResolution.java 2012-08-16 00:16:55 UTC (rev 43059)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllOtherAnnotationsFromParametersMarkerResolution.java 2012-08-16 00:17:47 UTC (rev 43060)
@@ -107,6 +107,11 @@
@Override
public String getDescription() {
+ if(description == null) {
+ System.out.println("compute description " + this);
+ description = getPreview();
+ System.out.println(description.length());
+ }
return description;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java 2012-08-16 00:16:55 UTC (rev 43059)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java 2012-08-16 00:17:47 UTC (rev 43060)
@@ -11,8 +11,6 @@
package org.jboss.tools.cdi.ui.marker;
import java.text.MessageFormat;
-import java.util.Iterator;
-import java.util.Set;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IBuffer;
@@ -92,10 +90,7 @@
}
private IAnnotation getScopeAnnotation(){
- Set<IScopeDeclaration> scopDeclarations = bean.getScopeDeclarations();
- Iterator<IScopeDeclaration> iter = scopDeclarations.iterator();
- while(iter.hasNext()){
- IScopeDeclaration declaration = iter.next();
+ for(IScopeDeclaration declaration: bean.getScopeDeclarations()) {
if(declaration.getJavaAnnotation() != null) {
return declaration.getJavaAnnotation();
}
@@ -104,10 +99,7 @@
}
private String getFullyQualifiedName(){
- Set<IScopeDeclaration> scopDeclarations = bean.getScopeDeclarations();
- Iterator<IScopeDeclaration> iter = scopDeclarations.iterator();
- while(iter.hasNext()){
- IScopeDeclaration declaration = iter.next();
+ for(IScopeDeclaration declaration: bean.getScopeDeclarations()) {
return declaration.getScope().getSourceType().getFullyQualifiedName();
}
return null;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java 2012-08-16 00:16:55 UTC (rev 43059)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java 2012-08-16 00:17:47 UTC (rev 43060)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.ui.refactoring;
+import java.util.Collection;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -103,7 +104,7 @@
if(cdiProject == null)
return null;
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdiProject.getBeans(file.getFullPath());
for(IBean bean : beans){
if(bean.getName() != null){
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/CDIBeanQueryParticipant.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/CDIBeanQueryParticipant.java 2012-08-16 00:16:55 UTC (rev 43059)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/CDIBeanQueryParticipant.java 2012-08-16 00:17:47 UTC (rev 43060)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.ui.search;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@@ -78,12 +79,11 @@
}
private void searchInProject(ISearchRequestor requestor, QuerySpecification querySpecification, ICDIProject cdiProject, IProgressMonitor monitor, IJavaElement element){
- Set<IBean> sourceBeans = cdiProject.getBeans(element);
+ Collection<IBean> sourceBeans = cdiProject.getBeans(element);
Set<IInjectionPoint> injectionPoints = new HashSet<IInjectionPoint>();
for (IBean b: sourceBeans) {
- Set<IParametedType> ts = b.getLegalTypes();
- for (IParametedType t: ts) {
+ for (IParametedType t: b.getLegalTypes()) {
injectionPoints.addAll(cdiProject.getInjections(t.getType().getFullyQualifiedName()));
}
}
@@ -93,7 +93,7 @@
for(IInjectionPoint injectionPoint : injectionPoints){
if(monitor.isCanceled())
break;
- Set<IBean> resultBeans = cdiProject.getBeans(false, injectionPoint);
+ Collection<IBean> resultBeans = cdiProject.getBeans(false, injectionPoint);
monitor.worked(1);
for(IBean cBean : resultBeans){
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2012-08-16 00:16:55 UTC (rev 43059)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2012-08-16 00:17:47 UTC (rev 43060)
@@ -11,6 +11,7 @@
package org.jboss.tools.cdi.ui.search;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -94,12 +95,11 @@
if(cdiProject == null)
return;
- Set<IBean> beans = cdiProject.getBeans(element.getPath());
+ Collection<IBean> beans = cdiProject.getBeans(element.getPath());
IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element, 0);
if(injectionPoint != null){
- Set<IBean> resultBeanSet = cdiProject.getBeans(false, injectionPoint);
- List<IBean> resultBeanList = CDIUtil.sortBeans(resultBeanSet);
+ List<IBean> resultBeanList = CDIUtil.sortBeans(cdiProject.getBeans(false, injectionPoint));
for(IBean bean : resultBeanList){
if(bean != null && containsInSearchScope(querySpecification, bean)){
CDIMatch match = new CDIMatch(bean);
@@ -123,8 +123,7 @@
private void resolveObserverMethods(ICDIProject cdiProject, IInjectionPoint injectionPoint, ISearchRequestor requestor,
QuerySpecification querySpecification){
- Set<IObserverMethod> observerMethods = cdiProject.resolveObserverMethods(injectionPoint);
- for(IObserverMethod observerMethod : observerMethods){
+ for(IObserverMethod observerMethod : cdiProject.resolveObserverMethods(injectionPoint)){
if(containsInSearchScope(querySpecification, observerMethod)){
// match observer method
CDIMatch match = new CDIMatch(observerMethod);
@@ -138,8 +137,7 @@
private void findObservedEvents(ICDIProject cdiProject, IParameter param, ISearchRequestor requestor,
QuerySpecification querySpecification){
- Set<IInjectionPoint> events = cdiProject.findObservedEvents(param);
- for(IInjectionPoint event : events){
+ for(IInjectionPoint event : cdiProject.findObservedEvents(param)){
if(containsInSearchScope(querySpecification, event)){
// match event
CDIMatch match = new CDIMatch(event);
@@ -151,14 +149,13 @@
}
}
- private IParameter findObserverParameter(Set<IBean> beans, IMethod method) throws JavaModelException {
+ private IParameter findObserverParameter(Collection<IBean> beans, IMethod method) throws JavaModelException {
for (IBean bean: beans) {
if(bean instanceof IClassBean) {
- Set<IObserverMethod> observers = ((IClassBean)bean).getObserverMethods();
- for (IObserverMethod bm: observers) {
+ for (IObserverMethod bm: ((IClassBean)bean).getObserverMethods()) {
if(bm.getMethod().equals(method)){
IObserverMethod obs = (IObserverMethod)bm;
- Set<IParameter> ps = obs.getObservedParameters();
+ Collection<IParameter> ps = obs.getObservedParameters();
if(!ps.isEmpty()) {
return ps.iterator().next();
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanWizardPage.java 2012-08-16 00:16:55 UTC (rev 43059)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanWizardPage.java 2012-08-16 00:17:47 UTC (rev 43060)
@@ -293,9 +293,7 @@
IJavaProject jp = root.getJavaProject();
ICDIProject cdi = NewCDIAnnotationWizardPage.getCDIProject(jp);
if(cdi != null) {
- Set<String> scopes = cdi.getScopeNames();
- String[] tags = scopes.toArray(new String[0]);
- setScopes(tags);
+ setScopes(cdi.getScopeNames().toArray(new String[0]));
} else {
setScopes(new String[]{""});
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java 2012-08-16 00:16:55 UTC (rev 43059)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java 2012-08-16 00:17:47 UTC (rev 43060)
@@ -35,7 +35,6 @@
import org.jboss.tools.cdi.internal.core.validation.AnnotationValidationDelegate;
import org.jboss.tools.cdi.ui.CDIUIMessages;
import org.jboss.tools.cdi.ui.CDIUIPlugin;
-import org.jboss.tools.cdi.ui.wizard.NewBeanWizardPage.CheckBoxEditorWrapper;
import org.jboss.tools.common.java.IAnnotationDeclaration;
import org.jboss.tools.common.ui.widget.editor.ITaggedFieldEditor;
import org.jboss.tools.common.ui.widget.editor.ListFieldEditor;
@@ -234,9 +233,7 @@
IJavaProject jp = root.getJavaProject();
ICDIProject cdi = getCDIProject(jp);
if(cdi != null) {
- Set<String> scopes = cdi.getScopeNames();
- String[] tags = scopes.toArray(new String[0]);
- setScopes(tags);
+ setScopes(cdi.getScopeNames().toArray(new String[0]));
} else {
setScopes(new String[]{""});
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/OpenCDINamedBeanDialog.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/OpenCDINamedBeanDialog.java 2012-08-16 00:16:55 UTC (rev 43059)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/OpenCDINamedBeanDialog.java 2012-08-16 00:17:47 UTC (rev 43060)
@@ -14,6 +14,7 @@
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
+import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@@ -190,8 +191,7 @@
ICDIProject cdiProject = CDICorePlugin.getCDIProject(project, true);
if (cdiProject != null) {
- Set<IBean> iter = cdiProject.getNamedBeans(false);
- for (IBean bean: iter) {
+ for (IBean bean: cdiProject.getNamedBeans(false)) {
if (cdiProject == bean.getDeclaringProject()) {
contentProvider.add(new CDINamedBeanWrapper(bean
.getName(), project.getName(), bean),
@@ -291,7 +291,7 @@
}
String beanName = beanWrapper.getBeanName();
- Set<IBean> beans = cdiProject
+ Collection<IBean> beans = cdiProject
.getBeans(beanName, true);
IBean bean = (beans == null || beans.isEmpty() ? null : beans.iterator().next());
return (bean != null);
@@ -457,7 +457,7 @@
ICDIProject cdiProject = CDICorePlugin.getCDIProject(
project, true);
if (cdiProject != null) {
- Set<IBean> beans = cdiProject
+ Collection<IBean> beans = cdiProject
.getBeans(beanName, true);
if (!beans.isEmpty())
return beans.iterator().next();
@@ -518,7 +518,7 @@
mem.putString(DELETED, YES);
continue;
}
- Set<IBean> beans = cdiProject
+ Collection<IBean> beans = cdiProject
.getBeans(beanName, true);
IBean bean = (beans == null || beans.isEmpty() ? null : beans.iterator().next());
if (bean == null)
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2012-08-16 00:16:55 UTC (rev 43059)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2012-08-16 00:17:47 UTC (rev 43060)
@@ -15,7 +15,6 @@
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
-import java.util.Iterator;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.OperationCanceledException;
@@ -609,16 +608,13 @@
}
protected void moveAll(ValuedQualifier[] mods, boolean add2) {
- int size = mods.length;
ArrayList<ValuedQualifier> list = new ArrayList<ValuedQualifier>();
- for (int i = 0; i < size; i++) {
- if (!contains(list, mods[i]))
- list.add(mods[i]);
+ for (ValuedQualifier qualifier: mods) {
+ if (!contains(list, qualifier))
+ list.add(qualifier);
}
- Iterator<ValuedQualifier> iterator = list.iterator();
- while (iterator.hasNext()) {
- ValuedQualifier qualifier = iterator.next();
+ for (ValuedQualifier qualifier: list) {
if (add2) {
qualifiers.remove(qualifier);
deployed.add(qualifier);
@@ -653,9 +649,7 @@
public ArrayList<ValuedQualifier> getQualifiersToRemove() {
ArrayList<ValuedQualifier> list = new ArrayList<ValuedQualifier>();
- Iterator<ValuedQualifier> iterator = originalQualifiers.iterator();
- while (iterator.hasNext()) {
- ValuedQualifier qualifier = iterator.next();
+ for (ValuedQualifier qualifier: originalQualifiers) {
if (!contains(deployed, qualifier))
list.add(qualifier);
}
@@ -664,9 +658,7 @@
public ArrayList<ValuedQualifier> getQualifiersToAdd() {
ArrayList<ValuedQualifier> list = new ArrayList<ValuedQualifier>();
- Iterator<ValuedQualifier> iterator = deployed.iterator();
- while (iterator.hasNext()) {
- ValuedQualifier qualifier = iterator.next();
+ for (ValuedQualifier qualifier: deployed) {
if (!contains(originalQualifiers, qualifier))
list.add(qualifier);
}
12 years, 5 months
JBoss Tools SVN: r43059 - trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-15 20:16:55 -0400 (Wed, 15 Aug 2012)
New Revision: 43059
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Replaced Set by Collection in interfaces.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java 2012-08-16 00:16:18 UTC (rev 43058)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java 2012-08-16 00:16:55 UTC (rev 43059)
@@ -11,8 +11,8 @@
package org.jboss.tools.cdi.text.ext.test;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
-import java.util.Set;
import junit.framework.TestCase;
@@ -525,7 +525,7 @@
return null;
}
- protected ICDIElement findCDIElement(Set<? extends ICDIElement> elements, String elementPath){
+ protected ICDIElement findCDIElement(Collection<? extends ICDIElement> elements, String elementPath){
for(ICDIElement element : elements){
if(elementPath.equals(element.getSourcePath().toString()))
return element;
12 years, 5 months