Author: akazakov
Date: 2010-11-29 11:48:35 -0500 (Mon, 29 Nov 2010)
New Revision: 27005
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/IParametedType.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IScope.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/EventBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ScopeElement.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/CDIValidationMessages.java
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/resources/tck/tests/jbt/validation/unproxyable/InjectionPointBean_Broken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
Log:
https://jira.jboss.org/browse/JBIDE-6575 - Implemented: 5.4.1. Unproxyable bean types
- If an injection point whose declared type cannot be proxied by the container resolves to
a bean with a normal scope,
the container automatically detects the problem and treats it as a deployment problem.
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-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -64,6 +64,15 @@
Set<IParametedType> getAllTypes();
/**
+ * Returns the text representation of this bean.
+ * If the bean is IClassBean then the method will return the simple name of the class of
the bean.
+ * If the bean is IProducerField then the method will return the simple name of the type
of the field.
+ * If the bean is IProducerMethod then the method will return the simple name of the
return type of the producer method.
+ * @return the text representation of this bean.
+ */
+ String getSimpleJavaName();
+
+ /**
* Obtains all the type declarations of the bean class or producer method or
* field (legal types as well as illegal ones).
*
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -44,6 +44,14 @@
boolean isPrimitive();
/**
+ * Returns the simple name of the type. In case of IType this method will return the
short name of the type.
+ * If this type is primitive then the method will return the name of the primitive
type.
+ *
+ * @return the simple name of the type.
+ */
+ String getSimpleName();
+
+ /**
* Returns type parameters
*
* @return type parameters
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IScope.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IScope.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IScope.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -11,10 +11,16 @@
package org.jboss.tools.cdi.core;
/**
- * Represents an interceptor binding type.
+ * Represents a scope type.
*
* @author Viacheslav Kabanovich
*/
public interface IScope extends ICDIAnnotation {
-}
+ /**
+ * Returns true if the scope is a normal scope.
+ *
+ * @return
+ */
+ boolean isNorlmalScope();
+}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -524,4 +524,12 @@
result.addAll(methods);
return result;
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IBean#getSimpleJavaName()
+ */
+ public String getSimpleJavaName() {
+ return this.getBeanClass().getElementName();
+ }
}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/EventBean.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/EventBean.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/EventBean.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -171,4 +171,14 @@
return false;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IBean#getSimpleJavaName()
+ */
+ public String getSimpleJavaName() {
+ if(type!=null) {
+ return type.getSimpleName();
+ }
+ return "";
+ }
+}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -11,10 +11,11 @@
package org.jboss.tools.cdi.internal.core.impl;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
-import java.util.StringTokenizer;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
@@ -356,4 +357,25 @@
return true;
}
-}
+ static Map<String, String> primitives = new HashMap<String, String>();
+ static {
+ primitives.put("Integer", "int");
+ primitives.put("Short", "short");
+ primitives.put("Long", "long");
+ primitives.put("Character", "char");
+ primitives.put("Float", "float");
+ primitives.put("Double", "double");
+ primitives.put("Boolean", "boolean");
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IParametedType#getSimpleName()
+ */
+ public String getSimpleName() {
+ if(getSignature()!=null) {
+ return
isPrimitive()?primitives.get(Signature.getSignatureSimpleName(getSignature())):Signature.getSignatureSimpleName(getSignature());
+ }
+ return "";
+ }
+}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -206,4 +206,11 @@
return false;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IBean#getSimpleJavaName()
+ */
+ public String getSimpleJavaName() {
+ return getBeanClass().getElementName() + "." + getField().getElementName();
+ }
}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -259,4 +259,11 @@
return false;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IBean#getSimpleJavaName()
+ */
+ public String getSimpleJavaName() {
+ return getBeanClass().getElementName() + "." + getMethod().getElementName() +
"()"; //$NON-NLS-1$
+ }
}
\ No newline at end of file
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ScopeElement.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ScopeElement.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ScopeElement.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
+import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.IScope;
/**
@@ -21,4 +22,11 @@
public ScopeElement() {}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IScope#isNorlmalScope()
+ */
+ public boolean isNorlmalScope() {
+ return getAnnotationDeclaration(CDIConstants.NORMAL_SCOPE_ANNOTATION_TYPE_NAME)!=null;
+ }
+}
\ 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-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -1232,6 +1232,47 @@
} else if(bean instanceof IInterceptor) {
addError(CDIValidationMessages.INJECTED_INTERCEPTOR,
CDIPreferences.INJECTED_INTERCEPTOR, reference, injection.getResource());
}
+ /*
+ * 5.4.1. Unproxyable bean types
+ * - If an injection point whose declared type cannot be proxied by the container
resolves to a bean with a normal scope,
+ * the container automatically detects the problem and treats it as a deployment
problem.
+ */
+ if(bean.getScope().isNorlmalScope() && injection.getType()!=null) {
+ // - Array types cannot be proxied by the container.
+ String typeSignature = injection.getType().getSignature();
+ int kind = Signature.getTypeSignatureKind(typeSignature);
+ if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE,
injection.getType().getSimpleName(), bean.getSimpleJavaName()),
CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else if(injection.getType().isPrimitive()) {
+ // - Primitive types cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE,
injection.getType().getSimpleName(), bean.getSimpleJavaName()),
CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else if(bean instanceof IClassBean) {
+ try {
+ if(Flags.isFinal(bean.getBeanClass().getFlags())) {
+ // - Classes which are declared final cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE,
injection.getType().getSimpleName(), bean.getSimpleJavaName()),
CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else {
+ IMethod[] methods = bean.getBeanClass().getMethods();
+ boolean hasDefaultConstructor = false;
+ for (IMethod method : methods) {
+ hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor()
&& !Flags.isPrivate(method.getFlags()) &&
method.getParameterNames().length==0);
+ if(Flags.isFinal(method.getFlags())) {
+ // - Classes which have final methods cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM,
injection.getType().getSimpleName(), bean.getSimpleJavaName()),
CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ hasDefaultConstructor = true;
+ break;
+ }
+ }
+ if(!hasDefaultConstructor) {
+ // - Classes which don't have a non-private constructor with no parameters
cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC,
injection.getType().getSimpleName(), bean.getSimpleJavaName()),
CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ }
+ }
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ }
+ }
}
/*
* 5.5.7. Injection point metadata
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -27,7 +27,11 @@
public static String UNSATISFIED_INJECTION_POINTS;
public static String AMBIGUOUS_INJECTION_POINTS;
- public static String UNPROXYABLE_BEAN_TYPE;
+ public static String UNPROXYABLE_BEAN_ARRAY_TYPE;
+ public static String UNPROXYABLE_BEAN_PRIMITIVE_TYPE;
+ public static String UNPROXYABLE_BEAN_TYPE_WITH_NPC;
+ public static String UNPROXYABLE_BEAN_FINAL_TYPE;
+ public static String UNPROXYABLE_BEAN_TYPE_WITH_FM;
public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION;
public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_BEAN_CLASS;
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-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-11-29
16:48:35 UTC (rev 27005)
@@ -6,7 +6,11 @@
UNSATISFIED_INJECTION_POINTS=No bean is eligible for injection to the injection point
AMBIGUOUS_INJECTION_POINTS=Multiple beans are eligible for injection to the injection
point
-UNPROXYABLE_BEAN_TYPE=Injection point declares a type {0} that cannot be proxied by the
container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
+UNPROXYABLE_BEAN_ARRAY_TYPE=Injection point declares an array type {0} that cannot be
proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
+UNPROXYABLE_BEAN_PRIMITIVE_TYPE=Injection point declares a primitive type {0} that cannot
be proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
+UNPROXYABLE_BEAN_TYPE_WITH_NPC=Injection point declares a class {0} with a non-private
constructor with no parameters (such a class cannot be proxied by the container) resolves
to a bean {1} with a normal scope [JSR-299 �5.4.1]
+UNPROXYABLE_BEAN_FINAL_TYPE=Injection point declares a final class {0} that cannot be
proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
+UNPROXYABLE_BEAN_TYPE_WITH_FM=Injection point declares a class {0} with final methods
(such a class cannot be proxied by the container) resolves to a bean {1} with a normal
scope [JSR-299 �5.4.1]
ILLEGAL_TYPE_IN_TYPED_DECLARATION=Bean 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 [JSR-299 �2.2.2]
ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_BEAN_CLASS=Bean class 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 [JSR-299 �2.2.2]
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-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -45,7 +45,7 @@
new String[][]{
{CDIPreferences.UNSATISFIED_INJECTION_POINTS,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_unsatisfiedInjectionPoints_label},
{CDIPreferences.AMBIGUOUS_INJECTION_POINTS,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_ambiguousInjectionPoints_label},
-// {CDIPreferences.UNPROXYABLE_BEAN_TYPE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_unproxyableBeanType_label},
+ {CDIPreferences.UNPROXYABLE_BEAN_TYPE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_unproxyableBeanType_label},
{CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalTypeInTypedDeclaration_label},
{CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeHasWildcard_label},
{CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE,
CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeIsVariable_label},
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/InjectionPointBean_Broken.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/InjectionPointBean_Broken.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/InjectionPointBean_Broken.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -5,5 +5,5 @@
public class InjectionPointBean_Broken {
@Inject TestType[] arrayBroken;
@Inject TestType arrayOk;
- @Inject @TestQualifier TestType[] arrayBroken2;
+ @Inject @TestQualifier TestType[] arrayOk2;
}
\ No newline at end of file
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2010-11-29
16:44:15 UTC (rev 27004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2010-11-29
16:48:35 UTC (rev 27005)
@@ -72,11 +72,11 @@
*
* @throws Exception
*/
- public void _testInjectionPointWithArrayType() throws Exception {
+ public void testInjectionPointWithArrayType() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/InjectionPointBean_Broken.java");
- assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE, "TestType[]",
"ArrayProducer.produce()"), 6);
- assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE, "TestType[]",
"ArrayProducer.produce2()"), 8);
- assertMarkerIsNotCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE, "TestType",
"TestType"), 7);
+ assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE,
"TestType[]", "ArrayProducer.produce()"), 6);
+ assertMarkerIsNotCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE,
"TestType", "TestType"), 7);
+ assertMarkerIsNotCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE,
"TestType[]", "ArrayProducer.produce2()"), 8);
}
/**
@@ -87,12 +87,12 @@
*
* @throws Exception
*/
- public void _testInjectionPointWithUnproxyableTypeWhichResolvesToNormalScopedBean()
throws Exception {
+ public void testInjectionPointWithUnproxyableTypeWhichResolvesToNormalScopedBean()
throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/Number_Broken.java");
- assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE, "int",
"NumberProducer.produce()"), 9);
- assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE, "long",
"NumberProducer.foo"), 13);
- assertMarkerIsNotCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE, "Short",
"NumberProducer.foo2"), 17);
- assertMarkerIsNotCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE, "boolean",
"NumberProducer.foo3"), 21);
+ assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE,
"int", "NumberProducer.produce()"), 9);
+ assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE,
"long", "NumberProducer.foo"), 13);
+ assertMarkerIsNotCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE,
"Short", "NumberProducer.foo2"), 17);
+ assertMarkerIsNotCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE,
"boolean", "NumberProducer.foo3"), 21);
}
/**
@@ -103,9 +103,9 @@
*
* @throws Exception
*/
- public void _testClassWithPrivateConstructor() throws Exception {
+ public void testClassWithPrivateConstructor() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java");
- assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE,
"Unproxyable_Broken", "Unproxyable_Broken"), 23);
+ assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC,
"Unproxyable_Broken", "Unproxyable_Broken"), 23);
}
/**
@@ -116,9 +116,9 @@
*
* @throws Exception
*/
- public void _testInjectionPointWhichResolvesToNormalScopedFinalBean() throws Exception
{
+ public void testInjectionPointWhichResolvesToNormalScopedFinalBean() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java");
- assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE, "Tuna_Broken",
"Tuna_Broken"), 24);
+ assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE,
"Tuna_Broken", "Tuna_Broken"), 24);
}
/**
@@ -129,8 +129,8 @@
*
* @throws Exception
*/
- public void _testClassWithFinalMethodCannotBeProxied() throws Exception {
+ public void testClassWithFinalMethodCannotBeProxied() throws Exception {
IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java");
- assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE, "Tuna_Broken",
"Tuna_Broken"), 23);
+ assertMarkerIsCreated(file,
MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM,
"Tuna_Broken", "Tuna_Broken"), 23);
}
}
\ No newline at end of file