XMLWordPrintable

    • 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&gt;org.jboss.beans.MyFirstInterceptor</class&gt;
       </interceptors>
       <weld:scan/>
       <decorators>
        <class&gt;org.jboss.beans.MyFirstDecorator</class&gt;
       </decorators>
       <alternatives>
        <class&gt;org.jboss.beans.MyFirstBean</class&gt;
        <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

        1. hoover1.png
          hoover1.png
          40 kB
        2. hoover2.png
          hoover2.png
          37 kB
        3. hoover3.png
          hoover3.png
          25 kB
        4. hoover4.png
          hoover4.png
          30 kB
        5. hoover5.png
          hoover5.png
          28 kB
        6. hoover6.png
          hoover6.png
          32 kB
        7. new_decorator.png
          new_decorator.png
          57 kB
        8. new_interceptor.png
          new_interceptor.png
          57 kB
        9. new_bean.png
          new_bean.png
          73 kB
        10. new_stereotype.png
          new_stereotype.png
          65 kB

              dazarov_jira Daniel Azarov (Inactive)
              dazarov_jira Daniel Azarov (Inactive)
              Isaac Rooskov Isaac Rooskov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: