Are there any Java runtime exploring tools?
Are there any Java runtime exploring tools? I mean the tools allowing to invoke concrete objects' methods in the running application (to check the correct behavior). It would be nice if I could substitute the object with another object of this type also, may be instantiated from sketch or deserialized from some sour开发者_运维问答ce. As I looked, usual debuggers are limited in this possibilities, but I dont pretend to the fact I
ve checked all of them.
I would suggest bytecode manipulation frameworks like ASM or BCEL for this purpose.
I would use basic jUnit and EasyMock for creating different input mock objects to check the behavior of your class in different situations. Then in the end you have a nice set of unit tests to maintain your codebase.
You should be able to achieve this at a higher level than direct bytecode manipulation using AOP tools such as AspectJ. Here are a couple of pointers:
- http://www.ibm.com/developerworks/java/library/j-aspectj2/
- http://danielroop.com/blog/2007/10/04/jmock-and-aspectj/
精彩评论