Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse/JUnit null pointer error
Eclipse/JUnit null pointer error [message #168980] Fri, 16 July 2004 06:52 Go to next message
Eclipse UserFriend
Originally posted by: kk_oop.yahoo.com

Hi.

I saw an interesting article about making Mock Objects for JUnit. I tried
it out in Eclipse and I got a null pointer error. Could someone take a
look at or try running the code to see if this is a problem with the way
Eclipse is running JUnit? The code is in the article at:

http://www-106.ibm.com/developerworks/library/j-mocktest.htm l

It's in listings 4, 5 and 6.

Thanks for any input!

Ken
Re: Eclipse/JUnit null pointer error [message #168998 is a reply to message #168980] Fri, 16 July 2004 07:27 Go to previous message
Eclipse UserFriend
Originally posted by: kk_oop.yahoo.com

Ken wrote:

> Hi.

> I saw an interesting article about making Mock Objects for JUnit. I tried
> it out in Eclipse and I got a null pointer error. Could someone take a
> look at or try running the code to see if this is a problem with the way
> Eclipse is running JUnit? The code is in the article at:

> http://www-106.ibm.com/developerworks/library/j-mocktest.htm l

> It's in listings 4, 5 and 6.

> Thanks for any input!

> Ken

Hi. I'm answering my own post again :).

As it turns out, when I was trying to instantiate the mock object in my
constructor. So, if you looked at the article, in listing 4, I had the
line:

Transaction transaction = createTransaction();

in my production class' constructor. I see now in the listing, they have
it outside the constructor in one of the production class' methods. Works
fine if I do it that way.

Thanks,

Ken
Previous Topic:Retreive Project Properties
Next Topic:postprocessing builder
Goto Forum:
  


Current Time: Sat May 10 01:03:08 EDT 2025

Powered by FUDForum. Page generated in 0.03008 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top