3

I have a set of apps, each with associated test case instrumentation. I'm launching the instrumentation programmatically from yet another "launcher" app (implemented as a service), using startInstrumentation() as in this example: https://stackoverflow.com/a/9815087/1536475

This works just fine for launching one test case.

What I would like is for the launcher to run test case 1, wait for the test to complete, then run test case 2. What's holding me back is that startInstrumentation() returns immediately and I don't know how to wait for test case 1 to complete before starting test case 2.

I'm hoping to find a solution more elegant than modifying the test case to somehow communicate its completion back to the launcher (e.g., test case broadcasts a message).

I'd just like the launcher to see that the test case has completed and know it's safe to proceed with the next one.

Thanks!

Community
  • 1
  • 1
koopa
  • 31
  • 2
  • A shout out a month later to see if anyone has any ideas. This one still has me stumped! – koopa Dec 14 '12 at 20:15
  • Bummer, I've found this site to be really helpful when other people are asking the questions. Even a critique of my question (you know, why nobody is even commenting) would be appreciated. – koopa Jan 29 '13 at 05:40
  • Looks like no one has any idea about the question, not even to criticize. :( – Krishnabhadra Jan 29 '13 at 05:51
  • 1
    I am not sure of the benefits of the approach of having an application that runs different instrumentations in a row. If you have multiple applications to test why run them bunched, surely they should be run when one of the apps changes, having to run the tests for every application when just one changes seems a goof way to slow feedback. If you really want to do what you say though, you can have your test check for running applications, and then only run when the process of the application under test stops running. – Paul Harris Feb 07 '13 at 07:36
  • Thanks for the feedback and the suggestion. The reason I ask the question is that I'm trying to use the JUnit test infrastructure to build a modular workload runner that can be used for benchmarking (e.g., battery life) of various workload combinations. I suppose looking for the running application would do the job, just not sure if there might be undesirable side effects of this approach that are not obvious. I'd rather observe the instrumentation itself as it seems cleaner, but this may be the best solution the framework provides. Thanks again! – koopa May 30 '13 at 18:14

0 Answers0