8 Replies Latest reply on Mar 10, 2008 11:02 AM by kabirkhan

    State of the JAXB parsing

      I've managed to get the testsuite down to 1 error and 54 failures
      with the new parser.

      The tests failing fall into the following categories:

      * Attributes on the wrapped objects, which is a known issue with the way I implemented
      this in JBossXB - http://www.jboss.com/index.html?module=bb&op=viewtopic&t=131304

      * Two issues with with the cardinality tests which I haven't figured out
      CardinalityCallbackTestCase and BadCardinalityCallbackTestCase
      all the other problems in this part of the testsuite were caused by
      initialization code only being the old xml parsing layer (see other threads),
      so I guess this is similar but I can't spot what it is? ;-)

      * Old xml parsing tests failing because they are expecting the wrong
      GenericBeanMetaDataFactory class

      * Old xml parsing tests where validation was in the xml parsing layer.
      These checks need moving to the initialVisit() of the relevant metadata
      e.g. This code in ValueFactoryHandler should be in
      AbstractValueFactoryMetaData::initialVisit()

       public Object endElement(Object o, QName qName, ElementBinding element)
       {
       AbstractValueFactoryMetaData vf = (AbstractValueFactoryMetaData)o;
       if (vf.getUnderlyingValue() == null || vf.getMethod() == null)
       throw new IllegalArgumentException("Bean or method cannot null: " + vf);
       if (vf.getParameter() != null && vf.getParameters() != null)
       throw new IllegalArgumentException("Both parameter and parameters cannot be set: " + vf);
      


      * Related to the previous point, its actually pointless to test the parsing
      layer throws these errors since we don't actually install the metadata
      where the initial visit and other initialization occurs where this validation
      can be properly performed.

      * AliasMetaData - there's no support for this at all in the new xml parsing
      and the way it is done in the old version is wrong (I didn't think this
      was useful anyway so it could just be dropped?).
      The reason it is wrong, is because it is trying to use the classloader
      (well actually it is not but it should be if it means anything)
      and replace properties in the parsing stage rather than the more
      relevant initialVisit() stage.

      * policy metadata - I think Ales is working on this? Although this isn't high
      priority since nobody is using it at the moment.

        • 1. Re: State of the JAXB parsing

           

          "adrian@jboss.org" wrote:

          * Two issues with with the cardinality tests which I haven't figured out
          CardinalityCallbackTestCase and BadCardinalityCallbackTestCase
          all the other problems in this part of the testsuite were caused by
          initialization code only being the old xml parsing layer (see other threads),
          so I guess this is similar but I can't spot what it is? ;-)


          This was caused by there already being a "whenRequired" on the
          AbstractLifecycleMetaData, except it justs called "state" as a property.
          I removed the redundant property from the CallbackMetaData.

          • 2. Re: State of the JAXB parsing

             

            "adrian@jboss.org" wrote:

            * Old xml parsing tests where validation was in the xml parsing layer.


            I moved all these to the initial visit so there's really only 4 failures
            due the wrapper problem, if you exclude the alias and policy parsing. ;-)

            • 3. Re: State of the JAXB parsing

               

              "adrian@jboss.org" wrote:
              So there's really only 4 failures
              due the wrapper problem, if you exclude the alias and policy parsing. ;-)


              It turned out that not all the 4 failures were due to the wrapping problem,
              but I've fixed these as well.

              The only errors now are in the old xml parsing tests, so I'm happy that this works now. ;-)

              The next step is to get jboss-reflect released so we can do a jbossxb-2.0.0.CR7
              which will allow us to remove container from the MC project.

              • 4. Re: State of the JAXB parsing

                This is what is left to do on the JAXB parsing.

                REQUIRED
                1) Create a jboss-beans-common.2.0.xsd
                2) Change the mc, spring, policy and aop schemas to xsd:redefine it
                3) Complete aop-mc-int (Kabir)
                4) Move old schema binding handlers to spring-int

                NICE TO HAVE
                1) Remove the redundant JaxbTestCases from the xml tests
                2) Change the testsuite such that it validates the xml against the schema

                OPTIONAL
                1) Get JBossXB to provide a testsuite support framework for xml parsing

                • 5. Re: State of the JAXB parsing

                   

                  "adrian@jboss.org" wrote:

                  2) Change the mc, spring, policy and aop schemas to xsd:redefine it


                  Only the latest versions of the schemas, e.g. don't change bean-deployer-1.0.xsd

                  • 6. Re: State of the JAXB parsing

                    I've reverted to plan B for now.

                    i.e. aop-mc-int still uses the schema binding initializer
                    which means we can move the old schema binding handlers out of kernel just yet.

                    • 7. Re: State of the JAXB parsing
                      alesj

                       

                      "adrian@jboss.org" wrote:

                      i.e. aop-mc-int still uses the schema binding initializer
                      which means we can move the old schema binding handlers out of kernel just yet.

                      I guess you meant can't?

                      • 8. Re: State of the JAXB parsing
                        kabirkhan

                         

                        "adrian@jboss.org" wrote:
                        This is what is left to do on the JAXB parsing.

                        REQUIRED
                        1) Create a jboss-beans-common.2.0.xsd
                        2) Change the mc, spring, policy and aop schemas to xsd:redefine it
                        3) Complete aop-mc-int (Kabir)
                        4) Move old schema binding handlers to spring-int



                        I have created http://jira.jboss.com/jira/browse/JBMICROCONT-258 and related issues. jboss-beans-common_2_0.xsd is in, and the mc schema has been updated to use it.