Browse Source
Merge in ~LIDONGY/base-third from ~AFLY/base-third:release/10.0 to release/10.0 * commit 'dff97cfdc26064e22d8f03a802ac2bc37d86da51': DEC-16125 fix: resin和weblogic下存在joda时区加载不到的问题release/10.0
Afly
4 years ago
2 changed files with 65 additions and 6 deletions
@ -0,0 +1,35 @@
|
||||
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…
Reference in new issue