-
Sub-task
-
Resolution: Done
-
Major
-
None
-
Not Required
1. Quick fix for "There is no class/annotation with the specified name [JSR-299 §5.1.1]" problem marker
In case when Bean class or Stereotype does not exists there should be a quick fix:
"Create Bean Class/Stereotype". This quick fix should run Creation wizard for Bean Class or Stereotype with selected "Add @Alternative" option
2. Quick fix for "<class> element must specify the name of an alternative bean class [JSR-299 §5.1.1]" and "<stereotype> element must specify the name of an @Alternative stereotype annotation [JSR-299 §5.1.1]" problem markers
In case of existing of Bean Class or Stereotype and when Bean Class or Stereotype has no @Alternative annotation there should be a quick fix:
"Add @Alternative annotation to Bean Class/Stereotype"
3. Quick fix for "There is no class with the specified name [JSR-299 §9.4]/[JSR-299 §8.2]" problem markers
In case when Decorator or Interceptor does not exists there should be a quick fix:
"Create Interceptor/Decorator". This quick fix should run Creation wizard for Interceptor or Decorator
Test case:
1. Create CDI Project
2. Create beans.xml file and open it in JBoss Tools XML Editor
<?xml version="1.0"?> <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:weld="http://jboss.org/schema/weld/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd http://jboss.org/schema/weld/beans http://jboss.org/schema/weld/beans_1_1.xsd"> <interceptors> <class>org.jboss.beans.MyFirstInterceptor</class> </interceptors> <weld:scan/> <decorators> <class>org.jboss.beans.MyFirstDecorator</class> </decorators> <alternatives> <class>org.jboss.beans.MyFirstBean</class> <stereotype>org.jboss.beans.MyFirstStereotype</stereotype> </alternatives> </beans>
3. Save file
ASSERT: Problem markers appear
4. Point mouse cursor to 'org.jboss.beans.MyFirstInterceptor'
ASSERT: Text hoover message appears:
5. Select "Create 'org.jboss.beans.MyFirstInterceptor' CDI Interceptor" quick fix
ASSERT: New Interceptor Wizard appears:
7. Press Finish button
ASSERT: 'org.jboss.beans.MyFirstInterceptor' class is created and opened in Java Editor, there is not problem marker on 'org.jboss.beans.MyFirstInterceptor' in beans.xml
8. Point mouse cursor to 'org.jboss.beans.MyFirstDecorator'
ASSERT: Text hoover message appears:
9. Select "Create 'org.jboss.beans.MyFirstDecorator' CDI Decorator" quick fix
ASSERT: New Decorator Wizard appears:
10. Add interface and Press Finish button
ASSERT: 'org.jboss.beans.MyFirstDecorator' class is created and opened in Java Editor, there is not problem marker on 'org.jboss.beans.MyFirstDecorator' in beans.xml
11. Point mouse cursor to 'org.jboss.beans.MyFirstBean'
ASSERT: Text hoover message appears:
12. Select "Create 'org.jboss.beans.MyFirstBean' CDI Bean Class" quick fix
ASSERT: New CDI Bean Wizard appears:
13. Press Finish button
ASSERT: 'org.jboss.beans.MyFirstBean' class is created and opened in Java Editor, there is not problem marker on 'org.jboss.beans.MyFirstBean' in beans.xml
14. Point mouse cursor to 'org.jboss.beans.MyFirstStereotype'
ASSERT: Text hoover message appears:
15. Select "Create 'org.jboss.beans.MyFirstStereotype' CDI Stereotype" quick fix
ASSERT: New Stereotype Wizard appears:
16. Press Finish button
ASSERT: 'org.jboss.beans.MyFirstStereotype' class is created and opened in Java Editor, there is not problem marker on 'org.jboss.beans.MyFirstStereotype' in beans.xml
17. Open org.jboss.beans.MyFirstBean class in Java Editor
18. Delete @Alternative annotation and save the file
ASSERT: problem marker appears on 'org.jboss.beans.MyFirstBean' in beans.xml
19. Point mouse cursor to 'org.jboss.beans.MyFirstBean'
ASSERT: Text hoover message appears:
20. Select "Add @Alternative annotation to 'MyFirstBean' class" quick fix
ASSERT: there is no problem marker on 'org.jboss.beans.MyFirstBean' in beans.xml
21. Open org.jboss.beans.MyFirstStereotype class in Java Editor
18. Delete @Alternative annotation and save the file
ASSERT: problem marker appears on 'org.jboss.beans.MyFirstStereotype' in beans.xml
19. Point mouse cursor to 'org.jboss.beans.MyFirstStereotype'
ASSERT: Text hoover message appears:
20. Select "Add @Alternative annotation to 'MyFirstStereotype' class" quick fix
ASSERT: there is no problem marker on 'org.jboss.beans.MyFirstStereotype' in beans.xml
- blocks
-
JBIDE-9865 New Decorator Wizard should show "Please select decorated type" error message in case when Name field is not empty
- Closed