PhD Position Available at University of Wisconsin-Milwaukee# Engineering - 工程
c*n
1 楼
the nasty thing about jmock is that whenever I want to mock a dependent
object, I have to abstract out the object creation,
and turn a statment like
MyClass obj = new MyClass();
into
MyClass obj = createMyClass();
while production code has
MyClass createMyClass() { return new MyClass();}
and mock code has
MyClass createMyClass() { return instance_var_mock_myclass;}
I end up having a lot of createXXX() methods in each class implemented,
furthermore, clover would complain that the createXXX() them
object, I have to abstract out the object creation,
and turn a statment like
MyClass obj = new MyClass();
into
MyClass obj = createMyClass();
while production code has
MyClass createMyClass() { return new MyClass();}
and mock code has
MyClass createMyClass() { return instance_var_mock_myclass;}
I end up having a lot of createXXX() methods in each class implemented,
furthermore, clover would complain that the createXXX() them