Browse Source

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
pull/567/head
Philippe Liard 14 years ago
committed by Mihaela Rosca
parent
commit
60da46779b
3 changed files with 10 additions and 1 deletions
  1. +1
    -1
      java/build.xml
  2. +8
    -0
      java/pom.xml
  3. +1
    -0
      java/test/com/google/i18n/phonenumbers/ShortNumberUtilTest.java

+ 1
- 1
java/build.xml View File

@ -149,7 +149,7 @@
<junit printsummary="yes">
<classpath refid="test.classpath"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${report.dir}">
<batchtest fork="no" todir="${report.dir}">
<fileset dir="${test.dir}" includes="**/*Test.java"/>
</batchtest>
</junit>


+ 8
- 0
java/pom.xml View File

@ -108,6 +108,14 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<forkMode>never</forkMode>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>


+ 1
- 0
java/test/com/google/i18n/phonenumbers/ShortNumberUtilTest.java View File

@ -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());


Loading…
Cancel
Save