Separation of JUnit classes into special test package?

后端 未结 3 1520
萌比男神i
萌比男神i 2020-12-04 06:24

I am learning the concepts of Test-Driven Development through reading the Craftsman articles (click Craftsman under By Topic) recommended in an answer to m

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 07:11

    I put my test classes in the same package as what they are testing but in a different source folder or project. Organizing my test code in this fashion allows me to easily compile and package it separately so that production jar files do not contain test code. It also allows the test code to access package private fields and methods.

提交回复
热议问题