android junit

package com.wjj.junit;

import java.util.List;

import android.test.AndroidTestCase;
import android.util.Log;

public class PersonServiceTest extends AndroidTestCase{

public void test() throws Throwable{
MySQLLift db = new MySQLLift(this.getContext());
PersonService personService = new PersonService(db);
//personService.save();
List<Person> list = personService.findAll();
System.out.println("list.size()-----> " + list.size());
for(Person p : list){
System.out.println("p.getId()------> " + p.getId());
System.out.println("p.getName()-------> " + p.getName());
}
System.out.println("=========DBTest=========");
System.out.println("=========DBTest=========");
//personService.del(2);
}

public void testResultCde() throws Throwable{
PersonService personService = new PersonService();
XMLReader reader = new XMLReader();
List list = reader.getPersons(this.getClass().getClassLoader().getResourceAsStream("itcast.xml"));
System.out.println("===============XMLReaderTest============= >>>> " + list.size());
System.out.println("========XMLReaderTest=============personService");
assertEquals(10, personService.testRcde());
}

public void testResultCde1() throws Throwable{
PersonService personService = new PersonService();
assertEquals(20, personService.testRcde());
}

public void SAXPReaderTest()throws Throwable{
MySQLLift db = new MySQLLift(this.getContext());
PersonService personService = new PersonService(db);
personService.save();
Log.i("XMLReaderTest", "XMLReaderTest" );
Log.d("XMLReaderTest", "XMLReaderTest");
System.out.println("=====XMLReaderTest=====");
assertEquals(3, 1);
}

public void DBTest()throws Throwable{
MySQLLift db = new MySQLLift(this.getContext());
PersonService personService = new PersonService(db);
Person person = new Person();
person.setId(4);
person.setName("hellwoorld");
personService.update(person);
List<Person> list = personService.findAll();
for(Person p : list){
System.out.println("DBTestUpdated---> " + p.getId());
System.out.println("DBTestUpdated----> " + p.getName());
}
}

public void TestGetScorllData()throws Throwable{
MySQLLift db = new MySQLLift(this.getContext());
System.out.println("TestGetScorllData-------->");
PersonService personService = new PersonService(db);
Person person = personService.findPerson(6);
System.out.println("TestGetScorllData-----> " + person.getId());
System.out.println("TestGetScorllData-----> -- " + person.getName());
}
}


这是我写的TEST 方法类。 里面一共有6个测试方法, 但是当我右键->android junit test的时候, 他只跑前3个方法, 是怎么回事儿? 有人遇到过吗?
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值