diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/.classpath b/rse/tests/org.eclipse.rse.tests.framework.examples/.classpath new file mode 100644 index 00000000000..751c8f2e504 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/.project b/rse/tests/org.eclipse.rse.tests.framework.examples/.project new file mode 100644 index 00000000000..7728e1f9370 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/.project @@ -0,0 +1,28 @@ + + + org.eclipse.rse.tests.framework.examples + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/META-INF/MANIFEST.MF b/rse/tests/org.eclipse.rse.tests.framework.examples/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..78f276e3984 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/META-INF/MANIFEST.MF @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: RSE Test Framework Example +Bundle-SymbolicName: org.eclipse.rse.examples.testframework;singleton:=true +Bundle-Version: 1.0.0 +Bundle-Vendor: Eclipse.org +Bundle-Localization: plugin +Require-Bundle: org.junit, + org.eclipse.rse.tests.framework +Eclipse-LazyStart: true diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/build.properties b/rse/tests/org.eclipse.rse.tests.framework.examples/build.properties new file mode 100755 index 00000000000..eb4b5d31354 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = .,\ + plugin.xml,\ + META-INF/,\ + scripts/ diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/plugin.xml b/rse/tests/org.eclipse.rse.tests.framework.examples/plugin.xml new file mode 100755 index 00000000000..9dc4684dc6e --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/plugin.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/001.jpg b/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/001.jpg new file mode 100755 index 00000000000..948ebf5c6f8 Binary files /dev/null and b/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/001.jpg differ diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/002.jpg b/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/002.jpg new file mode 100755 index 00000000000..f7137c07998 Binary files /dev/null and b/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/002.jpg differ diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/003.jpg b/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/003.jpg new file mode 100755 index 00000000000..f6f16ab4f7a Binary files /dev/null and b/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/003.jpg differ diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/script7.txt b/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/script7.txt new file mode 100755 index 00000000000..9f92e8d46b7 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/script7.txt @@ -0,0 +1,24 @@ +# test script +show 001.jpg #show the first screen +tell look at the highlighted areas and see if they are translated correctly +pause press continue if they are OK, otherwise fail the test +show 002.jpg # show the next screen +pause how does this look? # a comment +show 003.jpg #another one again +pause + + testing the ability to cope with continuations + + are we OK with this? + + + + + # some blank lines are above -- they should be ignored + pause how + + about + + this? +tell Comment check ... # this is a comment, not a continuation + +pause ... this line should not be combined with the last + +tell Comment check 2 + # this is a comment + ... you should see this right after the 2 + \ No newline at end of file diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/AbstractTest.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/AbstractTest.java new file mode 100755 index 00000000000..e24ae2b7771 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/AbstractTest.java @@ -0,0 +1,25 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +import org.eclipse.rse.tests.framework.AnnotatingTestCase; + +public class AbstractTest extends AnnotatingTestCase { + + protected void sleep(int n) { + try { + Thread.sleep(n); + } catch (InterruptedException e) { + } + } + +} + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/AnnotatingSuite.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/AnnotatingSuite.java new file mode 100755 index 00000000000..8eb74e1124f --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/AnnotatingSuite.java @@ -0,0 +1,23 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +import junit.framework.TestSuite; + +public class AnnotatingSuite extends TestSuite { + + public AnnotatingSuite() { + super(AnnotatingTests.class); + setName("annotation"); + } + +} + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/AnnotatingTests.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/AnnotatingTests.java new file mode 100755 index 00000000000..05344874c70 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/AnnotatingTests.java @@ -0,0 +1,46 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +public class AnnotatingTests extends AbstractTest { + + public void testSuccess01() { + remark("Remark 1 for 01"); + remark("Remark 2 for 01"); + sleep(500); + } + + public void testSuccess02() { + remark("Remark 1 for 02"); + remark("Remark 2 for 02"); + sleep(500); + } + + public void testSuccess03() { + remark("Remark 1 for 03"); + remark("Remark 2 for 03"); + sleep(500); + } + + public void testSuccess04() { + remark("Remark 1 for 04"); + remark("Remark 2 for 04"); + sleep(500); + } + + public void testSuccess05() { + remark("Remark 1 for 05"); + remark("Remark 2 for 05"); + sleep(500); + } + +} + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/ErrorSuite.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/ErrorSuite.java new file mode 100755 index 00000000000..a3a8fd75fe0 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/ErrorSuite.java @@ -0,0 +1,23 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +import junit.framework.TestSuite; + +public class ErrorSuite extends TestSuite { + + public ErrorSuite() { + super(ErrorTests.class); + setName("errors"); + } + +} + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/ErrorTests.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/ErrorTests.java new file mode 100755 index 00000000000..df1a07de810 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/ErrorTests.java @@ -0,0 +1,31 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +public class ErrorTests extends AbstractTest { + + public void testError01() { + sleep(1000); + throw new RuntimeException("generic runtime exception 01"); + } + + public void testError02() { + sleep(1000); + throw new RuntimeException("generic runtime exception 02"); + } + + public void testError03() { + sleep(1000); + throw new RuntimeException("generic runtime exception 03"); + } + +} + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/FailureSuite.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/FailureSuite.java new file mode 100755 index 00000000000..2cfc8dd20ab --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/FailureSuite.java @@ -0,0 +1,23 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +import junit.framework.TestSuite; + +public class FailureSuite extends TestSuite { + + public FailureSuite() { + super(FailureTests.class); + setName("failures"); + } + +} + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/FailureTests.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/FailureTests.java new file mode 100755 index 00000000000..faaa21694bf --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/FailureTests.java @@ -0,0 +1,31 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +public class FailureTests extends AbstractTest { + + public void testFailure01() { + sleep(50); + fail("generic failure 01"); + } + + public void testFailure02() { + sleep(50); + fail("generic failure 02"); + } + + public void testFailure03() { + sleep(50); + fail("generic failure 03"); + } + +} + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/MixedSuite.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/MixedSuite.java new file mode 100755 index 00000000000..a12d39dfb16 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/MixedSuite.java @@ -0,0 +1,41 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +import junit.framework.TestSuite; + +public class MixedSuite extends TestSuite { + + public MixedSuite() { + super(); + setName("mixed results"); + this.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess01")); + this.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess02")); + this.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess03")); + this.addTest(TestSuite.createTest(FailureTests.class, "testFailure01")); + this.addTest(TestSuite.createTest(FailureTests.class, "testFailure02")); + this.addTest(TestSuite.createTest(FailureTests.class, "testFailure03")); + this.addTest(TestSuite.createTest(ErrorTests.class, "testError01")); + this.addTest(TestSuite.createTest(ErrorTests.class, "testError02")); + this.addTest(TestSuite.createTest(ErrorTests.class, "testError03")); + this.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess01")); + this.addTest(TestSuite.createTest(FailureTests.class, "testFailure01")); + this.addTest(TestSuite.createTest(ErrorTests.class, "testError01")); + this.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess02")); + this.addTest(TestSuite.createTest(FailureTests.class, "testFailure02")); + this.addTest(TestSuite.createTest(ErrorTests.class, "testError02")); + this.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess03")); + this.addTest(TestSuite.createTest(FailureTests.class, "testFailure03")); + this.addTest(TestSuite.createTest(ErrorTests.class, "testError03")); + } + +} + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/MixedSuiteProvider.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/MixedSuiteProvider.java new file mode 100755 index 00000000000..bef42ca78f3 --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/MixedSuiteProvider.java @@ -0,0 +1,51 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +import junit.framework.TestSuite; + +import org.eclipse.rse.tests.framework.ITestSuiteProvider; + +public class MixedSuiteProvider implements ITestSuiteProvider { + + public TestSuite getSuite(String arg) { + TestSuite suite = new TestSuite("Mixed Suite, arg = " + arg); + if (arg == null || arg.equals("success")) { + suite.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess01")); + suite.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess02")); + suite.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess03")); + } + if (arg == null || arg.equals("failure")) { + suite.addTest(TestSuite.createTest(FailureTests.class, "testFailure01")); + suite.addTest(TestSuite.createTest(FailureTests.class, "testFailure02")); + suite.addTest(TestSuite.createTest(FailureTests.class, "testFailure03")); + } + if (arg == null || arg.equals("error")) { + suite.addTest(TestSuite.createTest(ErrorTests.class, "testError01")); + suite.addTest(TestSuite.createTest(ErrorTests.class, "testError02")); + suite.addTest(TestSuite.createTest(ErrorTests.class, "testError03")); + } + if (arg == null) { + suite.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess01")); + suite.addTest(TestSuite.createTest(FailureTests.class, "testFailure01")); + suite.addTest(TestSuite.createTest(ErrorTests.class, "testError01")); + suite.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess02")); + suite.addTest(TestSuite.createTest(FailureTests.class, "testFailure02")); + suite.addTest(TestSuite.createTest(ErrorTests.class, "testError02")); + suite.addTest(TestSuite.createTest(SuccessTests.class, "testSuccess03")); + suite.addTest(TestSuite.createTest(FailureTests.class, "testFailure03")); + suite.addTest(TestSuite.createTest(ErrorTests.class, "testError03")); + } + return suite; + } + +} + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/SuccessSuite.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/SuccessSuite.java new file mode 100755 index 00000000000..fc39a26923b --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/SuccessSuite.java @@ -0,0 +1,23 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +import junit.framework.TestSuite; + +public class SuccessSuite extends TestSuite { + + public SuccessSuite() { + super(SuccessTests.class); + setName("successes"); + } + +} + + diff --git a/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/SuccessTests.java b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/SuccessTests.java new file mode 100755 index 00000000000..55d9f34581e --- /dev/null +++ b/rse/tests/org.eclipse.rse.tests.framework.examples/src/org/eclipse/rse/tests/framework/examples/SuccessTests.java @@ -0,0 +1,34 @@ +/* ******************************************************************************* + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - initial contribution. + * *******************************************************************************/ +package org.eclipse.rse.tests.framework.examples; + +public class SuccessTests extends AbstractTest { + + public void testSuccess01() { + sleep(500); + } + + public void testSuccess02() { + sleep(500); + } + + public void testSuccess03() { + sleep(500); + } + + public void testSuccess04() { + sleep(500); + } + + public void testSuccess05() { + sleep(500); + } + +}