j2me unit test
来源:互联网 发布:超能勇士知乎 编辑:程序博客网 时间:2024/05/20 12:21
package com.common;
import j2meunit.framework.Test;
import j2meunit.framework.TestCase;
import j2meunit.framework.TestMethod;
import j2meunit.framework.TestSuite;
public class StringUtilTest extends TestCase {
public StringUtilTest() {
}
public StringUtilTest(String sTestName, TestMethod rTestMethod) {
super(sTestName, rTestMethod);
}
protected void setUp() throws Exception {
super.setUp();
}
protected void tearDown() throws Exception {
super.tearDown();
}
public Test suite() {
TestSuite aSuite = new TestSuite();
aSuite.addTest(new StringUtilTest("testTime2Int", new TestMethod() {
public void run(TestCase tc) {
((StringUtilTest) tc).testTime2Int();
}
}));
aSuite.addTest(new StringUtilTest("testSplit", new TestMethod() {
public void run(TestCase tc) {
((StringUtilTest) tc).testSplit();
}
}));
return aSuite;
}
public void testTime2Int() {
this.assertEquals(StringUtil.time2Int("15.18.19"), 161819);
}
public void testSplit() {
this.assertEquals(StringUtil.split("1234#asf", "#")[1], "asf");
}
}
package com.common;
import j2meunit.framework.TestCase;
public class TestAllPC extends TestCase {
public static void main(String[] args) {
String[] runnerArgs = new String[] { "com.common.StringUtilTest" };
j2meunit.textui.TestRunner.main(runnerArgs);
}
}
package com.common;
import j2meunit.midletui.TestRunner;
public class TestAll extends TestRunner {
protected void startApp() {
String[] runnerArgs = new String[] { "com.common.StringUtilTest" };
start(runnerArgs);
}
}
Properties->Java Build Path->Order and Export
Select checkbox of j2meunit.jar
- j2me unit test
- unit test
- Unit Test
- Unit test
- UNIT TEST
- Unit Test
- Unit Test
- Unit Test、 UI Test
- unit Test 筆記-write unit test
- [转]Unit Test 原则
- Unit Test研究报告
- vs2005 unit test 点滴
- Design to Unit Test
- Unit Test Frameworks
- Unit Test Key Points
- Unit Test研究报告
- Ruby 的 Test::Unit
- c++ unit test
- Eclipse快捷键指南
- 数学建模竞赛—基金投资组合优化及绩效评价问题
- 时间格式转换
- word技巧
- 用vmware gsx server安装win2003+sql2005集群
- j2me unit test
- 第一天----Java基础
- 解决新方案
- SSAS 无法用于处理操作的 ImpersonationMode
- 第二天----Java基础
- 第二天----Java基础---面向对象上
- 第三天----Java基础---面向对象上
- D3D学习笔记之一---创建D3D环境的窗口
- J2mePolish 打包帮助