6 Replies Latest reply on Mar 1, 2010 12:19 AM by jesper.pedersen

    JBJCA-272 - Standalone validator tool

    jeff.zhang

      The tool can be running as standalone tool. Like

      $ validator/Main ra16inout.rar

       

      it will go through rar package and validate the ra.xml and classes base on spec of JCA 1.6

       

      Steps:

      • Unjar the rar
      • use classloader for load the classes and xml file
      • Rar-Metadata parse and get the metadata information
      • load the classes that would be validated
      • create ValidateClass arrays
      • call Validator:validate
      • get result - List<Failure>
      • output error /waning if it has
      • done
        • 1. Re: JBJCA-272 - Standalone validator tool
          jesper.pedersen

          validator/Main ra16inout.rar

          Yes, but through shell scripts (validate.sh / validate.bat), which you meant

           

          The rest looks good.

           

          1. The unjar should happen to java.io.tmpdir, and of course cleaned up afterwards.
          2. The validator tool should reference the JCA API and our public API JARs so those classes always are resolved
          3. Yes, this is shared with the deployer - so it should be moved to .deployers.common
          4. Same as 3)
          5. Correct
          6. Corect
          7. Correct
          8. The output should go into files (current directory or directory specified by -output) - and an error code should be set if there are errors (System.exit(1))
          9. A short description should go to the console (maybe we can add a -quite flag - if the user don't want that)

           

          This would make a good first revision of the tool IMHO.

          • 2. Re: JBJCA-272 - Standalone validator tool
            jesper.pedersen

            The initial commit of the standalone validator looks good

             

            We can hopefully get some feedback from the community about the usage for future releases, as the current

             

            java -jar jboss-jca-validator.jar <file>
            

             

            isn't optimal in the long run. But we have to consider the dependencies that the tool needs.

             

            And, we need to keep the standalone validator as a static analyzer as we can't assume that the environment the resource adapter targets is available. Hence we should take the aproach that is currently implemented.

            • 3. Re: JBJCA-272 - Standalone validator tool
              vickyk

              I have to add the following lines explicitlity to get the validator build working for this build.xml

              https://svn.jboss.org/repos/jbossas/projects/jboss-jca/trunk/validator/build.xml

               

              <property name="build.validator.dir" value="${build.dir}/validator" />
              
                 <path id="standalone.lib.path.id">
                  <fileset dir="/home/vicky/workspace/jboss-jca/trunk/lib/standalone">
                    <include name="**/*.jar"/>
                  </fileset>
                  <fileset dir="/home/vicky/workspace/jboss-jca/trunk/target">
                    <include name="**/*.jar"/>
                  </fileset>
                </path>
              

               

               

              Shouldn't build be working from here ?

               

              vicky@pamposh:~/workspace/jboss-jca/trunk/validator
              

               


              Jeff, are we in sync here?

              • 4. Re: JBJCA-272 - Standalone validator tool
                jesper.pedersen

                All modules are built from the top-level directory.

                 

                .../trunk/ant
                

                 

                HTH

                • 5. Re: JBJCA-272 - Standalone validator tool
                  vickyk

                  Yes I could get things working when I run it from the top lovel directory.

                  I do see couple of jboss-jca-validator related jars i.e jboss-jca-validator.jar and jboss-jca-validator-cli.jar. I don't think we should have two jars especially when the cli related jar is just having a Main class. Why not to have the Main class which is part of the cli related jar in the validator jar?

                   

                  Also where can we get the RAR's which are validated against the validator tool.

                  • 6. Re: JBJCA-272 - Standalone validator tool
                    jesper.pedersen

                    Proper separation of concerns -- see JBJCA-291.

                     

                    All resource adapters deployed will pass through the validator (of course if it is enabled). So that would be all the resource adapters in the test suite.

                     

                    The validator can also be used from the command line, and through Ant and Maven once implemented.