8 Replies Latest reply on Jan 14, 2010 12:22 PM by Alexander Jesse

    static analysis

    J InOK Newbie

      Is anyone actively working on the static analysis code? The current trunk has some limitations that I'd like to see worked out. I'm willing to do the work myself, but I don't want to duplicate any effort if these things are already being addressed:

      - Add support for files with arbitrary file suffixes (right now, .jsp and .xhtml are hardcoded).

      - Handle any EL expression in the ViewConfigReconciler, not just those of the form #{bean.method}. Fix the project's pom, which currently brings in the el api twice (v. 1.0 and v. 2.1).

      - Dynamically create test cases that run individually, as opposed to rolling all tests into one big test case that fails immediately on the first of possibly many errors.

        • 1. Re: static analysis
          Stan Silvert Master

          I'd love to have your help with the static analysis stuff and I'm sure that Dennis would too.

          Can you send me an email so that the three of us can talk off line? I'm stan at jboss dot com.

          Also, can you go ahead and enter Jira tasks for each of your new features. I know that the last one you mentioned has been a frequent request.

          Stan

          • 3. Re: static analysis
            Alexander Jesse Newbie

            Stuff that I would like to see for the static analysis:
            - just drop a war at the static analysis-code, locaion of the view-definitions, config-files are known then...
            - provide a list of exceptions, now the code just throws an exception at the first violation and then stops...
            I think so far these have not yet been requested... shall I open issues?

            • 4. Re: static analysis
              Stan Silvert Master

               

              "AleJesse" wrote:

              - just drop a war at the static analysis-code, locaion of the view-definitions, config-files are known then...

              Yes, please open a request for this one.
              "AleJesse" wrote:

              - provide a list of exceptions, now the code just throws an exception at the first violation and then stops...

              This one sounds similar to http://jira.jboss.com/jira/browse/JSFUNIT-139. If you agree, please add your comments to that one.

              Regards,

              Stan

              • 5. Re: static analysis
                Alexander Jesse Newbie

                 

                "stan.silvert@jboss.com" wrote:
                "AleJesse" wrote:

                - just drop a war at the static analysis-code, locaion of the view-definitions, config-files are known then...

                Yes, please open a request for this one.

                http://jira.jboss.com/jira/browse/JSFUNIT-142
                "stan.silvert@jboss.com" wrote:
                "AleJesse" wrote:

                - provide a list of exceptions, now the code just throws an exception at the first violation and then stops...

                This one sounds similar to http://jira.jboss.com/jira/browse/JSFUNIT-139. If you agree, please add your comments to that one.

                True, upon rereading it... comment added

                • 6. Re: static analysis
                  Alexander Jesse Newbie

                   

                  "AleJesse" wrote:
                  "stan.silvert@jboss.com" wrote:

                  "stan.silvert@jboss.com" wrote:
                  "AleJesse" wrote:

                  - provide a list of exceptions, now the code just throws an exception at the first violation and then stops...

                  This one sounds similar to http://jira.jboss.com/jira/browse/JSFUNIT-139. If you agree, please add your comments to that one.

                  True, upon rereading it... comment added

                  and it itched too much... at least for the AbstractFacesConfigTestCase
                  Code to create testsuites and individual testcases works in my local environment. The drawback is that on large applications with lots of config-files, managed beans and properties it generates a lot of test cases and takes its time.


                  • 7. Re: static analysis
                    Alexander Jesse Newbie

                    Preparing to check in a "fix" for http://jira.jboss.com/jira/browse/JSFUNIT-139

                     

                    AbstractFacesConfigTestCase (with ClassDefintionsImpl, ManagedBeansImpl) is replaced by ConfigFilesTestSuite and a bunch of individual TestSuites and TestCases.

                     

                    The new config file tests are called like this sample

                    public class MyConfigFilesTestSuite extends TestSuite
                    {
                       /**
                        * Create the testcase suite.
                        * 
                        * @return a JUnit Test instance containing the complete hierarchy
                        */
                       public static Test suite()
                       {
                          // create a new TestSuite and give it this class' name as the testuite-name
                          TestSuite suite = new TestSuite();
                          suite.setName(MyConfigFilesTestSuite.class.getSimpleName());
                          
                          // create a list of all application config files 
                          // (see the <code>javax.faces.CONFIG_FILES</code> context-parameter in the web.xml)
                          List<String> configFiles = new ArrayList<String>();
                          configFiles.add("testdata/navigation-faces-config.xml");
                          configFiles.add("testdata/mytype-config.xml");
                          configFiles.add("testdata/i18n-faces-config.xml");
                          configFiles.add("testdata/myjsf-faces-config.xml");
                          configFiles.add("testdata/central-settings-faces-config.xml");
                          configFiles.add("testdata/myApplication-beans.xml");
                          configFiles.add("testdata/faces-config.xml");
                    
                          // Ask the config-files-test-suite to generate the complete suite/case hierarchys
                          suite.addTest(new ConfigFilesTestSuite("my application").getSuite(configFiles));
                    
                          return suite;
                       }
                    }
                    

                    Currently it should already test more than the old classes. And it should be easier to extend.

                    • 8. Re: static analysis
                      Alexander Jesse Newbie
                      Jar files with the current snapshot can be found on the WIKI-page for Static Analysis.