JBoss Tools SVN: r43089 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-08-17 06:26:57 -0400 (Fri, 17 Aug 2012)
New Revision: 43089
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/JenkinsSuite.java
Log:
Edit mapping file test added into Jenkins suite
Modified: 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 2012-08-17 09:42:41 UTC (rev 43088)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/JenkinsSuite.java 2012-08-17 10:26:57 UTC (rev 43089)
@@ -2,6 +2,7 @@
import org.jboss.tools.hb.ui.bot.test.configuration.CreateConfigurationFileTest;
import org.jboss.tools.hb.ui.bot.test.mappingfile.CreateMappingFileTest;
+import org.jboss.tools.hb.ui.bot.test.mappingfile.EditMappingFileTest;
import org.jboss.tools.hb.ui.bot.test.perspective.PerspectiveTest;
import org.jboss.tools.hb.ui.bot.test.reveng.CreateRevengFileTest;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
@@ -18,9 +19,10 @@
@SuiteClasses({
PerspectiveTest.class,
CreateConfigurationFileTest.class,
- // EditConfigurationFileTest.class - Multipage editor must be fixed
+ // EditConfigurationFileTest.class - Multipage editor must be fixed for Juno
CreateRevengFileTest.class,
- CreateMappingFileTest.class
+ CreateMappingFileTest.class,
+ EditMappingFileTest.class
})
public class JenkinsSuite {
12 years, 4 months
JBoss Tools SVN: r43088 - in trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test: src/org/jboss/tools/hb/ui/bot/suite and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-08-17 05:42:41 -0400 (Fri, 17 Aug 2012)
New Revision: 43088
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/pom.xml
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/test/mappingfile/CreateMappingFileTest.java
Log:
Test added into Jenkins suite, dependencies added and minor fix done
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-17 09:17:14 UTC (rev 43087)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/pom.xml 2012-08-17 09:42:41 UTC (rev 43088)
@@ -33,6 +33,11 @@
<artifactId>org.eclipse.datatools.enablement.hsqldb.feature.feature.group</artifactId>
<version>0.0.0</version>
</dependency>
+ <dependency>
+ <type>p2-installable-unit</type>
+ <artifactId>org.hibernate.eclipse.feature.feature.group</artifactId>
+ <version>0.0.0</version>
+ </dependency>
<!--
<dependency>
<type>p2-installable-unit</type>
@@ -48,8 +53,7 @@
<profile>
<id>mvn-debug</id>
<properties>
- <systemProperties>-Xdebug
- -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y</systemProperties>
+ <systemProperties>-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y</systemProperties>
</properties>
</profile>
<profile>
Modified: 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 2012-08-17 09:17:14 UTC (rev 43087)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/JenkinsSuite.java 2012-08-17 09:42:41 UTC (rev 43088)
@@ -1,6 +1,7 @@
package org.jboss.tools.hb.ui.bot.suite;
import org.jboss.tools.hb.ui.bot.test.configuration.CreateConfigurationFileTest;
+import org.jboss.tools.hb.ui.bot.test.mappingfile.CreateMappingFileTest;
import org.jboss.tools.hb.ui.bot.test.perspective.PerspectiveTest;
import org.jboss.tools.hb.ui.bot.test.reveng.CreateRevengFileTest;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
@@ -17,8 +18,9 @@
@SuiteClasses({
PerspectiveTest.class,
CreateConfigurationFileTest.class,
- //EditConfigurationFileTest.class - Multipage editor must be fixed
- CreateRevengFileTest.class
+ // EditConfigurationFileTest.class - Multipage editor must be fixed
+ CreateRevengFileTest.class,
+ CreateMappingFileTest.class
})
public class JenkinsSuite {
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/mappingfile/CreateMappingFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/mappingfile/CreateMappingFileTest.java 2012-08-17 09:17:14 UTC (rev 43087)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/mappingfile/CreateMappingFileTest.java 2012-08-17 09:42:41 UTC (rev 43088)
@@ -19,7 +19,7 @@
* @author jpeterka
*
*/
-@Require(clearProjects = false)
+@Require(clearProjects = true)
public class CreateMappingFileTest extends HibernateBaseTest {
final String prj = "hibernate35";
12 years, 4 months
JBoss Tools SVN: r43087 - branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-08-17 05:17:14 -0400 (Fri, 17 Aug 2012)
New Revision: 43087
Modified:
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java
Log:
JBIDE-11990 to maintenance
Modified: branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java
===================================================================
--- branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java 2012-08-17 09:15:53 UTC (rev 43086)
+++ branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java 2012-08-17 09:17:14 UTC (rev 43087)
@@ -14,10 +14,13 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.internal.AbstractJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.util.PollThreadUtils;
+import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
public abstract class AbstractRSEBehaviourDelegate extends AbstractJBossBehaviourDelegate {
@@ -47,9 +50,27 @@
} // else wait for the poller to set the proper state
}
+ private String pid;
+ public void setPid(String pid) {
+ this.pid = pid;
+ }
+
@Override
- protected void forceStop() {
+ protected synchronized void forceStop() {
+ if( getServer().getServerState() == IServer.STATE_STOPPED)
+ return;
+ String localPid = pid;
+ pid = null;
setServerStopped();
+ if( localPid != null ) {
+ try {
+ ServerShellModel model = RSEHostShellModel.getInstance().getModel(getServer());
+ String cmd = "kill -9 " + localPid;
+ model.executeRemoteCommand("/", cmd, new String[]{}, new NullProgressMonitor(), 2000, true);
+ } catch(CoreException ce ) {
+ RSECorePlugin.getLog().log(new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, "Unable to terminate remote process " + pid, ce));
+ }
+ }
}
protected abstract String getShutdownCommand(IServer server) throws CoreException;
@@ -63,5 +84,10 @@
public void onServerStopping() {
pollServer(IServerStatePoller.SERVER_DOWN);
}
+ @Override
+ protected void setServerStopped() {
+ super.setServerStopped();
+ pid = null;
+ }
}
Modified: branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java
===================================================================
--- branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java 2012-08-17 09:15:53 UTC (rev 43086)
+++ branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java 2012-08-17 09:17:14 UTC (rev 43087)
@@ -23,6 +23,7 @@
import org.eclipse.rse.services.shells.IHostShell;
import org.eclipse.rse.services.shells.IHostShellChangeEvent;
import org.eclipse.rse.services.shells.IHostShellOutputListener;
+import org.jboss.ide.eclipse.as.core.server.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
@@ -33,12 +34,16 @@
public abstract class AbstractRSELaunchDelegate extends AbstractJBossStartLaunchConfiguration
implements IJBossLaunchDelegate {
+ public static final String DELIMETER = ":";
+ public static final String ECHO_KEY_DISCOVER_PID = "JBTOOLS_SERVER_START_CMD";
protected void executeRemoteCommand(String command, DelegatingServerBehavior behavior)
throws CoreException {
try {
ServerShellModel model = RSEHostShellModel.getInstance().getModel(behavior.getServer());
IHostShell shell = model.createStartupShell("/", command, new String[] {}, new NullProgressMonitor());
- addShellOutputListener(shell);
+ addShellOutputListener(shell, behavior);
+ String getPidCommand = "echo \"" + ECHO_KEY_DISCOVER_PID + DELIMETER + behavior.getServer().getId() + DELIMETER + "\"$!";
+ shell.writeToShell(getPidCommand);
} catch (SystemMessageException sme) {
// could not connect to remote system
behavior.setServerStopped();
@@ -47,8 +52,8 @@
MessageFormat.format("Could not execute command on remote server {0}. Please ensure the server is reachable.", behavior.getServer().getName()), sme));
}
}
- // Only for debugging
- private void addShellOutputListener(IHostShell shell) {
+
+ private void addShellOutputListener(final IHostShell shell, final DelegatingServerBehavior behavior) {
if( shell == null )
return; // No listener needed for a null shell.
IHostShellOutputListener listener = null;
@@ -56,12 +61,19 @@
public void shellOutputChanged(IHostShellChangeEvent event) {
IHostOutput[] out = event.getLines();
for (int i = 0; i < out.length; i++) {
- // TODO listen here for obvious exceptions or failures
- // System.out.println(out[i]);
+ if( out[i].toString().startsWith(ECHO_KEY_DISCOVER_PID)) {
+ // pid found
+ int lastColon = out[i].toString().lastIndexOf(DELIMETER);
+ String pid = out[i].toString().substring(lastColon+1);
+ IJBossBehaviourDelegate del = behavior.getDelegate();
+ if( del instanceof AbstractRSEBehaviourDelegate) {
+ ((AbstractRSEBehaviourDelegate)del).setPid(pid);
+ }
+ }
}
}
};
- // shell.addOutputListener(listener);
+ shell.addOutputListener(listener);
}
protected void launchPingThread(DeployableServerBehavior beh) {
Modified: branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java
===================================================================
--- branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java 2012-08-17 09:15:53 UTC (rev 43086)
+++ branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java 2012-08-17 09:17:14 UTC (rev 43087)
@@ -192,7 +192,7 @@
if( !done[0]) {
statusLine[0] = statusLine[1];
statusLine[1] = lines[i].getString();
- System.out.println(lines[i].getString());
+ System.out.println("RSEHostShellModel debug out: " + lines[i].getString());
}
if( serverId.equals(statusLine[1]))
@@ -210,6 +210,7 @@
singleUseShell = null;
}
String s = statusLine[0];
+ done[0] = true; // ensure a cleanup
if( s != null ) {
try {
Integer i = Integer.parseInt(s);
12 years, 4 months
JBoss Tools SVN: r43086 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-08-17 05:15:53 -0400 (Fri, 17 Aug 2012)
New Revision: 43086
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java
Log:
JBIDE-11990 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java 2012-08-17 08:26:50 UTC (rev 43085)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java 2012-08-17 09:15:53 UTC (rev 43086)
@@ -14,10 +14,13 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.internal.AbstractJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.util.PollThreadUtils;
+import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
public abstract class AbstractRSEBehaviourDelegate extends AbstractJBossBehaviourDelegate {
@@ -47,9 +50,27 @@
} // else wait for the poller to set the proper state
}
+ private String pid;
+ public void setPid(String pid) {
+ this.pid = pid;
+ }
+
@Override
- protected void forceStop() {
+ protected synchronized void forceStop() {
+ if( getServer().getServerState() == IServer.STATE_STOPPED)
+ return;
+ String localPid = pid;
+ pid = null;
setServerStopped();
+ if( localPid != null ) {
+ try {
+ ServerShellModel model = RSEHostShellModel.getInstance().getModel(getServer());
+ String cmd = "kill -9 " + localPid;
+ model.executeRemoteCommand("/", cmd, new String[]{}, new NullProgressMonitor(), 2000, true);
+ } catch(CoreException ce ) {
+ RSECorePlugin.getLog().log(new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, "Unable to terminate remote process " + pid, ce));
+ }
+ }
}
protected abstract String getShutdownCommand(IServer server) throws CoreException;
@@ -63,5 +84,10 @@
public void onServerStopping() {
pollServer(IServerStatePoller.SERVER_DOWN);
}
+ @Override
+ protected void setServerStopped() {
+ super.setServerStopped();
+ pid = null;
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java 2012-08-17 08:26:50 UTC (rev 43085)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java 2012-08-17 09:15:53 UTC (rev 43086)
@@ -23,6 +23,7 @@
import org.eclipse.rse.services.shells.IHostShell;
import org.eclipse.rse.services.shells.IHostShellChangeEvent;
import org.eclipse.rse.services.shells.IHostShellOutputListener;
+import org.jboss.ide.eclipse.as.core.server.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
@@ -33,12 +34,16 @@
public abstract class AbstractRSELaunchDelegate extends AbstractJBossStartLaunchConfiguration
implements IJBossLaunchDelegate {
+ public static final String DELIMETER = ":";
+ public static final String ECHO_KEY_DISCOVER_PID = "JBTOOLS_SERVER_START_CMD";
protected void executeRemoteCommand(String command, DelegatingServerBehavior behavior)
throws CoreException {
try {
ServerShellModel model = RSEHostShellModel.getInstance().getModel(behavior.getServer());
IHostShell shell = model.createStartupShell("/", command, new String[] {}, new NullProgressMonitor());
- addShellOutputListener(shell);
+ addShellOutputListener(shell, behavior);
+ String getPidCommand = "echo \"" + ECHO_KEY_DISCOVER_PID + DELIMETER + behavior.getServer().getId() + DELIMETER + "\"$!";
+ shell.writeToShell(getPidCommand);
} catch (SystemMessageException sme) {
// could not connect to remote system
behavior.setServerStopped();
@@ -47,8 +52,8 @@
MessageFormat.format("Could not execute command on remote server {0}. Please ensure the server is reachable.", behavior.getServer().getName()), sme));
}
}
- // Only for debugging
- private void addShellOutputListener(IHostShell shell) {
+
+ private void addShellOutputListener(final IHostShell shell, final DelegatingServerBehavior behavior) {
if( shell == null )
return; // No listener needed for a null shell.
IHostShellOutputListener listener = null;
@@ -56,12 +61,19 @@
public void shellOutputChanged(IHostShellChangeEvent event) {
IHostOutput[] out = event.getLines();
for (int i = 0; i < out.length; i++) {
- // TODO listen here for obvious exceptions or failures
- // System.out.println(out[i]);
+ if( out[i].toString().startsWith(ECHO_KEY_DISCOVER_PID)) {
+ // pid found
+ int lastColon = out[i].toString().lastIndexOf(DELIMETER);
+ String pid = out[i].toString().substring(lastColon+1);
+ IJBossBehaviourDelegate del = behavior.getDelegate();
+ if( del instanceof AbstractRSEBehaviourDelegate) {
+ ((AbstractRSEBehaviourDelegate)del).setPid(pid);
+ }
+ }
}
}
};
- // shell.addOutputListener(listener);
+ shell.addOutputListener(listener);
}
protected void launchPingThread(DeployableServerBehavior beh) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java 2012-08-17 08:26:50 UTC (rev 43085)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java 2012-08-17 09:15:53 UTC (rev 43086)
@@ -192,7 +192,7 @@
if( !done[0]) {
statusLine[0] = statusLine[1];
statusLine[1] = lines[i].getString();
- System.out.println(lines[i].getString());
+ System.out.println("RSEHostShellModel debug out: " + lines[i].getString());
}
if( serverId.equals(statusLine[1]))
@@ -210,6 +210,7 @@
singleUseShell = null;
}
String s = statusLine[0];
+ done[0] = true; // ensure a cleanup
if( s != null ) {
try {
Integer i = Integer.parseInt(s);
12 years, 4 months
JBoss Tools SVN: r43085 - in branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot: task/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-17 04:26:50 -0400 (Fri, 17 Aug 2012)
New Revision: 43085
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
Log:
Added logs.
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java 2012-08-17 07:44:54 UTC (rev 43084)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java 2012-08-17 08:26:50 UTC (rev 43085)
@@ -2,7 +2,9 @@
import static org.eclipse.swtbot.swt.finder.waits.Conditions.widgetIsEnabled;
+import org.apache.log4j.Logger;
import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
@@ -16,6 +18,8 @@
*/
public class OpenPerspectiveTask extends AbstractSWTTask {
+ private static final Logger log = Logger.getLogger(OpenPerspectiveTask.class);
+
private IPerspective perspective;
public OpenPerspectiveTask(IPerspective name) {
@@ -25,7 +29,19 @@
@Override
public void perform() {
+ log.info("Opening wizard");
+ log.info("All shells: ");
+ for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
+ log.info(shell.getText() + ": " + shell);
+ log.info("Is active: " + shell.isActive());
+ }
getBot().waitUntil(widgetIsEnabled(getBot().menu("Window")), TaskDuration.NORMAL.getTimeout());
+ log.info("Opening wizard");
+ log.info("All shells: ");
+ for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
+ log.info(shell.getText() + ": " + shell);
+ log.info("Is active: " + shell.isActive());
+ }
SWTBotFactory.getOpen().perspective(perspective);
}
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java 2012-08-17 07:44:54 UTC (rev 43084)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java 2012-08-17 08:26:50 UTC (rev 43085)
@@ -41,6 +41,7 @@
log.info("All shells: ");
for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
log.info(shell.getText() + ": " + shell);
+ log.info("Is active: " + shell.isActive());
}
new SWTBotNewObjectWizard().open(name, getGroupPath());
}
12 years, 4 months
JBoss Tools SVN: r43084 - branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-17 03:44:54 -0400 (Fri, 17 Aug 2012)
New Revision: 43084
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java
Log:
Added wait for enabled menu item
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java 2012-08-17 07:44:34 UTC (rev 43083)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java 2012-08-17 07:44:54 UTC (rev 43084)
@@ -1,7 +1,11 @@
package org.jboss.tools.portlet.ui.bot.matcher.perspective;
+import static org.eclipse.swtbot.swt.finder.waits.Conditions.widgetIsEnabled;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
import org.jboss.tools.ui.bot.ext.gen.IPerspective;
/**
@@ -21,6 +25,12 @@
@Override
public void perform() {
+ getBot().waitUntil(widgetIsEnabled(getBot().menu("Window")), TaskDuration.NORMAL.getTimeout());
SWTBotFactory.getOpen().perspective(perspective);
}
+
+ @Override
+ public SWTBot getBot() {
+ return SWTBotFactory.getBot();
+ }
}
12 years, 4 months
JBoss Tools SVN: r43083 - branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-17 03:44:34 -0400 (Fri, 17 Aug 2012)
New Revision: 43083
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
Log:
Added logs.
Modified: branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
===================================================================
--- branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java 2012-08-17 07:32:41 UTC (rev 43082)
+++ branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java 2012-08-17 07:44:34 UTC (rev 43083)
@@ -1,6 +1,9 @@
package org.jboss.tools.portlet.ui.bot.task.wizard;
+import org.apache.log4j.Logger;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
import org.jboss.tools.ui.bot.ext.wizards.SWTBotNewObjectWizard;
/**
@@ -10,6 +13,8 @@
*
*/
public class WizardOpeningTask extends AbstractSWTTask {
+
+ private static final Logger log = Logger.getLogger(WizardOpeningTask.class);
private String category;
@@ -32,6 +37,11 @@
@Override
public void perform() {
+ log.info("Opening wizard");
+ log.info("All shells: ");
+ for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
+ log.info(shell.getText() + ": " + shell);
+ }
new SWTBotNewObjectWizard().open(name, getGroupPath());
}
12 years, 4 months
JBoss Tools SVN: r43082 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-08-17 03:32:41 -0400 (Fri, 17 Aug 2012)
New Revision: 43082
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/JenkinsSuite.java
Log:
Test added into hb ui bot jenkins suite
Modified: 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 2012-08-17 01:12:11 UTC (rev 43081)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/JenkinsSuite.java 2012-08-17 07:32:41 UTC (rev 43082)
@@ -2,6 +2,7 @@
import org.jboss.tools.hb.ui.bot.test.configuration.CreateConfigurationFileTest;
import org.jboss.tools.hb.ui.bot.test.perspective.PerspectiveTest;
+import org.jboss.tools.hb.ui.bot.test.reveng.CreateRevengFileTest;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@@ -15,7 +16,9 @@
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({
PerspectiveTest.class,
- CreateConfigurationFileTest.class
+ CreateConfigurationFileTest.class,
+ //EditConfigurationFileTest.class - Multipage editor must be fixed
+ CreateRevengFileTest.class
})
public class JenkinsSuite {
12 years, 4 months
JBoss Tools SVN: r43081 - in trunk: cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-08-16 21:12:11 -0400 (Thu, 16 Aug 2012)
New Revision: 43081
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTSuppressWarningsTests.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java
trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10611 As-you-type CDI validation
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-08-16 23:40:33 UTC (rev 43080)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-08-17 01:12:11 UTC (rev 43081)
@@ -57,6 +57,7 @@
import org.jboss.tools.cdi.core.test.tck.validation.AYTAnnotationValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.AYTDefenitionErrorsValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.AYTDeploymentProblemsValidationTests;
+import org.jboss.tools.cdi.core.test.tck.validation.AYTSuppressWarningsTests;
import org.jboss.tools.cdi.core.test.tck.validation.AnnotationsValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.BeansXmlValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.BuilderOrderValidationTest;
@@ -139,9 +140,7 @@
suite.addTestSuite(AYTDeploymentProblemsValidationTests.class);
// suite.addTestSuite(BeansXmlValidationTest.class);
suite.addTestSuite(AYTAnnotationValidationTest.class);
-// suite.addTestSuite(CoreValidationTest.class);
-// suite.addTestSuite(ELValidationTest.class);
-// suite.addTestSuite(SuppressWarningsTests.class);
+ suite.addTestSuite(AYTSuppressWarningsTests.class);
// Refactoring test
suite.addTestSuite(NamedBeanRefactoringTest.class);
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTSuppressWarningsTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTSuppressWarningsTests.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTSuppressWarningsTests.java 2012-08-17 01:12:11 UTC (rev 43081)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.test.tck.validation;
+
+import org.jboss.tools.tests.IAnnotationTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class AYTSuppressWarningsTests extends SuppressWarningsTests {
+
+ private CDIAnnotationTest annotationTest = new CDIAnnotationTest();
+
+ @Override
+ protected IAnnotationTest getAnnotationTest() {
+ return annotationTest;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTSuppressWarningsTests.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELValidationTest.java 2012-08-16 23:40:33 UTC (rev 43080)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELValidationTest.java 2012-08-17 01:12:11 UTC (rev 43081)
@@ -32,22 +32,22 @@
AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
file = tckProject.getFile("WebContent/elValidation.xhtml");
AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 9);
-
+
IFile namedBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/NamedBean.java");
IFile newNamedBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/NewNamedBean.validation");
namedBean.setContents(newNamedBean.getContents(), IFile.FORCE, new NullProgressMonitor());
TestUtil.validate(namedBean);
-
+
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/TestBean.java");
AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
file = tckProject.getFile("WebContent/elValidation.xhtml");
AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 9);
-
+
newNamedBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/NamedBean.java");
namedBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/NamedBean.validation");
newNamedBean.setContents(namedBean.getContents(), IFile.FORCE, new NullProgressMonitor());
TestUtil.validate(newNamedBean);
-
+
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/TestBean.java");
AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
file = tckProject.getFile("WebContent/elValidation.xhtml");
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java 2012-08-16 23:40:33 UTC (rev 43080)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java 2012-08-17 01:12:11 UTC (rev 43081)
@@ -22,7 +22,6 @@
import org.jboss.tools.common.base.test.validation.TestUtil;
import org.jboss.tools.jst.web.kb.internal.validation.ELValidationMessages;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
* @author Alexey Kazakov
@@ -36,72 +35,74 @@
((IPersistentPreferenceStore)store).save();
}
- private void restorePreferences(String preference) throws Exception{
+ private void restorePreferences(String preference, IFile file) throws Exception{
IPreferenceStore store = CDICorePlugin.getDefault().getPreferenceStore();
store.putValue(preference, CDIPreferences.ERROR);
((IPersistentPreferenceStore)store).save();
+ TestUtil.validate(file);
}
private void modifyPreferences() throws Exception{
modifyPreferences(CDIPreferences.PRODUCER_ANNOTATED_INJECT);
}
- private void restorePreferences() throws Exception{
- restorePreferences(CDIPreferences.PRODUCER_ANNOTATED_INJECT);
+ private void restorePreferences(IFile file) throws Exception{
+ restorePreferences(CDIPreferences.PRODUCER_ANNOTATED_INJECT, file);
}
public void testWOSuppress() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 20, 24, 28, 31, 39, 42, 45);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 20, 24, 28, 31, 39, 42, 45);
}
public void testClass() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 8);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 8);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 7, 12, 38);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 7, 12, 38);
}
public void testFieldWithSuppressInParentElement() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 13);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 13);
}
public void testField() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
+ IFile file2 = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
try {
modifyPreferences();
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
TestUtil.validate(file);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 17);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 19);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 17);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 19);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 15, 17, 23);
+ getAnnotationTest().assertAnnotationIsCreated(file2, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 15, 17, 23);
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
} finally {
- restorePreferences();
+ restorePreferences(file);
+ restorePreferences(file2);
}
}
public void testParam() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 22);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 31);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 22);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 31);
}
public void testMultipleSuppress() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
try {
modifyPreferences();
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
TestUtil.validate(file);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 27);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 26);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 27);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 26);
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
} finally {
- restorePreferences();
+ restorePreferences(file);
}
}
@@ -109,19 +110,19 @@
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
TestUtil.validate(file);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 27);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 17, 19, 26);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 27);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 17, 19, 26);
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
}
public void testNameAll() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 35);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 35);
}
public void testGroupName() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 49);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 49);
}
/**
@@ -131,20 +132,20 @@
public void testEL() throws Exception {
String message = NLS.bind(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "abc");
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, message, 39);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, message, 39);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, message, 34);
+ getAnnotationTest().assertAnnotationIsCreated(file, message, 34);
}
public void testWarningsOnClassNameRegion() throws Exception {
String message = NLS.bind(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, "Rabbit", "SessionScoped");
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Rabbit.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, message, 9);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, message, 9);
message = NLS.bind(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, "AnotherRabbit", "SessionScoped");
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherRabbit.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, message, 8);
+ getAnnotationTest().assertAnnotationIsCreated(file, message, 8);
}
/**
@@ -154,41 +155,41 @@
* @throws Exception
*/
public void testWarningsOnTyped() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Rabbit.java");
try {
modifyPreferences(CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION);
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Rabbit.java");
TestUtil.validate(file);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 13);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 13);
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
} finally {
- restorePreferences(CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION);
+ restorePreferences(CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION, file);
}
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherRabbit.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 11);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherRabbit.java");
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 11);
}
public void testMultipleSuppressFromElementAndItsParent() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 45);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 44);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 45);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 44);
}
public void testWarningsOnAnnotatedParam() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
try {
modifyPreferences(CDIPreferences.OBSERVER_ANNOTATED_INJECT);
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
TestUtil.validate(file);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 51);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 52);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 51);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 52);
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
} finally {
- restorePreferences(CDIPreferences.OBSERVER_ANNOTATED_INJECT);
+ restorePreferences(CDIPreferences.OBSERVER_ANNOTATED_INJECT, file);
}
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 44, 45);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 44, 45);
}
}
\ No newline at end of file
Modified: trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java 2012-08-16 23:40:33 UTC (rev 43080)
+++ trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java 2012-08-17 01:12:11 UTC (rev 43081)
@@ -78,9 +78,9 @@
}
public void assertAnnotationsEqualToMarkers(final IResource resource) throws CoreException {
- if(validatedResources.contains(resource)) {
- return;
- }
+// if(validatedResources.contains(resource)) {
+// return;
+// }
validatedResources.add(resource);
IMarker[] allMarkers = AbstractResourceMarkerTest.findMarkers(resource, getMarkerType(), ".*", true);
@@ -92,7 +92,15 @@
String mType = marker.getType();
int startInt = marker.getAttribute(IMarker.CHAR_START, -1);
int endInt = marker.getAttribute(IMarker.CHAR_END, -1);
- markersSB.append(++i).append(") message=\"").append(message).append("\"; line=\"").append(line).append("\"; start=\"").append(startInt).append("\"; end=\"").append(endInt).append("\"; type=\"").append(mType).append("\";\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ markersSB
+ .append(++i)
+ .append(") message=\"").append(message)
+ .append("\"; line=\"").append(line)
+ .append("\"; start=\"").append(startInt)
+ .append("\"; end=\"").append(endInt)
+ .append("\"; type=\"").append(mType)
+ .append("\"; sevirity=\"").append(marker.getAttribute(IMarker.SEVERITY))
+ .append(";\r\n");
}
markersSB.append("]"); //$NON-NLS-1$
@@ -187,7 +195,14 @@
int line = message.getLineNumber();
int start = message.getOffset();
int end = start + message.getLength();
- messagesSB.append(++i).append(") message=\"").append(text).append("\"; line=\"").append(line).append("\"; start=\"").append(start).append("\"; end=\"").append(end).append("\"; type=\"").append(mType).append("\";\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ messagesSB.append(++i)
+ .append(") message=\"").append(text)
+ .append("\"; line=\"").append(line)
+ .append("\"; start=\"").append(start)
+ .append("\"; end=\"").append(end)
+ .append("\"; type=\"").append(mType)
+ .append("\"; sevirity=\"").append(message.getSeverity())
+ .append("\";\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
}
messagesSB.append("]"); //$NON-NLS-1$
12 years, 4 months
JBoss Tools SVN: r43080 - in trunk: cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-08-16 19:40:33 -0400 (Thu, 16 Aug 2012)
New Revision: 43080
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTDeploymentProblemsValidationTests.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AnnotationsValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java
trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.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 22:45:09 UTC (rev 43079)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-08-16 23:40:33 UTC (rev 43080)
@@ -728,12 +728,23 @@
*/
Collection<IBean> beans = context.getCdiProject().getBeans(name, true);
if(beans.size()>1 && beans.contains(bean)) {
+ // We need to sort bean element names to make sure we report the same problem message for the same bean name for every validation process.
+ IBean[] sortedBeans = beans.toArray(new IBean[beans.size()]);
+ for (int i = sortedBeans.length - 1; i >= 0; i--) {
+ for (int j = 0; j < i; j++) {
+ if (sortedBeans[j].getElementName().compareTo(sortedBeans[j + 1].getElementName()) > 0) {
+ IBean t = sortedBeans[j];
+ sortedBeans[j] = sortedBeans[j+1];
+ sortedBeans[j+1] = t;
+ }
+ }
+ }
ITextSourceReference reference = bean.getNameLocation(true);
Set<String> names = new HashSet<String>();
String bName = bean.getElementName();
names.add(bName);
StringBuffer sb = new StringBuffer(bName);
- for (IBean iBean : beans) {
+ for (IBean iBean : sortedBeans) {
if(!isAsYouTypeValidation()) {
getValidationContext().addLinkedCoreResource(SHORT_ID, name, iBean.getSourcePath(), true);
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-08-16 22:45:09 UTC (rev 43079)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-08-16 23:40:33 UTC (rev 43080)
@@ -56,6 +56,7 @@
import org.jboss.tools.cdi.core.test.tck.lookup.UnsatisfiedDependencyTest;
import org.jboss.tools.cdi.core.test.tck.validation.AYTAnnotationValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.AYTDefenitionErrorsValidationTest;
+import org.jboss.tools.cdi.core.test.tck.validation.AYTDeploymentProblemsValidationTests;
import org.jboss.tools.cdi.core.test.tck.validation.AnnotationsValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.BeansXmlValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.BuilderOrderValidationTest;
@@ -135,7 +136,7 @@
// As-you-type validation tests
suite.addTestSuite(AYTDefenitionErrorsValidationTest.class);
-// suite.addTestSuite(DeploymentProblemsValidationTests.class);
+ suite.addTestSuite(AYTDeploymentProblemsValidationTests.class);
// suite.addTestSuite(BeansXmlValidationTest.class);
suite.addTestSuite(AYTAnnotationValidationTest.class);
// suite.addTestSuite(CoreValidationTest.class);
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTDeploymentProblemsValidationTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTDeploymentProblemsValidationTests.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTDeploymentProblemsValidationTests.java 2012-08-16 23:40:33 UTC (rev 43080)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.test.tck.validation;
+
+import org.jboss.tools.tests.IAnnotationTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class AYTDeploymentProblemsValidationTests extends DeploymentProblemsValidationTests {
+
+ private CDIAnnotationTest annotationTest = new CDIAnnotationTest();
+
+ @Override
+ protected IAnnotationTest getAnnotationTest() {
+ return annotationTest;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTDeploymentProblemsValidationTests.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AnnotationsValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AnnotationsValidationTest.java 2012-08-16 22:45:09 UTC (rev 43079)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AnnotationsValidationTest.java 2012-08-16 23:40:33 UTC (rev 43080)
@@ -15,8 +15,6 @@
import org.eclipse.core.resources.IFile;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
-import org.jboss.tools.tests.AbstractResourceMarkerTest;
-import org.jboss.tools.tests.IAnnotationTest;
/**
* Wrong targets in CDI annotation types.
@@ -25,12 +23,6 @@
*/
public class AnnotationsValidationTest extends ValidationTest {
- private IAnnotationTest annotationTest = new AbstractResourceMarkerTest();
-
- protected IAnnotationTest getAnnotationTest() {
- return annotationTest;
- }
-
public void testQualifierWithMissingTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/broken/Hairy_MissingTarget.java");
getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 36);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2012-08-16 22:45:09 UTC (rev 43079)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2012-08-16 23:40:33 UTC (rev 43080)
@@ -18,19 +18,12 @@
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
-import org.jboss.tools.tests.IAnnotationTest;
/**
* @author Alexey Kazakov
*/
public class DefenitionErrorsValidationTest extends ValidationTest {
- private IAnnotationTest annotationTest = new AbstractResourceMarkerTest();
-
- protected IAnnotationTest getAnnotationTest() {
- return annotationTest;
- }
-
/**
* 2.2.2. Restricting the bean types of a bean
* - bean class or producer method or field specifies a @Typed annotation,
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2012-08-16 22:45:09 UTC (rev 43079)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2012-08-16 23:40:33 UTC (rev 43080)
@@ -21,7 +21,6 @@
import org.jboss.tools.cdi.core.IInjectionPointField;
import org.jboss.tools.cdi.core.IInjectionPointParameter;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
-import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
* @author Alexey Kazakov
@@ -37,9 +36,9 @@
*/
public void testInconsistentSpecialization() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Maid.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, "Maid, Manager", "Employee"), 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, "Maid, Manager", "Employee"), 21);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Manager.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, "Manager, Maid", "Employee"), 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, "Manager, Maid", "Employee"), 21);
}
/**
@@ -50,15 +49,15 @@
*/
public void testAmbiguousDependency() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Farm_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 25);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 34);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 34);
}
public void testAmbiguousDependencyWithNamed() throws Exception {
String path = "JavaSource/org/jboss/jsr299/tck/tests/jbt/lookup/duplicateName/TestNamed.java";
IFile file = tckProject.getFile(path);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 9, 25, 26);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 9, 25, 26);
IInjectionPointField p = getInjectionPointField(path, "s5");
Collection<IBean> bs = cdiProject.getBeans(false, p);
@@ -88,17 +87,17 @@
*/
public void testUnsatisfiedDependency() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Bean_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 25);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 34);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 34);
}
public void testUnsatisfiedDependencyWithNamed() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/lookup/duplicateName/TestNamed.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 22, 23, 19, 20);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 22, 23, 19, 20);
int[] lines = {10, 11, 13, 14, 16, 17};
for (int i: lines) {
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, i);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, i);
}
}
@@ -110,8 +109,8 @@
*/
public void testAmbiguousDependencyForInstance() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/InjectionInstance.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 8);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 11);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 8);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 11);
}
/**
@@ -122,8 +121,8 @@
*/
public void testUnsatisfiedDependencyForInstance() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/InjectionInstance.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 9);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 9);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
}
/**
@@ -133,9 +132,9 @@
*/
public void testBeansWithDefaultCounstructor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/defaultconstructors/CurrentProject.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 12);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 15);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 12);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 15);
}
/**
@@ -146,13 +145,13 @@
*/
public void testPrimitiveInjectionPointResolvedToNonPrimitiveProducerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GameBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 7, 19);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 9);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 10);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 11);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 20);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 21);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 22);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 7, 19);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 9);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 10);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 11);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 20);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 21);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 22);
}
/**
@@ -165,15 +164,15 @@
*/
public void testInjectionPointWithArrayType() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/InjectionPointBean_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType[]", "ArrayProducer.produce()"), 6);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType", "TestType"), 7);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType[]", "ArrayProducer.produce2()"), 8);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType[]", "ArrayProducer.produce()"), 6);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType", "TestType"), 7);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType[]", "ArrayProducer.produce2()"), 8);
}
public void testNormalBeanWithArrayType() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/ArrayProducer.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE_2, "TestType[]", "ArrayProducer.produce()"), 8);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE_2, "TestType[]", "ArrayProducer.produce2()"), 8);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE_2, "TestType[]", "ArrayProducer.produce()"), 8);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE_2, "TestType[]", "ArrayProducer.produce2()"), 8);
}
/**
@@ -186,18 +185,18 @@
*/
public void testInjectionPointWithUnproxyableTypeWhichResolvesToNormalScopedBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/Number_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "int", "NumberProducer.produce()"), 9);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "long", "NumberProducer.foo"), 13);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "Short", "NumberProducer.foo2"), 17);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "NumberProducer.foo3"), 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "int", "NumberProducer.produce()"), 9);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "long", "NumberProducer.foo"), 13);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "Short", "NumberProducer.foo2"), 17);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "NumberProducer.foo3"), 21);
}
public void testNormalScopedBeanWithUnproxyableType() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/NumberProducer.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE_2, "int", "NumberProducer.produce()"), 9);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE_2, "long", "NumberProducer.foo"), 16);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE_2, "Short", "NumberProducer.foo2"), 21);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE_2, "boolean", "NumberProducer.foo3"), 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE_2, "int", "NumberProducer.produce()"), 9);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE_2, "long", "NumberProducer.foo"), 16);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE_2, "Short", "NumberProducer.foo2"), 21);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE_2, "boolean", "NumberProducer.foo3"), 21);
}
/**
@@ -210,8 +209,8 @@
*/
public void testClassWithPrivateConstructor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, "Unproxyable_Broken", "Unproxyable_Broken"), 23);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC.substring(0, 0), 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, "Unproxyable_Broken", "Unproxyable_Broken"), 23);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC.substring(0, 0), 25);
}
/**
@@ -220,7 +219,7 @@
*/
public void testClassWithDefaultConstructor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/Number_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, "BeanWithDefaultConsturctor", "BeanWithDefaultConsturctor"), 24);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, "BeanWithDefaultConsturctor", "BeanWithDefaultConsturctor"), 24);
}
/**
@@ -233,19 +232,19 @@
*/
public void testInjectionPointWhichResolvesToNormalScopedFinalBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, "Tuna_Broken", "Tuna_Broken"), 24);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE.substring(0, 0) + ".*", 26);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, "Tuna_Broken", "Tuna_Broken"), 24);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE.substring(0, 0) + ".*", 26);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/Opportunity.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, "String", "Opportunity.t"), 26);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, "String", "Opportunity.t"), 26);
}
public void testNormalScopedFinalBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE_2, "Tuna_Broken", "Tuna_Broken"), 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE_2, "Tuna_Broken", "Tuna_Broken"), 21);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/Opportunity.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE_2, "String", "Opportunity.t"), 32);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE_2, "String", "Opportunity.t"), 32);
}
/**
@@ -258,11 +257,11 @@
*/
public void testClassWithFinalMethodCannotBeProxied() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, "Tuna_Broken", "Tuna_Broken"), 23);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM.substring(0, 0) + ".*", 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, "Tuna_Broken", "Tuna_Broken"), 23);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM.substring(0, 0) + ".*", 25);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM_2, "Tuna_Broken", "Tuna_Broken"), 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM_2, "Tuna_Broken", "Tuna_Broken"), 21);
}
@@ -276,14 +275,14 @@
*/
public void testDuplicateNamedBeans() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Cod.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "Cod, Sole"), 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "Cod, Sole"), 21);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Sole.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "Sole, Cod"), 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "Sole, Cod"), 21);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/lookup/duplicateName/TestNamed.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "TestNamed.foo4.*"), 40, 49);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "TestNamed.foo5.*"), 43);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "TestNamed.foo6.*"), 46);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "TestNamed.foo4.*"), 40, 49);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "TestNamed.foo5.*"), 43);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "TestNamed.foo6.*"), 46);
}
/**
@@ -294,7 +293,7 @@
*/
public void testDuplicateBeanNamePrefix() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/ExampleWebsite_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNRESOLVABLE_EL_NAME, "example.com", "com", "example", "Example"), 22);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.UNRESOLVABLE_EL_NAME, "example.com", "com", "example", "Example"), 22);
}
/**
@@ -306,7 +305,7 @@
*/
public void testAppliesToFinalManagedBeanClass() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/finalBeanClass/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, "MockLogger"), 31);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, "MockLogger"), 31);
}
/**
@@ -318,7 +317,7 @@
*/
public void testAppliesToFinalMethodOnManagedBeanClass() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/finalBeanMethod/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, "MockLogger", "log(String string)"), 31);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, "MockLogger", "log(String string)"), 31);
}
/**
@@ -330,6 +329,6 @@
*/
public void testSimpleWebBeanWithNonSerializableImplementationClassFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/context/passivating/broken/nonPassivationCapableManagedBeanHasPassivatingScope/Hamina_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, "Hamina_Broken", "SessionScoped"), 22);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, "Hamina_Broken", "SessionScoped"), 22);
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java 2012-08-16 22:45:09 UTC (rev 43079)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java 2012-08-16 23:40:33 UTC (rev 43080)
@@ -16,12 +16,20 @@
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.common.validation.IValidator;
import org.jboss.tools.common.validation.ValidationContext;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+import org.jboss.tools.tests.IAnnotationTest;
/**
* @author Alexey Kazakov
*/
public class ValidationTest extends TCKTest {
+ private IAnnotationTest annotationTest = new AbstractResourceMarkerTest();
+
+ protected IAnnotationTest getAnnotationTest() {
+ return annotationTest;
+ }
+
protected CDICoreValidator getCDIValidator() {
ValidationContext context = new ValidationContext(tckProject);
List<IValidator> validators = context.getValidators();
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java 2012-08-16 22:45:09 UTC (rev 43079)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java 2012-08-16 23:40:33 UTC (rev 43080)
@@ -40,6 +40,7 @@
import org.eclipse.wst.validation.internal.core.ValidationException;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.jboss.tools.common.CommonPlugin;
import org.jboss.tools.common.util.EclipseUIUtil;
import org.jboss.tools.common.validation.java.TempJavaProblemAnnotation;
@@ -165,12 +166,17 @@
private void validate(Set<? extends IAsYouTypeValidator> validators, Collection<IRegion> dirtyRegions, IValidationContext helper, IReporter reporter) {
count++;
- for (IAsYouTypeValidator validator : validators) {
- IProject rootProject = rootProjects.get(validator);
- IValidatingProjectSet projectBrunch = context.getValidatingProjectTree(validator).getBrunches().get(rootProject);
- if(projectBrunch!=null) {
- validator.validate(this, rootProject, dirtyRegions, helper, reporter, context, projectBrunch.getRootContext(), file);
+ try {
+ for (IAsYouTypeValidator validator : validators) {
+ IProject rootProject = rootProjects.get(validator);
+ IValidatingProjectSet projectBrunch = context.getValidatingProjectTree(validator).getBrunches().get(rootProject);
+ if(projectBrunch!=null) {
+ validator.validate(this, rootProject, dirtyRegions, helper, reporter, context, projectBrunch.getRootContext(), file);
+ }
}
+ } catch(Exception e) {
+ // We need to catch exceptions and wrap them in KBValidationException to let JUnit tests catch validation exceptions reported to eclipse log.
+ CommonPlugin.getDefault().logError(new JBTValidationException(e.getMessage(), e));
}
}
Modified: trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java 2012-08-16 22:45:09 UTC (rev 43079)
+++ trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java 2012-08-16 23:40:33 UTC (rev 43080)
@@ -195,7 +195,8 @@
assertEquals("The number of markers doesn't equal to the number of AYT messages for " + resource + ".\r\nThe full list of the markers and messages:\r\n" + markersSB + "\r\n" + messagesSB, allMarkers.length, messages.size());
for (IMessage message : messages) {
- assertTrue("Can't find message: [text=\"" + message.getText() + "\"; line=\"" + message.getLineNumber() + "\"; start=\"" + message.getOffset() + "\"; end=\"" + message.getOffset() + message.getLength() + "\"; type=\"] for " + resource + ".\r\nThe full list of the markers and messages:\r\n" + markersSB + "\r\n" + messagesSB, contains(allMarkers, message));
+ int end = message.getOffset() + message.getLength();
+ assertTrue("Can't find message: [text=\"" + message.getText() + "\"; line=\"" + message.getLineNumber() + "\"; start=\"" + message.getOffset() + "\"; end=\"" + end + "\"; type=\"] for " + resource + ".\r\nThe full list of the markers and messages:\r\n" + markersSB + "\r\n" + messagesSB, contains(allMarkers, message));
}
} catch (BadLocationException e) {
throw new CoreException(new Status(IStatus.ERROR, BaseTestPlugin.PLUGIN_ID, e.getMessage(), e));
12 years, 4 months