4 Replies Latest reply on Aug 13, 2007 10:50 AM by Pete Muir

    A few issues.

    tzman Newbie

      My apologies if these issues have already been fixed/mentioned.

      1.) org.jboss.seam.mock.BaseSeamTest

      
       protected void startJbossEmbeddedIfNecessary() throws DeploymentException, IOException
       {
       if ( !started )
       {
       Bootstrap bootstrap = Bootstrap.getInstance();
       bootstrap.bootstrap();
       started = true;
       if ( resourceExists("seam.properties") )
       {
       bootstrap.deployResourceBase("seam.properties");
       }
       if ( resourceExists("META-INF/components.xml") )
       {
       bootstrap.deployResourceBase("META-INF/components.xml");
       }
       if ( resourceExists("META-INF/seam.properties") )
       {
       bootstrap.deployResourceBase("META-INF/seam.properties");
       }
       }
       }
      


      The call to deployResourceBase will only locate the first resource?

      or should this be:

      
      
       @Override
       protected void startJbossEmbeddedIfNecessary(
       ) throws DeploymentException, IOException
       {
       Bootstrap bootstrap;
       if ( !started )
       {
       bootstrap = Bootstrap.getInstance();
       bootstrap.bootstrap();
       started = true;
       if ( resourceExists( "seam.properties" ) )
       {
       bootstrap.deployResourceBases( "seam.properties" );
       }
       if ( resourceExists( "META-INF/components.xml" ) )
       {
       bootstrap.deployResourceBases("META-INF/components.xml" );
       }
       if ( resourceExists( "META-INF/seam.properties" ) )
       {
       bootstrap.deployResourceBases("META-INF/seam.properties" );
       }
       }
       }
      
      
      



      2.) org.jboss.seam.framework.Identifier

      The equals method checks for an instance of the derived type org.jboss.seam.framework.EntityIdentifier


      3.) It doesn't appear as though we can use injection in base classes. Am I mistaken? Is this a design decision?
      We have gotten around this by retrieving the components programatically, i.e. Component.getInstance( "entityManager" );

      This means that for testing I have to load the container, when I only need hibernate; or I have to do a check in by base class before retrieving the component to ensure the application context is active.


      Thanks for all the work.



        • 1. Re: A few issues.
          Pete Muir Master

           

          "tzman" wrote:
          My apologies if these issues have already been fixed/mentioned.

          1.) org.jboss.seam.mock.BaseSeamTest


          http://jira.jboss.com/jira/browse/JBSEAM-1791


          2.) org.jboss.seam.framework.Identifier

          The equals method checks for an instance of the derived type org.jboss.seam.framework.EntityIdentifier


          Please raise a JIRA issue for this.


          3.) It doesn't appear as though we can use injection in base classes. Am I mistaken? Is this a design decision?
          We have gotten around this by retrieving the components programatically, i.e. Component.getInstance( "entityManager" );

          This means that for testing I have to load the container, when I only need hibernate; or I have to do a check in by base class before retrieving the component to ensure the application context is active


          I don't know what you mean by a base class. But Seam injection only occurs in classes annotated @Name.

          • 2. Re: A few issues.
            tzman Newbie

            1.) Thanks

            2.) Here is the JIRA issue

            http://jira.jboss.com/jira/browse/JBSEAM-1794

            I will try to put a patch in for this if I can get a moment to update from cvs.


            3.)

            I don't know what you mean by a base class.


            By base class I mean a base class we code for our application. Something similar to the EntityHome framework. We have a base abstract business object where we wrap the functionality of entities and an entity manager. We have something similar for entity queries and other service based code. For both cases we can do a large portion of the work in the base class, but that requires an entity manager.

            But Seam injection only occurs in classes annotated @Name.

            This sort of the point, in most case it would not make sense to have a base class be a named component, and it cannot be if it is abstract.

            Seam checking for annotations in the base class(es) of the component would make things easier, but if it was a design decision to not do so then that is fine and I can make use of what ever api's are available. I was merely curious as to if it was something that has just not been added yet or was never planned to be available.


            Thanks again.


            • 3. Re: A few issues.
              tzman Newbie

               

              I will try to put a patch in for this if I can get a moment to update from cvs.


              Never mind, you already fixed it. :)



              • 4. Re: A few issues.
                Pete Muir Master

                Ah, if you have something like

                public abstract class MyAbstractClass {
                
                 @In protected Foo foo;
                 ...
                }


                public class MyClass extends MyAbstractClass {
                 // Do something with foo
                }


                it should work. If you are unsure, post what you've got.