Skip to content

Latest commit

 

History

History

junit

JUnit

Tutorial

init

$ bash junit_init.sh

create executable file

$ cd [onlyTest|testCode|beforeAfte|stack|testException1]
$ make

run testcase

$ make test

syllabus

week3

OnlyTest: Only JUint test

TestCode: Simple assert

week4

BeforeAfter: Show execution path of before and after annotation

Stack: Use stack example show why use before and after annotation

week5

Parameterized: Use JUnit @parameterized annotation to generate multiple tese case

week6

Parameterized2.0: Use JUnit @parameterized annotation to generate multiple tese case(homework version)

TestException1: Use stack example show how to check exception with test

TestException2: Use stack example show how to check exception with test rule

week7

Jacoco: Use jacoco to run & cal & show coverage information

week8

Jacoco Labwork: Labwork for jacoco, need add testcase and achieve 100% coverage

week9

Stub: Stub example, and use Mockito to stub

week10

Mock: Mock example, and use Mockito to mock

Mock2: Mock Mazu example, and use Mockito to mock

week11

StubLW: Labwork for Stub, complete testcase & achieve 100% coverage in multiplicationWithArray method