Android JUNIT testing stuck -


i'm new @ junit tests, i'm trying test database access through code:

public class seutickettest extends activityinstrumentationtestcase2<seuticket> {      private seuticket mactivity;      public seutickettest(string name) {         super("br.com.code.seuticket.android.view",seuticket.class);     setname(name);     }      @override     protected void setup() throws exception {         super.setup();         mactivity = this.getactivity();     }       public void testticketinsertion() {         ticket ticket = new ticket("123453", "vip", new date(), "vila country");         persistenceticket persistence = new persistenceticket(mactivity);         persistence.addticket(ticket);                        assertequals(persistence.fetchticket(ticket.getticketcode()).getticketcode(),ticket.getticketcode());     }     public void testuserinsertion() {         user user = new user();         user.setpin("1234");         user.setphone("9241173");         persistenceuser persistence = new persistenceuser(mactivity);         persistence.adduser(user);         assertequals(persistence.fetchuser().getpin(), user.getpin());     }  } 

but tests stuck after complete testticketinsertion, second test keep running forever, , before run tests message shows @ console: test run failed: process crashed.

any ideas? hope find answer here. people!

i brand new junit testing in android , ran same problem. make sure have teardown method overridden , making call super.

protected void teardown() throws exception {     super.teardown(); } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -