Skip to content

Commit

Permalink
Remove the @disabled in bdtopo_v2 tests (since we have a validated BD…
Browse files Browse the repository at this point in the history
…Topo dataset
  • Loading branch information
j3r3m1 committed May 19, 2020
1 parent d7a41ed commit 61b391a
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import static org.junit.jupiter.api.Assertions.*
class AbstractTablesInitializationTest {

@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void initParametersAbstract(){
H2GIS h2GISDatabase = H2GIS.open("./target/h2gis_abstract_tables_${UUID.randomUUID()};AUTO_SERVER=TRUE", "sa", "")
def process = BDTopo_V2.initParametersAbstract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,34 @@ class BDTopoGISLayersTest {

public static communeToTest = "12174"

@BeforeAll
static void beforeAll(){
if(InputDataFormattingTest.class.getResource("processingChain") != null &&
new File(InputDataFormattingTest.class.getResource("processingChain").toURI()).exists()) {
System.properties.setProperty("data.bd.topo", "true")
}
else {
System.properties.setProperty("data.bd.topo", "false")
}
}

@BeforeEach
void beforeEach(){
if(System.properties.containsKey("data.bd.topo") && System.properties.getProperty("data.bd.topo") == "true") {
def dataFolderInseeCode = "sample_$communeToTest"
def listFilesBDTopo = ["IRIS_GE", "BATI_INDIFFERENCIE", "BATI_INDUSTRIEL", "BATI_REMARQUABLE",
"ROUTE", "SURFACE_EAU", "ZONE_VEGETATION", "ZONE_VEGETATION",
"TRONCON_VOIE_FERREE", "TERRAIN_SPORT", "CONSTRUCTION_SURFACIQUE",
"SURFACE_ROUTE", "SURFACE_ACTIVITE"]

def paramTables = ["BUILDING_ABSTRACT_PARAMETERS", "BUILDING_ABSTRACT_USE_TYPE", "BUILDING_BD_TOPO_USE_TYPE",
"RAIL_ABSTRACT_TYPE", "RAIL_BD_TOPO_TYPE", "RAIL_ABSTRACT_CROSSING",
"RAIL_BD_TOPO_CROSSING", "ROAD_ABSTRACT_PARAMETERS", "ROAD_ABSTRACT_SURFACE",
"ROAD_ABSTRACT_CROSSING", "ROAD_BD_TOPO_CROSSING", "ROAD_ABSTRACT_TYPE",
"ROAD_BD_TOPO_TYPE", "VEGET_ABSTRACT_PARAMETERS", "VEGET_ABSTRACT_TYPE",
"VEGET_BD_TOPO_TYPE"]

h2GISDatabase = H2GIS.open("./target/h2gis_input_data_formating;AUTO_SERVER=TRUE", "sa", "")

// Load parameter files
paramTables.each{
h2GISDatabase.load(getClass().getResource(it+".csv"), it, true)
}
// Load data files
listFilesBDTopo.each{
h2GISDatabase.load(getClass().getResource("$dataFolderInseeCode/${it}.shp"), it, true)
}
def dataFolderInseeCode = "sample_$communeToTest"
def listFilesBDTopo = ["IRIS_GE", "BATI_INDIFFERENCIE", "BATI_INDUSTRIEL", "BATI_REMARQUABLE",
"ROUTE", "SURFACE_EAU", "ZONE_VEGETATION", "ZONE_VEGETATION",
"TRONCON_VOIE_FERREE", "TERRAIN_SPORT", "CONSTRUCTION_SURFACIQUE",
"SURFACE_ROUTE", "SURFACE_ACTIVITE"]

def paramTables = ["BUILDING_ABSTRACT_PARAMETERS", "BUILDING_ABSTRACT_USE_TYPE", "BUILDING_BD_TOPO_USE_TYPE",
"RAIL_ABSTRACT_TYPE", "RAIL_BD_TOPO_TYPE", "RAIL_ABSTRACT_CROSSING",
"RAIL_BD_TOPO_CROSSING", "ROAD_ABSTRACT_PARAMETERS", "ROAD_ABSTRACT_SURFACE",
"ROAD_ABSTRACT_CROSSING", "ROAD_BD_TOPO_CROSSING", "ROAD_ABSTRACT_TYPE",
"ROAD_BD_TOPO_TYPE", "VEGET_ABSTRACT_PARAMETERS", "VEGET_ABSTRACT_TYPE",
"VEGET_BD_TOPO_TYPE"]

h2GISDatabase = H2GIS.open("./target/h2gis_input_data_formating;AUTO_SERVER=TRUE", "sa", "")

// Load parameter files
paramTables.each{
h2GISDatabase.load(getClass().getResource(it+".csv"), it, true)
}
// Load data files
listFilesBDTopo.each{
h2GISDatabase.load(getClass().getResource("$dataFolderInseeCode/${it}.shp"), it, true)
}
}

@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessTest() {
def process = BDTopo_V2.importPreprocess
assertTrue process.execute([datasource: h2GISDatabase,
Expand Down Expand Up @@ -261,7 +247,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_BUILDING table is well produced, despite the absence of the BATI_INDIFFERENCIE table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessBuildIndifTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS BATI_INDIFFERENCIE;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -314,7 +299,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_BUILDING table is well produced, despite the absence of the BATI_INDUSTRIEL table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessBuildIndusTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS BATI_INDUSTRIEL;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -368,7 +352,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_BUILDING table is well produced, despite the absence of the BATI_REMARQUABLE table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessBuildRemarqTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS BATI_REMARQUABLE;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -422,7 +405,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_ROAD table is well produced, despite the absence of the ROUTE table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessRoadTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS ROUTE;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -478,7 +460,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_RAIL table is well produced, despite the absence of the TRONCON_VOIE_FERREE table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessRailTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS TRONCON_VOIE_FERREE;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -530,7 +511,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_HYDRO table is well produced, despite the absence of the SURFACE_EAU table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessHydroTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS SURFACE_EAU;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -576,7 +556,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_VEGET table is well produced, despite the absence of the ZONE_VEGETATION table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessVegetTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS ZONE_VEGETATION;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -624,7 +603,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_IMPERVIOUS table is well produced, despite the absence of the SURFACE_ACTIVITE table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessImperviousSurfActTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS SURFACE_ACTIVITE;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -678,7 +656,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_IMPERVIOUS table is well produced, despite the absence of the TERRAIN_SPORT table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessImperviousSportTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS TERRAIN_SPORT;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -732,7 +709,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_IMPERVIOUS table is well produced, despite the absence of the CONSTRUCTION_SURFACIQUE table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessImperviousConstrSurfTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS CONSTRUCTION_SURFACIQUE;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -786,7 +762,6 @@ class BDTopoGISLayersTest {

// Check whether the INPUT_IMPERVIOUS table is well produced, despite the absence of the SURFACE_ROUTE table
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void importPreprocessImperviousSurfRoadTest() {
h2GISDatabase.execute ("DROP TABLE IF EXISTS SURFACE_ROUTE;")
def process = BDTopo_V2.importPreprocess
Expand Down Expand Up @@ -840,7 +815,6 @@ class BDTopoGISLayersTest {

// Check that the conversion (to valid) of an invalid building (ID = BATIMENT0000000290122667 from BATI_INDIFFERENCIE) is well done
@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void checkMakeValidBuildingIndif() {
def process = BDTopo_V2.importPreprocess
assertTrue process.execute([datasource: h2GISDatabase,
Expand All @@ -866,7 +840,6 @@ class BDTopoGISLayersTest {
}

@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void initTypes() {
def process = BDTopo_V2.initTypes
assertTrue process.execute([datasource : h2GISDatabase, buildingAbstractUseType: 'BUILDING_ABSTRACT_USE_TYPE',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,34 @@ class InputDataFormattingTest {

public static communeToTest = "12174"

@BeforeAll
static void beforeAll(){
if(InputDataFormattingTest.class.getResource("processingChain") != null &&
new File(InputDataFormattingTest.class.getResource("processingChain").toURI()).exists()) {
System.properties.setProperty("data.bd.topo", "true")
}
else {
System.properties.setProperty("data.bd.topo", "false")
}
}

@BeforeEach
void beforeEach(){
if(System.properties.containsKey("data.bd.topo") && System.properties.getProperty("data.bd.topo") == "true") {
def dataFolderInseeCode = "sample_$communeToTest"
def listFilesBDTopo = ["IRIS_GE", "BATI_INDIFFERENCIE", "BATI_INDUSTRIEL", "BATI_REMARQUABLE",
"ROUTE", "SURFACE_EAU", "ZONE_VEGETATION", "ZONE_VEGETATION",
"TRONCON_VOIE_FERREE", "TERRAIN_SPORT", "CONSTRUCTION_SURFACIQUE",
"SURFACE_ROUTE", "SURFACE_ACTIVITE"]

def paramTables = ["BUILDING_ABSTRACT_PARAMETERS", "BUILDING_ABSTRACT_USE_TYPE", "BUILDING_BD_TOPO_USE_TYPE",
"RAIL_ABSTRACT_TYPE", "RAIL_BD_TOPO_TYPE", "RAIL_ABSTRACT_CROSSING",
"RAIL_BD_TOPO_CROSSING", "ROAD_ABSTRACT_PARAMETERS", "ROAD_ABSTRACT_SURFACE",
"ROAD_ABSTRACT_CROSSING", "ROAD_BD_TOPO_CROSSING", "ROAD_ABSTRACT_TYPE",
"ROAD_BD_TOPO_TYPE", "VEGET_ABSTRACT_PARAMETERS", "VEGET_ABSTRACT_TYPE",
"VEGET_BD_TOPO_TYPE"]

h2GISDatabase = H2GIS.open("./target/h2gis_input_data_formating;AUTO_SERVER=TRUE", "sa", "")

// Load parameter files
paramTables.each{
h2GISDatabase.load(getClass().getResource(it+".csv"), it, true)
}
// Load data files
listFilesBDTopo.each{
h2GISDatabase.load(getClass().getResource("$dataFolderInseeCode/${it}.shp"), it, true)
}
def dataFolderInseeCode = "sample_$communeToTest"
def listFilesBDTopo = ["IRIS_GE", "BATI_INDIFFERENCIE", "BATI_INDUSTRIEL", "BATI_REMARQUABLE",
"ROUTE", "SURFACE_EAU", "ZONE_VEGETATION", "ZONE_VEGETATION",
"TRONCON_VOIE_FERREE", "TERRAIN_SPORT", "CONSTRUCTION_SURFACIQUE",
"SURFACE_ROUTE", "SURFACE_ACTIVITE"]

def paramTables = ["BUILDING_ABSTRACT_PARAMETERS", "BUILDING_ABSTRACT_USE_TYPE", "BUILDING_BD_TOPO_USE_TYPE",
"RAIL_ABSTRACT_TYPE", "RAIL_BD_TOPO_TYPE", "RAIL_ABSTRACT_CROSSING",
"RAIL_BD_TOPO_CROSSING", "ROAD_ABSTRACT_PARAMETERS", "ROAD_ABSTRACT_SURFACE",
"ROAD_ABSTRACT_CROSSING", "ROAD_BD_TOPO_CROSSING", "ROAD_ABSTRACT_TYPE",
"ROAD_BD_TOPO_TYPE", "VEGET_ABSTRACT_PARAMETERS", "VEGET_ABSTRACT_TYPE",
"VEGET_BD_TOPO_TYPE"]

h2GISDatabase = H2GIS.open("./target/h2gis_input_data_formating;AUTO_SERVER=TRUE", "sa", "")

// Load parameter files
paramTables.each{
h2GISDatabase.load(getClass().getResource(it+".csv"), it, true)
}
// Load data files
listFilesBDTopo.each{
h2GISDatabase.load(getClass().getResource("$dataFolderInseeCode/${it}.shp"), it, true)
}
}

@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void inputDataFormatting(){
def processImport = BDTopo_V2.importPreprocess
assertTrue processImport.execute([datasource: h2GISDatabase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ class ProcessingChainBDTopoTest extends ChainProcessAbstractTest{
"ROAD_BD_TOPO_TYPE", "VEGET_ABSTRACT_PARAMETERS", "VEGET_ABSTRACT_TYPE",
"VEGET_BD_TOPO_TYPE"]

@BeforeAll
static void init(){
if(ProcessingChainBDTopoTest.class.getResource(bdtopoFoldName) != null &&
new File(ProcessingChainBDTopoTest.class.getResource(bdtopoFoldName).toURI()).exists()) {
System.properties.setProperty("data.bd.topo", "true")
}
else{
System.properties.setProperty("data.bd.topo", "false")
}
}

def loadFiles(String inseeCode, String dbSuffixName){
H2GIS h2GISDatabase = H2GIS.open(h2db+dbSuffixName+";AUTO_SERVER=TRUE", "sa", "")

Expand Down Expand Up @@ -78,7 +67,6 @@ class ProcessingChainBDTopoTest extends ChainProcessAbstractTest{
}

@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void prepareBDTopoTest(){
def dbSuffixName = "_prepare"
def inseeCode = communeToTest
Expand Down Expand Up @@ -138,7 +126,6 @@ class ProcessingChainBDTopoTest extends ChainProcessAbstractTest{


@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void bdtopoLczFromTestFiles() {
def dbSuffixName = "_lcz"
H2GIS datasource = loadFiles(communeToTest, dbSuffixName)
Expand Down Expand Up @@ -181,7 +168,6 @@ class ProcessingChainBDTopoTest extends ChainProcessAbstractTest{


@Test
@DisabledIfSystemProperty(named = "data.bd.topo", matches = "false")
void bdtopoGeoIndicatorsFromTestFiles() {
def dbSuffixName = "_geoIndicators"
H2GIS h2GISDatabase = loadFiles(communeToTest, dbSuffixName)
Expand Down

0 comments on commit 61b391a

Please sign in to comment.