1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-01-09 12:48:00 -05:00

Run all scenario tests and cleanup after each test

This commit is contained in:
Sebastian Kaspari 2010-12-17 23:30:32 +01:00
parent 414bc658ba
commit 7764351a37
4 changed files with 29 additions and 4 deletions

View File

@ -32,8 +32,8 @@ public class AllTests {
public static Test suite() { public static Test suite() {
TestSuite suite = new TestSuite("Scenario-Tests"); TestSuite suite = new TestSuite("Scenario-Tests");
//$JUnit-BEGIN$ //$JUnit-BEGIN$
//suite.addTestSuite(ServerListScenarios.class); suite.addTestSuite(ServerListScenarios.class);
//suite.addTestSuite(ConnectionScenarios.class); suite.addTestSuite(ConnectionScenarios.class);
suite.addTestSuite(ChannelScenarios.class); suite.addTestSuite(ChannelScenarios.class);
//$JUnit-END$ //$JUnit-END$
return suite; return suite;

View File

@ -23,6 +23,7 @@ package org.yaaic.test.scenario;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
import com.jayway.android.robotium.solo.Solo; import com.jayway.android.robotium.solo.Solo;
@ -73,7 +74,11 @@ public class ChannelScenarios extends ActivityInstrumentationTestCase2
helper.disconnectFromServer(); helper.disconnectFromServer();
helper.deleteTestServer(); helper.deleteTestServer();
solo.sleep(500); try {
solo.finalize();
} catch (Throwable t) {
Log.d("Yaaic/ChannelScenarios", t.getMessage());
}
} }
/** /**

View File

@ -23,6 +23,7 @@ package org.yaaic.test.scenario;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
import com.jayway.android.robotium.solo.Solo; import com.jayway.android.robotium.solo.Solo;
@ -73,7 +74,11 @@ public class ConnectionScenarios extends ActivityInstrumentationTestCase2
helper.disconnectFromServer(); helper.disconnectFromServer();
helper.deleteTestServer(); helper.deleteTestServer();
solo.sleep(500); try {
solo.finalize();
} catch (Throwable t) {
Log.d("Yaaic/ChannelScenarios", t.getMessage());
}
} }
/** /**

View File

@ -24,6 +24,7 @@ package org.yaaic.test.scenario;
import com.jayway.android.robotium.solo.Solo; import com.jayway.android.robotium.solo.Solo;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
/** /**
* Scenario Tests for the ServersActivity * Scenario Tests for the ServersActivity
@ -53,12 +54,26 @@ public class ServerListScenarios extends ActivityInstrumentationTestCase2
/** /**
* Setup test case * Setup test case
*/ */
@Override
protected void setUp() protected void setUp()
{ {
solo = new Solo(getInstrumentation(), getActivity()); solo = new Solo(getInstrumentation(), getActivity());
helper = new ScenarioHelper(solo); helper = new ScenarioHelper(solo);
} }
/**
* Cleanup after run
*/
@Override
protected void tearDown()
{
try {
solo.finalize();
} catch (Throwable t) {
Log.d("Yaaic/ChannelScenarios", t.getMessage());
}
}
/** /**
* Test-Scenario: * Test-Scenario:
* *