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个方法, 是怎么回事儿? 有人遇到过吗?

你可能感兴趣的:(android)