JBoss Tools SVN: r22014 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-05-11 12:11:41 -0400 (Tue, 11 May 2010)
New Revision: 22014
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/AlternativeInterceptorBroken.java
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/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/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/resources/tck/tests/jbt/validation/decorators/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
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 CDI validation rule: Interceptor or decorator is an alternative.
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-05-11 15:24:42 UTC (rev 22013)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-05-11 16:11:41 UTC (rev 22014)
@@ -35,5 +35,6 @@
defaultPreferences.put(CDIPreferences.DECORATOR_HAS_NAME, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.ILLEGAL_SCOPE_FOR_INTERCEPTOR, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.ILLEGAL_SCOPE_FOR_DECORATOR, CDIPreferences.WARNING);
+ defaultPreferences.put(CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, 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-05-11 15:24:42 UTC (rev 22013)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-05-11 16:11:41 UTC (rev 22014)
@@ -724,8 +724,8 @@
private void validateInterceptor(IInterceptor interceptor) {
/*
- * 2.5.3. Beans with no EL name - interceptor has a name (Non-Portable
- * behavior)
+ * 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);
@@ -737,6 +737,15 @@
}
addError(CDIValidationMessages.INTERCEPTOR_HAS_NAME, CDIPreferences.INTERCEPTOR_HAS_NAME, declaration, interceptor.getResource());
}
+
+ /*
+ * 2.6.1. Declaring an alternative
+ * - interceptor is an alternative (Non-Portable behavior)
+ */
+ ITextSourceReference declaration = interceptor.getAlternativeDeclaration();
+ if(declaration!=null) {
+ addError(CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, declaration, interceptor.getResource());
+ }
}
private void validateDecorator(IDecorator decorator) {
@@ -754,6 +763,15 @@
}
addError(CDIValidationMessages.DECORATOR_HAS_NAME, CDIPreferences.DECORATOR_HAS_NAME, declaration, decorator.getResource());
}
+
+ /*
+ * 2.6.1. Declaring an alternative
+ * - decorator is an alternative (Non-Portable behavior)
+ */
+ ITextSourceReference declaration = decorator.getAlternativeDeclaration();
+ if(declaration!=null) {
+ addError(CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, declaration, decorator.getResource());
+ }
}
private IAnnotationDeclaration getNamedStereotypeDeclaration(IStereotyped stereotyped) {
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-05-11 15:24:42 UTC (rev 22013)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-05-11 16:11:41 UTC (rev 22014)
@@ -81,7 +81,8 @@
public static String ILLEGAL_INTERCEPTOR_BINDING_METHOD;
public static String CONFLICTING_INTERCEPTOR_BINDINGS;
public static String OBSERVER_IN_INTERCEPTOR_OR_DECORATOR;
- public static String INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE;
+ public static String INTERCEPTOR_IS_ALTERNATIVE;
+ public static String DECORATOR_IS_ALTERNATIVE;
public static String MISSING_INTERCEPTOR_BINDING;
public static String ILLEGAL_SPECIALIZING_MANAGED_BEAN;
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-05-11 15:24:42 UTC (rev 22013)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-05-11 16:11:41 UTC (rev 22014)
@@ -1,4 +1,5 @@
Definition Errors
+
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
@@ -7,10 +8,6 @@
2.4.1. Built-in scope types
- interceptor or decorator has any scope other than @Dependent (Non-Portable behavior)
-
-
-
-
2.4.3. Declaring the bean scope
- bean class or producer method or field specifies multiple scope type annotations
@@ -32,6 +29,10 @@
- stereotype declares any other qualifier annotation
- stereotype is annotated @Typed
+
+
+
+
3.1. Managed beans
- the bean class of a managed bean is annotated with both
the @Interceptor and @Decorator stereotypes
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-05-11 15:24:42 UTC (rev 22013)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-05-11 16:11:41 UTC (rev 22014)
@@ -61,7 +61,8 @@
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)
CONFLICTING_INTERCEPTOR_BINDINGS=The set of interceptor bindings of a bean or interceptor, including bindings inherited from stereotypes and other interceptor bindings, has two instances of a certain interceptor binding type and the instances have different values of some annotation member
OBSERVER_IN_INTERCEPTOR_OR_DECORATOR=Interceptor or decorator has a method with a parameter annotated @Observes
-INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE=Interceptor or decorator is an alternative
+INTERCEPTOR_IS_ALTERNATIVE=Interceptor is an alternative
+DECORATOR_IS_ALTERNATIVE=Decorator is an alternative
MISSING_INTERCEPTOR_BINDING=Interceptor declared using @Interceptor does not declare any interceptor binding
ILLEGAL_SPECIALIZING_MANAGED_BEAN=Managed bean class annotated @Specializes does not directly extend the bean class of another managed bean
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-05-11 15:24:42 UTC (rev 22013)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-05-11 16:11:41 UTC (rev 22014)
@@ -113,7 +113,7 @@
// {CDIPreferences.ILLEGAL_INTERCEPTOR_BINDING_METHOD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalInterceptorBindingMethod_label},
// {CDIPreferences.CONFLICTING_INTERCEPTOR_BINDINGS, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_conflictingInterceptorBindings_label},
// {CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_observerInInterceptorOrDecorator_label},
-// {CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_interceptorOrDecoratorIsAlternative_label},
+ {CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_interceptorOrDecoratorIsAlternative_label},
// {CDIPreferences.MISSING_INTERCEPTOR_BINDING, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingInterceptorBinding_label},
},
CDICorePlugin.PLUGIN_ID
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java 2010-05-11 16:11:41 UTC (rev 22014)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.decorators;
+
+import javax.decorator.Decorator;
+import javax.enterprise.inject.Alternative;
+
+@Decorator
+@Alternative
+public class AlternativeDecoratorBroken {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml 2010-05-11 15:24:42 UTC (rev 22013)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml 2010-05-11 16:11:41 UTC (rev 22014)
@@ -2,5 +2,6 @@
<decorators>
<class>org.jboss.jsr299.tck.tests.jdt.validation.decorators.NamedDecoratorBroken</class>
<class>org.jboss.jsr299.tck.tests.jdt.validation.decorators.DecoratorWithWrongScopeBroken</class>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.decorators.AlternativeDecoratorBroken</class>
</decorators>
-</beans>
+</beans>
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/AlternativeInterceptorBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/AlternativeInterceptorBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/AlternativeInterceptorBroken.java 2010-05-11 16:11:41 UTC (rev 22014)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+import javax.enterprise.inject.Alternative;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Interceptor
+@Alternative
+public class AlternativeInterceptorBroken {
+
+ @AroundInvoke
+ public Object alwaysReturnThis(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/AlternativeInterceptorBroken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml 2010-05-11 15:24:42 UTC (rev 22013)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml 2010-05-11 16:11:41 UTC (rev 22014)
@@ -3,5 +3,6 @@
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.NamedInterceptorBroken</class>
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.FordInterceptor</class>
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.InterceptorWithWrongScopeBroken</class>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.AltrenativeInterceptorBroken</class>
</interceptors>
</beans>
\ No newline at end of file
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-05-11 15:24:42 UTC (rev 22013)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-05-11 16:11:41 UTC (rev 22014)
@@ -58,8 +58,35 @@
}
/**
+ * 2.4.3. Declaring the bean scope
+ * - bean class or producer method or field specifies multiple scope type annotations
+ *
+ * @throws Exception
+ */
+ public void testMultipleBeanScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/BeanWithTooManyScopeTypes_Broken.java");
+ 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);
+ }
+
+ /**
+ * 2.4.4. Default scope
+ * - bean does not explicitly declare a scope when there is no default scope
+ * (there are two different stereotypes declared by the bean that declare different default scopes)
+ *
+ * @throws Exception
+ */
+ public void testBeanWithMultipleScopedStereotypes() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/scopeConflict/Scallop_Broken.java");
+ 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);
+ }
+
+ /**
* 2.5.3. Beans with no EL name
- * - interceptor or decorator has a name (Non-Portable behavior)
+ * - interceptor has a name (Non-Portable behavior)
*
* @throws Exception
*/
@@ -71,54 +98,69 @@
}
/**
- * 2.7.1.3. Stereotype declares a non-empty @Named annotation (Non-Portable behavior)
- *
+ * 2.5.3. Beans with no EL name
+ * - decorator has a name (Non-Portable behavior)
+ *
* @throws Exception
*/
- public void testNonEmptyNamedForStereotype() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/nonEmptyNamed/StereotypeWithNonEmptyNamed_Broken.java");
- 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);
+ 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);
+ 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);
}
/**
- * 3.5.1. Declaring a resource
- * - producer field declaration specifies an EL name (together with one of @Resource, @PersistenceContext, @PersistenceUnit, @EJB, @WebServiceRef)
- *
+ * 2.6.1. Declaring an alternative
+ * - interceptor is an alternative (Non-Portable behavior)
+ *
* @throws Exception
*/
- 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);
+ 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, 9);
}
/**
- * 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
+ * 2.6.1. Declaring an alternative
+ * - decorator is an alternative (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testAlternativeDecorator() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, 7);
+ }
+
+ /**
+ * 2.7.1.1. Declaring the default scope for a stereotype
+ * - stereotype declares more than one scope
*
* @throws Exception
*/
- public void 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);
+ 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);
+ int markerNumbers = getMarkersNumber(file);
+ assertEquals("StereotypeWithTooManyScopeTypes_Broken.java should has two error markers.", markerNumbers, 2);
}
/**
- * 2.5.3. Beans with no EL name
- * - interceptor or decorator has a name (Non-Portable behavior)
- *
+ * 2.7.1.3. Declaring a @Named stereotype
+ * - stereotype declares a non-empty @Named annotation (Non-Portable behavior)
+ *
* @throws Exception
*/
- public void testNamedDecorator() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedDecoratorBroken.java");
- 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, CDIValidationMessages.DECORATOR_HAS_NAME, 8);
+ 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);
+ int markerNumbers = getMarkersNumber(file);
+ assertEquals("StereotypeWithNonEmptyNamed_Broken.java should has the only error marker.", markerNumbers, 1);
}
/**
- * 2.7.1.3. Stereotype declares any other qualifier annotation
+ * 2.7.1.3. Declaring a @Named stereotype
+ * - stereotype declares any other qualifier annotation
*
* @throws Exception
*/
@@ -130,7 +172,8 @@
}
/**
- * 2.7.1.3. Stereotype is annotated @Typed
+ * 2.7.1.3. Declaring a @Named stereotype
+ * - stereotype is annotated @Typed
*
* @throws Exception
*/
@@ -142,46 +185,28 @@
}
/**
- * 2.7.1.1. Declaring the default scope for a stereotype
- * - stereotype declares more than one scope
+ * 3.5.1. Declaring a resource
+ * - producer field declaration specifies an EL name (together with one of @Resource, @PersistenceContext, @PersistenceUnit, @EJB, @WebServiceRef)
*
* @throws Exception
*/
- public void 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);
- int markerNumbers = getMarkersNumber(file);
- assertEquals("StereotypeWithTooManyScopeTypes_Broken.java should has two error markers.", markerNumbers, 2);
+ 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);
}
/**
- * 2.4.3. Declaring the bean scope
- * - bean class or producer method or field specifies multiple scope type annotations
+ * 3.11. The qualifier @Named at injection points
+ * - injection point other than injected field declares a @Named annotation that does not specify the value member
*
* @throws Exception
*/
- public void 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);
- int markerNumbers = getMarkersNumber(file);
- assertEquals("StereotypeWithTyped_Broken.java should has two error markers.", markerNumbers, 2);
+ 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);
}
/**
- * 2.4.4. Default scope
- * - bean does not explicitly declare a scope when there is no default scope
- * (there are two different stereotypes declared by the bean that declare different default scopes)
- *
- * @throws Exception
- */
- public void testBeanWithMultipleScopedStereotypes() throws Exception {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/scopeConflict/Scallop_Broken.java");
- 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);
- }
-
- /**
* 3.3.6. Declaring a disposer method
* - method has more than one parameter annotated @Disposes
*
15 years, 11 months
JBoss Tools SVN: r22013 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-05-11 11:24:42 -0400 (Tue, 11 May 2010)
New Revision: 22013
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/ScopedStereotype.java
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/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.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
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 CDI validation rule: Interceptor or decorator has any scope other than @Dependent
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-05-11 14:37:20 UTC (rev 22012)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-05-11 15:24:42 UTC (rev 22013)
@@ -33,5 +33,7 @@
}
defaultPreferences.put(CDIPreferences.INTERCEPTOR_HAS_NAME, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.DECORATOR_HAS_NAME, CDIPreferences.WARNING);
+ defaultPreferences.put(CDIPreferences.ILLEGAL_SCOPE_FOR_INTERCEPTOR, CDIPreferences.WARNING);
+ defaultPreferences.put(CDIPreferences.ILLEGAL_SCOPE_FOR_DECORATOR, 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-05-11 14:37:20 UTC (rev 22012)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-05-11 15:24:42 UTC (rev 22013)
@@ -827,6 +827,38 @@
}
}
}
+
+ /*
+ * 2.4.1. Built-in scope types
+ * - interceptor or decorator has any scope other than @Dependent (Non-Portable behavior)
+ */
+ boolean interceptor = bean instanceof IInterceptor;
+ boolean decorator = bean instanceof IDecorator;
+ if(interceptor || decorator) {
+ IScope scope = bean.getScope();
+ if(!CDIConstants.DEPENDENT_ANNOTATION_TYPE_NAME.equals(scope.getSourceType().getFullyQualifiedName())) {
+ String key;
+ String message;
+ ITextSourceReference declaration = null;
+ if(!scopes.isEmpty()) {
+ declaration = scopes.iterator().next();
+ }
+ if(interceptor) {
+ key = CDIPreferences.ILLEGAL_SCOPE_FOR_INTERCEPTOR;
+ message = CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR;
+ if(declaration==null) {
+ declaration = ((IInterceptor)bean).getInterceptorAnnotation();
+ }
+ } else {
+ key = CDIPreferences.ILLEGAL_SCOPE_FOR_DECORATOR;
+ message = CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR;
+ if(declaration==null) {
+ declaration = ((IDecorator)bean).getDecoratorAnnotation();
+ }
+ }
+ addError(message, key, declaration, bean.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-05-11 14:37:20 UTC (rev 22012)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-05-11 15:24:42 UTC (rev 22013)
@@ -7,6 +7,10 @@
2.4.1. Built-in scope types
- interceptor or decorator has any scope other than @Dependent (Non-Portable behavior)
+
+
+
+
2.4.3. Declaring the bean scope
- bean class or producer method or field specifies multiple scope type annotations
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-05-11 14:37:20 UTC (rev 22012)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-05-11 15:24:42 UTC (rev 22013)
@@ -67,8 +67,8 @@
{CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForProducerMethod_label},
{CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForProducerField_label},
// {CDIPreferences.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeWhenTypeInjectionPointIsInjected_label},
-// {CDIPreferences.ILLEGAL_SCOPE_FOR_INTERCEPTOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForInterceptor_label},
-// {CDIPreferences.ILLEGAL_SCOPE_FOR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForDecorator_label},
+ {CDIPreferences.ILLEGAL_SCOPE_FOR_INTERCEPTOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForInterceptor_label},
+ {CDIPreferences.ILLEGAL_SCOPE_FOR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForDecorator_label},
},
CDICorePlugin.PLUGIN_ID
);
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java 2010-05-11 15:24:42 UTC (rev 22013)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.decorators;
+
+import javax.decorator.Decorator;
+import javax.enterprise.context.ApplicationScoped;
+
+@Decorator
+@ApplicationScoped
+public class DecoratorWithWrongScopeBroken {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml 2010-05-11 14:37:20 UTC (rev 22012)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml 2010-05-11 15:24:42 UTC (rev 22013)
@@ -1,5 +1,6 @@
<beans>
<decorators>
<class>org.jboss.jsr299.tck.tests.jdt.validation.decorators.NamedDecoratorBroken</class>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.decorators.DecoratorWithWrongScopeBroken</class>
</decorators>
</beans>
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java 2010-05-11 15:24:42 UTC (rev 22013)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Interceptor
+@ScopedStereotype
+public class InterceptorWithWrongScopeBroken {
+
+ @AroundInvoke
+ public Object alwaysReturnThis(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/ScopedStereotype.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/ScopedStereotype.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/ScopedStereotype.java 2010-05-11 15:24:42 UTC (rev 22013)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Stereotype;
+
+@Stereotype
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@RequestScoped
+@Inherited
+@interface ScopedStereotype {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/ScopedStereotype.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml 2010-05-11 14:37:20 UTC (rev 22012)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml 2010-05-11 15:24:42 UTC (rev 22013)
@@ -2,5 +2,6 @@
<interceptors>
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.NamedInterceptorBroken</class>
<class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.FordInterceptor</class>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.InterceptorWithWrongScopeBroken</class>
</interceptors>
</beans>
\ No newline at end of file
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-05-11 14:37:20 UTC (rev 22012)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-05-11 15:24:42 UTC (rev 22013)
@@ -21,6 +21,56 @@
public class ValidationTest extends TCKTest {
/**
+ * 2.2.2. Restricting the bean types of a bean
+ * - bean class or producer method or field specifies a @Typed annotation,
+ * and the value member specifies a class which does not correspond to a type
+ * in the unrestricted set of bean types of a bean
+ *
+ * @throws Exception
+ */
+ public void testLegalTypesInTyped() throws Exception {
+ IFile petShopFile = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java");
+ 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);
+ }
+
+ /**
+ * 2.4.1. Built-in scope types
+ * - interceptor has any scope other than @Dependent (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testInterceptorWithWrongScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR, 7);
+ }
+
+ /**
+ * 2.4.1. Built-in scope types
+ * - decorator has any scope other than @Dependent (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testDecoratorWithWrongScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR, 7);
+ }
+
+ /**
+ * 2.5.3. Beans with no EL name
+ * - interceptor or decorator has a name (Non-Portable behavior)
+ *
+ * @throws Exception
+ */
+ public void testNamedInterceptor() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedInterceptorBroken.java");
+ 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, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 7);
+ }
+
+ /**
* 2.7.1.3. Stereotype declares a non-empty @Named annotation (Non-Portable behavior)
*
* @throws Exception
@@ -60,19 +110,6 @@
*
* @throws Exception
*/
- 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);
- 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);
- }
-
- /**
- * 2.5.3. Beans with no EL name
- * - interceptor or decorator has a name (Non-Portable behavior)
- *
- * @throws Exception
- */
public void testNamedDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedDecoratorBroken.java");
AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DECORATOR_HAS_NAME, 10);
@@ -81,21 +118,6 @@
}
/**
- * 2.2.2. Restricting the bean types of a bean
- * - bean class or producer method or field specifies a @Typed annotation,
- * and the value member specifies a class which does not correspond to a type
- * in the unrestricted set of bean types of a bean
- *
- * @throws Exception
- */
- public void testLegalTypesInTyped() throws Exception {
- IFile petShopFile = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java");
- 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);
- }
-
- /**
* 2.7.1.3. Stereotype declares any other qualifier annotation
*
* @throws Exception
@@ -303,7 +325,7 @@
}
/**
- * 3.4. Producer methods
+ * 3.4. Producer fields.
* - producer field type is a type variable
*
* @throws Exception
15 years, 11 months
JBoss Tools SVN: r22012 - in workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces: META-INF and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-05-11 10:37:20 -0400 (Tue, 11 May 2010)
New Revision: 22012
Added:
workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/resources/commons-logging-1.0.4.jar
Modified:
workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/META-INF/MANIFEST.MF
workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/build.properties
workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/IceFacesActivator.java
workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/template/IceFacesOutputTextTemplate.java
Log:
JBIDE-4710
Modified: workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/META-INF/MANIFEST.MF
===================================================================
--- workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/META-INF/MANIFEST.MF 2010-05-11 14:30:47 UTC (rev 22011)
+++ workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/META-INF/MANIFEST.MF 2010-05-11 14:37:20 UTC (rev 22012)
@@ -20,4 +20,5 @@
resources/jsf-api.jar,
resources/jsp-api.jar,
resources/el-api.jar,
- resources/servlet-api.jar
+ resources/servlet-api.jar,
+ resources/commons-logging-1.0.4.jar
Modified: workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/build.properties
===================================================================
--- workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/build.properties 2010-05-11 14:30:47 UTC (rev 22011)
+++ workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/build.properties 2010-05-11 14:37:20 UTC (rev 22012)
@@ -11,5 +11,6 @@
resources/jsf-api.jar,\
resources/jsp-api.jar,\
resources/el-api.jar,\
- resources/servlet-api.jar
+ resources/servlet-api.jar,\
+ resources/commons-logging-1.0.4.jar
Added: workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/resources/commons-logging-1.0.4.jar
===================================================================
(Binary files differ)
Property changes on: workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/resources/commons-logging-1.0.4.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/IceFacesActivator.java
===================================================================
--- workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/IceFacesActivator.java 2010-05-11 14:30:47 UTC (rev 22011)
+++ workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/IceFacesActivator.java 2010-05-11 14:37:20 UTC (rev 22012)
@@ -24,16 +24,11 @@
// The shared instance
private static IceFacesActivator plugin;
- /**
- * The constructor
- */
- public IceFacesActivator() {
- }
-
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -43,6 +38,7 @@
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
Modified: workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/template/IceFacesOutputTextTemplate.java
===================================================================
--- workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/template/IceFacesOutputTextTemplate.java 2010-05-11 14:30:47 UTC (rev 22011)
+++ workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/template/IceFacesOutputTextTemplate.java 2010-05-11 14:37:20 UTC (rev 22012)
@@ -12,11 +12,13 @@
import javax.faces.render.Renderer;
+import org.jboss.tools.jsf.vpe.icefaces.IceFacesActivator;
import org.jboss.tools.jsf.vpe.icefaces.utill.VpeRendererUtil;
import org.jboss.tools.jsf.vpe.template.mock.impl.VpeUIComponent;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -24,21 +26,34 @@
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+/**
+ *
+ * @author mareshkau
+ *
+ */
public class IceFacesOutputTextTemplate extends VpeAbstractTemplate {
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
- Renderer render = new com.icesoft.faces.renderkit.dom_html_basic.TextRenderer();
- VpeUIComponent uiComponent = new VpeUIComponent((Element)sourceNode);
- Node result = VpeRendererUtil.processRenderer(render,uiComponent);
- nsIDOMNode resultVisualNode = VpeRendererUtil.createVisualNode(result, visualDocument);
- if(resultVisualNode.getNodeType()==Node.TEXT_NODE) {
- nsIDOMElement domElement = VisualDomUtil.createBorderlessContainer(visualDocument);
- domElement.appendChild(resultVisualNode);
- resultVisualNode = domElement;
+ try {
+ Renderer render = new com.icesoft.faces.renderkit.dom_html_basic.TextRenderer();
+ VpeUIComponent uiComponent = new VpeUIComponent(
+ (Element) sourceNode);
+ Node result = VpeRendererUtil.processRenderer(render, uiComponent);
+ nsIDOMNode resultVisualNode = VpeRendererUtil.createVisualNode(
+ result, visualDocument);
+ if (resultVisualNode.getNodeType() == Node.TEXT_NODE) {
+ nsIDOMElement domElement = VisualDomUtil
+ .createBorderlessContainer(visualDocument);
+ domElement.appendChild(resultVisualNode);
+ resultVisualNode = domElement;
+ }
+ return new VpeCreationData(resultVisualNode);
+ } catch (Throwable th) {
+ IceFacesActivator.getDefault().logError(th);
}
- return new VpeCreationData(resultVisualNode);
+ return VpeTemplateManager.getInstance().getDefTemplate().create(
+ pageContext, sourceNode, visualDocument);
}
}
15 years, 11 months
JBoss Tools SVN: r22011 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-11 10:30:47 -0400 (Tue, 11 May 2010)
New Revision: 22011
Modified:
branches/modular_build/genpom.xml
Log:
fix hudson path check
Modified: branches/modular_build/genpom.xml
===================================================================
--- branches/modular_build/genpom.xml 2010-05-11 14:29:10 UTC (rev 22010)
+++ branches/modular_build/genpom.xml 2010-05-11 14:30:47 UTC (rev 22011)
@@ -66,6 +66,22 @@
</target>
<target name="init" depends="local">
+ <!-- https://jira.jboss.org/jira/browse/JBQA-3313 Use static, shared space outside workspace, instead of working directly in the workspace -->
+ <condition property="WORKINGDIR" value="/home/hudson/static_build_env/jbds/tools/sources" else="${basedir}">
+ <available file="/home/hudson/static_build_env/jbds" type="dir" />
+ </condition>
+ <mkdir dir="${WORKINGDIR}" />
+ <echo level="info">WORKINGDIR = ${WORKINGDIR}</echo>
+
+ <condition property="COMMON_TOOLS"
+ value="/home/hudson/static_build_env/jbds/tools"
+ else="${WORKINGDIR}/../tools"
+ >
+ <available file="/home/hudson/static_build_env/jbds" type="dir" />
+ </condition>
+ <mkdir dir="${COMMON_TOOLS}" />
+ <echo level="info">COMMON_TOOLS = ${COMMON_TOOLS}</echo>
+
<available file="${COMMON_TOOLS}/ant-contrib.jar" type="file" property="ant-contrib.jar.exists" />
<antcall target="get.ant-contrib" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
15 years, 11 months
JBoss Tools SVN: r22010 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-11 10:29:10 -0400 (Tue, 11 May 2010)
New Revision: 22010
Modified:
branches/modular_build/genpom.xml
Log:
fix hudson path check
Modified: branches/modular_build/genpom.xml
===================================================================
--- branches/modular_build/genpom.xml 2010-05-11 13:58:51 UTC (rev 22009)
+++ branches/modular_build/genpom.xml 2010-05-11 14:29:10 UTC (rev 22010)
@@ -53,8 +53,14 @@
</target>
<!-- override for local build -->
- <available file="/qa/tools/opt" type="dir" property="isJBossQA" />
- <target name="local" unless="isJBossQA">
+ <condition property="isInHudson" value="true">
+ <or>
+ <contains string="${user.dir}" substring="hudson" />
+ <contains string="${user.name}" substring="hudson" />
+ <contains string="${user.home}" substring="hudson" />
+ </or>
+ </condition>
+ <target name="local" unless="isInHudson">
<property name="WORKINGDIR" value="${basedir}" />
<property name="COMMON_TOOLS" value="${java.io.tmpdir}" />
</target>
15 years, 11 months
JBoss Tools SVN: r22009 - in trunk/drools/docs/reference/en-US: images/create_new_project and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2010-05-11 09:58:51 -0400 (Tue, 11 May 2010)
New Revision: 22009
Modified:
trunk/drools/docs/reference/en-US/create_new_project.xml
trunk/drools/docs/reference/en-US/images/create_new_project/create_new_project8.png
trunk/drools/docs/reference/en-US/images/debugging_rules/debugging_rules1.png
Log:
TOOLSDOC-64-Drools ref guide contains obsolete screenshots - updated
Modified: trunk/drools/docs/reference/en-US/create_new_project.xml
===================================================================
--- trunk/drools/docs/reference/en-US/create_new_project.xml 2010-05-11 13:46:10 UTC (rev 22008)
+++ trunk/drools/docs/reference/en-US/create_new_project.xml 2010-05-11 13:58:51 UTC (rev 22009)
@@ -1,216 +1,216 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="create_new_project" xreflabel="create_new_project">
- <chapterinfo>
- <keywordset>
- <keyword>JBoss Tools</keyword>
- <keyword>Drools Tools</keyword>
- </keywordset>
- </chapterinfo>
-
- <title>Creating a New Drools Project</title>
-
- <para>In this chapter we are going to show you how to setup an executable sample Drools project
- to start using rules immediately.</para>
-
-
-
- <section id="sample_drools_project">
- <title>Creating a Sample Drools Project</title>
-
- <para>First, we suggest that you use <property>Drools perspective</property> which is aimed
- at work with Drools specific resources.</para>
-
- <para>To create a new Drools project follow to <emphasis>
- <property>File > New > Drools Project</property>. </emphasis> This will open
- <property>New Drools Project wizard</property> like on the figure below.</para>
-
- <para>On the first page type the project name and click
- <emphasis><property>Next</property>.</emphasis></para>
-
- <figure>
- <title>Creating a New Drools Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/create_new_project/create_new_project1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Next you have a choice to add some default artifacts to it like sample rules, decision
- tables or ruleflows and Java classes for them. Let's select first two check
- boxes and press <emphasis>
- <property>Next</property>. </emphasis></para>
-
- <figure>
- <title>Selecting Drools Project Elements</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/create_new_project/create_new_project2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Next page asks you to specify a Drools runtime. If you have not yet set it up, you
- should do this now by clicking the <emphasis>
- <property>Configure Workspace Settings</property>
- </emphasis> link.</para>
-
- <figure>
- <title>Configuring Drools Runtime</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/create_new_project/create_new_project3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>You should see the <property>Preferences window</property> where you can configure the
- workspace settings for Drools runtimes. To create a new runtime, press the <emphasis>
- <property>Add</property>
- </emphasis> button. The appeared dialog prompts you to enter a
- name for a new runtime and a path to the Drools runtime on your file system.</para>
-
- <note>
- <title>Note:</title>
- <para>A Drools runtime is a collection of jars on your file system that represent one
- specific release of the Drools project jars. While creating a new runtime, you must
- either point to the release of your choice, or you can simply create a new runtime
- on your file system from the jars included in the Drools Eclipse plugin.</para>
- </note>
-
- <figure>
- <title>Adding a New Drools Runtime</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/create_new_project/create_new_project4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Let's simply create a new Drools 5 runtime from the jars embedded in the
- Drools Eclipse plugin. Thus, you should press <emphasis>
- <property>Create a new Drools 5 runtime</property>
- </emphasis> button and select the folder where you want this runtime to be created and
- hit <emphasis>
- <property>OK</property>.</emphasis></para>
-
- <para>You will see the newly created runtime show up in your list of Drools runtimes. Check
- it and press <emphasis>
- <property>OK</property>.</emphasis></para>
-
- <figure>
- <title>Selecting a Drools Runtime</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/create_new_project/create_new_project5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Now press <emphasis>
- <property>Finish</property>
- </emphasis> to complete the project creation.</para>
-
- <figure>
- <title>Completing the Drools Project Creation</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/create_new_project/create_new_project6.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>This will setup a basic structure, classpath and sample rules and test case to get you
- started.</para>
- </section>
-
-
- <section id="structure_overview">
- <title>Drools Project Structure Overview</title>
-
- <para>Now let's look at the structure of the organized project. In the
- <property>Package Explorer</property> you should see the following:</para>
-
- <figure>
- <title>Drools Project in the Package Explorer</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/create_new_project/create_new_project7.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The newly created project contains an example rule file <emphasis>
- <property>Sample.drl</property>
- </emphasis> in the <emphasis>
- <property>src/main/rules</property>
- </emphasis> directory and an example java file <emphasis>
- <property>DroolsTest.java</property>
- </emphasis> that can be used to execute the rules in a Drools engine in the folder <emphasis>
- <property>src/main/java</property>
- </emphasis>, in the <emphasis>
- <property>com.sample</property>
- </emphasis> package. All the others jar's that are necessary during execution
- are also added to the classpath in a custom classpath container called <property>Drools
- Library</property>.</para>
-
- <tip>
- <title>Tip:</title>
- <para>Rules do not have to be kept in Java projects at all, this is just a convenience
- for people who are already using eclipse as their Java IDE.</para>
- </tip>
-
- </section>
-
- <section id="creating_rule">
- <title>Creating a New Rule</title>
-
- <para>Now we are going to add a new Rule resource to the project.</para>
-
- <para>You can either create an empty text <emphasis>
- <property>.drl</property>
- </emphasis> file or make use of the special <property>New Rule Resource
- wizard</property> to do it.</para>
-
- <para>To open the wizard follow to <emphasis>
- <property>File > New > Rule Resource</property>
- </emphasis> or use the menu with the JBoss Drools icon on the toolbar.</para>
-
- <figure>
- <title>Opening the New Rule Resource Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/create_new_project/create_new_project8.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>On the wizard page first select <emphasis>
- <property>/rules</property>
- </emphasis> as a top level directory to store your rules and type the rule name. Next
- it's mandatory to specify the rule package name. It defines a namespace that
- groups rules together.</para>
-
- <figure>
- <title>New Rule Resource Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/create_new_project/create_new_project9.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>As a result the wizard generates a rule skeleton to get you started.</para>
-
- <figure>
- <title>New Rule</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/create_new_project/create_new_project10.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
-
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="create_new_project" xreflabel="create_new_project">
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Drools Tools</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Creating a New Drools Project</title>
+
+ <para>In this chapter we are going to show you how to setup an executable sample Drools project
+ to start using rules immediately.</para>
+
+
+
+ <section id="sample_drools_project">
+ <title>Creating a Sample Drools Project</title>
+
+ <para>First, we suggest that you use <property>Drools perspective</property> which is aimed
+ at work with Drools specific resources.</para>
+
+ <para>To create a new Drools project follow to <emphasis>
+ <property>File > New > Drools Project</property>. </emphasis> This will open
+ <property>New Drools Project wizard</property> like on the figure below.</para>
+
+ <para>On the first page type the project name and click
+ <emphasis><property>Next</property>.</emphasis></para>
+
+ <figure>
+ <title>Creating a New Drools Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_project/create_new_project1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Next you have a choice to add some default artifacts to it like sample rules, decision
+ tables or ruleflows and Java classes for them. Let's select first two check
+ boxes and press <emphasis>
+ <property>Next</property>. </emphasis></para>
+
+ <figure>
+ <title>Selecting Drools Project Elements</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_project/create_new_project2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Next page asks you to specify a Drools runtime. If you have not yet set it up, you
+ should do this now by clicking the <emphasis>
+ <property>Configure Workspace Settings</property>
+ </emphasis> link.</para>
+
+ <figure>
+ <title>Configuring Drools Runtime</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_project/create_new_project3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You should see the <property>Preferences window</property> where you can configure the
+ workspace settings for Drools runtimes. To create a new runtime, press the <emphasis>
+ <property>Add</property>
+ </emphasis> button. The appeared dialog prompts you to enter a
+ name for a new runtime and a path to the Drools runtime on your file system.</para>
+
+ <note>
+ <title>Note:</title>
+ <para>A Drools runtime is a collection of jars on your file system that represent one
+ specific release of the Drools project jars. While creating a new runtime, you must
+ either point to the release of your choice, or you can simply create a new runtime
+ on your file system from the jars included in the Drools Eclipse plugin.</para>
+ </note>
+
+ <figure>
+ <title>Adding a New Drools Runtime</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_project/create_new_project4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Let's simply create a new Drools 5 runtime from the jars embedded in the
+ Drools Eclipse plugin. Thus, you should press <emphasis>
+ <property>Create a new Drools 5 runtime</property>
+ </emphasis> button and select the folder where you want this runtime to be created and
+ hit <emphasis>
+ <property>OK</property>.</emphasis></para>
+
+ <para>You will see the newly created runtime show up in your list of Drools runtimes. Check
+ it and press <emphasis>
+ <property>OK</property>.</emphasis></para>
+
+ <figure>
+ <title>Selecting a Drools Runtime</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_project/create_new_project5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Now press <emphasis>
+ <property>Finish</property>
+ </emphasis> to complete the project creation.</para>
+
+ <figure>
+ <title>Completing the Drools Project Creation</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_project/create_new_project6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>This will setup a basic structure, classpath and sample rules and test case to get you
+ started.</para>
+ </section>
+
+
+ <section id="structure_overview">
+ <title>Drools Project Structure Overview</title>
+
+ <para>Now let's look at the structure of the organized project. In the
+ <property>Package Explorer</property> you should see the following:</para>
+
+ <figure>
+ <title>Drools Project in the Package Explorer</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_project/create_new_project7.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The newly created project contains an example rule file <emphasis>
+ <property>Sample.drl</property>
+ </emphasis> in the <emphasis>
+ <property>src/main/rules</property>
+ </emphasis> directory and an example java file <emphasis>
+ <property>DroolsTest.java</property>
+ </emphasis> that can be used to execute the rules in a Drools engine in the folder <emphasis>
+ <property>src/main/java</property>
+ </emphasis>, in the <emphasis>
+ <property>com.sample</property>
+ </emphasis> package. All the others jar's that are necessary during execution
+ are also added to the classpath in a custom classpath container called <property>Drools
+ Library</property>.</para>
+
+ <tip>
+ <title>Tip:</title>
+ <para>Rules do not have to be kept in Java projects at all, this is just a convenience
+ for people who are already using eclipse as their Java IDE.</para>
+ </tip>
+
+ </section>
+
+ <section id="creating_rule">
+ <title>Creating a New Rule</title>
+
+ <para>Now we are going to add a new Rule package to the project.</para>
+
+ <para>You can either create an empty text <emphasis>
+ <property>.drl</property>
+ </emphasis> file or make use of the special <property>New Rule Package...</property>
+ wizard to do it.</para>
+
+ <para>To open the wizard follow to <emphasis>
+ <property>File > New > Rule Resource</property>
+ </emphasis> or use the menu with the JBoss Drools icon on the toolbar.</para>
+
+ <figure>
+ <title>Opening the New Rule Package Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_project/create_new_project8.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>On the wizard page first select <emphasis>
+ <property>/rules</property>
+ </emphasis> as a top level directory to store your rules and type the rule name. Next
+ it's mandatory to specify the rule package name. It defines a namespace that
+ groups rules together.</para>
+
+ <figure>
+ <title>New Rule Package Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_project/create_new_project9.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>As a result the wizard generates a rule skeleton to get you started.</para>
+
+ <figure>
+ <title>New Rule</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_project/create_new_project10.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+</chapter>
\ No newline at end of file
Modified: trunk/drools/docs/reference/en-US/images/create_new_project/create_new_project8.png
===================================================================
(Binary files differ)
Modified: trunk/drools/docs/reference/en-US/images/debugging_rules/debugging_rules1.png
===================================================================
(Binary files differ)
15 years, 11 months
JBoss Tools SVN: r22008 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-11 09:46:10 -0400 (Tue, 11 May 2010)
New Revision: 22008
Modified:
branches/modular_build/pom.xml
Log:
comment out components which don't yet have pom.xml files checked in
Modified: branches/modular_build/pom.xml
===================================================================
--- branches/modular_build/pom.xml 2010-05-11 13:45:35 UTC (rev 22007)
+++ branches/modular_build/pom.xml 2010-05-11 13:46:10 UTC (rev 22008)
@@ -17,7 +17,7 @@
<module>common</module>
<module>flow</module>
<module>jbpm</module>
- <module>jmx</module>
+ <!-- <module>jmx</module>
<module>archives</module>
<module>as</module>
<module>drools</module>
@@ -41,7 +41,7 @@
<module>examples</module>
<module>birt</module>
<module>maven</module>
- <module>site</module>
+ <module>site</module> -->
</modules>
</project>
15 years, 11 months
JBoss Tools SVN: r22007 - trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-05-11 09:45:35 -0400 (Tue, 11 May 2010)
New Revision: 22007
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
Log:
ExplorerBase#isFilePresent added
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2010-05-11 13:41:16 UTC (rev 22006)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2010-05-11 13:45:35 UTC (rev 22007)
@@ -196,6 +196,34 @@
return false;
}
}
+
+
+ /***
+ * Checks presence of file
+ *
+ * @param projectName - project name
+ * @param path - path to file
+ * @return true if file is located in explorer, false if not
+ */
+ public boolean isFilePresent(String projectName, String... path) {
+ SWTBot viewBot = open.viewOpen(viewObject).bot();
+ SWTBotTree tree = viewBot.tree().select(projectName);
+ StringBuilder builder = new StringBuilder(projectName);
+ // Go through path
+ try {
+ SWTBotTreeItem item = tree.expandNode(projectName);
+ for (String nodeName : path) {
+ builder.append("/" + nodeName);
+ item = item.expandNode(nodeName);
+ }
+ } catch (WidgetNotFoundException e) {
+ log.info("Node not found:" + builder.toString());
+ return false;
+ }
+
+ return true;
+ }
+
private SWTBotTreeItem getItem(SWTBotTreeItem ancestor, String name) {
try {
return ancestor.expandNode(name);
15 years, 11 months
JBoss Tools SVN: r22006 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-05-11 09:41:16 -0400 (Tue, 11 May 2010)
New Revision: 22006
Added:
branches/modular_build/pom.xml
Log:
add overall pom.xml so whole build can be run w/o ant (in theory)
Added: branches/modular_build/pom.xml
===================================================================
--- branches/modular_build/pom.xml (rev 0)
+++ branches/modular_build/pom.xml 2010-05-11 13:41:16 UTC (rev 22006)
@@ -0,0 +1,47 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>trunk</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <modules>
+ <!-- this order is important! -->
+ <module>tests</module>
+ <module>common</module>
+ <module>flow</module>
+ <module>jbpm</module>
+ <module>jmx</module>
+ <module>archives</module>
+ <module>as</module>
+ <module>drools</module>
+ <module>bpel</module>
+ <module>smooks</module>
+ <module>freemarker</module>
+ <module>profiler</module>
+ <module>portlet</module>
+ <module>modeshape</module>
+ <module>xulrunner</module>
+ <module>jst</module>
+ <module>vpe</module>
+ <module>jsf</module>
+ <module>esb</module>
+ <module>tptp</module>
+ <module>ws</module>
+ <module>cdi</module>
+ <module>struts</module>
+ <module>hibernatetools</module>
+ <module>seam</module>
+ <module>examples</module>
+ <module>birt</module>
+ <module>maven</module>
+ <module>site</module>
+ </modules>
+</project>
+
15 years, 11 months
JBoss Tools SVN: r22005 - trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-05-11 09:38:15 -0400 (Tue, 11 May 2010)
New Revision: 22005
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
IDELabel updated for Smooks tests
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-05-11 11:53:06 UTC (rev 22004)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-05-11 13:38:15 UTC (rev 22005)
@@ -140,7 +140,8 @@
public static final String JBOSS_TOOLS_WEB = "JBoss Tools Web";
public static final String JPA = "JPA";
public static final String DROOLS = "Drools";
- public static final String GUVNOR = "Guvnor";
+ public static final String GUVNOR = "Guvnor";
+ public static final String SMOOKS = "Smooks";
}
public class EntityLabel {
@@ -157,6 +158,7 @@
public static final String DROOLS_RULE = "Rule Resource";
public static final String GUIDED_DROOLS_RULE = "Guided Rule";
public static final String DSL_DROOLS_FILE = "Domain Specific Language";
+ public static final String SMOOKS_CONF_FILE = "Smooks Configuration File";
public static final String RESOURCES_FROM_GUVNOR = "Resources from Guvnor";
}
15 years, 11 months