< prev index next >

test/jdk/java/text/Collator/VietnameseTest.java

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2003, 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.

@@ -25,10 +25,11 @@
   * @test
   * @bug 4932968 5015215
   * @library /java/text/testlib
   * @summary test Vietnamese Collation
   * @modules jdk.localedata
+  * @run junit VietnameseTest
   */
  
  /*
   *******************************************************************************
   * (C) Copyright IBM Corp. 1996-2003 - All Rights Reserved                     *

@@ -42,16 +43,16 @@
   */
  
  import java.util.Locale;
  import java.text.Collator;
  
- // Quick dummy program for printing out test results
- public class VietnameseTest extends CollatorTest {
+ import org.junit.jupiter.api.Test;
  
-     public static void main(String[] args) throws Exception {
-         new VietnameseTest().run(args);
-     }
+ import static org.junit.jupiter.api.Assertions.fail;
+ 
+ // Quick dummy program for printing out test results
+ public class VietnameseTest {
  
      private final static String testPS[] = {
          "a",
          "a",
          "\u00c2",

@@ -344,21 +345,23 @@
          "\u1ef4",
          "z",
          "Z"
      };
  
+     @Test
      public void TestPrimary() {
-         doTest(myCollation, Collator.PRIMARY, testPS, testPT, testPR);
+         TestUtils.doCollatorTest(myCollation, Collator.PRIMARY, testPS, testPT, testPR);
      }
  
+     @Test
      public void TestTertiary() {
          int testLength = testT.length;
  
          myCollation.setStrength(Collator.TERTIARY);
          for (int i = 0; i < testLength - 1; i++) {
              for (int j = i+1; j < testLength; j++) {
-                 doTest(myCollation, testT[i], testT[j], -1);
+                 TestUtils.doCollatorTest(myCollation, testT[i], testT[j], -1);
              }
          }
      }
  
      private final Collator myCollation = Collator.getInstance(Locale.of("vi", "VN"));
< prev index next >