Browse Source

Pull request #2: DEC-16125 fix: 少了一个GMT+12,third包单元测试跑不到,移到decision

Merge in ~LIDONGY/base-third from ~AFLY/base-third:release/10.0 to release/10.0

* commit '0d5259925799519c4947666ffe7127a7b7644d54':
  DEC-16125 fix: 少了一个GMT+12,third包单元测试跑不到,移到decision
release/10.0
Afly 4 years ago
parent
commit
e4d2b7b5e5
  1. 1
      fine-joda/src/main/java/com/fr/third/joda/time/tz/ZoneInfoProvider.java
  2. 35
      fine-joda/src/test/java/com/fr/third/joda/time/tz/ZoneInfoProviderTest.java

1
fine-joda/src/main/java/com/fr/third/joda/time/tz/ZoneInfoProvider.java

@ -324,6 +324,7 @@ public class ZoneInfoProvider implements Provider {
GMTData.put("GMT+9", new byte[]{70, 0, 3, 45, 48, 57, 46, 46});
GMTData.put("GMT+10", new byte[]{70, 0, 3, 45, 49, 48, 44, 44});
GMTData.put("GMT+11", new byte[]{70, 0, 3, 45, 49, 49, 42, 42});
GMTData.put("GMT+12", new byte[]{70, 0, 3, 45, 49, 50, 40, 40});
}
}

35
fine-joda/src/test/java/com/fr/third/joda/time/tz/ZoneInfoProviderTest.java

@ -1,35 +0,0 @@
package com.fr.third.joda.time.tz;
import org.junit.Test;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import static org.junit.Assert.*;
/**
* @author Afly
* created on 2020-12-16
*/
public class ZoneInfoProviderTest {
@Test
public void testGetResource() throws IOException, NoSuchMethodException {
ZoneInfoProvider zoneInfoProvider = new ZoneInfoProvider();
assertNotNull(zoneInfoProvider.getZone("Etc/GMT+8"));
Method openResource = zoneInfoProvider.getClass().getDeclaredMethod("openResource", String.class);
openResource.setAccessible(true);
try {
openResource.invoke(zoneInfoProvider, "Etc/Exception+8");
fail();
} catch (Exception ignored) {
}
try {
openResource.invoke(zoneInfoProvider, "Etc/Exception-8");
fail();
} catch (Exception ignored) {
}
}
}
Loading…
Cancel
Save