From: <jga...@sv...> - 2007-11-19 20:45:51
|
Author: jgarnett Date: 2007-11-19 12:45:31 -0800 (Mon, 19 Nov 2007) New Revision: 27941 Modified: geotools/trunk/gt/modules/plugin/shapefile/src/test/java/org/geotools/data/shapefile/ShapefileDataStoreTest.java Log: Test should not fail if CHINESE charset has not been instaleld into your JRE Modified: geotools/trunk/gt/modules/plugin/shapefile/src/test/java/org/geotools/data/shapefile/ShapefileDataStoreTest.java =================================================================== --- geotools/trunk/gt/modules/plugin/shapefile/src/test/java/org/geotools/data/shapefile/ShapefileDataStoreTest.java 2007-11-19 18:21:03 UTC (rev 27940) +++ geotools/trunk/gt/modules/plugin/shapefile/src/test/java/org/geotools/data/shapefile/ShapefileDataStoreTest.java 2007-11-19 20:45:31 UTC (rev 27941) @@ -25,6 +25,7 @@ import java.net.URL; import java.net.URLDecoder; import java.nio.charset.Charset; +import java.nio.charset.UnsupportedCharsetException; import java.util.Arrays; import java.util.Date; import java.util.HashMap; @@ -125,10 +126,16 @@ } public void testLoadChineseChars() throws Exception { - FeatureCollection fc = loadFeatures(CHINESE, Charset.forName("GB18030"), null); - SimpleFeature first = fc.features().next(); - String s = (String) first.getAttribute("NAME"); - assertEquals("\u9ed1\u9f99\u6c5f\u7701", first.getAttribute("NAME")); + try { + FeatureCollection fc = loadFeatures(CHINESE, Charset.forName("GB18030"), null); + SimpleFeature first = fc.features().next(); + String s = (String) first.getAttribute("NAME"); + assertEquals("\u9ed1\u9f99\u6c5f\u7701", first.getAttribute("NAME")); + } + catch( UnsupportedCharsetException no){ + // this JDK has not been installed with the required + // lanaguage + } } public void testNamespace() throws Exception { |