Author: akazakov
Date: 2010-04-15 09:47:31 -0400 (Thu, 15 Apr 2010)
New Revision: 21495
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotyped.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotype.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.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.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 Implemented new validation rules: Decorator
or Interceptor has a name.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java 2010-04-15
13:44:55 UTC (rev 21494)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java 2010-04-15
13:47:31 UTC (rev 21495)
@@ -21,7 +21,7 @@
*
* @author Alexey Kazakov
*/
-public interface IBean extends IScoped, ICDIElement, IVariable, IAnnotated {
+public interface IBean extends IScoped, IStereotyped, ICDIElement, IVariable, IAnnotated
{
/**
* Returns the corresponding IType of the managed bean or session bean or of
@@ -107,14 +107,6 @@
Set<IQualifier> getQualifiers();
/**
- * Obtains the stereotype declarations of the bean class or producer method
- * or field.
- *
- * @return the set of stereotype declarations
- */
- Set<IStereotypeDeclaration> getStereotypeDeclarations();
-
- /**
* Determines if the bean is an alternative.
*
* @return <tt>true</tt> if the bean is an alternative, and
<tt>false</tt>
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotype.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotype.java 2010-04-15
13:44:55 UTC (rev 21494)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotype.java 2010-04-15
13:47:31 UTC (rev 21495)
@@ -19,7 +19,7 @@
*
* @author Alexey Kazakov
*/
-public interface IStereotype extends IScoped, ICDINamedAnnotation {
+public interface IStereotype extends IScoped, IStereotyped, ICDINamedAnnotation {
/**
* Returns the location of @Name declaration of this stereotype. If the bean
@@ -50,11 +50,4 @@
* @return the location of @Alternative declaration.
*/
IAnnotationDeclaration getAlternativeDeclaration();
-
- /**
- * Obtains the stereotype declarations of the stereotype.
- *
- * @return the set of stereotype declarations
- */
- Set<IStereotypeDeclaration> getStereotypeDeclarations();
}
\ No newline at end of file
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotyped.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotyped.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotyped.java 2010-04-15
13:47:31 UTC (rev 21495)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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;
+
+import java.util.Set;
+
+/**
+ * Represents an element that can has stereotypes.
+ *
+ * @author Alexey Kazakov
+ */
+public interface IStereotyped {
+
+ /**
+ * Obtains the stereotype declarations of the element (bean class or
+ * producer method or field or stereotype).
+ *
+ * @return the set of stereotype declarations
+ */
+ Set<IStereotypeDeclaration> getStereotypeDeclarations();
+}
\ No newline at end of file
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IStereotyped.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-04-15
13:44:55 UTC (rev 21494)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-04-15
13:47:31 UTC (rev 21495)
@@ -31,5 +31,7 @@
for (String name : CDIPreferences.SEVERITY_OPTION_NAMES) {
defaultPreferences.put(name, SeverityPreferences.ERROR);
}
+ defaultPreferences.put(CDIPreferences.INTERCEPTOR_HAS_NAME, CDIPreferences.WARNING);
+ defaultPreferences.put(CDIPreferences.DECORATOR_HAS_NAME, CDIPreferences.WARNING);
}
}
\ 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-04-15
13:44:55 UTC (rev 21494)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-04-15
13:47:31 UTC (rev 21495)
@@ -37,8 +37,10 @@
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.ICDIProject;
+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.IInterceptor;
import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IProducer;
import org.jboss.tools.cdi.core.IProducerField;
@@ -47,6 +49,7 @@
import org.jboss.tools.cdi.core.IScopeDeclaration;
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
+import org.jboss.tools.cdi.core.IStereotyped;
import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.cdi.core.preferences.CDIPreferences;
import org.jboss.tools.common.text.ITextSourceReference;
@@ -277,12 +280,24 @@
validateInjectionPoint(point);
}
+ if(bean instanceof IInterceptor) {
+ validateInterceptor((IInterceptor)bean);
+ }
+
+ if(bean instanceof IDecorator) {
+ validateDecorator((IDecorator)bean);
+ }
+
// TODO
}
private static final String[] RESOURCE_ANNOTATIONS =
{CDIConstants.RESOURCE_ANNOTATION_TYPE_NAME,
CDIConstants.WEB_SERVICE_REF_ANNOTATION_TYPE_NAME, CDIConstants.EJB_ANNOTATION_TYPE_NAME,
CDIConstants.PERSISTENCE_CONTEXT_ANNOTATION_TYPE_NAME,
CDIConstants.PERSISTENCE_UNIT_ANNOTATION_TYPE_NAME};
private void validateProducer(IProducer producer) {
+ /*
+ * 3.5.1. Declaring a resource
+ * - producer field declaration specifies an EL name (together with one of @Resource,
@PersistenceContext, @PersistenceUnit, @EJB, @WebServiceRef)
+ */
if(producer instanceof IProducerField) {
IProducerField producerField = (IProducerField)producer;
if(producerField.getName()!=null) {
@@ -302,6 +317,10 @@
}
private void validateInjectionPoint(IInjectionPoint injection) {
+ /*
+ * 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
+ */
if(!(injection instanceof IInjectionPointField)) {
IAnnotationDeclaration named =
injection.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
if(named!=null) {
@@ -324,6 +343,51 @@
}
}
+ private void validateInterceptor(IInterceptor interceptor) {
+ /*
+ * 2.5.3. Beans with no EL name - interceptor has a name (Non-Portable
+ * behavior)
+ */
+ if(interceptor.getName()!=null) {
+ ITextSourceReference declaration =
interceptor.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+ if (declaration == null) {
+ declaration =
interceptor.getAnnotation(CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME);
+ }
+ if(declaration==null) {
+ declaration = getNamedStereotypeDeclaration(interceptor);
+ }
+ addError(CDIValidationMessages.INTERCEPTOR_HAS_NAME,
CDIPreferences.INTERCEPTOR_HAS_NAME, declaration, interceptor.getResource());
+ }
+ }
+
+ private void validateDecorator(IDecorator decorator) {
+ /*
+ * 2.5.3. Beans with no EL name
+ * - decorator has a name (Non-Portable behavior)
+ */
+ if(decorator.getName()!=null) {
+ ITextSourceReference declaration =
decorator.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+ if (declaration == null) {
+ declaration = decorator.getAnnotation(CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME);
+ }
+ if(declaration==null) {
+ declaration = getNamedStereotypeDeclaration(decorator);
+ }
+ addError(CDIValidationMessages.DECORATOR_HAS_NAME, CDIPreferences.DECORATOR_HAS_NAME,
declaration, decorator.getResource());
+ }
+ }
+
+ private IAnnotationDeclaration getNamedStereotypeDeclaration(IStereotyped stereotyped)
{
+ Set<IStereotypeDeclaration> declarations =
stereotyped.getStereotypeDeclarations();
+ for (IStereotypeDeclaration declaration : declarations) {
+ if(CDIConstants.NAMED_QUALIFIER_TYPE_NAME.equals(declaration.getType().getFullyQualifiedName())
||
+ getNamedStereotypeDeclaration(declaration.getStereotype())!=null) {
+ return declaration;
+ }
+ }
+ return null;
+ }
+
/*
* 2.2.2. Restricting the bean types of a bean
* - bean class or producer method or field specifies a @Typed annotation,
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-04-15
13:44:55 UTC (rev 21494)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-04-15
13:47:31 UTC (rev 21495)
@@ -33,7 +33,8 @@
{CDIPreferences.STEREOTYPE_DECLARES_NON_EMPTY_NAME,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_stereotypeDeclaresNonEmptyName_label},
{CDIPreferences.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_resourceProducerFieldSetsElName_label},
{CDIPreferences.PARAM_INJECTION_DECLARES_EMPTY_NAME,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_paramInjectionDeclaresEmptyName_label},
-// {CDIPreferences.INTERCEPTOR_HAS_NAME,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_interceptorHasName_label},
+ {CDIPreferences.INTERCEPTOR_HAS_NAME,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_interceptorHasName_label},
+ {CDIPreferences.DECORATOR_HAS_NAME,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_decoratorHasName_label},
},
CDICorePlugin.PLUGIN_ID
);
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-04-15
13:44:55 UTC (rev 21494)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-04-15
13:47:31 UTC (rev 21495)
@@ -12,6 +12,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
@@ -24,7 +25,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, "Stereotype declares a non-empty @Named
annotation", 31);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.STEREOTYPE_DECLARES_NON_EMPTY_NAME, 31);
int markerNumbers = getMarkersNumber(file);
assertEquals("StereotypeWithNonEmptyNamed_Broken.java should has the only error
marker.", markerNumbers, 1);
}
@@ -37,7 +38,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, "Producer field declaration of Java EE
resource specifies an EL name", 15, 19, 24, 27, 31);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, 15, 19, 24, 27, 31);
}
/**
@@ -48,7 +49,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, "Injection point other than injected field
declares a @Named annotation that does not specify the value member", 10, 16);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, 10, 16);
}
/**
@@ -59,9 +60,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, "Interceptor has a name", 9);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, 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, "Interceptor has a name", 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 7);
}
/**
@@ -72,14 +73,20 @@
*/
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, "Decorator has a name", 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, 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, "Decorator has a name", 8);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DECORATOR_HAS_NAME, 8);
}
+ /**
+ * 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
+ */
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, "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", 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(petShopFile,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 25);
int markerNumbers = getMarkersNumber(petShopFile);
assertEquals("PetShop.java should has the only error marker.", markerNumbers,
1);
}
@@ -89,7 +96,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, "Stereotype declares any qualifier annotation
other than @Named", 30);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE, 30);
int markerNumbers = getMarkersNumber(file);
assertEquals("StereotypeWithBindingTypes_Broken.java should has the only error
marker.", markerNumbers, 1);
}
@@ -99,7 +106,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, "Stereotype is annotated @Typed", 15);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, 15);
int markerNumbers = getMarkersNumber(file);
assertEquals("StereotypeWithTyped_Broken.java should has the only error
marker.", markerNumbers, 1);
}
@@ -110,7 +117,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, "Stereotype declares more than one
scope", 32, 33);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, 32, 33);
int markerNumbers = getMarkersNumber(file);
assertEquals("StereotypeWithTooManyScopeTypes_Broken.java should has two error
markers.", markerNumbers, 2);
}
@@ -121,7 +128,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, "Bean class or producer method or field
specifies multiple scope type annotations", 22, 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS, 22, 23);
int markerNumbers = getMarkersNumber(file);
assertEquals("StereotypeWithTyped_Broken.java should has two error markers.",
markerNumbers, 2);
}
@@ -133,7 +140,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, "Bean does not explicitly declare a scope
when there is no default scope", 24, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file,
AbstractResourceMarkerTest.MARKER_TYPE,
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);
}