[Schmitzm-commits] r1171 - in trunk/src_junit/schmitzm/geotools: feature styling
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Oct 26 03:41:53 CEST 2010
Author: alfonx
Date: 2010-10-26 03:41:51 +0200 (Tue, 26 Oct 2010)
New Revision: 1171
Modified:
trunk/src_junit/schmitzm/geotools/feature/FeatureUtilTest.java
trunk/src_junit/schmitzm/geotools/styling/StylingUtilTest.java
Log:
Modified: trunk/src_junit/schmitzm/geotools/feature/FeatureUtilTest.java
===================================================================
--- trunk/src_junit/schmitzm/geotools/feature/FeatureUtilTest.java 2010-10-26 01:40:07 UTC (rev 1170)
+++ trunk/src_junit/schmitzm/geotools/feature/FeatureUtilTest.java 2010-10-26 01:41:51 UTC (rev 1171)
@@ -11,6 +11,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.geotools.data.DataUtilities;
@@ -198,9 +199,35 @@
public void testFindBestMatchingAttribute()
{
String s1 = "C�R�ALIC_1";
- String s2 = s1.replaceAll("[^\\w]", ".");
- String s3 = Pattern.quote(s2);
- Pattern.compile(s2);
+ String s2 = Pattern.quote(s1);
+ s2 = s2.substring(2,s2.length()-2);
+ String s3 = s2.replaceAll("�", ".");
+// s3 = s3.replaceAll("@", ".");
+ Pattern compile = Pattern.compile(s3);
+ Matcher matcher = compile.matcher("CóRéALIC_1");
+
+ assertTrue(matcher.find());
+
}
+
+ @Test
+ /**
+ * * <dataAttribute functionA="0.0" functionX="1.0" localname="C�R�ALIC_1" namespace="" visible="false" weight="15">
+
+ */
+ public void testFindBestMatchingAttribute2()
+ {
+ String s1 = "C�R�ALIC_1";
+ String s2 = Pattern.quote(s1);
+ s2 = s2.substring(2,s2.length()-2);
+ String s3 = s2.replaceAll("[^\\w]", "[^\\w]");
+// s3 = s3.replaceAll("@", ".");
+ Pattern compile = Pattern.compile(s3);
+ Matcher matcher = compile.matcher("CóRéALIC_1");
+
+ assertTrue(matcher.find());
+
+ }
+
}
Modified: trunk/src_junit/schmitzm/geotools/styling/StylingUtilTest.java
===================================================================
--- trunk/src_junit/schmitzm/geotools/styling/StylingUtilTest.java 2010-10-26 01:40:07 UTC (rev 1170)
+++ trunk/src_junit/schmitzm/geotools/styling/StylingUtilTest.java 2010-10-26 01:41:51 UTC (rev 1171)
@@ -127,18 +127,18 @@
assertEquals("3.0", colorMapEntries[1].getQuantity().toString());
assertEquals("4.0", colorMapEntries[2].getQuantity().toString());
}
+//
+// @Test
+// @Ignore
+// public void testParseColormapToSld() throws IOException, TransformerException {
+// URL colormapUrl = StylingUtilTest.class.getResource("gdaloutput.txt");
+// assertNotNull(colormapUrl);
+// ColorMap cm = StylingUtil.parseColormapToSld(colormapUrl);
+// assertEquals(256, cm.getColorMapEntries().length);
+//
+// RasterSymbolizer createRasterSymbolizer = StylingUtil.STYLE_BUILDER.createRasterSymbolizer(cm, 1.0);
+// Style style = StylingUtil.STYLE_BUILDER.createStyle(createRasterSymbolizer);
+// StylingUtil.saveStyleToSLD(style, new File("/home/stefan/Desktop/colors.sld"));
+// }
- @Test
- @Ignore
- public void testParseColormapToSld() throws IOException, TransformerException {
- URL colormapUrl = StylingUtilTest.class.getResource("gdaloutput.txt");
- assertNotNull(colormapUrl);
- ColorMap cm = StylingUtil.parseColormapToSld(colormapUrl);
- assertEquals(256, cm.getColorMapEntries().length);
-
- RasterSymbolizer createRasterSymbolizer = StylingUtil.STYLE_BUILDER.createRasterSymbolizer(cm, 1.0);
- Style style = StylingUtil.STYLE_BUILDER.createStyle(createRasterSymbolizer);
- StylingUtil.saveStyleToSLD(style, new File("/home/stefan/Desktop/colors.sld"));
- }
-
}
More information about the Schmitzm-commits
mailing list