2424
2525package io .pdal
2626
27+ import io .circe .parser
2728import java .nio .{ByteBuffer , ByteOrder }
2829
2930import scala .collection .JavaConverters ._
@@ -34,7 +35,7 @@ class PipelineSpec extends TestEnvironmentSpec {
3435 val badPipeline = Pipeline (badJson)
3536 badPipeline.validate() should be(false )
3637 badPipeline.close()
37- ( badPipeline.ptr() should be(0 ) )
38+ badPipeline.ptr() should be(0 )
3839 }
3940
4041 it(" should validate json" ) {
@@ -160,23 +161,29 @@ class PipelineSpec extends TestEnvironmentSpec {
160161 it(" should read crs correct" ) {
161162 val pvi = pipeline.getPointViews()
162163 val pv = pvi.next()
163- pv.getCrsProj4() should ( be(proj4String).or(be(proj4StringMac) ))
164+ pv.getCrsProj4() should be(proj4String).or(be(proj4StringMac))
164165 pv.close()
165166 pvi.close()
166167 }
167168
168- it(" should fail with InitializationException" ) {
169+ it(" should fail with InitializationException when the input json is null " ) {
169170 intercept[InitializationException ] { Pipeline (null ) }
170171 }
171172
172- it(" should fail with ExecutionException" ) {
173- val pipeline = Pipeline (" {" )
174- intercept[ExecutionException ] { pipeline.execute() }
175- intercept[ExecutionException ] { pipeline.getPointViews() }
176- intercept[ExecutionException ] { pipeline.getMetadata() }
177- intercept[ExecutionException ] { pipeline.getSchema() }
173+ it(" should fail with ExecutionException when the input json is invalid" ) {
174+ intercept[InitializationException ] { Pipeline (" {" ) }
175+ }
176+
177+ it(" should get pipeline" ) {
178+ parser.parse(pipeline.getPipeline()) shouldBe jsonExpectedJson
179+ }
180+
181+ it(" should get schema" ) {
182+ parser.parse(pipeline.getSchema()) shouldBe schemaJson
183+ }
178184
179- pipeline.close()
185+ it(" should get metadata" ) {
186+ parser.parse(pipeline.getMetadata()) shouldBe metadataJson
180187 }
181188
182189 it(" should extract mesh in iterative fashion" ) {
0 commit comments