Author: akazakov
Date: 2010-06-23 11:44:45 -0400 (Wed, 23 Jun 2010)
New Revision: 22958
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotated.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointParameter.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708 Added new validation rules:
1. Decorator has more than one delegate injection point
2. Decorator does not have a delegate injection point
3. Injection point that is not an injected field, initializer method parameter or bean
constructor method parameter is annotated @Delegate
4. Bean class that is not a decorator has an injection point annotated @Delegate
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.core;
public interface CDIConstants {
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotated.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotated.java 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotated.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -13,6 +13,7 @@
import java.util.List;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
* Represents a CDI element that can be annotated.
@@ -40,6 +41,18 @@
IAnnotationDeclaration getAnnotation(String annotationTypeName);
/**
+ * This method is similar to getAnnotation(String annotationTypeName). But
+ * JDT doesn't have API for getting IAnnotation from method parameters so
+ * this method is preferable for method parameters.
+ *
+ * @param annotationTypeName
+ * the name of the annotation type
+ * @return the text source reference of the annotation of the given annotation type, or
a null
+ * value
+ */
+ ITextSourceReference getAnnotationPosition(String annotationTypeName);
+
+ /**
* Determine if the element has an annotation of a certain annotation type.
*
* @param annotationTypeName
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -24,7 +24,7 @@
public interface IAnnotationDeclaration extends ITextSourceReference {
/**
- * Return the annotation declaration.
+ * Return the annotation declaration. May be null.
*
* @return the annotation declaration.
*/
@@ -38,7 +38,7 @@
IMember getParentMember();
/**
- * Returns the corresponding IType of the annotation.
+ * Returns the corresponding IType of the annotation. May be null.
*
* @return the corresponding IType of the annotation
*/
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IInjectionPoint.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -12,6 +12,8 @@
import java.util.Set;
+import org.jboss.tools.common.text.ITextSourceReference;
+
/**
* Represents an injection point.
*
@@ -57,7 +59,7 @@
* @return the @Delegate annotation of this injection point field or
* parameter of injection point method. May be null.
*/
- IAnnotationDeclaration getDelegateAnnotation();
+ ITextSourceReference getDelegateAnnotation();
/**
* Returns the @Inject annotation declaration
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -42,6 +42,7 @@
import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.AbstractTypeDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
*
@@ -75,6 +76,14 @@
return null;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#getAnnotationPosition(java.lang.String)
+ */
+ public ITextSourceReference getAnnotationPosition(String annotationTypeName) {
+ return getAnnotation(annotationTypeName);
+ }
+
public boolean isAnnotationPresent(String annotationTypeName) {
return definition!=null && definition.isAnnotationPresent(annotationTypeName);
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointParameter.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointParameter.java 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointParameter.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -19,6 +19,7 @@
import org.jboss.tools.cdi.core.IInjectionPointParameter;
import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.cdi.core.IQualifierDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
*
@@ -28,10 +29,18 @@
public class InjectionPointParameter extends Parameter implements
IInjectionPointParameter {
- public IAnnotationDeclaration getDelegateAnnotation() {
- return null;
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IInjectionPoint#getDelegateAnnotation()
+ */
+ public ITextSourceReference getDelegateAnnotation() {
+ return getAnnotationPosition(CDIConstants.DELEGATE_STEREOTYPE_TYPE_NAME);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IInjectionPoint#getQualifierDeclarations()
+ */
public Set<IQualifierDeclaration> getQualifierDeclarations() {
Set<IQualifierDeclaration> result = new HashSet<IQualifierDeclaration>();
//cannot implement
@@ -48,6 +57,10 @@
return result;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IInjectionPoint#isDelegate()
+ */
public boolean isDelegate() {
return isAnnotationPresent(CDIConstants.DELEGATE_STEREOTYPE_TYPE_NAME);
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -28,6 +28,7 @@
import org.jboss.tools.cdi.internal.core.impl.QualifierDeclaration;
import org.jboss.tools.cdi.internal.core.impl.ScopeDeclaration;
import org.jboss.tools.cdi.internal.core.impl.StereotypeDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
*
@@ -101,6 +102,14 @@
/*
* (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#getAnnotationPosition(java.lang.String)
+ */
+ public ITextSourceReference getAnnotationPosition(String annotationTypeName) {
+ return getAnnotation(annotationTypeName);
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.jboss.tools.cdi.core.IAnnotated#isAnnotationPresent(java.lang.String)
*/
public boolean isAnnotationPresent(String annotationTypeName) {
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/ParameterDefinition.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -1,10 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl.definition;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotated;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
@@ -35,18 +48,46 @@
return methodDefinition;
}
+ /**
+ * JDT doesn't have API for annotations for method params. So this method will
return a wrapper for ITextSourceReference.
+ * Use getAnnotationPosition() instead.
+ *
+ * @see org.jboss.tools.cdi.core.IAnnotated#getAnnotation(java.lang.String)
+ */
public IAnnotationDeclaration getAnnotation(String annotationTypeName) {
- return null;
+ ITextSourceReference reference = getAnnotationPosition(annotationTypeName);
+ if(reference==null) {
+ return null;
+ }
+ // JDT doesn't have API for annotations for method params. So let's wrap
ITextSourceReference into IAnnotationDeclaration.
+ AnnotationDeclaration ad = new AnnotationDeclaration();
+ ad.setDeclaration(null, methodDefinition.getMethod().getDeclaringType());
+ CDICoreNature nature =
CDICorePlugin.getCDI(methodDefinition.getResource().getProject(), false);
+ ad.setProject(nature);
+ return ad;
}
+ /**
+ * Returns an empty list because JDT doesn't have API for annotations for method
params. Use getAnnotationTypes() instead.
+ *
+ * @see org.jboss.tools.cdi.core.IAnnotated#getAnnotations()
+ */
public List<AnnotationDeclaration> getAnnotations() {
- return null;
+ return Collections.emptyList();
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#isAnnotationPresent(java.lang.String)
+ */
public boolean isAnnotationPresent(String annotationTypeName) {
return annotationsByTypeName.containsKey(annotationTypeName);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IAnnotated#getAnnotationPosition(java.lang.String)
+ */
public ITextSourceReference getAnnotationPosition(String annotationTypeName) {
return annotationsByTypeName.get(annotationTypeName);
}
@@ -69,4 +110,4 @@
String text =
methodDefinition.getTypeDefinition().getContent().substring(pos.getStartPosition(),
pos.getStartPosition() + pos.getLength());
return text;
}
-}
+}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -48,6 +48,7 @@
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.IInjectionPointMethod;
import org.jboss.tools.cdi.core.IInjectionPointParameter;
import org.jboss.tools.cdi.core.IInterceptor;
@@ -1004,6 +1005,14 @@
}
}
}
+ /*
+ * 8.1.2. Decorator delegate injection points
+ * - bean class that is not a decorator has an injection point annotated @Delegate
+ */
+ if(!(injection.getClassBean() instanceof IDecorator) && injection.isDelegate())
{
+ ITextSourceReference reference = injection.getDelegateAnnotation();
+ addError(CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE,
CDIPreferences.ILLEGAL_BEAN_DECLARING_DELEGATE, reference, injection.getResource());
+ }
}
/**
@@ -1264,6 +1273,44 @@
for (IProducer producer : producers) {
addError(CDIValidationMessages.PRODUCER_IN_DECORATOR,
CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR, producer.getProducesAnnotation(),
decorator.getResource());
}
+
+ Set<IInjectionPoint> injections = decorator.getInjectionPoints();
+ Set<ITextSourceReference> delegates = new HashSet<ITextSourceReference>();
+ for (IInjectionPoint injection : injections) {
+ ITextSourceReference delegateAnnotation = injection.getDelegateAnnotation();
+ if(delegateAnnotation!=null) {
+ if(injection instanceof IInjectionPointField) {
+ delegates.add(delegateAnnotation);
+ }
+ if(injection instanceof IInjectionPointParameter) {
+ if(((IInjectionPointParameter)
injection).getBeanMethod().getAnnotation(CDIConstants.PRODUCES_ANNOTATION_TYPE_NAME)==null)
{
+ delegates.add(delegateAnnotation);
+ } else {
+ /*
+ * 8.1.2. Decorator delegate injection points
+ * - injection point that is not an injected field, initializer method parameter
or bean constructor method parameter is annotated @Delegate
+ */
+ addError(CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE,
CDIPreferences.ILLEGAL_INJECTION_POINT_DELEGATE, delegateAnnotation,
decorator.getResource());
+ }
+ }
+ }
+ }
+ if(delegates.size()>1) {
+ /*
+ * 8.1.2. Decorator delegate injection points
+ * - decorator has more than one delegate injection point
+ */
+ for (ITextSourceReference declaration : delegates) {
+ addError(CDIValidationMessages.MULTIPLE_DELEGATE, CDIPreferences.MULTIPLE_DELEGATE,
declaration, decorator.getResource());
+ }
+ } else if(delegates.isEmpty()) {
+ /*
+ * 8.1.2. Decorator delegate injection points
+ * - decorator does not have a delegate injection point
+ */
+ IAnnotationDeclaration declaration = decorator.getDecoratorAnnotation();
+ addError(CDIValidationMessages.MISSING_DELEGATE, CDIPreferences.MISSING_DELEGATE,
declaration, decorator.getResource());
+ }
}
/*
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-06-23
15:44:45 UTC (rev 22958)
@@ -147,10 +147,6 @@
- Java EE component class supporting injection that is not a bean has an injection
point of type InjectionPoint and qualifier @Default (JBT: let's ignore this rule so
far since we don't have any good tool to recognize such components)
-
-
-
-
8.1.2. Decorator delegate injection points
- decorator has more than one delegate injection point, or
does not have a delegate injection point
@@ -158,6 +154,11 @@
or bean constructor method parameter is annotated @Delegate
- bean class that is not a decorator has an injection point annotated @Delegate
+
+
+
+
+
8.1.3. Decorated types of a decorator
- delegate type does not implement or extend a decorated type of the decorator,
or specifies different type parameters
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-06-23
15:44:45 UTC (rev 22958)
@@ -64,10 +64,10 @@
PRODUCER_IN_DECORATOR=Producer cannot be declared in a decorator
DISPOSER_IN_INTERCEPTOR=Interceptor has a method annotated @Disposes
DISPOSER_IN_DECORATOR=Decorator has a method annotated @Disposes
-MULTIPLE_DELEGATE=Decorator has more than one delegate injection point
-MISSING_DELEGATE=Decorator does not have a delegate injection point
-ILLEGAL_INJECTION_POINT_DELEGATE=Injection point that is not an injected field,
initializer method parameter or bean constructor method parameter is annotated @Delegate
-ILLEGAL_BEAN_DECLARING_DELEGATE=Bean class that is not a decorator has an injection point
annotated @Delegate
+MULTIPLE_DELEGATE=Decorator cannot have more than one delegate injection point [JSR-299
�8.1.2]
+MISSING_DELEGATE=Decorator must have a delegate injection point [JSR-299 �8.1.2]
+ILLEGAL_INJECTION_POINT_DELEGATE=Injection point that is a producer method parameter
cannot be annotated @Delegate [JSR-299 �8.1.2]
+ILLEGAL_BEAN_DECLARING_DELEGATE=Bean class that is not a decorator cannot have an
injection point annotated @Delegate [JSR-299 �8.1.2]
DELEGATE_HAS_ILLEGAL_TYPE=Delegate type does not implement or extend a decorated type of
the decorator, or specifies different type parameters
ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING=Interceptor for lifecycle callbacks
declares an interceptor binding type that is defined @Target({TYPE, METHOD})
ILLEGAL_INTERCEPTOR_BINDING_METHOD=Non-static, non-private, final method of a managed
bean has a interceptor binding (either method level, or declaring class level)
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -107,10 +107,10 @@
{CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_sessionBeanAnnotatedInterceptorOrDecorator_label},
{CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerInInterceptorOrDecorator_label},
{CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_disposerInInterceptorOrDecorator_label},
-// {CDIPreferences.MULTIPLE_DELEGATE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_multipleDelegate_label},
-// {CDIPreferences.MISSING_DELEGATE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingDelegate_label},
-// {CDIPreferences.ILLEGAL_INJECTION_POINT_DELEGATE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalInjectionPointDelegate_label},
-// {CDIPreferences.ILLEGAL_BEAN_DECLARING_DELEGATE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalBeanDeclaringDelegate_label},
+ {CDIPreferences.MULTIPLE_DELEGATE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_multipleDelegate_label},
+ {CDIPreferences.MISSING_DELEGATE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingDelegate_label},
+ {CDIPreferences.ILLEGAL_INJECTION_POINT_DELEGATE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalInjectionPointDelegate_label},
+ {CDIPreferences.ILLEGAL_BEAN_DECLARING_DELEGATE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalBeanDeclaringDelegate_label},
// {CDIPreferences.DELEGATE_HAS_ILLEGAL_TYPE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_delegateHasIllegalType_label},
// {CDIPreferences.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalLifecycleCallbackInterceptorBinding_label},
// {CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalInterceptorBindingMethod_label},
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-06-23
15:27:12 UTC (rev 22957)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-06-23
15:44:45 UTC (rev 22958)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
@@ -32,7 +33,7 @@
*/
public void testLegalTypesInTyped() throws Exception {
IFile petShopFile =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(petShopFile,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 25);
+ assertMarkerIsCreated(petShopFile,
CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 25);
int markerNumbers = getMarkersNumber(petShopFile);
assertEquals("PetShop.java should has the only error marker.", markerNumbers,
1);
}
@@ -45,7 +46,7 @@
*/
public void testInterceptorWithWrongScope() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR, 8);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR, 8);
}
/**
@@ -56,7 +57,7 @@
*/
public void testDecoratorWithWrongScope() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR,
7);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR, 7);
}
/**
@@ -67,7 +68,7 @@
*/
public void testMultipleBeanScope() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/BeanWithTooManyScopeTypes_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS, 22, 23);
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS, 22,
23);
int markerNumbers = getMarkersNumber(file);
assertEquals("StereotypeWithTyped_Broken.java should has two error markers.",
markerNumbers, 2);
}
@@ -81,7 +82,7 @@
*/
public void testBeanWithMultipleScopedStereotypes() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/scopeConflict/Scallop_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, 24, 25);
+ 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);
}
@@ -94,9 +95,9 @@
*/
public void testNamedInterceptor() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 9);
+ assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 9);
file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedStereotypedInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 7);
+ assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 7);
}
/**
@@ -107,9 +108,9 @@
*/
public void testNamedDecorator() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DECORATOR_HAS_NAME, 10);
+ assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 10);
file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedStereotypedDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DECORATOR_HAS_NAME, 8);
+ assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 8);
}
/**
@@ -120,7 +121,7 @@
*/
public void testAlternativeInterceptor() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/AlternativeInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE,
7);
+ assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, 7);
}
/**
@@ -131,7 +132,7 @@
*/
public void testAlternativeDecorator() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DECORATOR_IS_ALTERNATIVE,
7);
+ assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, 7);
}
/**
@@ -142,7 +143,7 @@
*/
public void testStereotypeScope() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/tooManyScopes/StereotypeWithTooManyScopeTypes_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, 32, 33);
+ 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);
}
@@ -155,7 +156,7 @@
*/
public void testNonEmptyNamedForStereotype() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/nonEmptyNamed/StereotypeWithNonEmptyNamed_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.STEREOTYPE_DECLARES_NON_EMPTY_NAME, 31);
+ 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);
}
@@ -168,7 +169,7 @@
*/
public void testAnnotatedStereotype() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereotypeWithBindingTypes_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE, 30);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE,
30);
int markerNumbers = getMarkersNumber(file);
assertEquals("StereotypeWithBindingTypes_Broken.java should has the only error
marker.", markerNumbers, 1);
}
@@ -181,7 +182,7 @@
*/
public void testTypedStereotype() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereotypeWithTyped_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, 15);
+ assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, 15);
int markerNumbers = getMarkersNumber(file);
assertEquals("StereotypeWithTyped_Broken.java should has the only error
marker.", markerNumbers, 1);
}
@@ -194,7 +195,7 @@
*/
public void testInterceptorCanNotAlsoBeDecorator() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorCanNotBeDecorator/InterceptingDecorator.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, 24, 25);
+ assertMarkerIsCreated(file, CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, 24,
25);
}
/**
@@ -205,7 +206,7 @@
*/
public void testNonDependentScopedBeanCanNotHavePublicField() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/dependentWithPublicField/Leopard_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD, 21);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD, 21);
}
/**
@@ -216,7 +217,7 @@
*/
public void testNonDependentGenericManagedBeanNotOk() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/bean/genericbroken/FooBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE, 21);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE, 21);
}
/**
@@ -228,7 +229,7 @@
*/
public void testSpecializingClassExtendsNonSimpleBean() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Cow_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN,
21);
}
/**
@@ -240,7 +241,7 @@
*/
public void testSpecializingClassDirectlyExtendsNothing() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN,
21);
}
/**
@@ -252,7 +253,7 @@
*/
public void testSpecializingClassDirectlyExtendsEnterpriseBean() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN,
21);
}
/**
@@ -264,7 +265,7 @@
*/
public void testSpecializingClassImplementsInterfaceAndExtendsNothing() throws Exception
{
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/Donkey_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN,
21);
}
/**
@@ -276,7 +277,7 @@
*/
public void testStatelessWithRequestScopeFails() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/Beagle_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
/**
@@ -288,7 +289,7 @@
*/
public void testStatelessWithApplicationScopeFails() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/Dachshund_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
/**
@@ -300,7 +301,7 @@
*/
public void testStatelessWithConversationScopeFails() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/Boxer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
/**
@@ -312,7 +313,7 @@
*/
public void testStatelessWithSessionScopeFails() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/Bullmastiff_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
@@ -325,7 +326,7 @@
*/
public void testSingletonWithConversationScopeFails() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/Husky_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 24);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 24);
}
/**
@@ -337,7 +338,7 @@
*/
public void testSingletonWithSessionScopeFails() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/IrishTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 25);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 25);
}
/**
@@ -349,7 +350,7 @@
*/
public void testSingletonWithRequestScopeFails() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/Greyhound_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 23);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 23);
}
/**
@@ -360,7 +361,7 @@
*/
public void testSessionBeanAnnotatedInterceptor() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/SessionBeanAnnotatedInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, 8, 9);
+ assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR,
8, 9);
}
/**
@@ -371,7 +372,7 @@
*/
public void testSessionBeanAnnotatedDecorator() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/SessionBeanAnnotatedDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, 6, 7);
+ assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, 6,
7);
}
/**
@@ -382,7 +383,7 @@
*/
public void testNonDependentGenericSessionBeanNotOk() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/FooBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE, 6);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE, 6);
}
/**
@@ -393,7 +394,7 @@
*/
public void testSpecializingClassDirectlyExtendsSimpleBean() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/directlyExtendsSimpleBean/Tractor_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN,
22);
}
/**
@@ -404,7 +405,7 @@
*/
public void testSpecializingEnterpriseClassImplementsInterfaceAndExtendsNothing() throws
Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/implementInterfaceAndExtendsNothing/Donkey_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN,
22);
}
/**
@@ -415,7 +416,7 @@
*/
public void testSpecializingEnterpriseClassDirectlyExtendsNothing() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/directlyExtendsNothing/Cow_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN,
22);
}
/**
@@ -429,7 +430,7 @@
*/
public void testParameterizedReturnTypeWithWildcard() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/SpiderProducer.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, 24);
+ assertMarkerIsCreated(file,
CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, 24);
}
/**
@@ -443,9 +444,9 @@
*/
public void testParameterizedType() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/TProducer.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 25);
+ 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");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 13);
+ assertMarkerIsCreated(file,
CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 13);
}
/**
@@ -456,10 +457,10 @@
*/
public void testParameterizedReturnTypeWithWrongScope() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 25, 39);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 21);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 35);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 31);
+ 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);
}
/**
@@ -470,7 +471,7 @@
*/
public void testInitializerMethodAnnotatedProduces() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/Pheasant_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT,
25);
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 25);
}
/**
@@ -481,7 +482,7 @@
*/
public void testProducerMethodWithParameterAnnotatedDisposes() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedDisposes/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 25, 26);
+ assertMarkerIsCreated(file,
CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 25, 26);
}
/**
@@ -492,7 +493,7 @@
*/
public void testProducerMethodWithParameterAnnotatedObserves() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedObserves/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 26);
+ assertMarkerIsCreated(file,
CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 26);
}
/**
@@ -503,7 +504,7 @@
*/
public void testProducerMethodOnSessionBeanMustBeBusinessMethod() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducer.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, 25);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, 25);
}
/**
@@ -514,7 +515,7 @@
*/
public void testDecoratorMustNotHaveProducerMethod() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/DecoratorHasProducerMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_IN_DECORATOR, 10);
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 10);
}
/**
@@ -525,7 +526,7 @@
*/
public void testInterceptorMustNotHaveProducerMethod() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/InterceptorHasProducerMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR,
17);
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 17);
}
/**
@@ -536,7 +537,7 @@
*/
public void testSpecializedStaticMethod() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializesStaticMethod/FurnitureShop_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_STATIC, 24);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_STATIC,
24);
}
/**
@@ -547,7 +548,7 @@
*/
public void testSpecializedMethodIndirectlyOverridesAnotherProducerMethod() throws
Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/indirectOverride/ShoeShop_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_OVERRIDE, 24);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_OVERRIDE, 24);
}
/**
@@ -558,7 +559,7 @@
*/
public void testMultipleDisposeParameters() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, 30, 30);
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, 30,
30);
}
/**
@@ -569,7 +570,7 @@
*/
public void testProducesUnallowed() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 30, 31);
+ assertMarkerIsCreated(file,
CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 30, 31);
}
/**
@@ -580,7 +581,7 @@
*/
public void testObserverParameterUnallowed() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 32, 32);
+ assertMarkerIsCreated(file,
CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 32, 32);
}
/**
@@ -591,7 +592,7 @@
*/
public void testInitializerUnallowed() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT,
32, 33);
+ assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 32, 33);
}
/**
@@ -602,9 +603,9 @@
*/
public void testDisposalMethodNotBusinessOrStatic() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/methodOnSessionBean/AppleTree.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, 31);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN,
31);
file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, 73);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN,
73);
}
/**
@@ -615,7 +616,7 @@
*/
public void testDecoratorDeclaresDisposer() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DISPOSER_IN_DECORATOR, 6,
9);
+ assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_DECORATOR, 6, 9);
}
/**
@@ -626,7 +627,7 @@
*/
public void testInterceptorDeclaresDisposer() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FordInterceptor.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, 8,
16);
+ assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, 8, 16);
}
/**
@@ -637,8 +638,8 @@
*/
public void testUnresolvedDisposalMethod() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 35);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 31);
+ assertMarkerIsCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 35);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER,
31);
}
/**
@@ -649,7 +650,7 @@
*/
public void testMultipleDisposersForProducer() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.MULTIPLE_DISPOSERS_FOR_PRODUCER, 13, 16);
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSERS_FOR_PRODUCER, 13,
16);
}
/**
@@ -660,8 +661,8 @@
*/
public void testParameterizedTypeWithWildcard() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/parameterizedReturnTypeWithWildcard/SpiderProducerWildCardType_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 23, 1011, 1026);
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 24, 1100, 1125);
+ assertMarkerIsCreatedForGivenPosition(file,
CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 23, 1011, 1026);
+ assertMarkerIsCreatedForGivenPosition(file,
CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 24, 1100, 1125);
}
/**
@@ -672,7 +673,7 @@
*/
public void testTypeVariable() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, 10);
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE,
10);
}
/**
@@ -683,10 +684,10 @@
*/
public void testParameterizedTypeWithWrongScope() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 11, 18);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 9);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 14);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 16);
+ 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);
}
/**
@@ -700,7 +701,7 @@
*/
public void testProducerAnnotatedInject() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ProducerAnnotatedInjectBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT,
8);
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 8);
}
/**
@@ -711,7 +712,7 @@
*/
public void testNonStaticProducerOfSessionBean() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/NonStaticProducerOfSessionBeanBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN, 9);
+ assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN, 9);
}
/**
@@ -722,7 +723,7 @@
*/
public void testDecoratorMustNotHaveProducerField() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/DecoratorHasProducerFieldBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_IN_DECORATOR, 9);
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 9);
}
/**
@@ -733,7 +734,7 @@
*/
public void testInterceptorMustNotHaveProducerField() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/InterceptorHasProducerFieldBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR,
16);
+ assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 16);
}
/**
@@ -744,7 +745,7 @@
*/
public void testResourceWithELName() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/resources/ProducerFieldsBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, 15, 19, 24, 27, 31);
+ assertMarkerIsCreated(file, CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME,
15, 19, 24, 27, 31);
}
/*
@@ -769,7 +770,7 @@
*/
public void testTooManyInitializerAnnotatedConstructor() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/tooManyInitializerAnnotatedConstructors/Goose_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.MULTIPLE_INJECTION_CONSTRUCTORS, 24, 29);
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_INJECTION_CONSTRUCTORS, 24,
29);
}
/**
@@ -780,7 +781,7 @@
*/
public void testConstructorHasDisposesParameter() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES, 24, 25);
+ assertMarkerIsCreated(file,
CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES, 24, 25);
}
/**
@@ -791,7 +792,7 @@
*/
public void testConstructorHasObservesParameter() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES, 25, 26);
+ assertMarkerIsCreated(file,
CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES, 25, 26);
}
/**
@@ -802,7 +803,7 @@
*/
public void testStaticInitializerMethod() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, 11);
+ assertMarkerIsCreated(file, CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, 11);
}
/**
@@ -813,8 +814,8 @@
*/
public void testInitializerMethodHasParameterAnnotatedDisposes() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/initializer/broken/parameterAnnotatedDisposes/Capercaillie_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT,
25, 1003, 1010);
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT,
26, 1048, 1057);
+ assertMarkerIsCreatedForGivenPosition(file,
CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 25, 1003, 1010);
+ assertMarkerIsCreatedForGivenPosition(file,
CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 26, 1048, 1057);
}
/**
@@ -825,7 +826,7 @@
*/
public void testGenericInitializerMethod() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT, 7);
+ assertMarkerIsCreated(file, CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT, 7);
}
/**
@@ -836,7 +837,7 @@
*/
public void testNamedInjectPoint() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/NamedInjectionBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, 10, 16);
+ assertMarkerIsCreated(file, CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME,
10, 16);
}
/**
@@ -847,8 +848,8 @@
*/
public void testBeanDoesNotHaveSomeTypeOfSpecializedBean() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/MissingTypeBeanBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN,
"MissingTypeBeanBroken", "Farmer", "Farmer"), 6);
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN,
"MissingTypeBeanBroken", "Farmer", "Simple"), 6);
+ 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);
}
/**
@@ -859,7 +860,7 @@
*/
public void testSpecializingAndSpecializedBeanHasName() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializingAndSpecializedBeanHaveName/HighSchool_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
MessageFormat.format(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN,
"HighSchool_Broken.getStarPupil()", "School.getStarPupil()"), 25);
+ assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN,
"HighSchool_Broken.getStarPupil()", "School.getStarPupil()"), 25);
}
/**
@@ -870,7 +871,7 @@
*/
public void testSpecializingInterceptor() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/SpecializingInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES, 9);
+ assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES,
9);
}
/**
@@ -881,7 +882,7 @@
*/
public void testSpecializingDecorator() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/SpecializingDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.DECORATOR_ANNOTATED_SPECIALIZES, 10);
+ assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_ANNOTATED_SPECIALIZES,
10);
}
/**
@@ -892,7 +893,7 @@
*/
public void testDecoratorNotResolved() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/House.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.INJECTED_DECORATOR, 23);
+ assertMarkerIsCreated(file, CDIValidationMessages.INJECTED_DECORATOR, 23);
}
/**
@@ -903,7 +904,7 @@
*/
public void testInterceptorNotResolved() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InjectInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.INJECTED_INTERCEPTOR, 7);
+ assertMarkerIsCreated(file, CDIValidationMessages.INJECTED_INTERCEPTOR, 7);
}
/**
@@ -914,9 +915,9 @@
*/
public void testAmbiguousDependency() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Farm_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS,
25);
+ assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 25);
file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS,
34);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 34);
}
/**
@@ -927,9 +928,9 @@
*/
public void testUnsatisfiedDependency() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Bean_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 25);
+ assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 25);
file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 34);
+ assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS,
34);
}
/**
@@ -940,7 +941,7 @@
*/
public void testTypeVariableInjectionPoint() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/FarmBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE,
11, 15);
+ assertMarkerIsCreated(file, CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE, 11, 15);
}
/**
@@ -951,13 +952,13 @@
*/
public void testPrimitiveInjectionPointResolvedToNonPrimitiveProducerMethod() throws
Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GameBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 7, 19);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 9);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 10);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 11);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 20);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 21);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 22);
+ 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);
}
/**
@@ -968,7 +969,7 @@
*/
public void testAnnotationMemberWithoutNonBinding() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/Expensive_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_QUALIFIER_TYPE_MEMBER,
35);
+ assertMarkerIsCreated(file,
CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_QUALIFIER_TYPE_MEMBER,
35);
}
/**
@@ -979,7 +980,7 @@
*/
public void testArrayMemberWithoutNonBinding() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/binding/members/array/Expensive_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_QUALIFIER_TYPE_MEMBER, 34);
+ assertMarkerIsCreated(file,
CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_QUALIFIER_TYPE_MEMBER, 34);
}
/**
@@ -990,10 +991,68 @@
*/
public void testSessionScopedBeanWithInjectionPoint() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/Cat_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 27);
+ 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);
+ 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);
+ }
+
+ /**
* 10.4.2. Declaring an observer method
* - method has more than one parameter annotated @Observes
*
@@ -1001,7 +1060,7 @@
*/
public void testObserverMethodMustHaveOnlyOneEventParameter() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/tooManyParameters/YorkshireTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.MULTIPLE_OBSERVING_PARAMETERS, 24, 24);
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_OBSERVING_PARAMETERS, 24,
24);
}
/**
@@ -1012,7 +1071,7 @@
*/
public void testObserverMethodAnnotatedProducesFails() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 25);
+ assertMarkerIsCreated(file,
CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 25);
}
/**
@@ -1023,7 +1082,7 @@
*/
public void testObserverMethodAnnotatedInitializerFails() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT,
25, 26);
+ assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 25, 26);
}
/**
@@ -1034,7 +1093,7 @@
*/
public void testObserverMethodWithDisposesParamFails() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 28, 28);
+ assertMarkerIsCreated(file,
CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 28, 28);
}
/**
@@ -1045,10 +1104,30 @@
*/
public void testObserverMethodOnEnterpriseBeanNotBusinessMethodOrStaticFails() throws
Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_OBSERVER_IN_SESSION_BEAN, 25);
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_OBSERVER_IN_SESSION_BEAN,
25);
}
public static int getMarkersNumber(IResource resource) {
return AbstractResourceMarkerTest.getMarkersNumberByGroupName(resource, null);
}
+
+ private static void assertMarkerIsCreated(IResource resource, String message, int...
expectedLines) throws CoreException {
+ AbstractResourceMarkerTest.assertMarkerIsCreated(resource,
AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), 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("]",
"\\]");
+ }
}
\ No newline at end of file