Ant之junit测试
作者:lingmincc 日期:2008-05-16 13:46:38
<?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***************");
}
<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
发表评论
订阅
上一篇
|

文章来自:
标签: 




