< prev index next >

test/jdk/java/text/Collator/Test4401726.java

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

@@ -25,23 +25,25 @@
   * @test
   * @bug 4401726
   * @author John O'Conner
   * @library /java/text/testlib
   * @summary Regression tests for Collation and associated classes
+  * @run junit Test4401726
   */
  
  
  import java.text.*;
  import java.util.Locale;
  import java.util.Vector;
  
- public class Test4401726 extends CollatorTest {
+ import org.junit.jupiter.api.Test;
  
-     public static void main(String[] args) throws Exception {
-         new Test4401726().run(args);
-     }
+ import static org.junit.jupiter.api.Assertions.fail;
+ 
+ public class Test4401726 {
  
+     @Test
     public void TestSetOffSet() {
  
         int[] expected = {0, -1, 65536};
         int[] actual = new int[expected.length];
  

@@ -58,11 +60,11 @@
              actual[1] = iterator.previous();
              iterator.setOffset(0);
              actual[2] = iterator.next();
  
              if (compareArray(expected, actual) == false) {
-                 errln("Failed.");
+                 fail("Failed.");
              }
  
              str = "a";
              iterator = rbc.getCollationElementIterator(str);
              iterator.setOffset(0);

@@ -70,15 +72,15 @@
              actual[1] = iterator.previous();
              iterator.setOffset(0);
              actual[2] = iterator.next();
  
              if (compareArray(expected, actual) == false) {
-                 errln("Failed.");
+                 fail("Failed.");
              }
  
          } catch (ParseException e) {
-             errln("Unexpected ParseException: " + e);
+             fail("Unexpected ParseException: " + e);
          }
  
  
      }
  
< prev index next >