Skip to content

Commit

Permalink
Switch to Java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
jericks committed Dec 31, 2015
1 parent 37fc9c3 commit afae74b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,4 +1,4 @@
language: java

jdk:
- openjdk7
- oraclejdk8
2 changes: 0 additions & 2 deletions src/test/groovy/geoscript/GeoScriptTestCase.groovy
Expand Up @@ -5,7 +5,6 @@ import geoscript.feature.Schema
import geoscript.filter.Expression
import geoscript.geom.Point
import geoscript.layer.Cursor
import geoscript.layer.Property
import geoscript.proj.Geodetic
import geoscript.layer.Format
import geoscript.layer.GeoTIFF
Expand All @@ -18,7 +17,6 @@ import org.junit.rules.TemporaryFolder
import static org.junit.Assert.*

import geoscript.geom.*
import geoscript.layer.Shapefile
import geoscript.layer.Layer
import geoscript.filter.Color
import geoscript.proj.Projection
Expand Down
15 changes: 8 additions & 7 deletions src/test/groovy/geoscript/style/SymbolizerTestCase.groovy
@@ -1,5 +1,6 @@
package geoscript.style

import geoscript.AssertUtil
import geoscript.feature.Field
import geoscript.style.io.SLDWriter
import org.junit.Rule
Expand Down Expand Up @@ -326,28 +327,28 @@ class SymbolizerTestCase {
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:UserLayer>
</sld:StyledLayerDescriptor>""".trim().replaceAll("\n","")
</sld:StyledLayerDescriptor>"""

Symbolizer sym = new Fill("wheat") + new Stroke("brown")

ByteArrayOutputStream out = new ByteArrayOutputStream()
sym.asSLD(out)
String sld = out.toString().trim().replaceAll(NEW_LINE,"")
String sld = out.toString().trim()
assertNotNull sld
assertTrue sld.length() > 0
assertEquals expectedSld, sld
AssertUtil.assertStringsEqual expectedSld, sld, removeXmlNS: true, trim: true

File file = folder.newFile("simple.sld")
sym.asSLD(file)
sld = file.text.trim().replaceAll(NEW_LINE,"")
sld = file.text.trim()
assertNotNull sld
assertTrue sld.length() > 0
assertEquals expectedSld, sld
AssertUtil.assertStringsEqual expectedSld, sld, removeXmlNS: true, trim: true

sld = sym.sld.trim().replaceAll(NEW_LINE,"")
sld = sym.sld.trim()
assertNotNull sld
assertTrue sld.length() > 0
assertEquals expectedSld, sld
AssertUtil.assertStringsEqual expectedSld, sld, removeXmlNS: true, trim: true
}

@Test
Expand Down
15 changes: 8 additions & 7 deletions src/test/groovy/geoscript/style/io/SLDWriterTestCase.groovy
@@ -1,5 +1,6 @@
package geoscript.style.io

import geoscript.AssertUtil
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
Expand Down Expand Up @@ -43,36 +44,36 @@ class SLDWriterTestCase {
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:UserLayer>
</sld:StyledLayerDescriptor>""".trim().replaceAll("\n","")
</sld:StyledLayerDescriptor>"""

@Test void writeToOutputStream() {
Symbolizer sym = new Fill("wheat") + new Stroke("brown")
SLDWriter writer = new SLDWriter();
ByteArrayOutputStream out = new ByteArrayOutputStream()
writer.write(sym, out)
String sld = out.toString().trim().replaceAll(NEW_LINE,"")
String sld = out.toString().trim()
assertNotNull sld
assertTrue sld.length() > 0
assertEquals expectedSld, sld
AssertUtil.assertStringsEqual expectedSld, sld, removeXmlNS: true, trim: true
}

@Test void writeToFile() {
Symbolizer sym = new Fill("wheat") + new Stroke("brown")
SLDWriter writer = new SLDWriter();
File file = folder.newFile("simple.sld")
writer.write(sym, file)
String sld = file.text.trim().replaceAll(NEW_LINE,"")
String sld = file.text.trim()
assertNotNull sld
assertTrue sld.length() > 0
assertEquals expectedSld, sld
AssertUtil.assertStringsEqual expectedSld, sld, removeXmlNS: true, trim: true
}

@Test void writeToString() {
Symbolizer sym = new Fill("wheat") + new Stroke("brown")
SLDWriter writer = new SLDWriter();
String sld = writer.write(sym).trim().replaceAll(NEW_LINE,"")
String sld = writer.write(sym).trim()
assertNotNull sld
assertTrue sld.length() > 0
assertEquals expectedSld, sld
AssertUtil.assertStringsEqual expectedSld, sld, removeXmlNS: true, trim: true
}
}

0 comments on commit afae74b

Please sign in to comment.