Uploaded image for project: 'XWork'
  1. XWork
  2. XW-666

NPE in unit tests, test failure - testSimpleTest(com.opensymphony.xwork2.TestNGXWorkTestCaseTest)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.2
    • 2.1.2
    • Configuration
    • None
    • Running in Sun Java 6, Linux / amd64
    • Patch

    Description

      When trying to build, I was receiving the following failures -

      Failed tests:

      testSimpleTest(com.opensymphony.xwork2.TestNGXWorkTestCaseTest)

      setUp(com.opensymphony.xwork2.TestNGXWorkTestCaseTest$RunTest)

      In debugging, I found an NPE in src/java/com/opensymphony/xwork2/TestNGXWorkTestCase.java. After instantiating the MockConfiguration, an attempt is made to retrieve a container, but the container is null, attempting to call 'getInstance' on the container results in an NPE. To resolve, I added a call to selfRegister() on the MockConfiguration. This makes a container available and the unit tests pass.

      Attachments

        Issue Links

          Activity

            People

              wesw Wesley Wannemacher
              wesw Wesley Wannemacher
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: