1 개요[ | ]
- JUnit
- J유닛, 제이유닛
- Java용 단위 테스트 도구
- 테스트 주도 개발에서 활용됨
- 컴파일시에
org.junit
패키지[1] 아래에 JAR로 링크됨 - 스프링 스타터 프로젝트 Maven Dependencies에 포함되어 있음
- 작성언어: Java
- 이클립스 퍼블릭 라이선스
2 예시[ | ]
Java
Copy
import org.junit.*;
public class FoobarTest {
@BeforeClass
public static void setUpClass() throws Exception {
// Code executed before the first test method
}
@Before
public void setUp() throws Exception {
// Code executed before each test
}
@Test
public void testOneThing() {
// Code that tests one thing
}
@Test
public void testAnotherThing() {
// Code that tests another thing
}
@Test
public void testSomethingElse() {
// Code that tests something else
}
@After
public void tearDown() throws Exception {
// Code executed after each test
}
@AfterClass
public static void tearDownClass() throws Exception {
// Code executed after the last test method
}
}
3 포팅판[ | ]
다른 언어로 포팅된 것이 많음
4 같이 보기[ | ]
5 참고[ | ]
- ↑ JUnit 4 이상은
org.unit
, JUnit 3 이하는junit.framework
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.
- 분류 댓글:
- Java (3)
Java 튜토리얼 웹사이트 ― Thesmolt젠킨스 ― John Jeong젠킨스 ― Icesky