JBoss Tools SVN: r24598 - in trunk/usage/plugins/org.jboss.tools.usage: src/org/jboss/tools/usage/reporting and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-09-01 08:47:02 -0400 (Wed, 01 Sep 2010)
New Revision: 24598
Modified:
trunk/usage/plugins/org.jboss.tools.usage/plugin.xml
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/messages.properties
Log:
[JBIDE-6880] Texts changed according chat with max
Modified: trunk/usage/plugins/org.jboss.tools.usage/plugin.xml
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/plugin.xml 2010-09-01 12:38:12 UTC (rev 24597)
+++ trunk/usage/plugins/org.jboss.tools.usage/plugin.xml 2010-09-01 12:47:02 UTC (rev 24598)
@@ -12,7 +12,7 @@
<page
class="org.jboss.tools.usage.preferences.UsageReportPreferencePage"
id="org.jboss.tools.usage.analytics.preferences.UsageAnalyticsPreferencePage"
- name="JBoss Usage Reporting Preferences"
+ name="Usage Reporting Preferences"
category="org.jboss.tools.common.model.ui.MainPreferencePage">
</page>
</extension>
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/messages.properties
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/messages.properties 2010-09-01 12:38:12 UTC (rev 24597)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/messages.properties 2010-09-01 12:47:02 UTC (rev 24598)
@@ -1,10 +1,10 @@
EclipseEnvironment_Error_SavePreferences=Could not sage {0} to preferences.
-UsageReport_Reporting_Usage=Reporting JBoss Tools / JBoss Developer Studio usage
+UsageReport_Reporting_Usage=Reporting JBoss Tools usage
UsageReport_Querying_Enablement=Querying whether reporting is globally enabled
UsageReport_Asking_User=Asking User to allow reporting
-UsageReport_Checkbox_Text=Report usage anonymously to Red Hat Inc.
-UsageReport_DialogMessage=Please allow Red Hat Inc. to report this installation anynomously for statistical matters.
-UsageReport_DialogTitle=Report usage
+UsageReport_Checkbox_Text=Report usage of JBoss Tools to JBoss Tools team.
+UsageReport_DialogMessage=Please allow the JBoss Tools team to receive anonymous usage statistics for this Eclipse installation with JBoss tools.
+UsageReport_DialogTitle=JBoss Tools Usage
UsageReport_Error_SavePreferences=Could not save preferences {0}
UsageReport_GoogleAnalyticsAccount=UA-17645367-1
UsageReport_HostName=jboss.org
14 years, 4 months
JBoss Tools SVN: r24597 - in workspace: usage and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-09-01 08:38:12 -0400 (Wed, 01 Sep 2010)
New Revision: 24597
Added:
workspace/usage/
workspace/usage/usage.properties
Log:
[JBIDE-6880] initial property file checked in
Added: workspace/usage/usage.properties
===================================================================
14 years, 4 months
JBoss Tools SVN: r24596 - in trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core: schema and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-09-01 07:43:34 -0400 (Wed, 01 Sep 2010)
New Revision: 24596
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/schema/referenceResolver.exsd
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ExportedClassFolderReferenceResolver.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/JBTVirtualComponent.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/OutputFolderReferenceResolver.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ReferenceResolverUtil.java
Log:
JBIDE-6964 - output folder reference resolver changed to wtp 3.2 api
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/plugin.xml 2010-09-01 11:34:03 UTC (rev 24595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/plugin.xml 2010-09-01 11:43:34 UTC (rev 24596)
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
- <extension-point id="referenceResolver" name="referenceResolver" schema="schema/referenceResolver.exsd"/>
<extension
- point="org.jboss.ide.eclipse.as.wtp.core.referenceResolver">
+ point="org.eclipse.wst.common.modulecore.referenceResolver">
<resolver
class="org.jboss.ide.eclipse.as.wtp.core.vcf.OutputFolderReferenceResolver"
id="org.jboss.ide.eclipse.as.wtp.core.vcf.outputFolderReferenceResolver">
@@ -13,5 +12,4 @@
id="org.jboss.ide.eclipse.as.wtp.core.vcf.exportedClasspathFolderReferenceResolver">
</resolver>
</extension>
-
</plugin>
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/schema/referenceResolver.exsd
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/schema/referenceResolver.exsd 2010-09-01 11:34:03 UTC (rev 24595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/schema/referenceResolver.exsd 2010-09-01 11:43:34 UTC (rev 24596)
@@ -1,116 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.common.modulecore" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.common.modulecore" id="referenceResolver" name="referenceResolver"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence minOccurs="1" maxOccurs="unbounded">
- <element ref="resolver"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="resolver">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- A required id which can be used to reference this resolver
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The implementation class of this extension
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.wst.common.componentcore.resolvers.IReferenceResolver"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="weight" type="string">
- <annotation>
- <documentation>
- The weight used for sorting the resolvers. Lighter weights float to the top and are tried first.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ExportedClassFolderReferenceResolver.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ExportedClassFolderReferenceResolver.java 2010-09-01 11:34:03 UTC (rev 24595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ExportedClassFolderReferenceResolver.java 2010-09-01 11:43:34 UTC (rev 24596)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.wtp.core.vcf;
-import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
@@ -20,6 +19,7 @@
import org.eclipse.wst.common.componentcore.internal.DependencyType;
import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
import org.eclipse.wst.common.componentcore.internal.impl.PlatformURLModuleConnection;
+import org.eclipse.wst.common.componentcore.resolvers.IReferenceResolver;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/JBTVirtualComponent.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/JBTVirtualComponent.java 2010-09-01 11:34:03 UTC (rev 24595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/JBTVirtualComponent.java 2010-09-01 11:43:34 UTC (rev 24596)
@@ -90,20 +90,20 @@
return DependencyGraphManager.getInstance().checkIfStillValid(depGraphModStamp);
}
- private static IVirtualReference[] getHardReferences(IVirtualComponent earComponent) {
+ private static IVirtualReference[] getHardReferences(IVirtualComponent component) {
StructureEdit core = null;
List hardReferences = new ArrayList();
try {
- core = StructureEdit.getStructureEditForRead(earComponent.getProject());
+ core = StructureEdit.getStructureEditForRead(component.getProject());
if (core != null && core.getComponent() != null) {
- WorkbenchComponent component = core.getComponent();
+ WorkbenchComponent component2 = core.getComponent();
if (component != null) {
- List referencedComponents = component.getReferencedComponents();
+ List referencedComponents = component2.getReferencedComponents();
for (Iterator iter = referencedComponents.iterator(); iter.hasNext();) {
ReferencedComponent referencedComponent = (ReferencedComponent) iter.next();
if (referencedComponent == null)
continue;
- IVirtualReference vReference = createVirtualReference(earComponent, referencedComponent);
+ IVirtualReference vReference = StructureEdit.createVirtualReference(component, referencedComponent);
if (vReference != null) {
IVirtualComponent referencedIVirtualComponent = vReference.getReferencedComponent();
if (referencedIVirtualComponent != null && referencedIVirtualComponent.exists()) {
@@ -193,145 +193,4 @@
}
return uri;
}
- /*
-
- private static List getLooseArchiveReferences(JBTVirtualComponent component, List hardReferences) {
- return getLooseArchiveReferences(component, hardReferences, null, (EARVirtualRootFolder)component.getRootFolder());
- }
-
- private static List getLooseArchiveReferences(JBTVirtualComponent component, List hardReferences, List dynamicReferences, EARVirtualRootFolder folder) {
- return null;
- }
-*/
-
- // Potentially to be overridden (awesome?)
- protected static IVirtualReference createVirtualReference(IVirtualComponent context, ReferencedComponent referencedComponent) {
- IReferenceResolver res = ReferenceResolverUtil.getDefault().getResolver(context, referencedComponent);
- return res.resolve(context, referencedComponent);
- }
-
- protected static ReferencedComponent createReferencedComponent(IVirtualReference reference) {
- IReferenceResolver res = ReferenceResolverUtil.getDefault().getResolver(reference);
- return res.resolve(reference);
- }
-
- /* *******************************************
- * Overrides from VirtualComponent class
- * These are mostly here because of the extrapolation
- * of createVirtualReference into its own method.
- *
- * These can probably be removed in WTP 3.2
- * *******************************************/
- @Override
- public IVirtualReference[] getAllReferences() {
- StructureEdit core = null;
- List references = new ArrayList();
- try {
- core = StructureEdit.getStructureEditForRead(getProject());
- if (core!=null && core.getComponent()!=null) {
- WorkbenchComponent component = core.getComponent();
- if (component!=null) {
- List referencedComponents = component.getReferencedComponents();
- for (Iterator iter = referencedComponents.iterator(); iter.hasNext();) {
- ReferencedComponent referencedComponent = (ReferencedComponent) iter.next();
- if (referencedComponent==null)
- continue;
- IVirtualReference vReference = createVirtualReference(this, referencedComponent);
- if( vReference != null ){
- vReference.setArchiveName( referencedComponent.getArchiveName() );
- }
- if (vReference != null && vReference.getReferencedComponent() != null)
- references.add(vReference);
- }
- }
- }
- return (IVirtualReference[]) references.toArray(new IVirtualReference[references.size()]);
- } finally {
- if(core != null)
- core.dispose();
- }
- }
-
- @Override
- protected ReferencedComponent getWorkbenchReferencedComponent(IVirtualReference aReference, WorkbenchComponent component) {
- if (aReference == null || aReference.getReferencedComponent() == null || component == null)
- return null;
- List referencedComponents = component.getReferencedComponents();
- URI uri = createReferencedComponent(aReference).getHandle();
- for (int i=0; i<referencedComponents.size(); i++) {
- ReferencedComponent ref = (ReferencedComponent) referencedComponents.get(i);
- if( ref.getHandle().equals(uri))
- return ref;
- }
- return null;
- }
-
- @Override
- public void addReferences(IVirtualReference[] references) {
- if (references==null || references.length==0)
- return;
- StructureEdit core = null;
- try {
- core = StructureEdit.getStructureEditForWrite(getProject());
- if (core == null)
- return;
- WorkbenchComponent component = core.getComponent();
- ReferencedComponent referencedComponent = null;
- ComponentcoreFactory factory = ComponentcorePackage.eINSTANCE.getComponentcoreFactory();
- for (int i=0; i<references.length; i++) {
- if (references[i] == null)
- continue;
- referencedComponent = createReferencedComponent(references[i]);
- if( referencedComponent != null )
- component.getReferencedComponents().add(referencedComponent);
- }
- //clean up any old obsolete references
- if (component != null){
- cleanUpReferences(component);
- }
- } finally {
- if(core != null) {
- core.saveIfNecessary(null);
- core.dispose();
- }
- }
- }
-
- /* @Override */
- private void cleanUpReferences(WorkbenchComponent component) {
- List referencedComponents = component.getReferencedComponents();
- for (Iterator iter = referencedComponents.iterator(); iter.hasNext();) {
- ReferencedComponent referencedComponent = (ReferencedComponent) iter.next();
- if (referencedComponent==null)
- continue;
- IVirtualReference vReference = createVirtualReference(this, referencedComponent);
- if (vReference == null || vReference.getReferencedComponent() == null || !vReference.getReferencedComponent().exists()){
- iter.remove();
- }
- }
- }
-
- @Override
- public void setReferences(IVirtualReference[] references) {
- StructureEdit core = null;
- try {
- core = StructureEdit.getStructureEditForWrite(getProject());
- WorkbenchComponent component = core.getComponent();
- ReferencedComponent referencedComponent = null;
-
- component.getReferencedComponents().clear();
- ComponentcoreFactory factory = ComponentcorePackage.eINSTANCE.getComponentcoreFactory();
- for (int i=0; i<references.length; i++) {
- referencedComponent = createReferencedComponent(references[i]);
- if( referencedComponent != null )
- component.getReferencedComponents().add(referencedComponent);
- }
- } finally {
- if(core != null) {
- core.saveIfNecessary(null);
- core.dispose();
- }
- }
- }
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/OutputFolderReferenceResolver.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/OutputFolderReferenceResolver.java 2010-09-01 11:34:03 UTC (rev 24595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/OutputFolderReferenceResolver.java 2010-09-01 11:43:34 UTC (rev 24596)
@@ -20,14 +20,16 @@
import org.eclipse.wst.common.componentcore.internal.DependencyType;
import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
import org.eclipse.wst.common.componentcore.internal.impl.PlatformURLModuleConnection;
+import org.eclipse.wst.common.componentcore.resolvers.IReferenceResolver;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-public class OutputFolderReferenceResolver implements IReferenceResolver {
+public class OutputFolderReferenceResolver implements IReferenceResolver {
public static final String OUTPUT_FOLDER_SEGMENT = "org.jboss.ide.eclipse.as.wtp.core.vcf.outputFolders";
public static final String OUTPUT_FOLDER_PROTOCOL = PlatformURLModuleConnection.MODULE_PROTOCOL
+IPath.SEPARATOR+ OUTPUT_FOLDER_SEGMENT + IPath.SEPARATOR;
public OutputFolderReferenceResolver() {
+
}
public boolean canResolve(IVirtualComponent context,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ReferenceResolverUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ReferenceResolverUtil.java 2010-09-01 11:34:03 UTC (rev 24595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ReferenceResolverUtil.java 2010-09-01 11:43:34 UTC (rev 24596)
@@ -27,6 +27,7 @@
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
import org.jboss.ide.eclipse.as.wtp.core.ASWTPToolsPlugin;
+@Deprecated
public class ReferenceResolverUtil {
public static ReferenceResolverUtil instance = null;
public static ReferenceResolverUtil getDefault() {
14 years, 4 months
JBoss Tools SVN: r24595 - in trunk/esb/plugins/org.jboss.tools.esb.core: resources/help and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-09-01 07:34:03 -0400 (Wed, 01 Sep 2010)
New Revision: 24595
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddScheduleProviderSupport.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
Log:
https://jira.jboss.org/browse/JBIDE-6085
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2010-09-01 11:33:11 UTC (rev 24594)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2010-09-01 11:34:03 UTC (rev 24595)
@@ -47,6 +47,8 @@
<xclass id="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"
class="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"/>
+ <xclass id="org.jboss.tools.esb.core.model.handlers.AddScheduleProviderSupport"
+ class="org.jboss.tools.esb.core.model.handlers.AddScheduleProviderSupport"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.AddGenericActionSupport"
class="org.jboss.tools.esb.core.model.handlers.AddGenericActionSupport"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.AddContentBasedRouterSupport"
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties 2010-09-01 11:33:11 UTC (rev 24594)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties 2010-09-01 11:34:03 UTC (rev 24595)
@@ -35,6 +35,8 @@
ESBProviders101_AddScheduleProvider.Title=ESB Schedule Provider
ESBProviders101_AddScheduleProvider_0.WindowTitle=Add Schedule Provider
ESBProviders101_AddScheduleProvider_0.Title=ESB Schedule Provider
+ESBProviders101_AddScheduleProvider_1.WindowTitle=Add Schedule Provider
+ESBProviders101_AddScheduleProvider_1.Title=ESB Schedule
ESBProviders101_AddJMSProvider_0.WindowTitle=Add JMS Provider
ESBProviders101_AddJMSProvider_0.Title=ESB JMS Provider
@@ -82,6 +84,8 @@
ESBProviders110_AddScheduleProvider.Title=ESB Schedule Provider
ESBProviders110_AddScheduleProvider_0.WindowTitle=Add Schedule Provider
ESBProviders110_AddScheduleProvider_0.Title=ESB Schedule Provider
+ESBProviders110_AddScheduleProvider_1.WindowTitle=Add Schedule Provider
+ESBProviders110_AddScheduleProvider_1.Title=ESB Schedule
ESBProviders110_AddJMSProvider_0.WindowTitle=Add JMS Provider
ESBProviders110_AddJMSProvider_0.Title=ESB JMS Provider
@@ -134,6 +138,8 @@
ESBProviders120_AddScheduleProvider.Title=ESB Schedule Provider
ESBProviders120_AddScheduleProvider_0.WindowTitle=Add Schedule Provider
ESBProviders120_AddScheduleProvider_0.Title=ESB Schedule Provider
+ESBProviders120_AddScheduleProvider_1.WindowTitle=Add Schedule Provider
+ESBProviders120_AddScheduleProvider_1.Title=ESB Schedule
ESBProviders120_AddJMSProvider_0.WindowTitle=Add JMS Provider
ESBProviders120_AddJMSProvider_0.Title=ESB JMS Provider
@@ -191,6 +197,8 @@
ESBProviders130_AddScheduleProvider.Title=ESB Schedule Provider
ESBProviders130_AddScheduleProvider_0.WindowTitle=Add Schedule Provider
ESBProviders130_AddScheduleProvider_0.Title=ESB Schedule Provider
+ESBProviders130_AddScheduleProvider_1.WindowTitle=Add Schedule Provider
+ESBProviders130_AddScheduleProvider_1.Title=ESB Schedule
ESBProviders130_AddJMSProvider_0.WindowTitle=Add JMS Provider
ESBProviders130_AddJMSProvider_0.Title=ESB JMS Provider
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2010-09-01 11:33:11 UTC (rev 24594)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2010-09-01 11:34:03 UTC (rev 24595)
@@ -1996,12 +1996,16 @@
<AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
- <XActionItem HandlerClassName="%Create%" ICON="action.empty"
- PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
+ PROPERTIES="validator.add=true;support=org.jboss.tools.esb.core.model.handlers.AddScheduleProviderSupport"
displayName="Schedule Provider..." kind="action" name="AddScheduleProvider">
<EntityData EntityName="ESBScheduleProvider101">
<AttributeData AttributeName="name"/>
</EntityData>
+ <EntityData EntityName="ESBScheduleCreator" Mandatory="no">
+ <AttributeData AttributeName="schedule kind" Mandatory="no"/>
+ <AttributeData AttributeName="schedule id"/>
+ </EntityData>
</XActionItem>
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
PROPERTIES="validator.add=true;support=org.jboss.tools.esb.core.model.handlers.AddProviderSupport;busEntity=ESBSQLBus101"
@@ -2270,6 +2274,35 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity name="ESBScheduleCreator">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.schedule" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="schedule" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttributeReference
+ attributes="schedule id,start date,end date"
+ entity="ESBSimpleSchedule101" name="schedule"/>
+ <XModelAttribute PROPERTIES="label=false;horizontal=true"
+ default="Simple" name="schedule kind">
+ <Constraint loader="List">
+ <value name="Simple"/>
+ <value name="Cron"/>
+ </Constraint>
+ <Editor name="RadioArray"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list"/>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%ESBOrdered%"
XMLSUBPATH="schedule-provider" name="ESBScheduleProvider101">
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddScheduleProviderSupport.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddScheduleProviderSupport.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddScheduleProviderSupport.java 2010-09-01 11:34:03 UTC (rev 24595)
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.esb.core.model.handlers;
+
+import java.util.Properties;
+
+import org.jboss.tools.common.meta.XChild;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.FindObjectHelper;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class AddScheduleProviderSupport extends SpecialWizardSupport {
+ String providerEntity;
+
+ public AddScheduleProviderSupport() {}
+
+ protected void reset() {
+ providerEntity = getEntityData()[0].getModelEntity().getName();
+ }
+
+ public String[] getActionNames(int stepId) {
+ if(getStepId() < getEntityData().length - 1) {
+ if(getStepId() == 0) {
+ return new String[]{NEXT, CANCEL};
+ } else {
+ return new String[]{BACK, NEXT, CANCEL};
+ }
+ } else if(getEntityData().length > 0) {
+ return new String[]{BACK, FINISH, CANCEL};
+ }
+ return new String[]{FINISH, CANCEL, HELP};
+ }
+
+ public boolean isActionEnabled(String name) {
+ if(FINISH.equals(name) && getStepId() < getEntityData().length - 1) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public void action(String name) throws XModelException {
+ if(FINISH.equals(name)) {
+ execute();
+ setFinished(true);
+ } else if(CANCEL.equals(name)) {
+ setFinished(true);
+ } else if(BACK.equals(name)) {
+ if(getStepId() == 0) return;
+ setStepId(getStepId() - 1);
+ } else if(NEXT.equals(name)) {
+ if(getStepId() >= getEntityData().length - 1) return;
+ setStepId(getStepId() + 1);
+ } else if(HELP.equals(name)) {
+ help();
+ }
+ }
+
+ protected void execute() throws XModelException {
+ Properties p0 = extractStepData(0);
+ XModelObject provider = XModelObjectLoaderUtil.createValidObject(getTarget().getModel(), providerEntity, p0);
+
+ Properties p1 = extractStepData(1);
+ String scheduleEntity = getScheduleEntity(provider, p1);
+ if(scheduleEntity != null) {
+ XModelObject bus = XModelObjectLoaderUtil.createValidObject(getTarget().getModel(), scheduleEntity, p1);
+ provider.addChild(bus);
+ }
+
+ DefaultCreateHandler.addCreatedObject(getTarget(), provider, FindObjectHelper.EVERY_WHERE);
+ }
+
+ private String getScheduleEntity(XModelObject provider, Properties p1) {
+ String scheduleKind = p1.getProperty("schedule kind");
+ XChild[] cs = provider.getModelEntity().getChildren();
+ for (int i = 0; i < cs.length; i++) {
+ if(cs[i].getName().indexOf(scheduleKind) >= 0) return cs[i].getName();
+ }
+ return null;
+ }
+
+ public boolean canBeProcessedByStandardWizard() {
+ return true;
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddScheduleProviderSupport.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 4 months
JBoss Tools SVN: r24594 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-09-01 07:33:11 -0400 (Wed, 01 Sep 2010)
New Revision: 24594
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/RadioArrayFieldEditor.java
Log:
https://jira.jboss.org/browse/JBIDE-6085
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/RadioArrayFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/RadioArrayFieldEditor.java 2010-09-01 09:52:39 UTC (rev 24593)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/RadioArrayFieldEditor.java 2010-09-01 11:33:11 UTC (rev 24594)
@@ -83,7 +83,7 @@
public Control[] getControls(Composite parent) {
Control label = null;
- if (makeGroup()) {
+ if (makeGroup() || hideLabel()) {
label = new Label(parent,SWT.NONE);
} else {
label = getLabelComposite(parent);
@@ -122,7 +122,9 @@
}
/// change!
int k = getTags().length;
- if(k != 3 || makeGroup) k = 1;
+ if(!isHorizontalLayout()) {
+ if(k != 3 || makeGroup) k = 1;
+ }
GridLayout layout = new GridLayout(k, false);
panel.setLayout(layout);
// panel.setFont(font);
@@ -156,6 +158,24 @@
return false;
}
+ boolean hideLabel() {
+ Object input = propertyEditor.getInput();
+ if(input instanceof DefaultValueAdapter) {
+ DefaultValueAdapter adapter = (DefaultValueAdapter)input;
+ return "false".equals(adapter.getAttribute().getProperty("label")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return false;
+ }
+
+ boolean isHorizontalLayout() {
+ Object input = propertyEditor.getInput();
+ if(input instanceof DefaultValueAdapter) {
+ DefaultValueAdapter adapter = (DefaultValueAdapter)input;
+ return "true".equals(adapter.getAttribute().getProperty("horizontal")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return false;
+ }
+
protected void valueChanged() {
setPresentsDefaultValue(false);
boolean oldState = isValid;
14 years, 4 months
JBoss Tools SVN: r24593 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test: tck and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-01 05:52:39 -0400 (Wed, 01 Sep 2010)
New Revision: 24593
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CoreValidationTest.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/DecoratorDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java
Log:
https://jira.jboss.org/browse/JBIDE-2708
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 2010-09-01 09:38:11 UTC (rev 24592)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2010-09-01 09:52:39 UTC (rev 24593)
@@ -37,9 +37,9 @@
import org.jboss.tools.cdi.core.test.tck.StereotypeInheritenceTest;
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.CoreValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.DefenitionErrorsValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.DeploymentProblemsValidationTests;
-import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
/**
* @author Alexey Kazakov
@@ -73,11 +73,11 @@
suite.addTestSuite(DecoratorDefinitionTest.class);
suite.addTestSuite(ObserverMethodResolutionTest.class);
- suite.addTestSuite(ValidationTest.class);
suite.addTestSuite(DefenitionErrorsValidationTest.class);
suite.addTestSuite(DeploymentProblemsValidationTests.class);
suite.addTestSuite(BeansXmlValidationTest.class);
suite.addTestSuite(AnnotationsValidationTest.class);
+ suite.addTestSuite(CoreValidationTest.class);
return new CDICoreTestSetup(suite);
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java 2010-09-01 09:38:11 UTC (rev 24592)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java 2010-09-01 09:52:39 UTC (rev 24593)
@@ -15,8 +15,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.cdi.core.IBean;
-import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IDecorator;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IParametedType;
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CoreValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CoreValidationTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CoreValidationTest.java 2010-09-01 09:52:39 UTC (rev 24593)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.core.test.tck.validation;
+
+import org.eclipse.jface.preference.IPersistentPreferenceStore;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CoreValidationTest extends ValidationTest {
+
+ /**
+ * https://jira.jboss.org/browse/JBIDE-6507
+ *
+ * @throws Exception
+ */
+ public void testDisabledValidator() throws Exception {
+ IPreferenceStore preferenceStore = CDICorePlugin.getDefault().getPreferenceStore();
+ preferenceStore.setValue(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, false);
+ ((IPersistentPreferenceStore)preferenceStore).save();
+
+ assertNull("CDICoreValidator is still enabled.", getCDIValidator());
+
+ preferenceStore.setValue(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, true);
+ ((IPersistentPreferenceStore)preferenceStore).save();
+
+ assertNotNull("CDICoreValidator is disabled.", getCDIValidator());
+ }
+}
\ 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/CoreValidationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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 2010-09-01 09:38:11 UTC (rev 24592)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java 2010-09-01 09:52:39 UTC (rev 24593)
@@ -14,12 +14,8 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.preference.IPersistentPreferenceStore;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
-import org.jboss.tools.common.preferences.SeverityPreferences;
import org.jboss.tools.jst.web.kb.internal.validation.ValidationContext;
import org.jboss.tools.jst.web.kb.validation.IValidator;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
@@ -29,25 +25,7 @@
*/
public class ValidationTest extends TCKTest {
- /**
- * https://jira.jboss.org/browse/JBIDE-6507
- *
- * @throws Exception
- */
- public void testDisabledValidator() throws Exception {
- IPreferenceStore preferenceStore = CDICorePlugin.getDefault().getPreferenceStore();
- preferenceStore.setValue(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, false);
- ((IPersistentPreferenceStore)preferenceStore).save();
-
- assertNull("CDICoreValidator is not be disabled.", getCDIValidator());
-
- preferenceStore.setValue(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, true);
- ((IPersistentPreferenceStore)preferenceStore).save();
-
- assertNotNull("CDICoreValidator is disabled.", getCDIValidator());
- }
-
- private CDICoreValidator getCDIValidator() {
+ protected CDICoreValidator getCDIValidator() {
ValidationContext context = new ValidationContext(tckProject);
List<IValidator> validators = context.getValidators();
for (IValidator validator : validators) {
14 years, 4 months
JBoss Tools SVN: r24592 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test: tck and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-01 05:38:11 -0400 (Wed, 01 Sep 2010)
New Revision: 24592
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/
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/BeansXmlValidationTest.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
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.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/DecoratorDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
Log:
https://jira.jboss.org/browse/JBIDE-2708 Reorginized CDI validation tests to avoid having too big test class.
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 2010-09-01 08:58:27 UTC (rev 24591)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2010-09-01 09:38:11 UTC (rev 24592)
@@ -35,7 +35,11 @@
import org.jboss.tools.cdi.core.test.tck.ScopeDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.StereotypeDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.StereotypeInheritenceTest;
-import org.jboss.tools.cdi.core.test.tck.ValidationTest;
+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.DefenitionErrorsValidationTest;
+import org.jboss.tools.cdi.core.test.tck.validation.DeploymentProblemsValidationTests;
+import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
/**
* @author Alexey Kazakov
@@ -67,8 +71,14 @@
suite.addTestSuite(DynamicLookupTest.class);
suite.addTestSuite(InterceptorDefinitionTest.class);
suite.addTestSuite(DecoratorDefinitionTest.class);
+ suite.addTestSuite(ObserverMethodResolutionTest.class);
+
suite.addTestSuite(ValidationTest.class);
- suite.addTestSuite(ObserverMethodResolutionTest.class);
+ suite.addTestSuite(DefenitionErrorsValidationTest.class);
+ suite.addTestSuite(DeploymentProblemsValidationTests.class);
+ suite.addTestSuite(BeansXmlValidationTest.class);
+ suite.addTestSuite(AnnotationsValidationTest.class);
+
return new CDICoreTestSetup(suite);
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java 2010-09-01 08:58:27 UTC (rev 24591)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java 2010-09-01 09:38:11 UTC (rev 24592)
@@ -18,6 +18,7 @@
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IDecorator;
+import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IParametedType;
/**
@@ -35,16 +36,25 @@
* @throws JavaModelException
*/
public void testDecoratedTypes() throws JavaModelException, CoreException {
- IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java");
- assertNotNull("Can't find the bean.", bean);
- if(!(bean instanceof IDecorator)) {
- fail("The bean is not a decorator.");
- }
- IDecorator decorator = (IDecorator)bean;
+ IDecorator decorator = getDecorator("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java");
Set<IParametedType> types = decorator.getDecoratedTypes();
assertContainsTypes(types,
"org.jboss.jsr299.tck.tests.decorators.definition.Foo",
"org.jboss.jsr299.tck.tests.decorators.definition.Bar",
"org.jboss.jsr299.tck.tests.decorators.definition.Baz");
}
+
+ /**
+ * section 8.1.2 a)
+ * section 11.1.1 c)
+ */
+ public void testDelegateInjectionPoint() throws JavaModelException, CoreException {
+ IDecorator decorator = getDecorator("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/TimestampLogger.java");
+ assertEquals("Wrong number of injection points.", 1, decorator.getInjectionPoints().size());
+ IInjectionPoint injection = decorator.getInjectionPoints().iterator().next();
+ assertEquals("Wrong type of the injection point.", "org.jboss.jsr299.tck.tests.decorators.definition.Logger", injection.getType().getType().getFullyQualifiedName());
+ assertNotNull("Can't find @Delegate annotation.", injection.getDelegateAnnotation());
+ }
+
+ // TODO continue implementing tests
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2010-09-01 08:58:27 UTC (rev 24591)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2010-09-01 09:38:11 UTC (rev 24592)
@@ -25,6 +25,7 @@
import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IDecorator;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IInjectionPointField;
import org.jboss.tools.cdi.core.IParametedType;
@@ -138,6 +139,15 @@
return null;
}
+ protected IDecorator getDecorator(String path) {
+ IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/TimestampLogger.java");
+ assertNotNull("Can't find the bean.", bean);
+ if(!(bean instanceof IDecorator)) {
+ fail("The bean is not a decorator.");
+ }
+ return (IDecorator)bean;
+ }
+
protected IQualifierDeclaration getQualifierDeclarationFromClass(String beanFilePath, String annotationTypeName) throws JavaModelException {
IFile file = tckProject.getFile(beanFilePath);
Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
Deleted: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-09-01 08:58:27 UTC (rev 24591)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-09-01 09:38:11 UTC (rev 24592)
@@ -1,1660 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.cdi.core.test.tck;
-
-import java.text.MessageFormat;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.preference.IPersistentPreferenceStore;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.jboss.tools.cdi.core.CDICorePlugin;
-import org.jboss.tools.cdi.core.IClassBean;
-import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
-import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
-import org.jboss.tools.common.preferences.SeverityPreferences;
-import org.jboss.tools.jst.web.kb.internal.validation.ValidationContext;
-import org.jboss.tools.jst.web.kb.validation.IValidator;
-import org.jboss.tools.tests.AbstractResourceMarkerTest;
-
-/**
- * @author Alexey Kazakov
- */
-public class ValidationTest extends TCKTest {
-
- /**
- * 2.2.2. Restricting the bean types of a bean
- * - bean class or producer method or field specifies a @Typed annotation,
- * and the value member specifies a class which does not correspond to a type
- * in the unrestricted set of bean types of a bean
- *
- * @throws Exception
- */
- public void testLegalTypesInTyped() throws Exception {
- IFile petShopFile = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java");
- assertMarkerIsCreated(petShopFile, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD, 25);
- int markerNumbers = getMarkersNumber(petShopFile);
- assertEquals("PetShop.java should has the only error marker.", markerNumbers, 1);
- }
-
- /**
- * 2.4.1. Built-in scope types
- * - interceptor has any scope other than @Dependent (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testInterceptorWithWrongScope() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR, 8);
- }
-
- /**
- * 2.4.1. Built-in scope types
- * - decorator has any scope other than @Dependent (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testDecoratorWithWrongScope() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR, 7);
- }
-
- /**
- * 2.4.3. Declaring the bean scope
- * - bean class or producer method or field specifies multiple scope type annotations
- *
- * @throws Exception
- */
- public void testMultipleBeanScope() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/BeanWithTooManyScopeTypes_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS, 22, 23);
- int markerNumbers = getMarkersNumber(file);
- assertEquals("StereotypeWithTyped_Broken.java should has two error markers.", markerNumbers, 2);
- }
-
- /**
- * 2.4.4. Default scope
- * - bean does not explicitly declare a scope when there is no default scope
- * (there are two different stereotypes declared by the bean that declare different default scopes)
- *
- * @throws Exception
- */
- public void testBeanWithMultipleScopedStereotypes() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/scopeConflict/Scallop_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, 24, 25);
- int markerNumbers = getMarkersNumber(file);
- assertEquals("Scallop_Broken.java should has two error markers.", markerNumbers, 2);
- }
-
- /**
- * 2.5.3. Beans with no EL name
- * - interceptor has a name (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testNamedInterceptor() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 9);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedStereotypedInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 7);
- }
-
- /**
- * 2.5.3. Beans with no EL name
- * - decorator has a name (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testNamedDecorator() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 10);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedStereotypedDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 8);
- }
-
- /**
- * 2.6.1. Declaring an alternative
- * - interceptor is an alternative (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testAlternativeInterceptor() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/AlternativeInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, 7);
- }
-
- /**
- * 2.6.1. Declaring an alternative
- * - decorator is an alternative (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testAlternativeDecorator() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, 7);
- }
-
- /**
- * 2.7.1.1. Declaring the default scope for a stereotype
- * - stereotype declares more than one scope
- *
- * @throws Exception
- */
- public void testStereotypeScope() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/tooManyScopes/StereotypeWithTooManyScopeTypes_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, 32, 33);
- int markerNumbers = getMarkersNumber(file);
- assertEquals("StereotypeWithTooManyScopeTypes_Broken.java should has two error markers.", markerNumbers, 2);
- }
-
- /**
- * 2.7.1.3. Declaring a @Named stereotype
- * - stereotype declares a non-empty @Named annotation (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testNonEmptyNamedForStereotype() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/nonEmptyNamed/StereotypeWithNonEmptyNamed_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_NON_EMPTY_NAME, 31);
- int markerNumbers = getMarkersNumber(file);
- assertEquals("StereotypeWithNonEmptyNamed_Broken.java should has the only error marker.", markerNumbers, 1);
- }
-
- /**
- * 2.7.1.3. Declaring a @Named stereotype
- * - stereotype declares any other qualifier annotation
- *
- * @throws Exception
- */
- public void testAnnotatedStereotype() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereotypeWithBindingTypes_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE, 30);
- int markerNumbers = getMarkersNumber(file);
- assertEquals("StereotypeWithBindingTypes_Broken.java should has the only error marker.", markerNumbers, 1);
- }
-
- /**
- * 2.7.1.3. Declaring a @Named stereotype
- * - stereotype is annotated @Typed
- *
- * @throws Exception
- */
- public void testTypedStereotype() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereotypeWithTyped_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, 15);
- int markerNumbers = getMarkersNumber(file);
- assertEquals("StereotypeWithTyped_Broken.java should has the only error marker.", markerNumbers, 1);
- }
-
- /**
- * 3.1. Managed beans
- * - the bean class of a managed bean is annotated with both the @Interceptor and @Decorator stereotypes
- *
- * @throws Exception
- */
- public void testInterceptorCanNotAlsoBeDecorator() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorCanNotBeDecorator/InterceptingDecorator.java");
- assertMarkerIsCreated(file, CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, 24, 25);
- }
-
- /**
- * 3.1. Managed beans
- * - managed bean with a public field declares any scope other than @Dependent
- *
- * @throws Exception
- */
- public void testNonDependentScopedBeanCanNotHavePublicField() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/dependentWithPublicField/Leopard_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD, 21);
- }
-
- /**
- * 3.1. Managed beans
- * - managed bean with a parameterized bean class declares any scope other than @Dependent
- *
- * @throws Exception
- */
- public void testNonDependentGenericManagedBeanNotOk() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/bean/genericbroken/FooBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE, 21);
- }
-
- /**
- * 3.1.4. Specializing a managed bean
- * - managed bean class annotated @Specializes does not directly extend the bean class of another managed bean
- * (Test a specializing bean extending a non simple bean)
- *
- * @throws Exception
- */
- public void testSpecializingClassExtendsNonSimpleBean() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Cow_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
- }
-
- /**
- * 3.1.4. Specializing a managed bean
- * - managed bean class annotated @Specializes does not directly extend the bean class of another managed bean
- * (Test a specializing bean extending nothing)
- *
- * @throws Exception
- */
- public void testSpecializingClassDirectlyExtendsNothing() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
- }
-
- /**
- * 3.1.4. Specializing a managed bean
- * - managed bean class annotated @Specializes does not directly extend the bean class of another managed bean
- * (Test a specializing bean directly extending an enterprise bean class)
- *
- * @throws Exception
- */
- public void testSpecializingClassDirectlyExtendsEnterpriseBean() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
- }
-
- /**
- * 3.1.4. Specializing a managed bean
- * - managed bean class annotated @Specializes does not directly extend the bean class of another managed bean
- * (Test a specializing bean implementing an interface and extending nothing)
- *
- * @throws Exception
- */
- public void testSpecializingClassImplementsInterfaceAndExtendsNothing() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/Donkey_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
- }
-
- /**
- * 3.2. Session beans
- * - session bean specifies an illegal scope
- * (a stateless session bean must belong to the @Dependent pseudo-scope)
- *
- * @throws Exception
- */
- public void testStatelessWithRequestScopeFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/Beagle_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
- }
-
- /**
- * 3.2. Session beans
- * - session bean specifies an illegal scope
- * (a stateless session bean must belong to the @Dependent pseudo-scope)
- *
- * @throws Exception
- */
- public void testStatelessWithApplicationScopeFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/Dachshund_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
- }
-
- /**
- * 3.2. Session beans
- * - session bean specifies an illegal scope
- * (a stateless session bean must belong to the @Dependent pseudo-scope)
- *
- * @throws Exception
- */
- public void testStatelessWithConversationScopeFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/Boxer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
- }
-
- /**
- * 3.2. Session beans
- * - session bean specifies an illegal scope
- * (a stateless session bean must belong to the @Dependent pseudo-scope)
- *
- * @throws Exception
- */
- public void testStatelessWithSessionScopeFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/Bullmastiff_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
- }
-
-
- /**
- * 3.2. Session beans
- * - session bean specifies an illegal scope
- * (a singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope)
- *
- * @throws Exception
- */
- public void testSingletonWithConversationScopeFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/Husky_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 24);
- }
-
- /**
- * 3.2. Session beans
- * - session bean specifies an illegal scope
- * (a singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope)
- *
- * @throws Exception
- */
- public void testSingletonWithSessionScopeFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/IrishTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 25);
- }
-
- /**
- * 3.2. Session beans
- * - session bean specifies an illegal scope
- * (a singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope)
- *
- * @throws Exception
- */
- public void testSingletonWithRequestScopeFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/Greyhound_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 23);
- }
-
- /**
- * 3.2. Session beans
- * - bean class of a session bean is annotated @Interceptor
- *
- * @throws Exception
- */
- public void testSessionBeanAnnotatedInterceptor() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/SessionBeanAnnotatedInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, 8, 9);
- }
-
- /**
- * 3.2. Session beans
- * - bean class of a session bean is annotated @Decorator
- *
- * @throws Exception
- */
- public void testSessionBeanAnnotatedDecorator() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/SessionBeanAnnotatedDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, 6, 7);
- }
-
- /**
- * 3.2. Session beans
- * - session bean with a parameterized bean class declares any scope other than @Dependent
- *
- * @throws Exception
- */
- public void testNonDependentGenericSessionBeanNotOk() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/FooBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE, 6);
- }
-
- /**
- * 3.2.4. Specializing a session bean
- * - session bean class annotated @Specializes does not directly extend the bean class of another session bean
- *
- * @throws Exception
- */
- public void testSpecializingClassDirectlyExtendsSimpleBean() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/directlyExtendsSimpleBean/Tractor_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
- }
-
- /**
- * 3.2.4. Specializing a session bean
- * - session bean class annotated @Specializes does not directly extend the bean class of another session bean
- *
- * @throws Exception
- */
- public void testSpecializingEnterpriseClassImplementsInterfaceAndExtendsNothing() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/implementInterfaceAndExtendsNothing/Donkey_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
- }
-
- /**
- * 3.2.4. Specializing a session bean
- * - session bean class annotated @Specializes does not directly extend the bean class of another session bean
- *
- * @throws Exception
- */
- public void testSpecializingEnterpriseClassDirectlyExtendsNothing() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/directlyExtendsNothing/Cow_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
- }
-
- /**
- * 3.3. Producer methods
- * - producer method return type contains a wildcard type parameter
- *
- * 2.2.1 - Legal bean types
- * - a parameterized type that contains a wildcard type parameter is not a legal bean type.
- *
- * @throws Exception
- */
- public void testParameterizedReturnTypeWithWildcard() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/SpiderProducer.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, 24);
- }
-
- /**
- * 3.3. Producer methods
- * - producer method return type is a type variable
- *
- * 2.2.1 - Legal bean types
- * - a type variable is not a legal bean type
- *
- * @throws Exception
- */
- public void testParameterizedType() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/TProducer.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 25);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 13);
- }
-
- /**
- * 3.3. Producer methods
- * - producer method with a parameterized return type with a type variable declares any scope other than @Dependent
- *
- * @throws Exception
- */
- public void testParameterizedReturnTypeWithWrongScope() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 25, 39);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 21);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 35);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 31);
- }
-
- /**
- * 3.3.2. Declaring a producer method
- * - producer method is annotated @Inject
- *
- * @throws Exception
- */
- public void testInitializerMethodAnnotatedProduces() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/Pheasant_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 25);
- }
-
- /**
- * 3.3.2. Declaring a producer method
- * - a producer method has a parameter annotated @Disposes
- *
- * @throws Exception
- */
- public void testProducerMethodWithParameterAnnotatedDisposes() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedDisposes/SpiderProducer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 25, 26);
- }
-
- /**
- * 3.3.2. Declaring a producer method
- * - a producer method has a parameter annotated @Observers
- *
- * @throws Exception
- */
- public void testProducerMethodWithParameterAnnotatedObserves() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedObserves/SpiderProducer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 26);
- }
-
- /**
- * 3.3.2. Declaring a producer method
- * - non-static method of a session bean class is annotated @Produces, and the method is not a business method of the session bean
- *
- * @throws Exception
- */
- public void testProducerMethodOnSessionBeanMustBeBusinessMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducer.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, 25);
- }
-
- /**
- * 3.3.2. Declaring a producer method
- * - decorator has a method annotated @Produces
- *
- * @throws Exception
- */
- public void testDecoratorMustNotHaveProducerMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/DecoratorHasProducerMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 10);
- }
-
- /**
- * 3.3.2. Declaring a producer method
- * - interceptor has a method annotated @Produces
- *
- * @throws Exception
- */
- public void testInterceptorMustNotHaveProducerMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/InterceptorHasProducerMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 17);
- }
-
- /**
- * 3.3.3. Specializing a producer method
- * - method annotated @Specializes is static
- *
- * @throws Exception
- */
- public void testSpecializedStaticMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializesStaticMethod/FurnitureShop_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_STATIC, 24);
- }
-
- /**
- * 3.3.3. Specializing a producer method
- * - method annotated @Specializes does not directly override another producer method
- *
- * @throws Exception
- */
- public void testSpecializedMethodIndirectlyOverridesAnotherProducerMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/indirectOverride/ShoeShop_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_OVERRIDE, 24);
- }
-
- /**
- * 3.3.6. Declaring a disposer method
- * - method has more than one parameter annotated @Disposes
- *
- * @throws Exception
- */
- public void testMultipleDisposeParameters() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/SpiderProducer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, 30, 30);
- }
-
- /**
- * 3.3.6. Declaring a disposer method
- * - a disposer method is annotated @Produces.
- *
- * @throws Exception
- */
- public void testProducesUnallowed() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/SpiderProducer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 30, 31);
- }
-
- /**
- * 3.3.6. Declaring a disposer method
- * - a disposer method is annotated @Observes.
- *
- * @throws Exception
- */
- public void testObserverParameterUnallowed() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/SpiderProducer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 32, 32);
- }
-
- /**
- * 3.3.6. Declaring a disposer method
- * - a disposer method is annotated @Inject.
- *
- * @throws Exception
- */
- public void testInitializerUnallowed() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/SpiderProducer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 32, 33);
- }
-
- /**
- * 3.3.6. Declaring a disposer method
- * - a non-static method of a session bean class has a parameter annotated @Disposes, and the method is not a business method of the session bean
- *
- * @throws Exception
- */
- public void testDisposalMethodNotBusinessOrStatic() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/methodOnSessionBean/AppleTree.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, 31);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, 73);
- }
-
- /**
- * 3.3.6. Declaring a disposer method
- * - decorators may not declare disposer methods
- *
- * @throws Exception
- */
- public void testDecoratorDeclaresDisposer() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_DECORATOR, 6, 9);
- }
-
- /**
- * 3.3.6. Declaring a disposer method
- * - interceptors may not declare disposer methods
- *
- * @throws Exception
- */
- public void testInterceptorDeclaresDisposer() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FordInterceptor.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, 8, 16);
- }
-
- /**
- * 3.3.7. Disposer method resolution
- * - there is no producer method declared by the (same) bean class that is assignable to the disposed parameter of a disposer method
- *
- * @throws Exception
- */
- public void testUnresolvedDisposalMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/SpiderProducer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 35);
- assertMarkerIsNotCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 31);
- }
-
- /**
- * 3.3.7. Disposer method resolution
- * - there are multiple disposer methods for a single producer method
- *
- * @throws Exception
- */
- public void testMultipleDisposersForProducer() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSERS_FOR_PRODUCER, 13, 16);
- }
-
- /**
- * 3.4. Producer fields
- * - producer field type contains a wildcard type parameter
- *
- * @throws Exception
- */
- public void testParameterizedTypeWithWildcard() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/parameterizedReturnTypeWithWildcard/SpiderProducerWildCardType_Broken.java");
- assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 23, 1011, 1026);
- assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 24, 1100, 1125);
- }
-
- /**
- * 3.4. Producer fields.
- * - producer field type is a type variable
- *
- * @throws Exception
- */
- public void testTypeVariable() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, 10);
- }
-
- /**
- * 3.4. Producer fields
- * - producer field with a parameterized type with a type variable declares any scope other than @Dependent
- *
- * @throws Exception
- */
- public void testParameterizedTypeWithWrongScope() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 11, 18);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 9);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 14);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 16);
- }
-
- /**
- * 3.4.2. Declaring a producer field
- * - producer field is annotated @Inject
- *
- * 3.8.1. Declaring an injected field
- * - injected field is annotated @Produces
- *
- * @throws Exception
- */
- public void testProducerAnnotatedInject() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ProducerAnnotatedInjectBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 8);
- }
-
- /**
- * 3.4.2. Declaring a producer field
- * - non-static field of a session bean class is annotated @Produces
- *
- * @throws Exception
- */
- public void testNonStaticProducerOfSessionBean() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/NonStaticProducerOfSessionBeanBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN, 9);
- }
-
- /**
- * 3.4.2. Declaring a producer field
- * - decorator has a field annotated @Produces
- *
- * @throws Exception
- */
- public void testDecoratorMustNotHaveProducerField() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/DecoratorHasProducerFieldBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 9);
- }
-
- /**
- * 3.4.2. Declaring a producer field
- * - interceptor has a field annotated @Produces
- *
- * @throws Exception
- */
- public void testInterceptorMustNotHaveProducerField() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/InterceptorHasProducerFieldBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 16);
- }
-
- /**
- * 3.5.1. Declaring a resource
- * - producer field declaration specifies an EL name (together with one of @Resource, @PersistenceContext, @PersistenceUnit, @EJB, @WebServiceRef)
- *
- * @throws Exception
- */
- public void testResourceWithELName() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/resources/ProducerFieldsBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, 15, 19, 24, 27, 31);
- }
-
- /*
- * 3.5.1. Declaring a resource
- * - matching object in the Java EE component environment is not of the same type as the producer field declaration
- *
- * TODO needs some investigation.
- */
-
- /*
- * 3.6. Additional built-in beans
- * - Java EE component class has an injection point of type UserTransaction and qualifier @Default, and may not validly make use of the JTA UserTransaction according to the Java EE platform specification
- *
- * TODO needs some investigation.
- */
-
- /**
- * 3.7.1. Declaring a bean constructor
- * - bean class has more than one constructor annotated @Inject
- *
- * @throws Exception
- */
- public void testTooManyInitializerAnnotatedConstructor() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/tooManyInitializerAnnotatedConstructors/Goose_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_INJECTION_CONSTRUCTORS, 24, 29);
- }
-
- /**
- * 3.7.1. Declaring a bean constructor
- * - bean constructor has a parameter annotated @Disposes
- *
- * @throws Exception
- */
- public void testConstructorHasDisposesParameter() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor.java");
- assertMarkerIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES, 24, 25);
- }
-
- /**
- * 3.7.1. Declaring a bean constructor
- * - bean constructor has a parameter annotated @Observes
- *
- * @throws Exception
- */
- public void testConstructorHasObservesParameter() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor.java");
- assertMarkerIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES, 25, 26);
- }
-
- /**
- * 3.9. Initializer methods
- * - initializer method may not be static
- *
- * @throws Exception
- */
- public void testStaticInitializerMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, 11);
- }
-
- /**
- * 3.9.1. Declaring an initializer method
- * - an initializer method has a parameter annotated @Disposes
- *
- * @throws Exception
- */
- public void testInitializerMethodHasParameterAnnotatedDisposes() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/initializer/broken/parameterAnnotatedDisposes/Capercaillie_Broken.java");
- assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 25, 1003, 1010);
- assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 26, 1048, 1057);
- }
-
- /**
- * 3.9.1. Declaring an initializer method
- * - generic method of a bean is annotated @Inject
- *
- * @throws Exception
- */
- public void testGenericInitializerMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT, 7);
- }
-
- /**
- * 3.11. The qualifier @Named at injection points
- * - injection point other than injected field declares a @Named annotation that does not specify the value member
- *
- * @throws Exception
- */
- public void testNamedInjectPoint() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/NamedInjectionBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, 10, 16);
- }
-
- /**
- * 4.3.1. Direct and indirect specialization
- * - X specializes Y but does not have some bean type of Y
- *
- * @throws Exception
- */
- public void testBeanDoesNotHaveSomeTypeOfSpecializedBean() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/MissingTypeBeanBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, "MissingTypeBeanBroken", "Farmer", "Farmer"), 6);
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, "MissingTypeBeanBroken", "Farmer", "Simple"), 6);
- }
-
- /**
- * 4.3.1. Direct and indirect specialization
- * - X specializes Y and Y has a name and X declares a name explicitly, using @Named
- *
- * @throws Exception
- */
- public void testSpecializingAndSpecializedBeanHasName() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializingAndSpecializedBeanHaveName/HighSchool_Broken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, "HighSchool_Broken.getStarPupil()", "School.getStarPupil()"), 25);
- }
-
- /**
- * 4.3.1. Direct and indirect specialization
- * - interceptor is annotated @Specializes (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testSpecializingInterceptor() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/SpecializingInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES, 9);
- }
-
- /**
- * 4.3.1. Direct and indirect specialization
- * - decorator is annotated @Specializes (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testSpecializingDecorator() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/SpecializingDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_ANNOTATED_SPECIALIZES, 10);
- }
-
- /**
- * 5.1.4. Inter-module injection
- * - a decorator can not be injected
- *
- * @throws Exception
- */
- public void testDecoratorNotResolved() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/House.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INJECTED_DECORATOR, 23);
- }
-
- /**
- * 5.1.4. Inter-module injection
- * - an interceptor can not be injected
- *
- * @throws Exception
- */
- public void testInterceptorNotResolved() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InjectInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INJECTED_INTERCEPTOR, 7);
- }
-
- /**
- * 5.2.1. Unsatisfied and ambiguous dependencies
- * - If an unresolvable ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem.
- *
- * @throws Exception
- */
- public void testAmbiguousDependency() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Farm_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 25);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 34);
- }
-
- /**
- * 5.2.1. Unsatisfied and ambiguous dependencies
- * - If an unsatisfied dependency exists, the container automatically detects the problem and treats it as a deployment problem.
- *
- * @throws Exception
- */
- public void testUnsatisfiedDependency() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Bean_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 25);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 34);
- }
-
- /**
- * 5.2.2. Legal injection point types
- * - injection point type is a type variable
- *
- * @throws Exception
- */
- public void testTypeVariableInjectionPoint() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/FarmBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE, 11, 15);
- }
-
- /**
- * 5.2.4. Primitive types and null values
- * - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
- *
- * @throws Exception
- */
- public void testPrimitiveInjectionPointResolvedToNonPrimitiveProducerMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GameBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 7, 19);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 9);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 10);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 11);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 20);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 21);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 22);
- }
-
- /**
- * 5.2.5. Qualifier annotations with members
- * - annotation-valued member of a qualifier type is not annotated @Nonbinding (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testAnnotationMemberWithoutNonBinding() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/Expensive_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_QUALIFIER_TYPE_MEMBER, 35);
- }
-
- /**
- * 5.2.5. Qualifier annotations with members
- * - array-valued member of a qualifier type is not annotated @Nonbinding (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testArrayMemberWithoutNonBinding() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/binding/members/array/Expensive_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_QUALIFIER_TYPE_MEMBER, 34);
- }
-
- /**
- * 5.5.7. Injection point metadata
- * - bean that declares any scope other than @Dependent has an injection point of type InjectionPoint and qualifier @Default
- *
- * @throws Exception
- */
- public void testSessionScopedBeanWithInjectionPoint() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/Cat_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 27);
- }
-
- /**
- * 8.1.2. Decorator delegate injection points
- * - decorator has more than one delegate injection point
- *
- * @throws Exception
- */
- public void testMultipleDelegateInjectionPoints() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/multipleDelegateInjectionPoints/TimestampLogger.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DELEGATE, 31, 32);
- }
-
- /**
- * 8.1.2. Decorator delegate injection points
- * - decorator does not have a delegate injection point
- *
- * @throws Exception
- */
- public void testNoDelegateInjectionPoints() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/noDelegateInjectionPoints/TimestampLogger.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_DELEGATE, 25);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_DELEGATE);
- }
-
- /**
- * 8.1.2. Decorator delegate injection points
- * - decorator does not have a delegate injection point
- *
- * @throws Exception
- */
- public void testDecoratorDelegateInjectionPoints() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/TimestampLogger.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE, 33);
- }
-
- /**
- * 8.1.2. Decorator delegate injection points
- * - bean class that is not a decorator has an injection point annotated @Delegate
- *
- * @throws Exception
- */
- public void testNonDecoratorWithDecoratesAnnotationNotOK() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/nonDecoratorWithDecorates/Elf.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE, 24);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
- }
-
- /**
- * 8.1.3. Decorator delegate injection points
- * - delegate type does not implement or extend a decorated type of the decorator
- *
- * @throws Exception
- */
- public void testNotAllDecoratedTypesImplemented() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented/TimestampLogger.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"), 31);
- }
-
- /**
- * 8.1. Decorator delegate injection points
- * See https://jira.jboss.org/browse/JBIDE-6957
- *
- * @throws Exception
- */
- public void testAllDecoratedTypesImplemented() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLogger.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
-
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerWithMethod.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
-
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE.substring(0, 60) + ".*");
- }
-
- /**
- * 8.1.3. Decorator delegate injection points
- * - delegate type specifies different type parameters
- *
- * @throws Exception
- */
- public void testDelegateSpecifiesDifferentTypeParameterInInterfcaeInFiled() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
- }
-
- /**
- * 8.1.3. Decorator delegate injection points
- * - delegate type specifies different type parameters
- *
- * @throws Exception
- */
- public void testDelegateSpecifiesDifferentTypeParameterInInterfcaeInMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampWithMethodBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<java.lang.String>"), 10);
- }
-
- /**
- * 8.1.3. Decorator delegate injection points
- * - delegate type specifies different type parameters
- *
- * @throws Exception
- */
- public void testDelegateSpecifiesDifferentTypeParameterWithInterfaceInFiled() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
- }
-
- /**
- * 8.1.3. Decorator delegate injection points
- * - delegate type specifies different type parameters
- *
- * @throws Exception
- */
- public void testDelegateSpecifiesDifferentTypeParameterWithInterfaceInMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerWithMethodBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
- }
-
- /**
- * 8.1.3. Decorator delegate injection points
- * - delegate type specifies different type parameters
- *
- * @throws Exception
- */
- public void testDelegateSpecifiesDifferentTypeParameterInFiled() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
-
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLogger.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Test"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
- }
-
- /**
- * 8.1.3. Decorator delegate injection points
- * - delegate type specifies different type parameters
- *
- * @throws Exception
- */
- public void testDelegateSpecifiesDifferentTypeParameterInMethod() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerWithMethodBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
-
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerWithMethod.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Test"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
- }
-
- /**
- * 9.2. Declaring the interceptor bindings of an interceptor
- * - interceptor declared using @Interceptor does not declare any interceptor binding (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testNoInterceptorBinfdingsInInterceptor() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NoInterceptorBinfdingsInInterceptor.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING, 7);
-
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/SecureTransaction.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING);
- }
-
- /**
- * 9.2. Declaring the interceptor bindings of an interceptor
- * - interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
- * @PreDestroy
- *
- * @throws Exception
- */
- public void testInterceptorBinfdingsInInterceptorWithPreDestroyBroken() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithPreDestroyBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
- }
-
- /**
- * 9.2. Declaring the interceptor bindings of an interceptor
- * - interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
- * @PostConstruct
- *
- * @throws Exception
- */
- public void testInterceptorBinfdingsInInterceptorWithPostConstructBroken() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithPostConstructorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
- }
-
- /**
- * 9.2. Declaring the interceptor bindings of an interceptor
- * - interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
- *
- * @throws Exception
- */
- public void testInterceptorBinfdingsInInterceptorWithLifeCycleMethodOk() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithLifeCycleMethodOk.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/CatInterceptor.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
- }
-
- /**
- * 9.3. Binding an interceptor to a bean
- * - managed bean has a class level interceptor binding and has a non-static, non-private, final method
- *
- * @throws Exception
- */
- public void testClassLevelInterceptorBindingWithFinalMethodBroken() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassLevelInterceptorBindingWithFinalMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
- }
-
- /**
- * 9.3. Binding an interceptor to a bean
- * - managed bean has a method level interceptor binding and this method is declared as non-static, non-private, final
- *
- * @throws Exception
- */
- public void testClassWithMethodLevelInterceptorBindingWithFinalMethodBroken() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassWithMethodLevelInterceptorBindingWithFinalMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
- }
-
- /**
- * 9.3. Binding an interceptor to a bean
- * - managed bean has a class level interceptor binding and is declared final
- *
- * @throws Exception
- */
- public void testFinalClassWithClassLevelInterceptorBindingBroken() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FinalClassWithClassLevelInterceptorBindingBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 4);
- }
-
- /**
- * 9.3. Binding an interceptor to a bean
- * - managed bean has a method level interceptor binding and is declared final
- *
- * @throws Exception
- */
- public void testFinalClassWithMethodLevelInterceptorBindingBroken() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FinalClassWithMethodLevelInterceptorBindingBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 3);
- }
-
- /**
- * 9.3. Binding an interceptor to a bean
- * - managed bean has a class level interceptor binding and is declared final or has a non-static, non-private, final method
- *
- * @throws Exception
- */
- public void testClassLevelInterceptorBindingOk() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassLevelInterceptorBindingOk.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
- }
-
- /**
- * 9.3. Binding an interceptor to a bean
- * - managed bean has a method level interceptor binding and is declared final or has a non-static, non-private, final method
- *
- * @throws Exception
- */
- public void testClassWithMethodLevelInterceptorBindingOk() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassWithMethodLevelInterceptorBindingOk.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
- }
-
- /**
- * 9.5.2. Interceptor binding types with members
- * - the set of interceptor bindings of a bean or interceptor, including bindings
- * inherited from stereotypes and other interceptor bindings, has two instances
- * of a certain interceptor binding type and the instances have different values
- * of some annotation member
- *
- * @throws Exception
- */
- public void testInterceptorBindingsWithConflictingAnnotationMembersNotOk() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/broken/invalidBindingAnnotations/Foo.java");
-// assertMarkerIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 19, 20);
- //At present CDICoreValidator puts marker to class name
- assertMarkerIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 21);
- }
-
- /**
- * 9.5.2. Interceptor binding types with members
- * - annotation-valued member of an interceptor binding type is not annotated @Nonbinding (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testAnnotationTypeMemberWithoutNonBindingInInterceptorByndingType() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/members/InterceptorBindingMemberBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 19);
- assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 20);
- }
-
- /**
- * 9.5.2. Interceptor binding types with members
- * - array-valued member of an interceptor binding type is not annotated @Nonbinding (Non-Portable behavior)
- *
- * @throws Exception
- */
- public void testArrayTypeMemberWithoutNonBindingInInterceptorByndingType() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/members/InterceptorBindingMemberBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 21);
- assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 22);
- }
-
- /**
- * 10.4.2. Declaring an observer method
- * - method has more than one parameter annotated @Observes
- *
- * @throws Exception
- */
- public void testObserverMethodMustHaveOnlyOneEventParameter() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/tooManyParameters/YorkshireTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_OBSERVING_PARAMETERS, 24, 24);
- }
-
- /**
- * 10.4.2. Declaring an observer method
- * - an observer method is annotated @Produces
- *
- * @throws Exception
- */
- public void testObserverMethodAnnotatedProducesFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 25);
- }
-
- /**
- * 10.4.2. Declaring an observer method
- * - observer method is annotated @Inject
- *
- * @throws Exception
- */
- public void testObserverMethodAnnotatedInitializerFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 25, 26);
- }
-
- /**
- * 10.4.2. Declaring an observer method
- * - a observer method is annotated @Disposes.
- *
- * @throws Exception
- */
- public void testObserverMethodWithDisposesParamFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 28, 28);
- }
-
- /**
- * 10.4.2. Declaring an observer method
- * - non-static method of a session bean class has a parameter annotated @Observes, and the method is not a business method of the EJB
- *
- * @throws Exception
- */
- public void testObserverMethodOnEnterpriseBeanNotBusinessMethodOrStaticFails() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_OBSERVER_IN_SESSION_BEAN, 25);
- }
-
- /**
- * 10.4.2. Declaring an observer method
- * - interceptor has a method with a parameter annotated @Observes
- *
- * @throws Exception
- */
- public void testObserverMethodInInterceptor() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ObserverMethodInInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_INTERCEPTOR, 10);
- }
-
- /**
- * 10.4.2. Declaring an observer method
- * - decorator has a method with a parameter annotated @Observes
- *
- * @throws Exception
- */
- public void testObserverMethodInDecorator() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/ObserverMethodInDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_DECORATOR, 14);
- }
-
- /**
- * 10.4.3. Conditional observer methods
- * - bean with scope @Dependent has an observer method declared notifyObserver=IF_EXISTS
- *
- * @throws Exception
- */
- public void testDependentBeanWithConditionalObserverMethodIsDefinitionError() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/dependentIsConditionalObserver/AlarmSystem.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_CONDITIONAL_OBSERVER, 24);
- }
-
- // Wrong targets in CDI annotation types.
-
- public void testQualifierWithMissingTarget() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/broken/Hairy_MissingTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 36);
- }
-
- public void testQualifierWithMissingRetention() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/broken/Hairy_MissingRetention.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, 36);
- }
-
- public void testQualifierWithWrongTarget() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/broken/Hairy_WrongTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 32);
- }
-
- public void testQualifierWithTargetOk() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/HairyTargetOk.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 14);
- }
-
- public void testStereotypeWithMissingTarget() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE.substring(0, 56) + ".*", 19);
- }
-
- public void testStereotypeWithMissingRetention() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingRetention.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE, 19);
- }
-
- public void testStereotypeWithWrongTarget() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_WrongTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE.substring(0, 56) + ".*", 15);
- }
-
- public void testScopeWithMissingTarget() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_MissingTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 33);
- }
-
- public void testScopeWithMissingRetention() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_MissingRetention.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_SCOPE_TYPE, 33);
- }
-
- public void testScopeWithWrongTarget() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_WrongTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 30);
- }
-
- // beans.xml
-
- /**
- * 5.1.1. Declaring selected alternatives for a bean archive
- * - Each child <class> element must specify the name of an alternative bean class. If there is no class with the specified
- * name the container automatically detects the problem
- * and treats it as a deployment problem.
- */
- public void testNoAlternativeClassWithSpecifiedName() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, false, 7);
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, 19);
- }
-
- /**
- * 5.1.1. Declaring selected alternatives for a bean archive
- * - Each child <class> element must specify the name of an alternative bean class. If the class with the specified name is not an alternative bean class,
- * the container automatically detects the problem and treats it as a deployment problem.
- */
- public void testIllegalAlternativeClassWithSpecifiedName() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS, 4);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS, 19);
- }
-
- /**
- * 5.1.1. Declaring selected alternatives for a bean archive
- * - Each child <stereotype> element must specify the name of an @Alternative stereotype annotation. If there is no annotation
- * with the specified name the container automatically detects the
- * problem and treats it as a deployment problem.
- */
- public void testNoAlternativeAnnotationWithSpecifiedName() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME, 12);
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME, 17);
- }
-
- /**
- * 5.1.1. Declaring selected alternatives for a bean archive
- * - Each child <stereotype> element must specify the name of an @Alternative stereotype annotation. If the annotation is not an @Alternative stereotype,
- * the container automatically detects the problem and treats it as a deployment problem.
- */
- public void testIllegalAlternativeAnnotationWithSpecifiedName() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION, 15);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION, 17);
- }
-
- /**
- * 5.1.1. Declaring selected alternatives for a bean archive
- * - If the same type is listed twice under the <alternatives> element, the container automatically detects the problem and
- * treats it as a deployment problem.
- */
- public void testSameAlternativeClassListedTwice() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 20, 22, 26, 27);
- assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 17);
- assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 19);
- }
-
- /**
- * 8.2. Decorator enablement and ordering
- * - Each child <class> element must specify the name of a decorator bean class. If there is no class with the specified name,
- * the container automatically detects the problem and treats it as a deployment problem.
- */
- public void testNonExistantDecoratorClassInBeansXmlNotOK() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME, 32);
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME, 33);
- }
-
- /**
- * 8.2. Decorator enablement and ordering
- * - Each child <class> element must specify the name of a decorator bean class. If the class with the specified name is not a decorator bean class,
- * the container automatically detects the problem and treats it as a deployment problem.
- */
- public void testEnabledDecoratorNotADecorator() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS, 35);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS, 33);
- }
-
- /**
- * 8.2. Decorator enablement and ordering
- * - If the same class is listed twice under the <decorators> element, the container automatically detects the problem and
- * treats it as a deployment problem.
- */
- public void testDecoratorListedTwiceInBeansXmlNotOK() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, 37, 38);
- assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, 33);
- }
-
- /**
- * 9.4. Interceptor enablement and ordering
- * - Each child <class> element must specify the name of an interceptor class. If there is no class with the specified name
- * the container automatically detects the problem and treats it as a deployment problem.
- */
- public void testNonExistantClassInBeansXmlNotOk() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, 42);
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, 43);
- }
-
- /**
- * 9.4. Interceptor enablement and ordering
- * - Each child <class> element must specify the name of an interceptor class. If the class with the specified name is not an interceptor class,
- * the container automatically detects the problem and treats it as a deployment problem.
- */
- public void testNonInterceptorClassInBeansXmlNotOk() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS, 44);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS, 43);
- }
-
- /**
- * 9.4. Interceptor enablement and ordering
- * - If the same class is listed twice under the <interceptors> element, the container automatically detects the problem and treats it as
- * a deployment problem.
- */
- public void testSameInterceptorClassListedTwiceInBeansXmlNotOk() throws Exception {
- IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_INTERCEPTOR_CLASS, 46, 47);
- assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_INTERCEPTOR_CLASS, 43);
- }
-
- /**
- * https://jira.jboss.org/browse/JBIDE-6507
- *
- * @throws Exception
- */
- public void testDisabledValidator() throws Exception {
- IPreferenceStore preferenceStore = CDICorePlugin.getDefault().getPreferenceStore();
- preferenceStore.setValue(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, false);
- ((IPersistentPreferenceStore)preferenceStore).save();
-
- assertNull("CDICoreValidator is not be disabled.", getCDIValidator());
-
- preferenceStore.setValue(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, true);
- ((IPersistentPreferenceStore)preferenceStore).save();
-
- assertNotNull("CDICoreValidator is disabled.", getCDIValidator());
- }
-
- private CDICoreValidator getCDIValidator() {
- ValidationContext context = new ValidationContext(tckProject);
- List<IValidator> validators = context.getValidators();
- for (IValidator validator : validators) {
- if(validator instanceof CDICoreValidator) {
- return (CDICoreValidator)validator;
- }
- }
- return null;
- }
-
- public static int getMarkersNumber(IResource resource) {
- return AbstractResourceMarkerTest.getMarkersNumberByGroupName(resource, null);
- }
-
- private static void assertMarkerIsCreated(IResource resource, String pattern, int... expectedLines) throws CoreException {
- assertMarkerIsCreated(resource, pattern, true, expectedLines);
- }
-
- private static void assertMarkerIsCreated(IResource resource, String message, boolean pattern, int... expectedLines) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, pattern?convertMessageToPatern(message):message, pattern, expectedLines);
- }
-
- private static void assertMarkerIsNotCreated(IResource resource, String message) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message));
- }
-
- private static void assertMarkerIsNotCreated(IResource resource, String message, int expectedLine) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), expectedLine);
- }
-
- private static void assertMarkerIsCreatedForGivenPosition(IResource resource, String message, int lineNumber, int startPosition, int endPosition) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), lineNumber, startPosition, endPosition);
- }
-
- private static String convertMessageToPatern(String message) {
- return message.replace("[", "\\[").replace("]", "\\]").replace("<", "\\<").replace(">", "\\>").replace("(", "\\(").replace(")", "\\)")
- .replace("{", "\\{").replace("}", "\\}").replace("'", "\\'");
- }
-}
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AnnotationsValidationTest.java 2010-09-01 09:38:11 UTC (rev 24592)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.core.test.tck.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+
+/**
+ * Wrong targets in CDI annotation types.
+ *
+ * @author Alexey Kazakov
+ */
+public class AnnotationsValidationTest extends ValidationTest {
+
+ public void testQualifierWithMissingTarget() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/broken/Hairy_MissingTarget.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 36);
+ }
+
+ public void testQualifierWithMissingRetention() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/broken/Hairy_MissingRetention.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, 36);
+ }
+
+ public void testQualifierWithWrongTarget() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/broken/Hairy_WrongTarget.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 32);
+ }
+
+ public void testQualifierWithTargetOk() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/HairyTargetOk.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 14);
+ }
+
+ public void testStereotypeWithMissingTarget() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingTarget.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE.substring(0, 56) + ".*", 19);
+ }
+
+ public void testStereotypeWithMissingRetention() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingRetention.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE, 19);
+ }
+
+ public void testStereotypeWithWrongTarget() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_WrongTarget.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE.substring(0, 56) + ".*", 15);
+ }
+
+ public void testScopeWithMissingTarget() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_MissingTarget.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 33);
+ }
+
+ public void testScopeWithMissingRetention() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_MissingRetention.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_SCOPE_TYPE, 33);
+ }
+
+ public void testScopeWithWrongTarget() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_WrongTarget.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 30);
+ }
+}
\ 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/AnnotationsValidationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java 2010-09-01 09:38:11 UTC (rev 24592)
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.core.test.tck.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class BeansXmlValidationTest extends ValidationTest {
+
+ /**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - Each child <class> element must specify the name of an alternative bean class. If there is no class with the specified
+ * name the container automatically detects the problem
+ * and treats it as a deployment problem.
+ */
+ public void testNoAlternativeClassWithSpecifiedName() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, false, 7);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, 19);
+ }
+
+ /**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - Each child <class> element must specify the name of an alternative bean class. If the class with the specified name is not an alternative bean class,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testIllegalAlternativeClassWithSpecifiedName() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS, 4);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS, 19);
+ }
+
+ /**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - Each child <stereotype> element must specify the name of an @Alternative stereotype annotation. If there is no annotation
+ * with the specified name the container automatically detects the
+ * problem and treats it as a deployment problem.
+ */
+ public void testNoAlternativeAnnotationWithSpecifiedName() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME, 12);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME, 17);
+ }
+
+ /**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - Each child <stereotype> element must specify the name of an @Alternative stereotype annotation. If the annotation is not an @Alternative stereotype,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testIllegalAlternativeAnnotationWithSpecifiedName() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION, 15);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION, 17);
+ }
+
+ /**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - If the same type is listed twice under the <alternatives> element, the container automatically detects the problem and
+ * treats it as a deployment problem.
+ */
+ public void testSameAlternativeClassListedTwice() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 20, 22, 26, 27);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 17);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 19);
+ }
+
+ /**
+ * 8.2. Decorator enablement and ordering
+ * - Each child <class> element must specify the name of a decorator bean class. If there is no class with the specified name,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testNonExistantDecoratorClassInBeansXmlNotOK() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME, 32);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME, 33);
+ }
+
+ /**
+ * 8.2. Decorator enablement and ordering
+ * - Each child <class> element must specify the name of a decorator bean class. If the class with the specified name is not a decorator bean class,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testEnabledDecoratorNotADecorator() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS, 35);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS, 33);
+ }
+
+ /**
+ * 8.2. Decorator enablement and ordering
+ * - If the same class is listed twice under the <decorators> element, the container automatically detects the problem and
+ * treats it as a deployment problem.
+ */
+ public void testDecoratorListedTwiceInBeansXmlNotOK() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, 37, 38);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, 33);
+ }
+
+ /**
+ * 9.4. Interceptor enablement and ordering
+ * - Each child <class> element must specify the name of an interceptor class. If there is no class with the specified name
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testNonExistantClassInBeansXmlNotOk() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, 42);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, 43);
+ }
+
+ /**
+ * 9.4. Interceptor enablement and ordering
+ * - Each child <class> element must specify the name of an interceptor class. If the class with the specified name is not an interceptor class,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testNonInterceptorClassInBeansXmlNotOk() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS, 44);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS, 43);
+ }
+
+ /**
+ * 9.4. Interceptor enablement and ordering
+ * - If the same class is listed twice under the <interceptors> element, the container automatically detects the problem and treats it as
+ * a deployment problem.
+ */
+ public void testSameInterceptorClassListedTwiceInBeansXmlNotOk() throws Exception {
+ IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
+ assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_INTERCEPTOR_CLASS, 46, 47);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_INTERCEPTOR_CLASS, 43);
+ }
+}
\ 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/BeansXmlValidationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2010-09-01 09:38:11 UTC (rev 24592)
@@ -0,0 +1,1370 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.core.test.tck.validation;
+
+import java.text.MessageFormat;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class DefenitionErrorsValidationTest extends ValidationTest {
+
+ /**
+ * 2.2.2. Restricting the bean types of a bean
+ * - bean class or producer method or field specifies a @Typed annotation,
+ * and the value member specifies a class which does not correspond to a type
+ * in the unrestricted set of bean types of a bean
+ *
+ * @throws Exception
+ */
+ public void testLegalTypesInTyped() throws Exception {
+ IFile petShopFile = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java");
+ assertMarkerIsCreated(petShopFile, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD, 25);
+ int markerNumbers = getMarkersNumber(petShopFile);
+ assertEquals("PetShop.java should has the only error marker.", markerNumbers, 1);
+ }
+
+ /**
+ * 2.4.1. Built-in scope types
+ * - interceptor has any scope other than @Dependent (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testInterceptorWithWrongScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR, 8);
+ }
+
+ /**
+ * 2.4.1. Built-in scope types
+ * - decorator has any scope other than @Dependent (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testDecoratorWithWrongScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR, 7);
+ }
+
+ /**
+ * 2.4.3. Declaring the bean scope
+ * - bean class or producer method or field specifies multiple scope type annotations
+ *
+ * @throws Exception
+ */
+ public void testMultipleBeanScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/BeanWithTooManyScopeTypes_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS, 22, 23);
+ int markerNumbers = getMarkersNumber(file);
+ assertEquals("StereotypeWithTyped_Broken.java should has two error markers.", markerNumbers, 2);
+ }
+
+ /**
+ * 2.4.4. Default scope
+ * - bean does not explicitly declare a scope when there is no default scope
+ * (there are two different stereotypes declared by the bean that declare different default scopes)
+ *
+ * @throws Exception
+ */
+ public void testBeanWithMultipleScopedStereotypes() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/scopeConflict/Scallop_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, 24, 25);
+ int markerNumbers = getMarkersNumber(file);
+ assertEquals("Scallop_Broken.java should has two error markers.", markerNumbers, 2);
+ }
+
+ /**
+ * 2.5.3. Beans with no EL name
+ * - interceptor has a name (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testNamedInterceptor() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedInterceptorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 9);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedStereotypedInterceptorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 7);
+ }
+
+ /**
+ * 2.5.3. Beans with no EL name
+ * - decorator has a name (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testNamedDecorator() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedDecoratorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 10);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedStereotypedDecoratorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 8);
+ }
+
+ /**
+ * 2.6.1. Declaring an alternative
+ * - interceptor is an alternative (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testAlternativeInterceptor() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/AlternativeInterceptorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, 7);
+ }
+
+ /**
+ * 2.6.1. Declaring an alternative
+ * - decorator is an alternative (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testAlternativeDecorator() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, 7);
+ }
+
+ /**
+ * 2.7.1.1. Declaring the default scope for a stereotype
+ * - stereotype declares more than one scope
+ *
+ * @throws Exception
+ */
+ public void testStereotypeScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/tooManyScopes/StereotypeWithTooManyScopeTypes_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, 32, 33);
+ int markerNumbers = getMarkersNumber(file);
+ assertEquals("StereotypeWithTooManyScopeTypes_Broken.java should has two error markers.", markerNumbers, 2);
+ }
+
+ /**
+ * 2.7.1.3. Declaring a @Named stereotype
+ * - stereotype declares a non-empty @Named annotation (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testNonEmptyNamedForStereotype() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/nonEmptyNamed/StereotypeWithNonEmptyNamed_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_NON_EMPTY_NAME, 31);
+ int markerNumbers = getMarkersNumber(file);
+ assertEquals("StereotypeWithNonEmptyNamed_Broken.java should has the only error marker.", markerNumbers, 1);
+ }
+
+ /**
+ * 2.7.1.3. Declaring a @Named stereotype
+ * - stereotype declares any other qualifier annotation
+ *
+ * @throws Exception
+ */
+ public void testAnnotatedStereotype() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereotypeWithBindingTypes_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE, 30);
+ int markerNumbers = getMarkersNumber(file);
+ assertEquals("StereotypeWithBindingTypes_Broken.java should has the only error marker.", markerNumbers, 1);
+ }
+
+ /**
+ * 2.7.1.3. Declaring a @Named stereotype
+ * - stereotype is annotated @Typed
+ *
+ * @throws Exception
+ */
+ public void testTypedStereotype() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereotypeWithTyped_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, 15);
+ int markerNumbers = getMarkersNumber(file);
+ assertEquals("StereotypeWithTyped_Broken.java should has the only error marker.", markerNumbers, 1);
+ }
+
+ /**
+ * 3.1. Managed beans
+ * - the bean class of a managed bean is annotated with both the @Interceptor and @Decorator stereotypes
+ *
+ * @throws Exception
+ */
+ public void testInterceptorCanNotAlsoBeDecorator() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorCanNotBeDecorator/InterceptingDecorator.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, 24, 25);
+ }
+
+ /**
+ * 3.1. Managed beans
+ * - managed bean with a public field declares any scope other than @Dependent
+ *
+ * @throws Exception
+ */
+ public void testNonDependentScopedBeanCanNotHavePublicField() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/dependentWithPublicField/Leopard_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD, 21);
+ }
+
+ /**
+ * 3.1. Managed beans
+ * - managed bean with a parameterized bean class declares any scope other than @Dependent
+ *
+ * @throws Exception
+ */
+ public void testNonDependentGenericManagedBeanNotOk() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/bean/genericbroken/FooBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE, 21);
+ }
+
+ /**
+ * 3.1.4. Specializing a managed bean
+ * - managed bean class annotated @Specializes does not directly extend the bean class of another managed bean
+ * (Test a specializing bean extending a non simple bean)
+ *
+ * @throws Exception
+ */
+ public void testSpecializingClassExtendsNonSimpleBean() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Cow_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ }
+
+ /**
+ * 3.1.4. Specializing a managed bean
+ * - managed bean class annotated @Specializes does not directly extend the bean class of another managed bean
+ * (Test a specializing bean extending nothing)
+ *
+ * @throws Exception
+ */
+ public void testSpecializingClassDirectlyExtendsNothing() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ }
+
+ /**
+ * 3.1.4. Specializing a managed bean
+ * - managed bean class annotated @Specializes does not directly extend the bean class of another managed bean
+ * (Test a specializing bean directly extending an enterprise bean class)
+ *
+ * @throws Exception
+ */
+ public void testSpecializingClassDirectlyExtendsEnterpriseBean() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ }
+
+ /**
+ * 3.1.4. Specializing a managed bean
+ * - managed bean class annotated @Specializes does not directly extend the bean class of another managed bean
+ * (Test a specializing bean implementing an interface and extending nothing)
+ *
+ * @throws Exception
+ */
+ public void testSpecializingClassImplementsInterfaceAndExtendsNothing() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/Donkey_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ }
+
+ /**
+ * 3.2. Session beans
+ * - session bean specifies an illegal scope
+ * (a stateless session bean must belong to the @Dependent pseudo-scope)
+ *
+ * @throws Exception
+ */
+ public void testStatelessWithRequestScopeFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/Beagle_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ }
+
+ /**
+ * 3.2. Session beans
+ * - session bean specifies an illegal scope
+ * (a stateless session bean must belong to the @Dependent pseudo-scope)
+ *
+ * @throws Exception
+ */
+ public void testStatelessWithApplicationScopeFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/Dachshund_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ }
+
+ /**
+ * 3.2. Session beans
+ * - session bean specifies an illegal scope
+ * (a stateless session bean must belong to the @Dependent pseudo-scope)
+ *
+ * @throws Exception
+ */
+ public void testStatelessWithConversationScopeFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/Boxer_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ }
+
+ /**
+ * 3.2. Session beans
+ * - session bean specifies an illegal scope
+ * (a stateless session bean must belong to the @Dependent pseudo-scope)
+ *
+ * @throws Exception
+ */
+ public void testStatelessWithSessionScopeFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/Bullmastiff_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ }
+
+
+ /**
+ * 3.2. Session beans
+ * - session bean specifies an illegal scope
+ * (a singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope)
+ *
+ * @throws Exception
+ */
+ public void testSingletonWithConversationScopeFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/Husky_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 24);
+ }
+
+ /**
+ * 3.2. Session beans
+ * - session bean specifies an illegal scope
+ * (a singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope)
+ *
+ * @throws Exception
+ */
+ public void testSingletonWithSessionScopeFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/IrishTerrier_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 25);
+ }
+
+ /**
+ * 3.2. Session beans
+ * - session bean specifies an illegal scope
+ * (a singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope)
+ *
+ * @throws Exception
+ */
+ public void testSingletonWithRequestScopeFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/Greyhound_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 23);
+ }
+
+ /**
+ * 3.2. Session beans
+ * - bean class of a session bean is annotated @Interceptor
+ *
+ * @throws Exception
+ */
+ public void testSessionBeanAnnotatedInterceptor() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/SessionBeanAnnotatedInterceptorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, 8, 9);
+ }
+
+ /**
+ * 3.2. Session beans
+ * - bean class of a session bean is annotated @Decorator
+ *
+ * @throws Exception
+ */
+ public void testSessionBeanAnnotatedDecorator() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/SessionBeanAnnotatedDecoratorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, 6, 7);
+ }
+
+ /**
+ * 3.2. Session beans
+ * - session bean with a parameterized bean class declares any scope other than @Dependent
+ *
+ * @throws Exception
+ */
+ public void testNonDependentGenericSessionBeanNotOk() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/FooBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE, 6);
+ }
+
+ /**
+ * 3.2.4. Specializing a session bean
+ * - session bean class annotated @Specializes does not directly extend the bean class of another session bean
+ *
+ * @throws Exception
+ */
+ public void testSpecializingClassDirectlyExtendsSimpleBean() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/directlyExtendsSimpleBean/Tractor_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ }
+
+ /**
+ * 3.2.4. Specializing a session bean
+ * - session bean class annotated @Specializes does not directly extend the bean class of another session bean
+ *
+ * @throws Exception
+ */
+ public void testSpecializingEnterpriseClassImplementsInterfaceAndExtendsNothing() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/implementInterfaceAndExtendsNothing/Donkey_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ }
+
+ /**
+ * 3.2.4. Specializing a session bean
+ * - session bean class annotated @Specializes does not directly extend the bean class of another session bean
+ *
+ * @throws Exception
+ */
+ public void testSpecializingEnterpriseClassDirectlyExtendsNothing() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/directlyExtendsNothing/Cow_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ }
+
+ /**
+ * 3.3. Producer methods
+ * - producer method return type contains a wildcard type parameter
+ *
+ * 2.2.1 - Legal bean types
+ * - a parameterized type that contains a wildcard type parameter is not a legal bean type.
+ *
+ * @throws Exception
+ */
+ public void testParameterizedReturnTypeWithWildcard() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/SpiderProducer.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, 24);
+ }
+
+ /**
+ * 3.3. Producer methods
+ * - producer method return type is a type variable
+ *
+ * 2.2.1 - Legal bean types
+ * - a type variable is not a legal bean type
+ *
+ * @throws Exception
+ */
+ public void testParameterizedType() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/TProducer.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 25);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 13);
+ }
+
+ /**
+ * 3.3. Producer methods
+ * - producer method with a parameterized return type with a type variable declares any scope other than @Dependent
+ *
+ * @throws Exception
+ */
+ public void testParameterizedReturnTypeWithWrongScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 25, 39);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 21);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 35);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 31);
+ }
+
+ /**
+ * 3.3.2. Declaring a producer method
+ * - producer method is annotated @Inject
+ *
+ * @throws Exception
+ */
+ public void testInitializerMethodAnnotatedProduces() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/Pheasant_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 25);
+ }
+
+ /**
+ * 3.3.2. Declaring a producer method
+ * - a producer method has a parameter annotated @Disposes
+ *
+ * @throws Exception
+ */
+ public void testProducerMethodWithParameterAnnotatedDisposes() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedDisposes/SpiderProducer_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 25, 26);
+ }
+
+ /**
+ * 3.3.2. Declaring a producer method
+ * - a producer method has a parameter annotated @Observers
+ *
+ * @throws Exception
+ */
+ public void testProducerMethodWithParameterAnnotatedObserves() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedObserves/SpiderProducer_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 26);
+ }
+
+ /**
+ * 3.3.2. Declaring a producer method
+ * - non-static method of a session bean class is annotated @Produces, and the method is not a business method of the session bean
+ *
+ * @throws Exception
+ */
+ public void testProducerMethodOnSessionBeanMustBeBusinessMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducer.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, 25);
+ }
+
+ /**
+ * 3.3.2. Declaring a producer method
+ * - decorator has a method annotated @Produces
+ *
+ * @throws Exception
+ */
+ public void testDecoratorMustNotHaveProducerMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/DecoratorHasProducerMethodBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 10);
+ }
+
+ /**
+ * 3.3.2. Declaring a producer method
+ * - interceptor has a method annotated @Produces
+ *
+ * @throws Exception
+ */
+ public void testInterceptorMustNotHaveProducerMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/InterceptorHasProducerMethodBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 17);
+ }
+
+ /**
+ * 3.3.3. Specializing a producer method
+ * - method annotated @Specializes is static
+ *
+ * @throws Exception
+ */
+ public void testSpecializedStaticMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializesStaticMethod/FurnitureShop_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_STATIC, 24);
+ }
+
+ /**
+ * 3.3.3. Specializing a producer method
+ * - method annotated @Specializes does not directly override another producer method
+ *
+ * @throws Exception
+ */
+ public void testSpecializedMethodIndirectlyOverridesAnotherProducerMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/indirectOverride/ShoeShop_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_OVERRIDE, 24);
+ }
+
+ /**
+ * 3.3.6. Declaring a disposer method
+ * - method has more than one parameter annotated @Disposes
+ *
+ * @throws Exception
+ */
+ public void testMultipleDisposeParameters() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/SpiderProducer_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, 30, 30);
+ }
+
+ /**
+ * 3.3.6. Declaring a disposer method
+ * - a disposer method is annotated @Produces.
+ *
+ * @throws Exception
+ */
+ public void testProducesUnallowed() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/SpiderProducer_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 30, 31);
+ }
+
+ /**
+ * 3.3.6. Declaring a disposer method
+ * - a disposer method is annotated @Observes.
+ *
+ * @throws Exception
+ */
+ public void testObserverParameterUnallowed() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/SpiderProducer_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 32, 32);
+ }
+
+ /**
+ * 3.3.6. Declaring a disposer method
+ * - a disposer method is annotated @Inject.
+ *
+ * @throws Exception
+ */
+ public void testInitializerUnallowed() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/SpiderProducer_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 32, 33);
+ }
+
+ /**
+ * 3.3.6. Declaring a disposer method
+ * - a non-static method of a session bean class has a parameter annotated @Disposes, and the method is not a business method of the session bean
+ *
+ * @throws Exception
+ */
+ public void testDisposalMethodNotBusinessOrStatic() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/methodOnSessionBean/AppleTree.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, 31);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, 73);
+ }
+
+ /**
+ * 3.3.6. Declaring a disposer method
+ * - decorators may not declare disposer methods
+ *
+ * @throws Exception
+ */
+ public void testDecoratorDeclaresDisposer() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_DECORATOR, 6, 9);
+ }
+
+ /**
+ * 3.3.6. Declaring a disposer method
+ * - interceptors may not declare disposer methods
+ *
+ * @throws Exception
+ */
+ public void testInterceptorDeclaresDisposer() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FordInterceptor.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, 8, 16);
+ }
+
+ /**
+ * 3.3.7. Disposer method resolution
+ * - there is no producer method declared by the (same) bean class that is assignable to the disposed parameter of a disposer method
+ *
+ * @throws Exception
+ */
+ public void testUnresolvedDisposalMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/SpiderProducer_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 35);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 31);
+ }
+
+ /**
+ * 3.3.7. Disposer method resolution
+ * - there are multiple disposer methods for a single producer method
+ *
+ * @throws Exception
+ */
+ public void testMultipleDisposersForProducer() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSERS_FOR_PRODUCER, 13, 16);
+ }
+
+ /**
+ * 3.4. Producer fields
+ * - producer field type contains a wildcard type parameter
+ *
+ * @throws Exception
+ */
+ public void testParameterizedTypeWithWildcard() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/parameterizedReturnTypeWithWildcard/SpiderProducerWildCardType_Broken.java");
+ assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 23, 1011, 1026);
+ assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 24, 1100, 1125);
+ }
+
+ /**
+ * 3.4. Producer fields.
+ * - producer field type is a type variable
+ *
+ * @throws Exception
+ */
+ public void testTypeVariable() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, 10);
+ }
+
+ /**
+ * 3.4. Producer fields
+ * - producer field with a parameterized type with a type variable declares any scope other than @Dependent
+ *
+ * @throws Exception
+ */
+ public void testParameterizedTypeWithWrongScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 11, 18);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 9);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 14);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 16);
+ }
+
+ /**
+ * 3.4.2. Declaring a producer field
+ * - producer field is annotated @Inject
+ *
+ * 3.8.1. Declaring an injected field
+ * - injected field is annotated @Produces
+ *
+ * @throws Exception
+ */
+ public void testProducerAnnotatedInject() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ProducerAnnotatedInjectBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 8);
+ }
+
+ /**
+ * 3.4.2. Declaring a producer field
+ * - non-static field of a session bean class is annotated @Produces
+ *
+ * @throws Exception
+ */
+ public void testNonStaticProducerOfSessionBean() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/NonStaticProducerOfSessionBeanBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN, 9);
+ }
+
+ /**
+ * 3.4.2. Declaring a producer field
+ * - decorator has a field annotated @Produces
+ *
+ * @throws Exception
+ */
+ public void testDecoratorMustNotHaveProducerField() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/DecoratorHasProducerFieldBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 9);
+ }
+
+ /**
+ * 3.4.2. Declaring a producer field
+ * - interceptor has a field annotated @Produces
+ *
+ * @throws Exception
+ */
+ public void testInterceptorMustNotHaveProducerField() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/InterceptorHasProducerFieldBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 16);
+ }
+
+ /**
+ * 3.5.1. Declaring a resource
+ * - producer field declaration specifies an EL name (together with one of @Resource, @PersistenceContext, @PersistenceUnit, @EJB, @WebServiceRef)
+ *
+ * @throws Exception
+ */
+ public void testResourceWithELName() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/resources/ProducerFieldsBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, 15, 19, 24, 27, 31);
+ }
+
+ /*
+ * 3.5.1. Declaring a resource
+ * - matching object in the Java EE component environment is not of the same type as the producer field declaration
+ *
+ * TODO needs some investigation.
+ */
+
+ /*
+ * 3.6. Additional built-in beans
+ * - Java EE component class has an injection point of type UserTransaction and qualifier @Default, and may not validly make use of the JTA UserTransaction according to the Java EE platform specification
+ *
+ * TODO needs some investigation.
+ */
+
+ /**
+ * 3.7.1. Declaring a bean constructor
+ * - bean class has more than one constructor annotated @Inject
+ *
+ * @throws Exception
+ */
+ public void testTooManyInitializerAnnotatedConstructor() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/tooManyInitializerAnnotatedConstructors/Goose_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_INJECTION_CONSTRUCTORS, 24, 29);
+ }
+
+ /**
+ * 3.7.1. Declaring a bean constructor
+ * - bean constructor has a parameter annotated @Disposes
+ *
+ * @throws Exception
+ */
+ public void testConstructorHasDisposesParameter() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES, 24, 25);
+ }
+
+ /**
+ * 3.7.1. Declaring a bean constructor
+ * - bean constructor has a parameter annotated @Observes
+ *
+ * @throws Exception
+ */
+ public void testConstructorHasObservesParameter() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES, 25, 26);
+ }
+
+ /**
+ * 3.9. Initializer methods
+ * - initializer method may not be static
+ *
+ * @throws Exception
+ */
+ public void testStaticInitializerMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, 11);
+ }
+
+ /**
+ * 3.9.1. Declaring an initializer method
+ * - an initializer method has a parameter annotated @Disposes
+ *
+ * @throws Exception
+ */
+ public void testInitializerMethodHasParameterAnnotatedDisposes() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/initializer/broken/parameterAnnotatedDisposes/Capercaillie_Broken.java");
+ assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 25, 1003, 1010);
+ assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 26, 1048, 1057);
+ }
+
+ /**
+ * 3.9.1. Declaring an initializer method
+ * - generic method of a bean is annotated @Inject
+ *
+ * @throws Exception
+ */
+ public void testGenericInitializerMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT, 7);
+ }
+
+ /**
+ * 3.11. The qualifier @Named at injection points
+ * - injection point other than injected field declares a @Named annotation that does not specify the value member
+ *
+ * @throws Exception
+ */
+ public void testNamedInjectPoint() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/NamedInjectionBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, 10, 16);
+ }
+
+ /**
+ * 4.3.1. Direct and indirect specialization
+ * - X specializes Y but does not have some bean type of Y
+ *
+ * @throws Exception
+ */
+ public void testBeanDoesNotHaveSomeTypeOfSpecializedBean() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/MissingTypeBeanBroken.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, "MissingTypeBeanBroken", "Farmer", "Farmer"), 6);
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, "MissingTypeBeanBroken", "Farmer", "Simple"), 6);
+ }
+
+ /**
+ * 4.3.1. Direct and indirect specialization
+ * - X specializes Y and Y has a name and X declares a name explicitly, using @Named
+ *
+ * @throws Exception
+ */
+ public void testSpecializingAndSpecializedBeanHasName() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializingAndSpecializedBeanHaveName/HighSchool_Broken.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, "HighSchool_Broken.getStarPupil()", "School.getStarPupil()"), 25);
+ }
+
+ /**
+ * 4.3.1. Direct and indirect specialization
+ * - interceptor is annotated @Specializes (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testSpecializingInterceptor() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/SpecializingInterceptorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES, 9);
+ }
+
+ /**
+ * 4.3.1. Direct and indirect specialization
+ * - decorator is annotated @Specializes (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testSpecializingDecorator() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/SpecializingDecoratorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_ANNOTATED_SPECIALIZES, 10);
+ }
+
+ /**
+ * 5.1.4. Inter-module injection
+ * - a decorator can not be injected
+ *
+ * @throws Exception
+ */
+ public void testDecoratorNotResolved() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/House.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.INJECTED_DECORATOR, 23);
+ }
+
+ /**
+ * 5.1.4. Inter-module injection
+ * - an interceptor can not be injected
+ *
+ * @throws Exception
+ */
+ public void testInterceptorNotResolved() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InjectInterceptorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.INJECTED_INTERCEPTOR, 7);
+ }
+
+ /**
+ * 5.2.2. Legal injection point types
+ * - injection point type is a type variable
+ *
+ * @throws Exception
+ */
+ public void testTypeVariableInjectionPoint() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/FarmBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE, 11, 15);
+ }
+
+ /**
+ * 5.2.5. Qualifier annotations with members
+ * - annotation-valued member of a qualifier type is not annotated @Nonbinding (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testAnnotationMemberWithoutNonBinding() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/Expensive_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_QUALIFIER_TYPE_MEMBER, 35);
+ }
+
+ /**
+ * 5.2.5. Qualifier annotations with members
+ * - array-valued member of a qualifier type is not annotated @Nonbinding (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testArrayMemberWithoutNonBinding() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/binding/members/array/Expensive_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_QUALIFIER_TYPE_MEMBER, 34);
+ }
+
+ /**
+ * 5.5.7. Injection point metadata
+ * - bean that declares any scope other than @Dependent has an injection point of type InjectionPoint and qualifier @Default
+ *
+ * @throws Exception
+ */
+ public void testSessionScopedBeanWithInjectionPoint() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/Cat_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 27);
+ }
+
+ /**
+ * 8.1.2. Decorator delegate injection points
+ * - decorator has more than one delegate injection point
+ *
+ * @throws Exception
+ */
+ public void testMultipleDelegateInjectionPoints() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/multipleDelegateInjectionPoints/TimestampLogger.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DELEGATE, 31, 32);
+ }
+
+ /**
+ * 8.1.2. Decorator delegate injection points
+ * - decorator does not have a delegate injection point
+ *
+ * @throws Exception
+ */
+ public void testNoDelegateInjectionPoints() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/noDelegateInjectionPoints/TimestampLogger.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_DELEGATE, 25);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_DELEGATE);
+ }
+
+ /**
+ * 8.1.2. Decorator delegate injection points
+ * - decorator does not have a delegate injection point
+ *
+ * @throws Exception
+ */
+ public void testDecoratorDelegateInjectionPoints() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/TimestampLogger.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE, 33);
+ }
+
+ /**
+ * 8.1.2. Decorator delegate injection points
+ * - bean class that is not a decorator has an injection point annotated @Delegate
+ *
+ * @throws Exception
+ */
+ public void testNonDecoratorWithDecoratesAnnotationNotOK() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/nonDecoratorWithDecorates/Elf.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE, 24);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
+ }
+
+ /**
+ * 8.1.3. Decorator delegate injection points
+ * - delegate type does not implement or extend a decorated type of the decorator
+ *
+ * @throws Exception
+ */
+ public void testNotAllDecoratedTypesImplemented() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented/TimestampLogger.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"), 31);
+ }
+
+ /**
+ * 8.1. Decorator delegate injection points
+ * See https://jira.jboss.org/browse/JBIDE-6957
+ *
+ * @throws Exception
+ */
+ public void testAllDecoratedTypesImplemented() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLogger.java");
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerWithMethod.java");
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE.substring(0, 60) + ".*");
+ }
+
+ /**
+ * 8.1.3. Decorator delegate injection points
+ * - delegate type specifies different type parameters
+ *
+ * @throws Exception
+ */
+ public void testDelegateSpecifiesDifferentTypeParameterInInterfcaeInFiled() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampBroken.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
+ }
+
+ /**
+ * 8.1.3. Decorator delegate injection points
+ * - delegate type specifies different type parameters
+ *
+ * @throws Exception
+ */
+ public void testDelegateSpecifiesDifferentTypeParameterInInterfcaeInMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampWithMethodBroken.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<java.lang.String>"), 10);
+ }
+
+ /**
+ * 8.1.3. Decorator delegate injection points
+ * - delegate type specifies different type parameters
+ *
+ * @throws Exception
+ */
+ public void testDelegateSpecifiesDifferentTypeParameterWithInterfaceInFiled() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerBroken.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
+ }
+
+ /**
+ * 8.1.3. Decorator delegate injection points
+ * - delegate type specifies different type parameters
+ *
+ * @throws Exception
+ */
+ public void testDelegateSpecifiesDifferentTypeParameterWithInterfaceInMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerWithMethodBroken.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
+ }
+
+ /**
+ * 8.1.3. Decorator delegate injection points
+ * - delegate type specifies different type parameters
+ *
+ * @throws Exception
+ */
+ public void testDelegateSpecifiesDifferentTypeParameterInFiled() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerBroken.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLogger.java");
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Test"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
+ }
+
+ /**
+ * 8.1.3. Decorator delegate injection points
+ * - delegate type specifies different type parameters
+ *
+ * @throws Exception
+ */
+ public void testDelegateSpecifiesDifferentTypeParameterInMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerWithMethodBroken.java");
+ assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerWithMethod.java");
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Test"));
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
+ }
+
+ /**
+ * 9.2. Declaring the interceptor bindings of an interceptor
+ * - interceptor declared using @Interceptor does not declare any interceptor binding (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testNoInterceptorBinfdingsInInterceptor() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NoInterceptorBinfdingsInInterceptor.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING, 7);
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/SecureTransaction.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING);
+ }
+
+ /**
+ * 9.2. Declaring the interceptor bindings of an interceptor
+ * - interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
+ * @PreDestroy
+ *
+ * @throws Exception
+ */
+ public void testInterceptorBinfdingsInInterceptorWithPreDestroyBroken() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithPreDestroyBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
+ }
+
+ /**
+ * 9.2. Declaring the interceptor bindings of an interceptor
+ * - interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
+ * @PostConstruct
+ *
+ * @throws Exception
+ */
+ public void testInterceptorBinfdingsInInterceptorWithPostConstructBroken() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithPostConstructorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
+ }
+
+ /**
+ * 9.2. Declaring the interceptor bindings of an interceptor
+ * - interceptor for lifecycle callbacks declares an interceptor binding type that is defined @Target({TYPE, METHOD})
+ *
+ * @throws Exception
+ */
+ public void testInterceptorBinfdingsInInterceptorWithLifeCycleMethodOk() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithLifeCycleMethodOk.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/CatInterceptor.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
+ }
+
+ /**
+ * 9.3. Binding an interceptor to a bean
+ * - managed bean has a class level interceptor binding and has a non-static, non-private, final method
+ *
+ * @throws Exception
+ */
+ public void testClassLevelInterceptorBindingWithFinalMethodBroken() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassLevelInterceptorBindingWithFinalMethodBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
+ }
+
+ /**
+ * 9.3. Binding an interceptor to a bean
+ * - managed bean has a method level interceptor binding and this method is declared as non-static, non-private, final
+ *
+ * @throws Exception
+ */
+ public void testClassWithMethodLevelInterceptorBindingWithFinalMethodBroken() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassWithMethodLevelInterceptorBindingWithFinalMethodBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
+ }
+
+ /**
+ * 9.3. Binding an interceptor to a bean
+ * - managed bean has a class level interceptor binding and is declared final
+ *
+ * @throws Exception
+ */
+ public void testFinalClassWithClassLevelInterceptorBindingBroken() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FinalClassWithClassLevelInterceptorBindingBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 4);
+ }
+
+ /**
+ * 9.3. Binding an interceptor to a bean
+ * - managed bean has a method level interceptor binding and is declared final
+ *
+ * @throws Exception
+ */
+ public void testFinalClassWithMethodLevelInterceptorBindingBroken() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FinalClassWithMethodLevelInterceptorBindingBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 3);
+ }
+
+ /**
+ * 9.3. Binding an interceptor to a bean
+ * - managed bean has a class level interceptor binding and is declared final or has a non-static, non-private, final method
+ *
+ * @throws Exception
+ */
+ public void testClassLevelInterceptorBindingOk() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassLevelInterceptorBindingOk.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
+ }
+
+ /**
+ * 9.3. Binding an interceptor to a bean
+ * - managed bean has a method level interceptor binding and is declared final or has a non-static, non-private, final method
+ *
+ * @throws Exception
+ */
+ public void testClassWithMethodLevelInterceptorBindingOk() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassWithMethodLevelInterceptorBindingOk.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
+ }
+
+ /**
+ * 9.5.2. Interceptor binding types with members
+ * - the set of interceptor bindings of a bean or interceptor, including bindings
+ * inherited from stereotypes and other interceptor bindings, has two instances
+ * of a certain interceptor binding type and the instances have different values
+ * of some annotation member
+ *
+ * @throws Exception
+ */
+ public void testInterceptorBindingsWithConflictingAnnotationMembersNotOk() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/broken/invalidBindingAnnotations/Foo.java");
+// assertMarkerIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 19, 20);
+ //At present CDICoreValidator puts marker to class name
+ assertMarkerIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 21);
+ }
+
+ /**
+ * 9.5.2. Interceptor binding types with members
+ * - annotation-valued member of an interceptor binding type is not annotated @Nonbinding (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testAnnotationTypeMemberWithoutNonBindingInInterceptorByndingType() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/members/InterceptorBindingMemberBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 19);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 20);
+ }
+
+ /**
+ * 9.5.2. Interceptor binding types with members
+ * - array-valued member of an interceptor binding type is not annotated @Nonbinding (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testArrayTypeMemberWithoutNonBindingInInterceptorByndingType() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/members/InterceptorBindingMemberBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 21);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 22);
+ }
+
+ /**
+ * 10.4.2. Declaring an observer method
+ * - method has more than one parameter annotated @Observes
+ *
+ * @throws Exception
+ */
+ public void testObserverMethodMustHaveOnlyOneEventParameter() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/tooManyParameters/YorkshireTerrier_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_OBSERVING_PARAMETERS, 24, 24);
+ }
+
+ /**
+ * 10.4.2. Declaring an observer method
+ * - an observer method is annotated @Produces
+ *
+ * @throws Exception
+ */
+ public void testObserverMethodAnnotatedProducesFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 25);
+ }
+
+ /**
+ * 10.4.2. Declaring an observer method
+ * - observer method is annotated @Inject
+ *
+ * @throws Exception
+ */
+ public void testObserverMethodAnnotatedInitializerFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 25, 26);
+ }
+
+ /**
+ * 10.4.2. Declaring an observer method
+ * - a observer method is annotated @Disposes.
+ *
+ * @throws Exception
+ */
+ public void testObserverMethodWithDisposesParamFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 28, 28);
+ }
+
+ /**
+ * 10.4.2. Declaring an observer method
+ * - non-static method of a session bean class has a parameter annotated @Observes, and the method is not a business method of the EJB
+ *
+ * @throws Exception
+ */
+ public void testObserverMethodOnEnterpriseBeanNotBusinessMethodOrStaticFails() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_OBSERVER_IN_SESSION_BEAN, 25);
+ }
+
+ /**
+ * 10.4.2. Declaring an observer method
+ * - interceptor has a method with a parameter annotated @Observes
+ *
+ * @throws Exception
+ */
+ public void testObserverMethodInInterceptor() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ObserverMethodInInterceptorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_INTERCEPTOR, 10);
+ }
+
+ /**
+ * 10.4.2. Declaring an observer method
+ * - decorator has a method with a parameter annotated @Observes
+ *
+ * @throws Exception
+ */
+ public void testObserverMethodInDecorator() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/ObserverMethodInDecoratorBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_DECORATOR, 14);
+ }
+
+ /**
+ * 10.4.3. Conditional observer methods
+ * - bean with scope @Dependent has an observer method declared notifyObserver=IF_EXISTS
+ *
+ * @throws Exception
+ */
+ public void testDependentBeanWithConditionalObserverMethodIsDefinitionError() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/dependentIsConditionalObserver/AlarmSystem.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_CONDITIONAL_OBSERVER, 24);
+ }
+}
\ 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/DefenitionErrorsValidationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2010-09-01 09:38:11 UTC (rev 24592)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.core.test.tck.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class DeploymentProblemsValidationTests extends ValidationTest {
+
+ /**
+ * 5.2.1. Unsatisfied and ambiguous dependencies
+ * - If an unresolvable ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem.
+ *
+ * @throws Exception
+ */
+ public void testAmbiguousDependency() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Farm_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 25);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 34);
+ }
+
+ /**
+ * 5.2.1. Unsatisfied and ambiguous dependencies
+ * - If an unsatisfied dependency exists, the container automatically detects the problem and treats it as a deployment problem.
+ *
+ * @throws Exception
+ */
+ public void testUnsatisfiedDependency() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Bean_Broken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 25);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 34);
+ }
+
+ /**
+ * 5.2.4. Primitive types and null values
+ * - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
+ *
+ * @throws Exception
+ */
+ public void testPrimitiveInjectionPointResolvedToNonPrimitiveProducerMethod() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GameBroken.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 7, 19);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 9);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 10);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 11);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 20);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 21);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 22);
+ }
+}
\ 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/DeploymentProblemsValidationTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java (from rev 24591, trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java)
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java 2010-09-01 09:38:11 UTC (rev 24592)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.test.tck.validation;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.preference.IPersistentPreferenceStore;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
+import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidationContext;
+import org.jboss.tools.jst.web.kb.validation.IValidator;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class ValidationTest extends TCKTest {
+
+ /**
+ * https://jira.jboss.org/browse/JBIDE-6507
+ *
+ * @throws Exception
+ */
+ public void testDisabledValidator() throws Exception {
+ IPreferenceStore preferenceStore = CDICorePlugin.getDefault().getPreferenceStore();
+ preferenceStore.setValue(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, false);
+ ((IPersistentPreferenceStore)preferenceStore).save();
+
+ assertNull("CDICoreValidator is not be disabled.", getCDIValidator());
+
+ preferenceStore.setValue(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, true);
+ ((IPersistentPreferenceStore)preferenceStore).save();
+
+ assertNotNull("CDICoreValidator is disabled.", getCDIValidator());
+ }
+
+ private CDICoreValidator getCDIValidator() {
+ ValidationContext context = new ValidationContext(tckProject);
+ List<IValidator> validators = context.getValidators();
+ for (IValidator validator : validators) {
+ if(validator instanceof CDICoreValidator) {
+ return (CDICoreValidator)validator;
+ }
+ }
+ return null;
+ }
+
+ public static int getMarkersNumber(IResource resource) {
+ return AbstractResourceMarkerTest.getMarkersNumberByGroupName(resource, null);
+ }
+
+ protected static void assertMarkerIsCreated(IResource resource, String pattern, int... expectedLines) throws CoreException {
+ assertMarkerIsCreated(resource, pattern, true, expectedLines);
+ }
+
+ protected static void assertMarkerIsCreated(IResource resource, String message, boolean pattern, int... expectedLines) throws CoreException {
+ AbstractResourceMarkerTest.assertMarkerIsCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, pattern?convertMessageToPatern(message):message, pattern, expectedLines);
+ }
+
+ protected static void assertMarkerIsNotCreated(IResource resource, String message) throws CoreException {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message));
+ }
+
+ protected static void assertMarkerIsNotCreated(IResource resource, String message, int expectedLine) throws CoreException {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), expectedLine);
+ }
+
+ protected static void assertMarkerIsCreatedForGivenPosition(IResource resource, String message, int lineNumber, int startPosition, int endPosition) throws CoreException {
+ AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), lineNumber, startPosition, endPosition);
+ }
+
+ protected static String convertMessageToPatern(String message) {
+ return message.replace("[", "\\[").replace("]", "\\]").replace("<", "\\<").replace(">", "\\>").replace("(", "\\(").replace(")", "\\)")
+ .replace("{", "\\{").replace("}", "\\}").replace("'", "\\'");
+ }
+}
\ 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/ValidationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 4 months
JBoss Tools SVN: r24591 - trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-01 04:58:27 -0400 (Wed, 01 Sep 2010)
New Revision: 24591
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6957 Added JUnit tests
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-09-01 08:41:50 UTC (rev 24590)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-09-01 08:58:27 UTC (rev 24591)
@@ -19,6 +19,7 @@
import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferenceStore;
import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.common.preferences.SeverityPreferences;
@@ -1069,8 +1070,16 @@
public void testNotAllDecoratedTypesImplemented() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented/TimestampLogger.java");
assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"), 31);
+ }
- file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLogger.java");
+ /**
+ * 8.1. Decorator delegate injection points
+ * See https://jira.jboss.org/browse/JBIDE-6957
+ *
+ * @throws Exception
+ */
+ public void testAllDecoratedTypesImplemented() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLogger.java");
assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
@@ -1083,6 +1092,9 @@
assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java");
+ assertMarkerIsNotCreated(file, CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE.substring(0, 60) + ".*");
}
/**
14 years, 4 months
JBoss Tools SVN: r24590 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test: tck and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-01 04:41:50 -0400 (Wed, 01 Sep 2010)
New Revision: 24590
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.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/DefaultNamedTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6957 Added JUnit tests
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 2010-09-01 08:25:52 UTC (rev 24589)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2010-09-01 08:41:50 UTC (rev 24590)
@@ -17,6 +17,7 @@
import org.jboss.tools.cdi.core.test.tck.AssignabilityOfRawAndParameterizedTypesTest;
import org.jboss.tools.cdi.core.test.tck.BeanDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.BeanSpecializationTest;
+import org.jboss.tools.cdi.core.test.tck.DecoratorDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.DefaultNamedTest;
import org.jboss.tools.cdi.core.test.tck.DynamicLookupTest;
import org.jboss.tools.cdi.core.test.tck.EnterpriseQualifierDefinitionTest;
@@ -65,6 +66,7 @@
suite.addTestSuite(QualifierWithMembersTest.class);
suite.addTestSuite(DynamicLookupTest.class);
suite.addTestSuite(InterceptorDefinitionTest.class);
+ suite.addTestSuite(DecoratorDefinitionTest.class);
suite.addTestSuite(ValidationTest.class);
suite.addTestSuite(ObserverMethodResolutionTest.class);
return new CDICoreTestSetup(suite);
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java 2010-09-01 08:41:50 UTC (rev 24590)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.core.test.tck;
+
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IDecorator;
+import org.jboss.tools.cdi.core.IParametedType;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class DecoratorDefinitionTest extends TCKTest {
+
+ /**
+ * section 8.1 b)
+ * section 8.1 c)
+ * section 11.1.1 b)
+ * section 11.3.11 a)
+ * section 11.3.11 b)
+ *
+ * @throws JavaModelException
+ */
+ public void testDecoratedTypes() throws JavaModelException, CoreException {
+ IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java");
+ assertNotNull("Can't find the bean.", bean);
+ if(!(bean instanceof IDecorator)) {
+ fail("The bean is not a decorator.");
+ }
+ IDecorator decorator = (IDecorator)bean;
+ Set<IParametedType> types = decorator.getDecoratedTypes();
+ assertContainsTypes(types,
+ "org.jboss.jsr299.tck.tests.decorators.definition.Foo",
+ "org.jboss.jsr299.tck.tests.decorators.definition.Bar",
+ "org.jboss.jsr299.tck.tests.decorators.definition.Baz");
+ }
+}
\ 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/DecoratorDefinitionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java 2010-09-01 08:25:52 UTC (rev 24589)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java 2010-09-01 08:41:50 UTC (rev 24590)
@@ -32,4 +32,4 @@
IBean bean = beans.iterator().next();
assertEquals("Wrong EL name.", "fallowDeer", bean.getName());
}
-}
+}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2010-09-01 08:25:52 UTC (rev 24589)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2010-09-01 08:41:50 UTC (rev 24590)
@@ -347,6 +347,40 @@
return false;
}
+ public static void assertContainsTypes(Set<IParametedType> types, String... typeNames) throws CoreException {
+ assertContainsTypes(true, types, typeNames);
+ }
+
+ public static void assertContainsTypes(boolean checkTheNumberOfTypes, Set<IParametedType> types, String... typeNames) throws CoreException {
+ if(checkTheNumberOfTypes) {
+ assertEquals("The number of types should be the same", typeNames.length, types.size());
+ }
+ for (String typeName : typeNames) {
+ assertContainsType(types, typeName);
+ }
+ }
+
+ public static void assertContainsType(Set<IParametedType> types, String typeName) throws CoreException {
+ StringBuffer allTheTypes = new StringBuffer("[ ");
+ for (IParametedType type : types) {
+ allTheTypes.append(type.getType().getFullyQualifiedName()).append(" ,");
+ }
+ allTheTypes.append(" ]");
+
+ for (IParametedType type : types) {
+ assertTrue("The set of types " + allTheTypes.toString() + " doesn't contain " + type.getType().getFullyQualifiedName() + " type.", containsType(types, typeName));
+ }
+ }
+
+ private static boolean containsType(Set<IParametedType> types, String typeName) throws CoreException {
+ for (IParametedType type : types) {
+ if(typeName.equals(type.getType().getFullyQualifiedName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public static void assertContainsQualifier(IBean bean, IQualifierDeclaration declaration) throws CoreException {
String typeName = declaration.getQualifier().getSourceType().getFullyQualifiedName();
Set<IQualifier> qualifiers = bean.getQualifiers();
14 years, 4 months
JBoss Tools SVN: r24589 - in trunk/as/plugins: org.jboss.ide.eclipse.archives.webtools/META-INF and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-09-01 04:25:52 -0400 (Wed, 01 Sep 2010)
New Revision: 24589
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetVCLabelProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/AbstractFilesetVirtualComponent.java
Log:
JBIDE-6961 - fileset references disappeared
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF 2010-09-01 04:40:21 UTC (rev 24588)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF 2010-09-01 08:25:52 UTC (rev 24589)
@@ -27,11 +27,11 @@
org.jboss.ide.eclipse.as.wtp.core,
org.jboss.ide.eclipse.as.wtp.ui,
org.eclipse.emf.common;bundle-version="2.5.0",
- org.eclipse.emf.ecore;bundle-version="2.5.0"
+ org.eclipse.emf.ecore;bundle-version="2.5.0",
+ org.eclipse.wst.common.modulecore.ui;bundle-version="1.0.1"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.jboss.ide.eclipse.archives,
- org.jboss.ide.eclipse.archives.webtools,
+Export-Package: org.jboss.ide.eclipse.archives.webtools,
org.jboss.ide.eclipse.archives.webtools.archivetypes,
org.jboss.ide.eclipse.archives.webtools.filesets,
org.jboss.ide.eclipse.archives.webtools.filesets.vcf,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2010-09-01 04:40:21 UTC (rev 24588)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2010-09-01 08:25:52 UTC (rev 24589)
@@ -171,14 +171,28 @@
<keywordReference id="org.eclipse.wst.server.preferenceKeywords"/>
</page>
</extension>
+ <extension
+ point="org.eclipse.wst.common.modulecore.referenceResolver">
+ <resolver
+ class="org.jboss.ide.eclipse.archives.webtools.filesets.vcf.FilesetComponentResolver"
+ id="org.jboss.ide.eclipse.archives.webtools.filesets.vcf.FilesetComponentResolver">
+ </resolver>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.modulecore.ui.referenceWizardFragment">
+ <referenceFragment
+ class="org.jboss.ide.eclipse.archives.webtools.ui.FilesetReferenceWizardFragment"
+ icon="$nl$/icons/multiple_files.gif"
+ id="org.jboss.ide.eclipse.archives.webtools.FilesetReferenceWizardFragment"
+ name="Fileset">
+ </referenceFragment>
+ </extension>
- <!-- Fileset integration for WTP Projects -->
- <extension
- point="org.jboss.ide.eclipse.as.wtp.core.referenceResolver">
- <resolver
- class="org.jboss.ide.eclipse.archives.webtools.filesets.vcf.FilesetComponentResolver"
- id="org.jboss.ide.eclipse.archives.webtools.filesets.vcf.FilesetComponentResolver">
- </resolver>
- </extension>
-
+ <extension
+ point="org.eclipse.wst.common.modulecore.ui.virtualComponentLabelProvider">
+ <provider
+ class="org.jboss.ide.eclipse.archives.webtools.filesets.vcf.FilesetVCLabelProvider"
+ weight="5">
+ </provider>
+ </extension>
</plugin>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java 2010-09-01 04:40:21 UTC (rev 24588)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java 2010-09-01 08:25:52 UTC (rev 24589)
@@ -5,7 +5,6 @@
import java.net.URLEncoder;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.emf.common.util.URI;
import org.eclipse.wst.common.componentcore.ComponentCore;
@@ -13,10 +12,9 @@
import org.eclipse.wst.common.componentcore.internal.DependencyType;
import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
import org.eclipse.wst.common.componentcore.internal.impl.PlatformURLModuleConnection;
+import org.eclipse.wst.common.componentcore.resolvers.IReferenceResolver;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.jboss.ide.eclipse.as.wtp.core.vcf.IReferenceResolver;
-import org.jboss.ide.eclipse.as.wtp.core.vcf.OutputFoldersVirtualComponent;
public class FilesetComponentResolver implements IReferenceResolver {
public static final String FILESET_SEGMENT = "org.jboss.ide.eclipse.archives.webtools.filesets.vcf.FilesetComponentResolver"; //$NON-NLS-1$
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetVCLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetVCLabelProvider.java 2010-09-01 04:40:21 UTC (rev 24588)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetVCLabelProvider.java 2010-09-01 08:25:52 UTC (rev 24589)
@@ -2,8 +2,8 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.ui.internal.propertypage.IVirtualComponentLabelProvider;
import org.jboss.ide.eclipse.archives.webtools.SharedImages;
-import org.jboss.ide.eclipse.as.wtp.ui.propertypage.IVirtualComponentLabelProvider;
public class FilesetVCLabelProvider implements IVirtualComponentLabelProvider {
@@ -28,4 +28,6 @@
return base;
}
+ public void dispose() {
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java 2010-09-01 04:40:21 UTC (rev 24588)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java 2010-09-01 08:25:52 UTC (rev 24589)
@@ -21,13 +21,16 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.wst.common.componentcore.internal.DependencyType;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualReference;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+import org.eclipse.wst.common.componentcore.ui.internal.propertypage.IReferenceEditor;
+import org.eclipse.wst.common.componentcore.ui.internal.propertypage.NewReferenceWizard;
+import org.eclipse.wst.common.componentcore.ui.internal.taskwizard.IWizardHandle;
+import org.eclipse.wst.common.componentcore.ui.internal.taskwizard.WizardFragment;
+import org.eclipse.wst.common.componentcore.ui.propertypage.IReferenceWizardConstants;
import org.jboss.ide.eclipse.archives.webtools.Messages;
import org.jboss.ide.eclipse.archives.webtools.filesets.vcf.WorkspaceFilesetVirtualComponent;
-import org.jboss.ide.eclipse.as.wtp.ui.propertypage.IReferenceEditor;
-import org.jboss.ide.eclipse.as.wtp.ui.propertypage.NewReferenceWizard;
public class FilesetReferenceWizardFragment extends WizardFragment implements IReferenceEditor {
public boolean hasComposite() {
@@ -136,9 +139,12 @@
}
public void performFinish(IProgressMonitor monitor) throws CoreException {
- getTaskModel().putObject(NewReferenceWizard.COMPONENT, getFilesetComponent());
- getTaskModel().putObject(NewReferenceWizard.COMPONENT_PATH, "/"); //$NON-NLS-1$
- getTaskModel().putObject(NewReferenceWizard.DEPENDENCY_TYPE, DependencyType.CONSUMES_LITERAL);
+ IVirtualComponent comp = getFilesetComponent();
+ IVirtualComponent rootComponent = (IVirtualComponent)getTaskModel().getObject(IReferenceWizardConstants.ROOT_COMPONENT);
+ VirtualReference ref = new VirtualReference(rootComponent, comp);
+ ref.setDependencyType(DependencyType.CONSUMES);
+ ref.setRuntimePath(new Path("/")); //$NON-NLS-1$
+ getTaskModel().putObject(NewReferenceWizard.FINAL_REFERENCE, ref);
}
protected IVirtualComponent getFilesetComponent() {
@@ -151,10 +157,10 @@
}
private WorkspaceFilesetVirtualComponent original;
- public boolean canEdit(IVirtualComponent vc) {
+ public boolean canEdit(IVirtualReference vr) {
+ IVirtualComponent vc = vr.getReferencedComponent();
if( vc instanceof WorkspaceFilesetVirtualComponent)
original = (WorkspaceFilesetVirtualComponent)vc;
return original != null;
}
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/AbstractFilesetVirtualComponent.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/AbstractFilesetVirtualComponent.java 2010-09-01 04:40:21 UTC (rev 24588)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/AbstractFilesetVirtualComponent.java 2010-09-01 08:25:52 UTC (rev 24589)
@@ -101,7 +101,7 @@
public IVirtualReference[] getReferences(Map<String, Object> options) {
// ignore
- return null;
+ return new IVirtualReference[]{};
}
public IVirtualReference[] getReferences() {
14 years, 4 months