< prev index next >

test/jdk/java/text/Collator/Test4401726.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.

*** 25,23 ***
   * @test
   * @bug 4401726
   * @author John O'Conner
   * @library /java/text/testlib
   * @summary Regression tests for Collation and associated classes
   */
  
  
  import java.text.*;
  import java.util.Locale;
  import java.util.Vector;
  
! public class Test4401726 extends CollatorTest {
  
!     public static void main(String[] args) throws Exception {
!         new Test4401726().run(args);
!     }
  
     public void TestSetOffSet() {
  
         int[] expected = {0, -1, 65536};
         int[] actual = new int[expected.length];
  
--- 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;
  
! import org.junit.jupiter.api.Test;
  
! 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 ***
              actual[1] = iterator.previous();
              iterator.setOffset(0);
              actual[2] = iterator.next();
  
              if (compareArray(expected, actual) == false) {
!                 errln("Failed.");
              }
  
              str = "a";
              iterator = rbc.getCollationElementIterator(str);
              iterator.setOffset(0);
--- 60,11 ---
              actual[1] = iterator.previous();
              iterator.setOffset(0);
              actual[2] = iterator.next();
  
              if (compareArray(expected, actual) == false) {
!                 fail("Failed.");
              }
  
              str = "a";
              iterator = rbc.getCollationElementIterator(str);
              iterator.setOffset(0);

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