JSPWiki
  1. JSPWiki
  2. JSPWIKI-751

The Ant target "guitests" fail with 17 out of 962 tests

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9.1
    • Component/s: None
    • Labels:
      None

      Description

      During review of the project I also checked the "guitests" and they failed. I suggest fixing them after graduation instead having useless discussion along the lines "the tests are known to be broken", "the tests are not so important", you name it

        Activity

        Hide
        Siegfried Goeschl added a comment -

        Reply from juanpablo.santos@gmail.com

        • first, the tests are actually running: guitests target depends on jar, which in turn executes the tests target, before the tests are ran within the junit.swingui.TestRunner. You should have the test report corresponding to the first test execution at $SVN/tests/reports/junit-noframes.html, noting that 964 tests out of 964 ran OK.
        • Strangely, junit.swingui.TestRunner runs only 962 tests, 17 of them failing. There are some other weird issues with this runner:
          + lots of messages (a couple of thousands) on stdout like:
          [java] log4j:ERROR [junit.runner.TestCaseClassLoader@776be68f] whereas object of type
          [java] log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
          + stacktraces regarding hsqldb startup (several dozens):
          [java] [Server@5087c7a8]: [Thread[HSQLDB Server @5087c7a8,5,main]]: run()/openServerSocket():
          [java] java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
          + the tests target takes almost 5 minutes on my PC, whereas the guitests takes half the time
          + the tests failing are all related to setup methods, failing because either this code:
          Context initCtx = new InitialContext();
          throws an unexpected exception (no InitialContext available) or this one:
          Properties props = new Properties();
          props.put( PageSorter.PROP_PAGE_NAME_COMPARATOR, HumanComparator.class.getPackage().getName() + ".HumanComparator" );
          throws a NPE on the second line
          + Most importantly: all the(se) tests run fine through normal tests target / Eclipse
        • Wrapping up this issue, to me it seems an issue of junit.swingui.TestRunner, which btw, is not present in JUnit 4.x (all modern IDEs support JUnit execution from quite a while, so it seems like it didn't make sense to continue mantaining this runner). So, I'd rather delete guitests target from build.xml, as all the test are passing and the test failing issues seem to be related to the runner, WDYT?
        Show
        Siegfried Goeschl added a comment - Reply from juanpablo.santos@gmail.com first, the tests are actually running: guitests target depends on jar, which in turn executes the tests target, before the tests are ran within the junit.swingui.TestRunner. You should have the test report corresponding to the first test execution at $SVN/tests/reports/junit-noframes.html, noting that 964 tests out of 964 ran OK. Strangely, junit.swingui.TestRunner runs only 962 tests, 17 of them failing. There are some other weird issues with this runner: + lots of messages (a couple of thousands) on stdout like: [java] log4j:ERROR [junit.runner.TestCaseClassLoader@776be68f] whereas object of type [java] log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable. + stacktraces regarding hsqldb startup (several dozens): [java] [Server@5087c7a8] : [Thread [HSQLDB Server @5087c7a8,5,main] ]: run()/openServerSocket(): [java] java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind + the tests target takes almost 5 minutes on my PC, whereas the guitests takes half the time + the tests failing are all related to setup methods, failing because either this code: Context initCtx = new InitialContext(); throws an unexpected exception (no InitialContext available) or this one: Properties props = new Properties(); props.put( PageSorter.PROP_PAGE_NAME_COMPARATOR, HumanComparator.class.getPackage().getName() + ".HumanComparator" ); throws a NPE on the second line + Most importantly: all the(se) tests run fine through normal tests target / Eclipse Wrapping up this issue, to me it seems an issue of junit.swingui.TestRunner, which btw, is not present in JUnit 4.x (all modern IDEs support JUnit execution from quite a while, so it seems like it didn't make sense to continue mantaining this runner). So, I'd rather delete guitests target from build.xml, as all the test are passing and the test failing issues seem to be related to the runner, WDYT?
        Hide
        Siegfried Goeschl added a comment -

        Reply from Janne Jalkanen

        guitests runs the same tests as "tests", but it uses a different JUnit test runner which shows up a pretty gui . Unfortunately the classloader seems different between these two and I don't recall it ever being anything else but a source of grief...

        Show
        Siegfried Goeschl added a comment - Reply from Janne Jalkanen guitests runs the same tests as "tests", but it uses a different JUnit test runner which shows up a pretty gui . Unfortunately the classloader seems different between these two and I don't recall it ever being anything else but a source of grief...
        Hide
        Siegfried Goeschl added a comment -

        We need to fix that issue since it starts useless discussions - if we have tests than it is assumed that the tests are passing and if the tests are not passing it is assumed that the build is broken

        Show
        Siegfried Goeschl added a comment - We need to fix that issue since it starts useless discussions - if we have tests than it is assumed that the tests are passing and if the tests are not passing it is assumed that the build is broken
        Hide
        Juan Pablo Santos Rodríguez added a comment -

        Deleted guitests target in trunk, at revision 1410799, as the same functionality can be achieved running org.apache.wiki.AllTests through any modern IDE.

        Show
        Juan Pablo Santos Rodríguez added a comment - Deleted guitests target in trunk, at revision 1410799, as the same functionality can be achieved running org.apache.wiki.AllTests through any modern IDE.

          People

          • Assignee:
            Unassigned
            Reporter:
            Siegfried Goeschl
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development