tag:blogger.com,1999:blog-8712770457197348465.post1715828095344040682..comments2024-03-28T02:47:19.159-07:00Comments on Javarevisited: JUnit4 Annotations : Test Examples and Tutorialjavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-8712770457197348465.post-69810882553076933242014-12-18T05:30:26.255-08:002014-12-18T05:30:26.255-08:00To better highlight with your example that tests n...To better highlight with your example that tests no longer have to follow a naming convention, I would have named the function differently. For example,<br /><br />@Test<br />public void calcInterest() {<br />System.out.println("calcInterest");<br />fail("An Example of @Test JUnit4 annotation");<br />}<br /><br />Now the example reinforces what the explanatory text says.Kavithanoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-43062909291018432482013-02-14T04:31:49.817-08:002013-02-14T04:31:49.817-08:00@Jamie, A classical copy paste mistake. Thanks for...@Jamie, A classical copy paste mistake. Thanks for pointing that out. You are correct method annotated with @After runs AFTER every JUnit test. Apologies for confusion, corrected now.Javin @ ClassLoader in Javahttp://javarevisited.blogspot.com/2012/12/how-classloader-works-in-java.htmlnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-17187154899970713252013-02-14T03:36:19.749-08:002013-02-14T03:36:19.749-08:00Hi, I am new to all of this and trying to learn. T...Hi, I am new to all of this and trying to learn. The second code snippet I find a little confusing "@After method will execute before every JUnit4 test". Shoulld this state it runs AFTER every test JUnit test? and not BEFORE?<br /><br />Thank you<br /><br />JamieAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-24876689178793147642012-06-26T07:56:47.601-07:002012-06-26T07:56:47.601-07:00@JohnMunsch, Thank, you added which is most common...@JohnMunsch, Thank, you added which is most common practice after @Test introduction,still some people follow test naming convention , but I like short names of method just like you. Thanks for highlighting that.Javin @ ldap authentication using spring securityhttp://javarevisited.blogspot.com/2011/11/ldap-authentication-active-directory.htmlnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-60635790127463016702012-06-25T07:22:24.492-07:002012-06-25T07:22:24.492-07:00Thanks @Simon Harrer, that's mistake. JUnit te...Thanks @Simon Harrer, that's mistake. JUnit test method should not have any parameter, thanks for pointing that.Javin @ final variable javahttp://javarevisited.blogspot.com/2011/12/final-variable-method-class-java.htmlnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-2116979812110870702012-06-25T05:50:03.241-07:002012-06-25T05:50:03.241-07:00The last code snippet is an invalid JUnit test as ...The last code snippet is an invalid JUnit test as a test method must not have any parameters.Anonymoushttps://www.blogger.com/profile/03730228211804255879noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-28257822769474825212012-06-23T19:16:58.323-07:002012-06-23T19:16:58.323-07:00@Jirka Pinkas, Thanks mate.I agree JUnit is essent...@Jirka Pinkas, Thanks mate.I agree JUnit is essential testing framework and must sit well on top on developer's TODO list. I will definitely try to bring more JUnit tutorials and practical examples of how to test certain features in Java. <br /><br />JavinJaivn @ encapsulation in Javahttp://javarevisited.blogspot.com/2012/03/what-is-encapsulation-in-java-and-oops.htmlnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-29002321765974115722012-06-23T05:15:14.683-07:002012-06-23T05:15:14.683-07:00Thank you, I hope you will continue about JUnit, b...Thank you, I hope you will continue about JUnit, because it is essential framework for modern programming.Jirka Pinkashttp://www.javavids.comnoreply@blogger.com