订阅所有JSP/Servlet的日志 订阅 | 这是最新一篇日志 上一篇 | 下一篇日志 下一篇 ]
java

Ant之junit测试

<?xml version="1.0" encoding="UTF-8"?>
<project name="PaslaTest" default="sampleTest" basedir="./">
<patternset id="test.pattern">
<include name = "jp/co/ntt/ansl/picax/acc/acccommon/util/CommonInformationTest.java" />
</patternset>
<target name="sampleTest">
<mkdir dir="./result/junit/sampleTest" />
<junit printsummary="yes">
<classpath>
<pathelement path="./bin" />
</classpath>
<batchtest todir="./result/junit/sampleTest">
<fileset dir="./WEB-INF/src">
<patternset refid="test.pattern" />
</fileset>
</batchtest>
<formatter type="xml" />
</junit>
</target>
<target name="junitReport" depends="sampleTest">
<mkdir dir="./result/junit/sampleHtml" />
<junitreport>
<fileset dir="./result/junit/sampleTest">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="./result/junit/sampleHtml" />
</junitreport>
</target>
</project>

public void testIsNgnType() {
System.out.println("*********mothod testIsNgnType start**************");
boolean isNgnType = false;
inforT = inforT.getCommonInformation();
isNgnType = inforT.isNgnType(null);
assertEquals(false,isNgnType);

isNgnType = inforT.isNgnType("1");
assertEquals(false,isNgnType);

isNgnType = inforT.isNgnType("8001");

assertEquals(true,isNgnType);

System.out.println("**********mothod testIsNgnType end***************");
}

平均得分
(1 次评分)





文章来自: 本站原创
标签:
评论: 0 | 查看次数: 807
发表评论
昵 称:  登录
内 容:
选 项:
字数限制 1000 字 | UBB代码 开启 | [img]标签 开启