---- Jay McGaffigan [email protected] wrote:
Have you looked at JTestR?
I’m not sure how active it is being developed and it might not do what
you are looking for… but it might be worth a shot.
Yes. I can pretty much do all of what jtestr is doing. But, I believe
that when you mock a java class that mock can not be returned in another
java class that you are testing. So, if I have a java class that
creates a java object of a DB object, I don’t think I can mock that java
DB object and expect the java that I’m testing to use that mock. I
don’t think Jtestr can do that, because I don’t believe jruby is able to
that. I maybe wrong, but jtestr examples only show simple mocking of
say a hash. I can do that. But, if I need to mock the java hash
object that is used in a java class, it will not return that mock to the
java class I am testing. Again I might be wrong about jtestr. Maybe it
can do that. I know I cannot just using jruby. I have tried with db
objects and pinged Nick S. who replied it was not possible.