< prev index next >

test/jdk/java/text/Collator/EnglishTest.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 23,15 ***
--- 23,20 ---
  
  /*
   * @test
   * @library /java/text/testlib
   * @summary test English Collation
+  * @run junit EnglishTest
   */
  
  import java.util.Locale;
  import java.text.Collator;
  
+ import org.junit.jupiter.api.Test;
+ 
+ import static org.junit.jupiter.api.Assertions.fail;
+ 
  /*
  (C) Copyright Taligent, Inc. 1996 - All Rights Reserved
  (C) Copyright IBM Corp. 1996 - All Rights Reserved
  
    The original version of this source code and documentation is copyrighted and

*** 40,15 ***
  technology is protected by multiple US and International patents. This notice and
  attribution to Taligent may not be removed.
    Taligent is a registered trademark of Taligent, Inc.
  */
  
! public class EnglishTest extends CollatorTest {
- 
-     public static void main(String[] args) throws Exception {
-         new EnglishTest().run(args);
-     }
  
      /*
       * Data for TestPrimary()
       */
      private static final String[] primarySourceData = {
--- 45,11 ---
  technology is protected by multiple US and International patents. This notice and
  attribution to Taligent may not be removed.
    Taligent is a registered trademark of Taligent, Inc.
  */
  
! public class EnglishTest {
  
      /*
       * Data for TestPrimary()
       */
      private static final String[] primarySourceData = {

*** 199,27 ***
          "\u00eb",
          "ea",
          "x"
      };
  
      public void TestPrimary() {
!         doTest(myCollation, Collator.PRIMARY,
                 primarySourceData, primaryTargetData, primaryResults);
      }
  
      public void TestSecondary() {
!         doTest(myCollation, Collator.SECONDARY,
                 secondarySourceData, secondaryTargetData, secondaryResults);
      }
  
      public void TestTertiary() {
!         doTest(myCollation, Collator.TERTIARY,
                 tertiarySourceData, tertiaryTargetData, tertiaryResults);
  
          for (int i = 0; i < testData.length-1; i++) {
              for (int j = i+1; j < testData.length; j++) {
!                 doTest(myCollation, testData[i], testData[j], -1);
              }
          }
      }
  
      private final Collator myCollation = Collator.getInstance(Locale.ENGLISH);
--- 200,30 ---
          "\u00eb",
          "ea",
          "x"
      };
  
+     @Test
      public void TestPrimary() {
!         TestUtils.doCollatorTest(myCollation, Collator.PRIMARY,
                 primarySourceData, primaryTargetData, primaryResults);
      }
  
+     @Test
      public void TestSecondary() {
!         TestUtils.doCollatorTest(myCollation, Collator.SECONDARY,
                 secondarySourceData, secondaryTargetData, secondaryResults);
      }
  
+     @Test
      public void TestTertiary() {
!         TestUtils.doCollatorTest(myCollation, Collator.TERTIARY,
                 tertiarySourceData, tertiaryTargetData, tertiaryResults);
  
          for (int i = 0; i < testData.length-1; i++) {
              for (int j = i+1; j < testData.length; j++) {
!                 TestUtils.doCollatorTest(myCollation, testData[i], testData[j], -1);
              }
          }
      }
  
      private final Collator myCollation = Collator.getInstance(Locale.ENGLISH);
< prev index next >