junit annotation
来源:互联网 发布:iphone4s网络不可用 编辑:程序博客网 时间:2024/05/30 02:25
package junit.samples;
import java.lang.reflect.Method;
import org.junit.Test;
import org.junit.internal.requests.ClassRequest;
import org.junit.runner.Runner;
home.xywy.com/niupixuan/342921.html
home.xywy.com/niupixuan/342921.html
home.xywy.com/niupixuan/342923.html
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
/**
* Some simple tests.
*/
public class SimpleTestAnnotation {
zhan.renren.com/njztpf?gid=3602888498049753301
zhan.renren.com/njztpf?gid=3602888498049753353
zhan.renren.com/njztpf?gid=3602888498049753595
protected int fValue1;
protected int fValue2;
@Test
public void sayHello() {
System.out.println("hello");
//Thread.dumpStack();
//int zero= 0;
//int result= 8 / zero;
}
@Test
public void sayGoodbye() {
System.out.println("good bye");
//Thread.dumpStack();
//int zero= 0;
//int result= 8 / zero;
}
public static void doTest_02() throws Exception {
SimpleTestAnnotation st= new SimpleTestAnnotation();
Method[] ms= SimpleTestAnnotation.class.getDeclaredMethods();
for (int i= 0; i < ms.length; i++) {
System.out.println("m:" + ms[i]);
if (ms[i].isAnnotationPresent(Test.class)) {
System.out.println("isAnnotationPresent");
try {
ms[i].invoke(st);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
public static void doTest_03() throws Exception {
ClassRequest cr = new ClassRequest(SimpleTestAnnotation.class);
BlockJUnit4ClassRunner runner = (BlockJUnit4ClassRunner)cr.getRunner();
//System.out.println("runner:" + runner);
RunNotifier rn = new RunNotifier();
runner.run(rn);
}
public static void main(String[] args) throws Exception {
//doTest_02();
doTest_03();
}
}
- JUnit Annotation
- JUnit Annotation
- junit annotation
- junit annotation
- junit @annotation
- 03Junit Junit的annotation
- 14 Annotation Junit 异常
- JUnit basic annotation
- JUnit的annotation
- JUnit中的注解(Annotation)
- JUnit中标注Annotation介绍
- JUnit Annotation——JUnit单元测试中批注@详解
- Junit的annotation(注释、注解)
- JUnit 4 常用的几个annotation 介绍
- JUnit中使用Annotation获得实例
- JUnit 4中annotation的用法
- UIAutomator2.0详解(JUnit Annotation篇)
- JUnit 4 使用 Java 5 中的注解(annotation)
- Cocos2d-x3.0 文件处理
- 第八周作业
- Matlab 高斯分布绘图
- 多线程的 匿名实现方法
- Construct Binary Tree from Preorder and Inorder Traversal
- junit annotation
- UVa 10152 - ShellSort
- CXF学习03---WSDL详解
- 最近走人有点多啊。
- 编程精华资源大汇总
- Android Activity切换动画 左右滑进滑出
- 多进程、多线程、多核CPU——(I)
- 三.Python数据类型の(二)序列类型(元组)
- zoj 3471 状态压缩dp