mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 23:25:26 +02:00
bug 149080 initial population of test framework examples
This commit is contained in:
parent
7d8d9716b7
commit
cbbcb043b1
20 changed files with 470 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
rse/tests/org.eclipse.rse.tests.framework.examples/.project
Normal file
28
rse/tests/org.eclipse.rse.tests.framework.examples/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.eclipse.rse.tests.framework.examples</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
10
rse/tests/org.eclipse.rse.tests.framework.examples/META-INF/MANIFEST.MF
Executable file
10
rse/tests/org.eclipse.rse.tests.framework.examples/META-INF/MANIFEST.MF
Executable file
|
@ -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
|
6
rse/tests/org.eclipse.rse.tests.framework.examples/build.properties
Executable file
6
rse/tests/org.eclipse.rse.tests.framework.examples/build.properties
Executable file
|
@ -0,0 +1,6 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = .,\
|
||||
plugin.xml,\
|
||||
META-INF/,\
|
||||
scripts/
|
44
rse/tests/org.eclipse.rse.tests.framework.examples/plugin.xml
Executable file
44
rse/tests/org.eclipse.rse.tests.framework.examples/plugin.xml
Executable file
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.0"?>
|
||||
<plugin>
|
||||
|
||||
<extension point="org.eclipse.rse.tests.framework.suites">
|
||||
<suite type="standard" name="Failure Suite">
|
||||
<arg name="class" value="org.eclipse.rse.tests.framework.examples.FailureSuite"/>
|
||||
</suite>
|
||||
<suite type="standard" name="Success Suite">
|
||||
<arg name="class" value="org.eclipse.rse.tests.framework.examples.SuccessSuite"/>
|
||||
</suite>
|
||||
<suite type="standard" name="Error Suite">
|
||||
<arg name="class" value="org.eclipse.rse.tests.framework.examples.ErrorSuite"/>
|
||||
</suite>
|
||||
<suite type="standard" name="Mixed Suite">
|
||||
<arg name="class" value="org.eclipse.rse.tests.framework.examples.MixedSuite"/>
|
||||
</suite>
|
||||
<suite type="generated" name="Mixed Suite (all)">
|
||||
<arg name="class" value="org.eclipse.rse.tests.framework.examples.MixedSuiteProvider"/>
|
||||
</suite>
|
||||
<suite type="generated" name="Mixed Suite (success)">
|
||||
<arg name="class" value="org.eclipse.rse.tests.framework.examples.MixedSuiteProvider"/>
|
||||
<arg name="argument" value="success"/>
|
||||
</suite>
|
||||
<suite type="generated" name="Mixed Suite (failure)">
|
||||
<arg name="class" value="org.eclipse.rse.tests.framework.examples.MixedSuiteProvider"/>
|
||||
<arg name="argument" value="failure"/>
|
||||
</suite>
|
||||
<suite type="generated" name="Mixed Suite (error)">
|
||||
<arg name="class" value="org.eclipse.rse.tests.framework.examples.MixedSuiteProvider"/>
|
||||
<arg name="argument" value="error"/>
|
||||
</suite>
|
||||
<suite type="standard" name="Annotating Suite">
|
||||
<arg name="class" value="org.eclipse.rse.tests.framework.examples.AnnotatingSuite"/>
|
||||
</suite>
|
||||
<!--
|
||||
<suite type="scripted" name="Test Script">
|
||||
<arg name="folder" value="scripts/test01"/>
|
||||
<arg name="script" value = "script7.txt"/>
|
||||
</suite>
|
||||
-->
|
||||
</extension>
|
||||
|
||||
</plugin>
|
BIN
rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/001.jpg
Executable file
BIN
rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/001.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
BIN
rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/002.jpg
Executable file
BIN
rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/002.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
BIN
rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/003.jpg
Executable file
BIN
rse/tests/org.eclipse.rse.tests.framework.examples/scripts/test01/003.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
|
@ -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
|
||||
|
|
@ -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) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue