Bug 1427 - initialization in frysc.proc.Test*.java incompatible with JUnit
Summary: initialization in frysc.proc.Test*.java incompatible with JUnit
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P1 normal
Target Milestone: ---
Assignee: Jeff Johnston
Depends on:
Blocks: 1582
  Show dependency treegraph
Reported: 2005-10-05 21:51 UTC by Andrew Cagney
Modified: 2005-11-01 20:28 UTC (History)
0 users

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2005-10-05 21:51:02 UTC
Many of the tests contain code like:

class TestCase ...
   int foo = 1;
   Obj o = new Obj ();
   testFoo ()
      refer to foo and o;

problem is that foo, and o are only assigned once when the TestCase is created,
and using a different context to that set up by the setUp() method.  The code
should instead either initialize using a setUp() method, or better use freshly
allocated objects.
Comment 1 Jeff Johnston 2005-11-01 20:28:38 UTC
Bug has been fixed by wrapping timers/counters/etc.. in an internal class for
each test.  The internal class is instantiated each time the test is run so
there is no lasting state between test runs.