문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
groovy:unittest [2012/09/17 12:31] kwon37xi [Java Unit Test로 수행하기] |
groovy:unittest [2014/12/22 22:36] (현재) kwon37xi |
||
|---|---|---|---|
| 줄 2: | 줄 2: | ||
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| ===== Stub ===== | ===== Stub ===== | ||
| 줄 55: | 줄 57: | ||
| def suite = AllTestSuite.suite(" | def suite = AllTestSuite.suite(" | ||
| junit.textui.TestRunner.run(suite) | junit.textui.TestRunner.run(suite) | ||
| + | </ | ||
| + | |||
| + | ===== shouldFail for JUnit 4 ===== | ||
| + | * [[http:// | ||
| + | <code groovy> | ||
| + | class ArithmeticTest { | ||
| + | final shouldFail = new GroovyTestCase().& | ||
| + | |||
| + | @Test | ||
| + | void divideByZero() { | ||
| + | String message = shouldFail(ArithmeticException) { | ||
| + | println 1/0 | ||
| + | } | ||
| + | assertEquals message, " | ||
| + | } | ||
| + | } | ||
| </ | </ | ||