Uploaded image for project: 'CDI TCK'
  1. CDI TCK
  2. CDITCK-15

Corner case tests for injecting into non-contextual EJBs

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 1.1.0.Alpha2
    • None
    • Tests
    • None

      For example:

      • chains of EJBs with contextual instances
      • reentrant injcetion (allowed by EJB?)

            [CDITCK-15] Corner case tests for injecting into non-contextual EJBs

            For example, check that:

            @Stateful @RequestScoped
            class Bar {
            
               @Inject Baz baz;
            
               public Baz getBaz() { return baz; }
            
            }
            
            @Stateful @RequestScoped
            class Baz {
            
               @Inject Bar bar;
            
               public Bar getBar() { return bar; }
            
            }
            

            And verify that this works, assuming they are normal scoped of course!

            Pete Muir (Inactive) added a comment - For example, check that: @Stateful @RequestScoped class Bar { @Inject Baz baz; public Baz getBaz() { return baz; } } @Stateful @RequestScoped class Baz { @Inject Bar bar; public Bar getBar() { return bar; } } And verify that this works, assuming they are normal scoped of course!

            For example, check that:

            class Foo {}
            
            @Stateless
            class Bar {
            
               @Inject Foo foo;
            
               public Foo getFoo() { return foo; }
            
            }
            
            @Stateless
            class Baz {
            
               @EJB Bar bar;
            
               public Bar getBar() { return bar; }
            
            }
            
            @Stateless
            class Qux {
            
               @EJB Baz baz;
            
               public Baz getBaz() { return baz; }
            
            }
            
            assertNotNull(qux.getBaz().getBar());
            

            Pete Muir (Inactive) added a comment - For example, check that: class Foo {} @Stateless class Bar { @Inject Foo foo; public Foo getFoo() { return foo; } } @Stateless class Baz { @EJB Bar bar; public Bar getBar() { return bar; } } @Stateless class Qux { @EJB Baz baz; public Baz getBaz() { return baz; } } assertNotNull(qux.getBaz().getBar());

              mkouba@redhat.com Martin Kouba
              pmuiratbleepbleep Pete Muir (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: