JUnit

1 개요[ | ]

JUnit
J유닛, 제이유닛

2 예시[ | ]

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 참고[ | ]

  1. JUnit 4 이상은 org.unit, JUnit 3 이하는 junit.framework
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}