test/java/util/PluggableLocale/ProviderTest.java

Print this page
rev 5957 : imported patch 8000245.8000273.8000615


  25  */
  26 
  27 import java.text.*;
  28 import java.util.*;
  29 import sun.text.resources.*;
  30 import sun.util.locale.provider.*;
  31 
  32 public class ProviderTest {
  33     void checkValidity(Locale target, Object jres, Object providers, Object result, boolean jresPreferred) {
  34         if (jresPreferred) {
  35             if ((result==null && jres!=null) || !result.equals(jres)) {
  36                 throw new RuntimeException(
  37                     "result do not match with jre's result. target: "+target+" result: "+result+" jre's: "+jres);
  38             }
  39         } else {
  40             if (providers!=null && !result.equals(providers)) {
  41                 throw new RuntimeException(
  42                     "result do not match with provider's result. target: "+target+" result: "+result+" providers: "+providers);
  43             }
  44         }


  45     }
  46 }


  25  */
  26 
  27 import java.text.*;
  28 import java.util.*;
  29 import sun.text.resources.*;
  30 import sun.util.locale.provider.*;
  31 
  32 public class ProviderTest {
  33     void checkValidity(Locale target, Object jres, Object providers, Object result, boolean jresPreferred) {
  34         if (jresPreferred) {
  35             if ((result==null && jres!=null) || !result.equals(jres)) {
  36                 throw new RuntimeException(
  37                     "result do not match with jre's result. target: "+target+" result: "+result+" jre's: "+jres);
  38             }
  39         } else {
  40             if (providers!=null && !result.equals(providers)) {
  41                 throw new RuntimeException(
  42                     "result do not match with provider's result. target: "+target+" result: "+result+" providers: "+providers);
  43             }
  44         }
  45 
  46         System.out.println("checkValidity succeeded. target: "+target+" result: "+result+" jre's: "+jres+" providers: "+providers+" jre-preferred: "+jresPreferred);
  47     }
  48 }