ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Lawrence Murphy <ga...@canada.com>
Subject Anonymous threads in Unittestgen testAll
Date Fri, 18 Jan 2002 04:19:41 GMT

This may be an Ant question, but it could also be a unittestgen
(http://sf.net/projects/wttools/) question --- I'm hoping this is
something others have already encountered and solved, or that
there is a config option somewhere to get the effect I need.

I have a collection class to be tested by two concurrent threads.
To do this, I used the general anonymous Thread syntax

         (new Thread() {
              public void run() {
              // stuff and extract data
              }
          })

I am using the unittestgent TestAll class with my test suite passed in
as a class, and I assume suite.addTest() is using introspection to
extract all Test* inner classes, and then inspecting those classes for
all test methods.

Unfortunately, these anonymous classes are not public, and this is
tripping an exception in my unit test report:

    Class ca.cbc.sportwire.util.TestTTLCacheMap$1 is not public

    junit.framework.AssertionFailedError: Class ca.cbc.sportwire.util.TestTTLCacheMap$1 is
not public
    at junit.framework.Assert.fail(Assert.java:32)
    at junit.framework.TestSuite$1.runTest(TestSuite.java:191)
    at junit.framework.TestCase.runBare(TestCase.java:130)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:121)
    at junit.framework.TestSuite.runTest(TestSuite.java:157)
    at junit.framework.TestSuite.run(TestSuite.java:152)
    at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:231)
    at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:409)

Is there anything I can do about this?  I need to give the unit test
results to some management types who are not going to really understand
why the application does not reach a perfect bug-free score in the
unit tests ;)

(ok, I /could/ hand-edit the HTML, but that's really cheating :)

-- 
Gary Lawrence Murphy <garym@teledyn.com> TeleDynamics Communications Inc
What happens on Groundhog Day?   http://www.teledyn.com/fun/GroundhogDay
"There are many things which do not concern the process" --- Joan of Arc



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message