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


    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");
        }
        
        
        
    
    }






    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");
        }
        
        
    
    }

  • 相关阅读:
    python ascii codec can't decode
    python文件编码说明 coding=utf-8
    windbg的使用
    在后台运行Python脚本服务
    ubuntu下更改分辨率
    【转】VC调试的时候 “没有调试信息,未加载符号”
    常用正则表达式——中文匹配、拉丁匹配
    SQL的经典操作——批量复制同行的其它列数据到其它列数据
    关于C++对汉字拼音的处理(3)
    关于环境变量设置是否需要重启的问题
  • 原文地址:https://www.cnblogs.com/vinplezhang/p/5682499.html
Copyright © 2020-2023  润新知