From 5cc7f98c8a9db03337105b1258a9ecfb1f8dfc86 Mon Sep 17 00:00:00 2001 From: Alexander Verbraeck Date: Sat, 2 Nov 2024 09:43:09 +0100 Subject: [PATCH] Issue #50. Different standards for Locale between Java releases --- .../src/test/java/org/djutils/cli/TestCliLocale.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/djutils-cli/src/test/java/org/djutils/cli/TestCliLocale.java b/djutils-cli/src/test/java/org/djutils/cli/TestCliLocale.java index 74477360..7f69887a 100644 --- a/djutils-cli/src/test/java/org/djutils/cli/TestCliLocale.java +++ b/djutils-cli/src/test/java/org/djutils/cli/TestCliLocale.java @@ -130,12 +130,10 @@ public void testCli() throws CliException args = new String[] {"--duration", "0,5s", "--locale", "no_NO"}; CliUtil.execute(options, args); assertEquals(new Duration(0.5, DurationUnit.SECOND), options.getDuration()); - args = new String[] {"--duration", "0.5s", "--locale", "no_NO_NY"}; + // Issue #50. This locale is not constant between Java versions and even Java releases of the same version + args = new String[] {"--duration", "10s", "--locale", "no_NO_NY"}; CliUtil.execute(options, args); - assertEquals(new Duration(0.5, DurationUnit.SECOND), options.getDuration()); - args = new String[] {"--duration", "0.5s", "--locale", "no-NO-NY"}; - CliUtil.execute(options, args); - assertEquals(new Duration(0.5, DurationUnit.SECOND), options.getDuration()); + assertEquals(new Duration(10.0, DurationUnit.SECOND), options.getDuration()); assertEquals(locale, Locale.getDefault()); Locale.setDefault(saveLocale);