Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-2714

org.jboss.test.web.test.JSFIntegrationUnitTestCase.testJSFAppWithBundledMyFaces tests failing to make use of JavaScript

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • EAP 5.0.0.CR3
    • Testsuite
    • None
    • Initially seen on HPUX, but later also seen on RHEL

      The test org.jboss.test.web.test.JSFIntegrationUnitTestCase.testJSFAppWithBundledMyFaces.testJSFAppWithBundledMyFaces makes use of the test framework HttpUnit.
      HttpUnit in turn relies on a number of external libraries to implement some of its features. One of these is js.jar, from Rhino, providing JavaScript support.

      This test is failing on HPUX with the following exception:

      Error Message
      org/mozilla/javascript/NotAFunctionException
      Stacktrace
      java.lang.NoClassDefFoundError: org/mozilla/javascript/NotAFunctionException
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2454)
      at java.lang.Class.getDeclaredMethods(Class.java:1795)
      at org.mozilla.javascript.FunctionObject.getMethodList(FunctionObject.java:312)
      at org.mozilla.javascript.ScriptableObject.defineClass(ScriptableObject.java:800)
      at org.mozilla.javascript.ScriptableObject.defineClass(ScriptableObject.java:734)
      at com.meterware.httpunit.javascript.JavaScript.initHTMLObjects(JavaScript.java:95)
      at com.meterware.httpunit.javascript.JavaScript.run(JavaScript.java:77)
      at com.meterware.httpunit.javascript.JavaScriptEngineFactory.associate(JavaScriptEngineFactory.java:46)
      at com.meterware.httpunit.FrameHolder.<init>(FrameHolder.java:53)
      at com.meterware.httpunit.WebWindow.<init>(WebWindow.java:239)
      at com.meterware.httpunit.WebClient.<init>(WebClient.java:51)
      at com.meterware.httpunit.WebConversation.<init>(WebConversation.java:50)
      at org.jboss.test.web.test.JSFIntegrationUnitTestCase.testJSFAppWithBundledMyFaces(JSFIntegrationUnitTestCase.java:86)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)

      The test is failing on HPUX with the above exception. I checked and found that the rhino.rhino.classpath which includes js.jar is defined in testsuite-libraries.ent, but it was never included in the tests.classpath in the testsuite. Adding the following:

      <!-- path refid="rhino.rhino.classpath"/ -->
      <pathelement path="${rhino.rhino.lib}/js.jar"/>

      to the distribution.jars.library.classpath fixes the problem on HPUX.

      But if the test was failing on HPUX, why was it passing on other platforms? Checking the RHEL execution of the same test, I found this on the output log for the test:

      Error Message
      Stacktrace
      Standard Error
      Rhino classes (js.jar) not found - Javascript disabled

      So, it appears that httpunit behaves differently on HPUX and RHEL.

            ssilvert@redhat.com Stan Silvert
            rachmato@redhat.com Richard Achmatowicz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: