From 60da46779b3980553d2f9c4a74e93863c01ac984 Mon Sep 17 00:00:00 2001 From: Philippe Liard Date: Fri, 4 Nov 2011 12:02:25 +0000 Subject: [PATCH] Reset PhoneNumberUtil singleton instance in ShortNumberUtilTest and make JUnit tests never fork in both Ant and Maven. PhoneNumberUtil.resetInstance() should always be used instead. This omission should not be hidden by unit tests that fork. That also makes the external version consistent with the internal one in which unit tests don't seem to be executed by default in isolated processes. Review URL: http://codereview.appspot.com/5341042 --- java/build.xml | 2 +- java/pom.xml | 8 ++++++++ .../com/google/i18n/phonenumbers/ShortNumberUtilTest.java | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/java/build.xml b/java/build.xml index 7cbd41838..bab47323e 100644 --- a/java/build.xml +++ b/java/build.xml @@ -149,7 +149,7 @@ - + diff --git a/java/pom.xml b/java/pom.xml index f4ff3bf37..c266e7daf 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -108,6 +108,14 @@ + + org.apache.maven.plugins + maven-surefire-plugin + 2.10 + + never + + org.apache.maven.plugins maven-source-plugin diff --git a/java/test/com/google/i18n/phonenumbers/ShortNumberUtilTest.java b/java/test/com/google/i18n/phonenumbers/ShortNumberUtilTest.java index b1ae29b85..8f0baf6c8 100644 --- a/java/test/com/google/i18n/phonenumbers/ShortNumberUtilTest.java +++ b/java/test/com/google/i18n/phonenumbers/ShortNumberUtilTest.java @@ -29,6 +29,7 @@ public class ShortNumberUtilTest extends TestCase { "/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting"; public ShortNumberUtilTest() { + PhoneNumberUtil.resetInstance(); PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance( TEST_META_DATA_FILE_PREFIX, CountryCodeToRegionCodeMapForTesting.getCountryCodeToRegionCodeMap());