From 5ec8ef6d3053d67badee3e9a06d6c20821191620 Mon Sep 17 00:00:00 2001 From: eblondel Date: Fri, 27 Jul 2018 22:07:46 +0200 Subject: [PATCH] #2 split WFSClient tests by version --- tests/testthat/test_WFSClient.R | 50 -------------------------- tests/testthat/test_WFSClient_v1_0_0.R | 22 ++++++++++++ tests/testthat/test_WFSClient_v1_1_0.R | 22 ++++++++++++ tests/testthat/test_WFSClient_v2_0_0.R | 22 ++++++++++++ 4 files changed, 66 insertions(+), 50 deletions(-) delete mode 100644 tests/testthat/test_WFSClient.R create mode 100644 tests/testthat/test_WFSClient_v1_0_0.R create mode 100644 tests/testthat/test_WFSClient_v1_1_0.R create mode 100644 tests/testthat/test_WFSClient_v2_0_0.R diff --git a/tests/testthat/test_WFSClient.R b/tests/testthat/test_WFSClient.R deleted file mode 100644 index dc6c5af..0000000 --- a/tests/testthat/test_WFSClient.R +++ /dev/null @@ -1,50 +0,0 @@ -# test_WFS.R -# Author: Emmanuel Blondel -# -# Description: Integration tests for WFS Client -#======================= -require(ows4R, quietly = TRUE) -require(testthat) -context("WFS") - -test_that("WFS 1.0.0",{ - wfs <- WFSClient$new("http://localhost:8080/geoserver/wfs", "1.0.0", logger = "INFO") - expect_is(wfs, "WFSClient") - caps <- wfs$getCapabilities() - expect_is(caps, "WFSCapabilities") - ft <- caps$findFeatureTypeByName("topp:tasmania_water_bodies", exact = TRUE) - expect_is(ft, "WFSFeatureType") - ft.des <- ft$getDescription() - expect_is(ft.des, "list") - ft.sp <- ft$getFeatures() - expect_is(ft.sp, "sf") - expect_is(ft.sp, "data.frame") -}) - -test_that("WFS 1.1.0",{ - wfs <- WFSClient$new("http://localhost:8080/geoserver/wfs", "1.1.0", logger = "INFO") - expect_is(wfs, "WFSClient") - caps <- wfs$getCapabilities() - expect_is(caps, "WFSCapabilities") - ft <- caps$findFeatureTypeByName("topp:tasmania_water_bodies", exact = TRUE) - expect_is(ft, "WFSFeatureType") - ft.des <- ft$getDescription() - expect_is(ft.des, "list") - ft.sp <- ft$getFeatures() - expect_is(ft.sp, "sf") - expect_is(ft.sp, "data.frame") -}) - -test_that("WFS 2.0.0",{ - wfs <- WFSClient$new("http://localhost:8080/geoserver/wfs", "2.0.0", logger = "INFO") - expect_is(wfs, "WFSClient") - caps <- wfs$getCapabilities() - expect_is(caps, "WFSCapabilities") - ft <- caps$findFeatureTypeByName("topp:tasmania_water_bodies", exact = TRUE) - expect_is(ft, "WFSFeatureType") - ft.des <- ft$getDescription() - expect_is(ft.des, "list") - ft.sp <- ft$getFeatures() - expect_is(ft.sp, "sf") - expect_is(ft.sp, "data.frame") -}) \ No newline at end of file diff --git a/tests/testthat/test_WFSClient_v1_0_0.R b/tests/testthat/test_WFSClient_v1_0_0.R new file mode 100644 index 0000000..12a1304 --- /dev/null +++ b/tests/testthat/test_WFSClient_v1_0_0.R @@ -0,0 +1,22 @@ +# test_WFSClient_v1_0_0.R +# Author: Emmanuel Blondel +# +# Description: Integration tests for WFS Client version 1.0.0 +#======================= +require(ows4R, quietly = TRUE) +require(testthat) +context("WFS") + +test_that("WFS 1.0.0",{ + wfs <- WFSClient$new("http://localhost:8080/geoserver/wfs", "1.0.0", logger = "INFO") + expect_is(wfs, "WFSClient") + caps <- wfs$getCapabilities() + expect_is(caps, "WFSCapabilities") + ft <- caps$findFeatureTypeByName("topp:tasmania_water_bodies", exact = TRUE) + expect_is(ft, "WFSFeatureType") + ft.des <- ft$getDescription() + expect_is(ft.des, "list") + ft.sp <- ft$getFeatures() + expect_is(ft.sp, "sf") + expect_is(ft.sp, "data.frame") +}) diff --git a/tests/testthat/test_WFSClient_v1_1_0.R b/tests/testthat/test_WFSClient_v1_1_0.R new file mode 100644 index 0000000..dbdc96a --- /dev/null +++ b/tests/testthat/test_WFSClient_v1_1_0.R @@ -0,0 +1,22 @@ +# test_WFSClient_v1_1_0.R +# Author: Emmanuel Blondel +# +# Description: Integration tests for WFS Client version 1.1.0 +#======================= +require(ows4R, quietly = TRUE) +require(testthat) +context("WFS") + +test_that("WFS 1.1.0",{ + wfs <- WFSClient$new("http://localhost:8080/geoserver/wfs", "1.1.0", logger = "INFO") + expect_is(wfs, "WFSClient") + caps <- wfs$getCapabilities() + expect_is(caps, "WFSCapabilities") + ft <- caps$findFeatureTypeByName("topp:tasmania_water_bodies", exact = TRUE) + expect_is(ft, "WFSFeatureType") + ft.des <- ft$getDescription() + expect_is(ft.des, "list") + ft.sp <- ft$getFeatures() + expect_is(ft.sp, "sf") + expect_is(ft.sp, "data.frame") +}) diff --git a/tests/testthat/test_WFSClient_v2_0_0.R b/tests/testthat/test_WFSClient_v2_0_0.R new file mode 100644 index 0000000..10937af --- /dev/null +++ b/tests/testthat/test_WFSClient_v2_0_0.R @@ -0,0 +1,22 @@ +# test_WFSClient_v2_0_0.R +# Author: Emmanuel Blondel +# +# Description: Integration tests for WFS Client version 2.0.0 +#======================= +require(ows4R, quietly = TRUE) +require(testthat) +context("WFS") + +test_that("WFS 2.0.0",{ + wfs <- WFSClient$new("http://localhost:8080/geoserver/wfs", "2.0.0", logger = "INFO") + expect_is(wfs, "WFSClient") + caps <- wfs$getCapabilities() + expect_is(caps, "WFSCapabilities") + ft <- caps$findFeatureTypeByName("topp:tasmania_water_bodies", exact = TRUE) + expect_is(ft, "WFSFeatureType") + ft.des <- ft$getDescription() + expect_is(ft.des, "list") + ft.sp <- ft$getFeatures() + expect_is(ft.sp, "sf") + expect_is(ft.sp, "data.frame") +}) \ No newline at end of file