zoukankan      html  css  js  c++  java
  • JUnit4_3

    @Test @Ignore @BeforeClass @Before @After @AfterClass

    /**
    *
    */
    package com.ailk;

    import static org.junit.Assert.*;

    import static org.hamcrest.core.Is.*;

    import org.junit.Ignore;
    import org.junit.Test;
    import org.junit.BeforeClass;
    import org.junit.AfterClass;
    import org.junit.Before;
    import org.junit.After;

    /**
    * @author Administrator
    *
    */
    public class TTest {
        @BeforeClass
        public static void BeforeClass() {
            System.out.println("BeforeClass");
        }
        @Before
        public void Before() {
            System.out.println("Before");
        }

        /**
         * Test method for {@link com.ailk.T#add(int, int)}.
         */
        @Test
        public void testAdd() {
            T t = new T();
            int z = t.add(3, 5);
            assertEquals(8, t.add(3, 5));
            assertThat(z, is(8));
            System.out.println("testAdd over!");
        }
        @Ignore
        public void testSub(){
        }
        @After
        public void After() {
            System.out.println("After");
        }
        @AfterClass
        public static void AfterClass() {
            System.out.println("AfterClass");
        }
    }

  • 相关阅读:
    CSS——精灵图与背景图片定位
    CSS——text-indent
    CSS——样式隐藏
    CSS——规避脱标流和vertical-align
    CSS——盒子居中显示
    CSS——img
    CSS——position
    CSS——样式初始化
    CSS——清除浮动
    CSS——float
  • 原文地址:https://www.cnblogs.com/holy/p/2047302.html
Copyright © 2011-2022 走看看