A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Joined: Jun 30, 2006
Jul 19, 2012 20:29:37
private MyClass myObj = Mokito.mock(MyClass.class)
private MyClass myObj = new MyClass();
Doing the exact same thing of instantiating an instance of MyClass?
author & internet detective
Joined: May 26, 2003
Jul 21, 2012 14:58:53
Well no. The later creates the real object. The former does not create the real object but instead creates a mock.
OCA 8 book
How To Ask Questions The Smart Way
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: mock object
Calling class methods by class object using Reflection
using this in a class itself
From main method to contractor, it is possible?
GC question, OCP book Exam 2 Question 1
Why this private member can be seen?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015