????μ???????????
???????????? ???????[ 2011/10/31 14:11:00 ] ????????
??????????y?????????????????????????????????????????????????API????????????????????????????????????????????????TestedBy?????????????????????????????????y???????????
??????????????TestedBy???????????????????@TestedBy?????API???????????@BeforeTestedBy???????????????????TestedBy?????????APIImplOne??APIImplTwo??????shouldAddTwoAndThree??????????????????????????????????
????Java????
1. public interface APIInterface {
????2. @TestedBy( testClass = "it.javalinux.testedby.APITest"?? testMethod = "shouldAddTwoAndThree" )
????3. public int add(int a?? int b);
????4. }
????5.
????6. public class APIImplOne {
????7. public int add(int a?? int b) {
????8. return a + b;
????9. }
????10.
????11. public class APIImplTwo {
????12. public int add(int a?? int b) {
????13. return a - b;
????14. }
????15.
????16. public class APITest {
????17.
????18. private APIInterface instance;
????19.
????20. @BeforeTestedBy
????21. public beforeTestedBy(APIInterface instance) {
????22. this.instance = instance;
????23. }
????24.
????25. public void shouldAddTwoAndThree() {
????26. assertThat(instance.add(3??2)?? is(5));
????27. }
????28.
????29. }
?????????????????????????????TestedBy?и???????????統(tǒng)??в?????????????????????????????????????????????????Щ????????????
??2???????????????????в???
??????д?????????????????????????????????д????????????????????????????????????????????????????????????????????????????????????????е??漰??????????????????????????е?????????????????????????
????????????IDE?????????????????????????????????ж?????????????????????IDE??????в?????testedBy????????????????eclipse?????????Щ???????????????????????????????????????????????????????????????????Σ????????д????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11