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 ...
随机推荐
- MySQL DATE_FORMAT() 函数
定义和用法 DATE_FORMAT() 函数用于以不同的格式显示日期/时间数据. 语法 DATE_FORMAT(date,format) date 参数是合法的日期.format 规定日期/时间的输出 ...
- sqrt函数实现
感谢杨工,让我更加认识到自己技术薄弱,这道题源自于和杨工的非正式面试,当时根本没思路,甚至没和查找有丝毫的联系,看来做自己想做的还是要付出努力的.sqrt()即开平方运算,y=x*x,已知Y的情况下求 ...
- Front-end Developer Interview Questions
Front-end-Developer-Interview-Questions A list of helpful front-end related questions you can use to ...
- php数据库两个关联大表的大数组分页处理,防止内存溢出
$ret = self::$db->select($tables, $fields, $where, $bind); if (!empty($ret)) { $retIds = array(); ...
- css层叠选择
首先声明一下CSS三大特性——继承.优先级和层叠.继承即子类元素继承父类的样式,比如font-size,font-weight等f开头的css样式以及text-align,text-indent等t开 ...
- 蓝牙版本V4.2特征讲解说明
2014年12月4日,最新的蓝牙4.2标准颁布,改善了数据传输速度和隐私保护程度,并接入了该设备将可直接通过IPv6和6LoWPAN接入互联网.在新的标准下蓝牙信号想要连接或者追踪用户设备必须经过用户 ...
- NRF51822之GPIOTE介绍
Note This library is obsolete and should not be used in new designs. Instead, you should use GPIOTE ...
- 《linux内核设计与实现》读书笔记第五章——系统调用
第5章 系统调用 操作系统提供接口主要是为了保证系统稳定可靠,避免应用程序恣意妄行. 5.1 与内核通信 系统调用在用户空间进程和硬件设备之间添加了一个中间层. 该层主要作用有三个: 为用户空间提供了 ...
- HBase的安装部署以及简单使用
一:下载安装 1.下载安装 2.开启hadoop与zookeeper 3.修改配置文件hbase-env export JAVA_HOME=/opt/modules/jdk1.7.0_67 expor ...
- Maven实战(一)安装与配置
1. 简介 Maven是基于项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的软件项目管理工具. 如果你已经有十次输入同样的Ant targets来编译你的代码.jar或者w ...