Eclipse and JUnit Tutorial

  1. Open Eclipse
  2. Create a new Java project
  3. Create two source folders (src and test)
  4. Create a new class called House
  5. Add members squareFeet, askingPrice, bedrooms, bathrooms
  6. Generate getters/setters
  7. Add a method getPricePerSqFoot()
  8. Create a new test class called HouseTest
  9. Add a setUp() method
  10. Add a test for the getPricePerSqFoot method
  11. Run the test, debug, and fix
  12. Use the refactoring menu to change a method name
  13. Look at other refactoring options
  14. Look at other assert methods

Resources