From: Michal K. <mic...@gm...> - 2008-09-11 13:02:25
|
I don't like the idea of a static field very much and will explain why. Suppose I have a JPFJUnit class which is a wrapper above JPF+JUnit and runs JUnit under pathfinder through the JPF class. JPFJUnit will be used from different kinds of applications to embed the test framework - e.g. from Eclipse plugin or Ant task. What happens when a JPFJUnit's static field is used for communication with JUnit's listener peer and is launched twice (e.g. on different test cases in Eclipse plugin) at the _same moment_. Then both peer instances will forward information to the same static field. I don't like this. I would like to have so called JPFJUnitListener that will receive information from both JPF and JUnit listeners. It could be used from a plugin in the following way: JPFJUnit jpfjunit = new JPFJUnit(); // do some config on jpfjunit jpfjunit.addListener(new MyJPFJUnitListener()); jpfjunit.run() { jpf = new JPF(); // do some config on jpf jpf.setTag(listeners); jpf.run(); } Michal Peter C. Mehlitz wrote: > Since this object would only be processed by your own listeners/native > peers, why don't you pass it directly between them (e.g. by using a > static field)? > > -- Peter > |