Skip to content

Commit

Permalink
Highlight the problem with the ruleset
Browse files Browse the repository at this point in the history
  • Loading branch information
hadrienk committed Nov 29, 2024
1 parent e1f71c9 commit 85f34bc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions vtl-sdmx/src/test/java/fr/insee/vtl/SDMXVTLWorkflowTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ public void setUp() {
engine = mgr.getEngineByExtension("vtl");
}

@Test
void testRefFromRepo() {
// Works partially, the transformation does not pull in the ruleset. Maybe the transformation is wrong and does not
// reference ruleset?
String url = "https://registry.sdmx.io/sdmx/v2/structure/transformationscheme/FR1/BPE_CENSUS/+/?format=sdmx-3.0&references=all";
ReadableDataLocation rdl = new ReadableDataLocationTmp(url);
SDMXVTLWorkflow sdmxVtlWorkflow = new SDMXVTLWorkflow(engine, rdl, Java8Helpers.mapOf());
System.out.println(sdmxVtlWorkflow.getEmptyDatasets());

System.out.println(sdmxVtlWorkflow.getTransformationsVTL());

// Invalid step definition for:CHECK_MUNICIPALITY
// - Caused by: fr.insee.vtl.engine.exceptions.UndefinedVariableException: undefined variable UNIQUE_MUNICIPALITY
engine.getBindings(ScriptContext.ENGINE_SCOPE).putAll(sdmxVtlWorkflow.getEmptyDatasets());
Map<String, PersistentDataset> result = sdmxVtlWorkflow.run();
assertThat(result).containsKeys(
"BPE_CENSUS_NUTS3_2021", "BPE_MUNICIPALITY", "BPE_NUTS3"
);
}

@Test
void testGetEmptyDataset() {

Expand Down

0 comments on commit 85f34bc

Please sign in to comment.