package com.alibaba.ceres.catalog.biz.product.impl;

import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.testng.annotations.AfterClass;

public class Test4JTest {
    
    
    @BeforeClass
    public static void beforeClass(){
        System.out.println("beforeClass");    
    }
    
    @AfterClass
    public static void afterClass(){
        System.out.println("afterClass");        
    }
    
    @Before
    public void before(){
        System.out.println("before");    
    }
    
    @After
    public void after(){
        System.out.println("after");    
    }
    
    
    @Test
    public void test1(){
        System.out.println("test1");
    }
    
    @Test
    public void test2(){
        System.out.println("test2");
    }
    
    
    

}

 



 

Test4J与Jtester单元测试常用注解比较


package com.alibaba.ceres.catalog.biz.product.impl;

import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class JtesterTest {
    
    @BeforeMethod
    public void beforeMethod(){
        System.out.println("beforeMethod");    
    }

    @AfterMethod
    public void afterMethod(){
        System.out.println("afterMethod");    
    }
    
    @BeforeClass
    public void beforeClassTest(){
        
        System.out.println("beforeClassTest");
    }
    
    @AfterClass
    public void afterClassTest(){
        
        System.out.println("AfterClass");
    }
    
    @BeforeTest
    public void beforeTest(){
        
        System.out.println("beforeTest");
    }
    
    @Test
    public void test1(){
        System.out.println("test1");
    }
    
    @Test
    public void test2(){
        System.out.println("test2");
    }
    
    @AfterTest
    public void afterTest(){
        System.out.println("afterTest");
    }
    
    

}

Test4J与Jtester单元测试常用注解比较

 

相关文章:

  • 2021-11-18
  • 2022-02-20
  • 2021-07-27
  • 2022-02-19
  • 2021-09-15
  • 2022-12-23
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2021-09-26
  • 2021-07-24
相关资源
相似解决方案