1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-01-08 12:18:07 -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() {
TestSuite suite = new TestSuite("Scenario-Tests");
//$JUnit-BEGIN$
//suite.addTestSuite(ServerListScenarios.class);
//suite.addTestSuite(ConnectionScenarios.class);
suite.addTestSuite(ServerListScenarios.class);
suite.addTestSuite(ConnectionScenarios.class);
suite.addTestSuite(ChannelScenarios.class);
//$JUnit-END$
return suite;

View File

@ -23,6 +23,7 @@ package org.yaaic.test.scenario;
import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
import com.jayway.android.robotium.solo.Solo;
@ -73,7 +74,11 @@ public class ChannelScenarios extends ActivityInstrumentationTestCase2
helper.disconnectFromServer();
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.util.Log;
import com.jayway.android.robotium.solo.Solo;
@ -73,7 +74,11 @@ public class ConnectionScenarios extends ActivityInstrumentationTestCase2
helper.disconnectFromServer();
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 android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
/**
* Scenario Tests for the ServersActivity
@ -53,11 +54,25 @@ public class ServerListScenarios extends ActivityInstrumentationTestCase2
/**
* Setup test case
*/
@Override
protected void setUp()
{
solo = new Solo(getInstrumentation(), getActivity());
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: