Skip to main content

Marco Castellani's Library tagged junit   View Popular

24 Jun 09

java.net: A Dozen Ways to Get the Testing Bug in the New Year

  • Writing tests first is a programming technique that takes practice, and lots of it. Accept the fact that you won't see miraculous results overnight. Experts say it takes a minimum of 21 days to build a positive habit and six months for it to become part of your personality. So when you feel yourself backsliding, don't despair. Just keep pressing on and pay careful attention to mental assertions you're making that could be codified in tests. Your brain will love you for it!
23 Jun 09

java.net: A Dozen Ways to Get the Testing Bug in the New Year

  • Notice that the result checking is now codified in the use of assertEquals() methods that automatically check whether the expected value (the first parameter) matches the actual value (the second parameter). There's no need for you to remember what the correct results should be.
  • Most Java IDEs have an integrated graphical runner just waiting to stroke your ego, such as this runner in Eclipse:
  • 5 more annotations...
22 Jun 09

Clarkware › JUnit Primer

  • unit tests are written to test the
    fundamental building blocks of the system from the inside out.
  • Any class that contains
    test methods should subclass the TestCase class.
  • 3 more annotations...

Unit testing with JUnit 4.x and EasyMock in Eclipse - Tutorial

  • the all test
    can be performed in an arbitrary order hence each test
    should stand alone and not depend on another test.
09 Jun 08

JUnit Cookbook

    • When you need to test something,
      here is what you do:



      1. Annotate a method with @org.junit.Test


      2. When you want to check a value, import org.junit.Assert.* statically, call assertTrue() and pass a boolean
        that is true if the test succeeds
1 - 13 of 13
Showing 20 items per page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo