首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

Thinking in Java第四版《注解》这章的这个程序为什么没有运行结果。该如何处理

2012-01-15 
Thinking in Java第四版《注解》这章的这个程序为什么没有运行结果。package chapter20_annotationsimport n

Thinking in Java第四版《注解》这章的这个程序为什么没有运行结果。
package chapter20_annotations;

import net.mindview.atunit.*;
import net.mindview.util.*;
/**
 *@Name:
 *@Date:Jul 2, 2011 10:56:44 AM
 *@TODO:基于注解的单元测试
 */
public class AtUnitExample {
public String methodOne(){
return "Method1";
}

public int methodTwo(){
System.out.println( "Method2");
return 2;
}

@Test boolean methodOneTest(){
return methodOne().equals("Method1");
}

@Test boolean m2(){
return methodTwo()==2;
}

@Test private boolean m3(){
return true;
}

@Test boolean failureTest(){
return false;
}

@Test boolean anotherDisappointment(){
return false;
}

public static void main(String args[]){
OSExecute.command("java net.mindview.atunit.AtUnit AtUnitExample");
}


}


[解决办法]
mark
[解决办法]
mark too
[解决办法]
把@Test都去掉
OSExecute.command("java net.mindview.atunit.AtUnit AtUnitExample");
你是没有OSExecute这个类的
这是作者自己在
net.mindview.atunit.*;
net.mindview.util.*;
这两个包中实现的

所以你的程序根本无法运行
得不到结果
[解决办法]
缺少类啊,OSExecute

探讨
把@Test都去掉
OSExecute.command("java net.mindview.atunit.AtUnit AtUnitExample");
你是没有OSExecute这个类的
这是作者自己在
net.mindview.atunit.*;
net.mindview.util.*;
这两个包中实现的

所以你的程序根本无法运行
得不到结果

热点排行