美文网首页
Junit5 - Standard Test Class

Junit5 - Standard Test Class

作者: 跨界师 | 来源:发表于2018-01-10 21:31 被阅读14次
    import static org.junit.jupiter.api.Assertions.fail;
    import org.junit.jupiter.api.AfterAll;
    import org.junit.jupiter.api.AfterEach;
    import org.junit.jupiter.api.BeforeAll;
    import org.junit.jupiter.api.BeforeEach;
    import org.junit.jupiter.api.Disabled;
    import org.junit.jupiter.api.Test;
    
    class StandardTests {
    
        @BeforeAll
        static void initAll() {
        }
    
        @BeforeEach
        void init() {
        }
    
        @Test
        void succeedingTest() {
        }
    
        @Test
        void failingTest() {
            fail("a failing test");
        }
    
        @Test
        @Disabled("for demonstration purposes")
        void skippedTest() {
            // not executed
        }
    
        @AfterEach
        void tearDown() {
        }
    
        @AfterAll
        static void tearDownAll() {
        }
    
    }
    

    相关文章

      网友评论

          本文标题:Junit5 - Standard Test Class

          本文链接:https://www.haomeiwen.com/subject/qicdnxtx.html