Hi, Could you please give me some CLUE, on how to proceed to test the following method: public int decide(LoggingEvent inEvent) { boolean retCode = false; if...
Kamal Ahmed
KAhmed@...
Feb 1, 2006 3:37 pm
15911
Kamal, Welcome. ... Yes. ... How do you create LoggingEvents elsewhere? Is it as simple as new LoggingEvent(some parameters)? If so, that's how I'd proceed ...
David, Thank for your response, I have just read the cookbook: I think you are referring to: public void testMoneyMoneyBag() { // [12 CHF] + [14 CHF] + [28...
Kamal Ahmed
KAhmed@...
Feb 1, 2006 4:42 pm
15913
... Pass in a mock LoggingEvent. Google for mock objects. -- Jason Rogers "I am crucified with Christ: nevertheless I live; yet not I, but Christ liveth in...
... What would happen if I have: @Test (expected=Bar.class) public void testMyFoo () {} If we execute junit3 style, it will find this test case, but won't see ...
Todd, Thanks, this certainly helped. I have tried to come up with a LoggingEvent (see snippet below) , is this what you were referring to? public void...
Kamal Ahmed
KAhmed@...
Feb 1, 2006 8:00 pm
15917
... If the class doesn't inherit from TestCase, then only the JUnit 4 behavior will work. If it does, then you should probably disambiguate anyway, for which...
Thanks, Todd. Sorry to bother you again, but when I use the following test case, I get error: public void testdecide() { Logger logger = Logger ...
Kamal Ahmed
KAhmed@...
Feb 1, 2006 10:18 pm
15920
Todd, The following change fixed it: public void testdecide() { Logger logger = Logger .getLogger("com.webmethods.sc.logging.test.unit.WmLoggerFilterTes"); ...
Kamal Ahmed
KAhmed@...
Feb 2, 2006 12:13 am
15921
... I noticed that the author points out the danger of using Pluggable Selector and reflection in general. What's up with that? Why do so many people find...
... Read the recipe about "Abstract Test Case", somewhere in the first few chapters. It should be able to explain the idea more completely to you. By the way,...
... Yes. ... new LoggingEvent(...); The first test I'd write is this: public void testNull() { assertEquals( Filter.DENY, new WmLoggerFilter().decide(null) ); ...
I don't think the performance overhead associated with reflection is as much of an issue as it was in early versions of Java, but the loss of static typing...
Stephen Smith
steve@...
Feb 2, 2006 9:12 am
15926
Mark, What an interesting idea. I've never considered instrumenting functional code in a manner "altering" unit test execution. However, the notion of...
... Not true. You would UnitTest it the same way as you test anything else. -- Jason Rogers "I am crucified with Christ: nevertheless I live; yet not I, but...
... In small spurts, no. But if it's used in a heavily used part of your system performance degradation takes place very quickly! -- Jason Rogers "I am...
... I wouldn't say it's dangerous, it's just that it adds more complexity to the system. Things can break easily after refactorings because refactorings don't...
Note: J2ME is my job, Java 3D is my hobbie. Well, I worked a litlle with the J2MEUnit, it resolved my problems, but i'm still working in some other questions...
Brunno Silva
brunno.silva@...
Feb 2, 2006 3:13 pm
15932
Since there seems to be an interest in RTTI, I think that the following will be of interest Using polymorphism design techniques eliminates all need for RTTI...
... That's true, but it's still something to be mindful of. And to be more specific, what is slow in reflection is look up, not invocation, so if you really...
... You'll have to fill me in on what you mean by "sensorial capacity". I have some experience with Java3D. The approach that worked the best is similar to...
Thanks - honestly the idea is stolen from PMD. Its what they use to replace attributes (in Java 1.4) so you can supress individual warnings. I bet that you...
... Who needs training wheels? :) ... That's why we have tests. ... Not dangerous: we don't worry about the performance overhead of invoking methods or...
... You'd think that would be a big issue, but no--even well-known TDD practitioners pooh-pooh it. -- J. B. (Joe) Rainsberger :: http://www.jbrains.info Your...
... Really? How does Adapter do this? Specifically, I was working in an area where there were a number of rule methods, like boolean isReadyToStart(); boolean...
... No, that's why we have static typing. Besides, *you* have tests. Not everybody does. If I have to choose between "tests" and "tests and static typing", I...