Coding kata to practice TDD and some file operations with Java and JUnit.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

File operations coding kata

Coding kata to practice some file operations using Java and TDD.

About coding kata:

Useful JUnit tips

  • Mark your test cases with @Test annotations. You don’t need to prefix your test cases with “test”. In addition, your class does not need to extend from “TestCase” class.

  • Use @Before and @After annotations for “setup” and “tearDown” methods respectively. They run before and after every test case.

  • Use @BeforeClass and @AfterClass annotations for class wide “setup” and “tearDown” respectively. Think them as one time setup and tearDown. They run for one time before and after all test cases.

  • Exception Handling: use “expected” paramater with @Test annotation for test cases that expect exception. Write the class name of the exception that will be thrown.

  • Put @Ignore annotation for test cases you want to ignore. You can add a string parameter that defines the reason to ignore the test.

  • Define a timeout period in miliseconds with “timeout” parameter. The test fails when the timeout period exceeds.

  • JUnit tutorial: