summaryrefslogtreecommitdiff
path: root/libjava/classpath/gnu/test
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/gnu/test')
-rw-r--r--libjava/classpath/gnu/test/.cvsignore1
-rw-r--r--libjava/classpath/gnu/test/Fail.java57
-rw-r--r--libjava/classpath/gnu/test/Makefile.am5
-rw-r--r--libjava/classpath/gnu/test/Pass.java57
-rw-r--r--libjava/classpath/gnu/test/Result.java85
-rw-r--r--libjava/classpath/gnu/test/Test.java57
-rw-r--r--libjava/classpath/gnu/test/Unresolved.java57
-rw-r--r--libjava/classpath/gnu/test/Unsupported.java59
-rw-r--r--libjava/classpath/gnu/test/Untested.java57
-rw-r--r--libjava/classpath/gnu/test/XFail.java57
-rw-r--r--libjava/classpath/gnu/test/XPass.java56
11 files changed, 548 insertions, 0 deletions
diff --git a/libjava/classpath/gnu/test/.cvsignore b/libjava/classpath/gnu/test/.cvsignore
new file mode 100644
index 000000000..70845e08e
--- /dev/null
+++ b/libjava/classpath/gnu/test/.cvsignore
@@ -0,0 +1 @@
+Makefile.in
diff --git a/libjava/classpath/gnu/test/Fail.java b/libjava/classpath/gnu/test/Fail.java
new file mode 100644
index 000000000..b3a032077
--- /dev/null
+++ b/libjava/classpath/gnu/test/Fail.java
@@ -0,0 +1,57 @@
+/* Fail.java -- Result code returned when test failed but was expected to
+ Copyright (c) 1998 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.test;
+
+/**
+ * Test failed but was expected to pass.
+ */
+public class Fail extends Result
+{
+ /**
+ * Constructs a Fail result code with additional information.
+ */
+ public Fail(String msg) {
+ super("FAIL", msg);
+ }
+ /**
+ * Constructs a Fail result code.
+ */
+ public Fail() {
+ this("");
+ }
+}
diff --git a/libjava/classpath/gnu/test/Makefile.am b/libjava/classpath/gnu/test/Makefile.am
new file mode 100644
index 000000000..49bc66916
--- /dev/null
+++ b/libjava/classpath/gnu/test/Makefile.am
@@ -0,0 +1,5 @@
+## Input file for automake to generate the Makefile.in used by configure
+
+##gnutestdir = $(datadir)/gnu/test/
+
+##gnutest_JAVA = Fail.java Test.java Untested.java Pass.java Unresolved.java XFail.java Result.java Unsupported.java XPass.java
diff --git a/libjava/classpath/gnu/test/Pass.java b/libjava/classpath/gnu/test/Pass.java
new file mode 100644
index 000000000..fbbd3b29f
--- /dev/null
+++ b/libjava/classpath/gnu/test/Pass.java
@@ -0,0 +1,57 @@
+/* Pass.java -- Result code returned when test passed and was excepted to
+ Copyright (c) 1998 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.test;
+
+/**
+ * Test passed and was excepted to pass.
+ */
+public class Pass extends Result
+{
+ /**
+ * Constructs a Pass result code with additional information.
+ */
+ public Pass(String msg) {
+ super("PASS", msg);
+ }
+ /**
+ * Constructs a Pass result code.
+ */
+ public Pass() {
+ this("");
+ }
+}
diff --git a/libjava/classpath/gnu/test/Result.java b/libjava/classpath/gnu/test/Result.java
new file mode 100644
index 000000000..908d4b485
--- /dev/null
+++ b/libjava/classpath/gnu/test/Result.java
@@ -0,0 +1,85 @@
+/* Result.java -- Abstract base class for all Result types.
+ Copyright (c) 1998 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.test;
+
+/**
+ * Class which all usable Result objects extend.
+ */
+public abstract class Result
+{
+ String name, msg;
+
+ /**
+ * Create a result of a given type, with a given message.
+ *
+ * @param name name of type
+ * @param msg message
+ */
+ public Result(String name, String msg) {
+ this.name = name;
+ this.msg = msg;
+ }
+
+ /**
+ * Create a result of a given type.
+ *
+ * @param name name of type
+ */
+ public Result(String name) {
+ this(name, "");
+ }
+
+ /**
+ * Returns the name of the type.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Returns the message associated with this instance of Result, or
+ * the empty string if no message exists.
+ */
+ public String getMsg() {
+ return (msg != null) ? msg : "";
+ }
+
+ public String toString() {
+ return getName() + ":" + getMsg();
+ }
+}
diff --git a/libjava/classpath/gnu/test/Test.java b/libjava/classpath/gnu/test/Test.java
new file mode 100644
index 000000000..f60c6dffc
--- /dev/null
+++ b/libjava/classpath/gnu/test/Test.java
@@ -0,0 +1,57 @@
+/* Test.java -- Interface representing a single test.
+ Copyright (c) 1998 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.test;
+
+/**
+ * Interface which all GNU Classpath tests must implement.
+ * The method <code>test</code> is invoked once for each test.
+ */
+public interface Test
+{
+ /**
+ * Returns the name of the test.
+ */
+ public String getName();
+
+ /**
+ * Performs a test.
+ *
+ * @return result from running the test
+ */
+ public Result test();
+}
diff --git a/libjava/classpath/gnu/test/Unresolved.java b/libjava/classpath/gnu/test/Unresolved.java
new file mode 100644
index 000000000..280d8b699
--- /dev/null
+++ b/libjava/classpath/gnu/test/Unresolved.java
@@ -0,0 +1,57 @@
+/* Unresolved.java - Result code returned when test gives indeterminate results.
+ Copyright (c) 1998 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.test;
+
+/**
+ * Test produced indeterminate results.
+ */
+public class Unresolved extends Result
+{
+ /**
+ * Constructs an Unresolved result code with additional information.
+ */
+ public Unresolved(String msg) {
+ super("UNRESOLVED", msg);
+ }
+ /**
+ * Constructs an Unresolved result code.
+ */
+ public Unresolved() {
+ this("");
+ }
+}
diff --git a/libjava/classpath/gnu/test/Unsupported.java b/libjava/classpath/gnu/test/Unsupported.java
new file mode 100644
index 000000000..a1ad03290
--- /dev/null
+++ b/libjava/classpath/gnu/test/Unsupported.java
@@ -0,0 +1,59 @@
+/* Unsupported.java -- Result code returned when test does not have the
+ Copyright (c) 1998 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.test;
+
+/**
+ * Test does not have the required support to run. For example,
+ * Unsupported could be returned when a needed resource
+ * (ie. multicasting) is not available.
+ */
+public class Unsupported extends Result
+{
+ /**
+ * Constructs an Unsupported result code with additional information.
+ */
+ public Unsupported(String msg) {
+ super("UNSUPPORTED", msg);
+ }
+ /**
+ * Constructs an Unsupported result code.
+ */
+ public Unsupported() {
+ this("");
+ }
+}
diff --git a/libjava/classpath/gnu/test/Untested.java b/libjava/classpath/gnu/test/Untested.java
new file mode 100644
index 000000000..5627fa8ca
--- /dev/null
+++ b/libjava/classpath/gnu/test/Untested.java
@@ -0,0 +1,57 @@
+/* Untested.java -- Result code returned when test was not run -- placeholder.
+ Copyright (c) 1998 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.test;
+
+/**
+ * Test was not run -- a placeholder.
+ */
+public class Untested extends Result
+{
+ /**
+ * Constructs an Untested result code with additional information.
+ */
+ public Untested(String msg) {
+ super("UNTESTED", msg);
+ }
+ /**
+ * Constructs an Untested result code.
+ */
+ public Untested() {
+ this("");
+ }
+}
diff --git a/libjava/classpath/gnu/test/XFail.java b/libjava/classpath/gnu/test/XFail.java
new file mode 100644
index 000000000..793ff117f
--- /dev/null
+++ b/libjava/classpath/gnu/test/XFail.java
@@ -0,0 +1,57 @@
+/* XFail.java - Result code returned when test failed and was expected to fail.
+ Copyright (c) 1998 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.test;
+
+/**
+ * Test failed and was expected to fail.
+ */
+public class XFail extends Result
+{
+ /**
+ * Constructs an XFail result code with additional information.
+ */
+ public XFail(String msg) {
+ super("XFAIL", msg);
+ }
+ /**
+ * Constructs an XFail result code.
+ */
+ public XFail() {
+ this("");
+ }
+}
diff --git a/libjava/classpath/gnu/test/XPass.java b/libjava/classpath/gnu/test/XPass.java
new file mode 100644
index 000000000..b41dd1c37
--- /dev/null
+++ b/libjava/classpath/gnu/test/XPass.java
@@ -0,0 +1,56 @@
+/* XPass.java - Result code returned when test passed but was expected to fail.
+ Copyright (c) 1998 Free Software Foundation, Inc.
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.test;
+
+/**
+ * Test passed but was expected to fail.
+ */
+public class XPass extends Result
+{
+ /**
+ * Constructs an XPass result code with additional information.
+ */
+ public XPass(String msg) {
+ super("XPASS", msg);
+ }
+ /**
+ * Constructs an XPass result code.
+ */
+ public XPass() {
+ this("");
+ }
+}