简体   繁体   中英

How test classes get reference of source classes in junit test?

Junit测试类驻留在完全不同的目标文件夹中,但是在运行测试用例时,测试类如何获得对源类的引用?

The test framework makes use of the classpath feature of a JVM. The classpath indicates where the program running the tests should find the classes it needs. The environment (your IDE, for example) sets the classpath to search in both the location of your test classes and the location of the classes you are testing. It will probably set the classpath to search in the location of your test classes and then search in the location of the classes being tested.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM