From 4578b3889f3b96ef66daffba46f0c9642d5362db Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Mon, 19 Mar 2018 05:54:12 -0400 Subject: [PATCH] Allow for locale differences in StopwatchTest --- .../src/test/java/ca/uhn/fhir/util/StopWatchTest.java | 10 +++++----- .../java/ca/uhn/fhir/parser/JsonParserDstu2Test.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/util/StopWatchTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/util/StopWatchTest.java index 19a234706f5..d80f624e065 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/util/StopWatchTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/util/StopWatchTest.java @@ -103,17 +103,17 @@ public class StopWatchTest { assertEquals("00:01:00.000", StopWatch.formatMillis(DateUtils.MILLIS_PER_MINUTE)); assertEquals("00:01:01", StopWatch.formatMillis(DateUtils.MILLIS_PER_MINUTE + DateUtils.MILLIS_PER_SECOND)); assertEquals("01:00:00", StopWatch.formatMillis(DateUtils.MILLIS_PER_HOUR)); - assertEquals("1.0 day", StopWatch.formatMillis(DateUtils.MILLIS_PER_DAY)); - assertEquals("2.0 days", StopWatch.formatMillis(DateUtils.MILLIS_PER_DAY * 2)); - assertEquals("2.0 days", StopWatch.formatMillis((DateUtils.MILLIS_PER_DAY * 2) + 1)); - assertEquals("2.4 days", StopWatch.formatMillis((DateUtils.MILLIS_PER_DAY * 2) + (10 * DateUtils.MILLIS_PER_HOUR))); + assertEquals("1.0 day", StopWatch.formatMillis(DateUtils.MILLIS_PER_DAY).replace(',','.')); + assertEquals("2.0 days", StopWatch.formatMillis(DateUtils.MILLIS_PER_DAY * 2).replace(',','.')); + assertEquals("2.0 days", StopWatch.formatMillis((DateUtils.MILLIS_PER_DAY * 2) + 1).replace(',','.')); + assertEquals("2.4 days", StopWatch.formatMillis((DateUtils.MILLIS_PER_DAY * 2) + (10 * DateUtils.MILLIS_PER_HOUR)).replace(',','.')); assertEquals("11 days", StopWatch.formatMillis((DateUtils.MILLIS_PER_DAY * 11) + (10 * DateUtils.MILLIS_PER_HOUR))); } @Test public void testFormatThroughput60Ops4Min() { StopWatch sw = new StopWatch(DateUtils.addMinutes(new Date(), -4)); - String throughput = sw.formatThroughput(60, TimeUnit.MINUTES); + String throughput = sw.formatThroughput(60, TimeUnit.MINUTES).replace(',','.'); ourLog.info("{} operations in {}ms = {} ops / second", 60, sw.getMillis(), throughput); assertThat(throughput, oneOf("14.9", "15.0", "15.1", "14,9", "15,0", "15,1")); } diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java index c8a4a4e397a..1614a2115db 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java @@ -1980,7 +1980,7 @@ public class JsonParserDstu2Test { ArgumentCaptor capt = ArgumentCaptor.forClass(String.class); verify(peh, times(0)).unknownElement(Mockito.isNull(IParseLocation.class), capt.capture()); - + assertEquals("Smith", p.getName().get(0).getGiven().get(0).getValue()); assertExtensionMetadata(p, "fhir-request-method", false, StringDt.class, "POST"); assertExtensionMetadata(p, "fhir-request-uri", false, UriDt.class, "Patient");