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

Test4J与Jtester单元测试常用注解比较的更多相关文章
- java基础第十八篇之单元测试、注解和动态代理
1:单元测试 1)JUnit是一个Java语言的单元测试框架,这里的单元指的就是方法 2)单元测试用来替换以前的main方法 1.1 Junit测试的步骤 1:在方法的上面加上 @Test 2:将ju ...
- 23_2spring的常用注解
1.基于注解的IOC配置 1.1导入jar包 <?xml version="1.0" encoding="UTF-8"?> <project ...
- SpringMVC入门和常用注解
SpringMVC的基本概念 关于 三层架构和 和 MVC 三层架构 我们的开发架构一般都是基于两种形式,一种是 C/S 架构,也就是客户端/服务器,另一种是 B/S 架构,也就 是浏览器服务器.在 ...
- Spring系列之Spring常用注解总结
传统的Spring做法是使用.xml文件来对bean进行注入或者是配置aop.事物,这么做有两个缺点:1.如果所有的内容都配置在.xml文件中,那么.xml文件将会十分庞大:如果按需求分开.xml文件 ...
- SpringMVC常用注解實例詳解3:@ResponseBody
我的開發環境框架: springmvc+spring+freemarker開發工具: springsource-tool-suite-2.9.0JDK版本: 1.6.0_29tomcat ...
- SpringMVC常用注解實例詳解2:@ModelAttribute
我的開發環境框架: springmvc+spring+freemarker開發工具: springsource-tool-suite-2.9.0JDK版本: 1.6.0_29tomcat ...
- Spring常用注解汇总
本文汇总了Spring的常用注解,以方便大家查询和使用,具体如下: 使用注解之前要开启自动扫描功能 其中base-package为需要扫描的包(含子包). <context:component- ...
- Spring常用注解,自动扫描装配Bean
1 引入context命名空间(在Spring的配置文件中),配置文件如下: xmlns:context="http://www.springframework.org/schema/con ...
- springmvc常用注解与类型转换
springmvc常用注解与类型转换 一:前置 spring -servlet.xml 注入 <!-- 启用spring mvc 注解 --> <context:annotation ...
随机推荐
- PHP date函数参数详解
PHP date函数参数详解 作者: 字体:[增加 减小] 类型:转载 time()在PHP中是得到一个数字,这个数字表示从1970-01-01到现在共走了多少秒,很奇怪吧 不过这样方便计 ...
- lvs简单配置
负载均衡服务器将会用到两块网卡,eth0为公网地址(此处将局域网ip作为公网地址),IP地址为192.168.1.104,eth0:1,IP地址为192.168.2.1在负载均衡器上添加一个ip别名, ...
- Linux环境PHP7.0安装
原文地址:http://blog.csdn.net/21aspnet/article/details/47708763 PHP7和HHVM比较 PHP7的在真实场景的性能确实已经和HHVM相当, 在一 ...
- Syntactic_sugar
https://en.wikipedia.org/wiki/Syntactic_sugar http://stackoverflow.com/questions/11366006/mysql-on-v ...
- single-chip microcomputer Microcontroller 单片机 单片微型计算机 微控制器
https://zh.wikipedia.org/wiki/单片机 单片机,全称单片微型计算机(英语:single-chip microcomputer),又称微控制器(microcontroller ...
- P1149 火柴棒等式
#include <bits/stdc++.h> using namespace std; const int num[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6} ...
- java实现的https请求
转载并修改自 http://www.blogjava.net/etlan/archive/2006/06/29/55767.html Https请求 超文本传输协议HTTP协议:被用于在Web浏览器和 ...
- Nginx 常用全局变量 及Rewrite规则详解
每次都很容易忘记Nginx的变量,下面列出来了一些常用 $remote_addr //获取客户端ip $binary_remote_addr //客户端ip(二进制) $remote_port //客 ...
- CRUD操作 create创建 read读取 update修改 delete删除
1.注释语法:--,#2.后缀是.sql的文件是数据库查询文件3.保存查询4.在数据库里面 列有个名字叫字段 行有个名字叫记录 CRUD操作:create 创建(添加)read 读取update 修改 ...
- IOS常见的三种回调方法介绍
认识下三种IOS常见的回调模式. 代理模式作为IOS中最常见的通讯模式,代理几乎无处不在. 这里有一个数组,我们首先通过代理的方式将数组传递到其他方法中去. 设置协议及方法 @protocol Cal ...