summaryrefslogtreecommitdiffstats
path: root/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java')
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java105
1 files changed, 0 insertions, 105 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java
deleted file mode 100644
index d46197df2e..0000000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.eclipse.swt.tests.junit;
- /*
- * (c) Copyright IBM Corp. 2000, 2002. All rights reserved.
- * This file is made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import java.lang.reflect.*;
-import junit.framework.*;
- public class SwtTestCase extends TestCase {
- /**
- * The following flags are used to mark test cases that
- * are not handled correctly by SWT at this time, or test
- * cases that maybe themselves dubious (eg. when the correct
- * behaviour may not be clear). Most of these flagged test
- * cases involve handling error conditions.
- *
- * Setting these flags to true will run those tests. As api
- * is implemented this gives us a convenient way to include
- * it in the junit tests.
- */
-
- // call should result in an 'Argument cannot be null' SWT error
- public static boolean fCheckSwtNullExceptions = false;
-
- // an out of range value is not handled gracefully according to our SWT policy
- public static boolean fCheckOutOfRangeBehaviour = false;
-
- // run test cases that may themselves be dubious
- // these should be eventually checked to see if
- // there is a valid failure or the test is bogus
- public static boolean fCheckBogusTestCases = false;
-
- // check multi select tree api
- public static boolean fCheckMultiSelectTree = false;
-
- // check visibility api (eg in menu)
- public static boolean fCheckVisibility = false;
-
- // run test cases that check SWT policy not covered by the flags above
- public static boolean fCheckSWTPolicy = false;
-
- // make dialog open calls, operator must then close them
- public static boolean fTestDialogOpen = false;
-
-public SwtTestCase(String name) {
- super(name);
-}
-
-static public void assertEquals(String message, Object expected[], Object actual[]) {
- if (expected == null && actual == null)
- return;
- boolean equal = false;
- if (expected != null && actual != null && expected.length == actual.length) {
- if (expected.length == 0)
- return;
- equal = true;
- for (int i = 0; i < expected.length; i++) {
- if (!expected[i].equals(actual[i])) {
- equal = false;
- }
- }
- }
- if (!equal) {
- failNotEquals(message, expected, actual);
- }
-}
-static public void assertEquals(Object expected[], Object actual[]) {
- assertEquals(null, expected, actual);
-}
-static public void assertEquals(String message, int expected[], int actual[]) {
- if (expected == null && actual == null)
- return;
- boolean equal = false;
- if (expected != null && actual != null && expected.length == actual.length) {
- if (expected.length == 0)
- return;
- equal = true;
- for (int i = 0; i < expected.length; i++) {
- if (expected[i] != actual[i]) {
- equal = false;
- }
- }
- }
- if (!equal) {
- failNotEquals(message, expected, actual);
- }
-}
-static public void assertEquals(int expected[], int actual[]) {
- assertEquals(null, expected, actual);
-}
-// copied exactly from junit.framework.TestCase so that it can be called from here even though private
-static private void failNotEquals(String message, Object expected, Object actual) {
- String formatted= "";
- if (message != null)
- formatted= message+" ";
- fail(formatted+"expected:<"+expected+"> but was:<"+actual+">");
-}
-
-protected void warnUnimpl(String message) {
- //System.out.println(this.getClass() + ": " + message);
- AllTests.unimplementedMethods++;
-}
-}