Package ca.uhn.fhir.util
Class TestUtil
java.lang.Object
ca.uhn.fhir.util.TestUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidSet some system properties randomly after each test..static voidTHIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODEstatic voidsetShouldRandomizeTimezones(boolean theShouldRandomizeTimezones)static voidsleepAtLeast(long theMillis)static voidsleepAtLeast(long theMillis, boolean theLogProgress)static StringstripReturns(String theString)THIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODEstatic StringstripWhitespace(String theString)THIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODEstatic voidwaitForSize(int theTarget, AtomicInteger theInteger)THIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODEstatic voidwaitForSize(int theTarget, Callable<Integer> theSource)THIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODE
-
Constructor Details
-
TestUtil
public TestUtil()
-
-
Method Details
-
setShouldRandomizeTimezones
-
randomizeLocaleAndTimezone
THIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODEWhen we run the unit tests in cobertura, JUnit doesn't seem to clean up static fields which leads to tons of memory being used by the end and the JVM crashes in Travis. Manually clearing all of the static fields seems to solve this.
-
doRandomizeLocaleAndTimezone
Set some system properties randomly after each test.. this is kind of hackish, but it helps us make sure we don't have any tests that depend on a particular environment -
waitForSize
THIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODEWait for an atomicinteger to hit a given site and fail if it never does
-
waitForSize
THIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODEWait for an atomicinteger to hit a given site and fail if it never does
- Throws:
Exception
-
stripReturns
THIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODEStrip \r chars from a string to account for line ending platform differences
-
stripWhitespace
THIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODEStrip \r chars from a string to account for line ending platform differences
-
sleepAtLeast
-
sleepAtLeast
-