diff --git a/tests/util/fr.tpt.ttool.tests.util/launch/TToolUtilTestsRunner.launch b/tests/util/fr.tpt.ttool.tests.util/launch/TToolUtilTestsRunner.launch new file mode 100644 index 0000000000000000000000000000000000000000..479b2cb67a2ffcc0e947344178630510c627fb13 --- /dev/null +++ b/tests/util/fr.tpt.ttool.tests.util/launch/TToolUtilTestsRunner.launch @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/fr.tpt.ttool.tests.util/src/fr/tpt/ttool/tests/util/TToolUtilTestsRunner.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="fr.tpt.ttool.tests.util.TToolUtilTestsRunner"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="fr.tpt.ttool.tests.util"/> +</launchConfiguration> diff --git a/tests/util/fr.tpt.ttool.tests.util/src/fr/tpt/ttool/tests/util/TToolUtilTestsRunner.java b/tests/util/fr.tpt.ttool.tests.util/src/fr/tpt/ttool/tests/util/TToolUtilTestsRunner.java new file mode 100644 index 0000000000000000000000000000000000000000..5df8a014a1f7b54187b14bba6bca36c8768795a1 --- /dev/null +++ b/tests/util/fr.tpt.ttool.tests.util/src/fr/tpt/ttool/tests/util/TToolUtilTestsRunner.java @@ -0,0 +1,27 @@ +package fr.tpt.ttool.tests.util; + +import org.junit.runner.JUnitCore; +import org.junit.runner.Result; +import org.junit.runner.notification.Failure; + +import fr.tpt.ttool.tests.util.remote.TestRshClient; + +public class TToolUtilTestsRunner { + + public static void main(String[] args) { + Result result = JUnitCore.runClasses( TestRshClient.class ); + + for ( final Failure failure : result.getFailures() ) { + System.err.println( "Test failed : " + failure.toString() ); + } + + if ( result.wasSuccessful() ) { + System.out.println( "All tests passed." ); + } + else { + System.err.println( "Some of the tests failed!" ); + } + + System.exit( 0 ); + } +} diff --git a/tests/util/fr.tpt.ttool.tests.util/src/fr/tpt/ttool/tests/util/remote/TestRshClient.java b/tests/util/fr.tpt.ttool.tests.util/src/fr/tpt/ttool/tests/util/remote/TestRshClient.java index 77eade0ebe36778aeae0f2076191dbd07c07618f..c75c854a94454113d064df154df83c46a4ab603e 100644 --- a/tests/util/fr.tpt.ttool.tests.util/src/fr/tpt/ttool/tests/util/remote/TestRshClient.java +++ b/tests/util/fr.tpt.ttool.tests.util/src/fr/tpt/ttool/tests/util/remote/TestRshClient.java @@ -8,6 +8,7 @@ import java.io.File; import java.io.StringWriter; import java.io.Writer; +import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -57,6 +58,12 @@ public class TestRshClient { client = new RshClient( "localhost" ); } + @After + public void tearDown() + throws Exception { + client = null; + } + @AfterClass public static void tearDownAfterClass() throws Exception {