开发者

Is it possible to exceute a method from a different application in Java?

开发者 https://www.devze.com 2023-01-04 04:37 出处:网络
I\'m trying to automate some manual tests for a desktop app written in Java. I\'m using FEST to do t开发者_运维技巧his. Is it possible to execute some parts of the code on the app being tested from FE

I'm trying to automate some manual tests for a desktop app written in Java. I'm using FEST to do t开发者_运维技巧his. Is it possible to execute some parts of the code on the app being tested from FEST and get the results back in a stream or something. Or is there any other testing framework that lets you do it?


I'm currently using JUnit for testing everything in any Java application, it writes the results in a hmtl set of documents for an easy consulting.

Try use this framework. For a good ref i advice you O'Reilly Pocket Ref.


Using FEST reflection module.

There is a method called staticMethod that lest you do it.

Example


String xml = staticMethod("staticMethodName")
                            .withReturnType(String.class)
                            .in(Class.forName("com.package.className"))
                            .invoke();

return xml;

0

精彩评论

暂无评论...
验证码 换一张
取 消