tests/libjava-mauve/src/gnu/testlet/java/lang/String/CASE_INSENSITIVE_ORDER.java
branchjk_new_structure
changeset 1541 75c2e24dea9a
parent 1540 92ac284961c1
child 1542 be11db817bcf
--- a/tests/libjava-mauve/src/gnu/testlet/java/lang/String/CASE_INSENSITIVE_ORDER.java	Fri Jul 20 21:39:51 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/* Copyright (C) 2001, 2002 Eric Blake
- *
- * This file is part of Mauve.
- *
- * Mauve 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.
- *
- * Mauve 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 Mauve; see the file COPYING.  If not, write to
- * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-// Tags: JDK1.2
-
-package gnu.testlet.java.lang.String;
-import gnu.testlet.Testlet;
-import gnu.testlet.TestHarness;
-import java.util.Comparator;
-import java.util.Locale;
-import java.io.Serializable;
-
-/**
- * This class tests compliance of the CASE_INSENSITIVE_ORDER field
- * of String, added in JDK 1.2.
- *
- * @author Eric Blake <ebb9@email.byu.edu>
- */
-public class CASE_INSENSITIVE_ORDER implements Testlet
-{
-  public void test(TestHarness harness)
-  {
-    Comparator c = String.CASE_INSENSITIVE_ORDER;
-    harness.check(c instanceof Serializable);
-    harness.check(c.compare("abc", "abc"), 0);
-    harness.check(c.compare("ABC", "ABC"), 0);
-    harness.check(c.compare("aBc", "AbC"), 0);
-    harness.check(c.compare("", "a") < 0);
-    harness.check(c.compare("a", "") > 0);
-    harness.check(c.compare("a", "b") < 0);
-    harness.check(c.compare("a", "B") < 0);
-    harness.check(c.compare("A", "b") < 0);
-    harness.check(c.compare("A", "B") < 0);
-    harness.check(c.compare("b", "a") > 0);
-    harness.check(c.compare("b", "A") > 0);
-    harness.check(c.compare("B", "a") > 0);
-    harness.check(c.compare("B", "A") > 0);
-
-    harness.checkPoint("unicode mappings");
-    // the API (as corrected in 1.4.1) specifies using
-    // Character.toUpperCase(), and not String.toUpperCase(), so 1:m case
-    // mappings are not performed (such as sharp-s to SS).
-    harness.check(c.compare("\u00df", "sS") != 0);
-    // Likewise, comparisons are locale independent, which affects things
-    // like Turkish 'i' and 'I'.
-    Locale l = Locale.getDefault();
-    Locale.setDefault(new Locale("tr", ""));
-    harness.check(c.compare("\u0131I", "i\u0130"), 0);
-    Locale.setDefault(l);
-    harness.check(c.compare("\u0131I", "i\u0130"), 0);
-
-    harness.checkPoint("bad input");
-    try
-      {
-	c.compare(null, "");
-	harness.fail("expected NullPointerException");
-      }
-    catch (NullPointerException e)
-      {
-	harness.check(true);
-      }
-    try
-      {
-	c.compare("", null);
-	harness.fail("expected NullPointerException");
-      }
-    catch (NullPointerException e)
-      {
-	harness.check(true);
-      }
-    try
-      {
-	c.compare(this, "");
-	harness.fail("expected ClassCastException");
-      }
-    catch (ClassCastException e)
-      {
-	harness.check(true);
-      }
-    try
-      {
-	c.compare("", this);
-	harness.fail("expected ClassCastException");
-      }
-    catch (ClassCastException e)
-      {
-	harness.check(true);
-      }
-  }
-}