-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...src/test/java/it/unibz/inf/ontop/docker/lightweight/{lowername}/Cast{pascalname}Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package it.unibz.inf.ontop.docker.lightweight.{lowername}; | ||
|
||
import com.google.common.collect.ImmutableMultiset; | ||
import com.google.common.collect.ImmutableSet; | ||
import it.unibz.inf.ontop.docker.lightweight.AbstractCastFunctionsTest; | ||
import it.unibz.inf.ontop.docker.lightweight.{pascalname}SQLLightweightTest; | ||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
import java.sql.SQLException; | ||
|
||
@{pascalname}SQLLightweightTest | ||
public class Cast{pascalname}SQLTest extends AbstractCastFunctionsTest { | ||
|
||
private static final String PROPERTIES_FILE = "/books/{lowername}/books-{lowername}.properties"; | ||
|
||
@BeforeAll | ||
public static void before() throws IOException, SQLException { | ||
initOBDA(OBDA_FILE, OWL_FILE, PROPERTIES_FILE); | ||
} | ||
|
||
@AfterAll | ||
public static void after() throws SQLException { | ||
release(); | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...st/java/it/unibz/inf/ontop/docker/lightweight/{lowername}/NestedData{pascalname}Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package it.unibz.inf.ontop.docker.lightweight.{lowername}; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import com.google.common.collect.ImmutableMultiset; | ||
import com.google.common.collect.ImmutableSet; | ||
import it.unibz.inf.ontop.docker.lightweight.AbstractNestedDataTest; | ||
import it.unibz.inf.ontop.docker.lightweight.{pascalname}LightweightTest; | ||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.BeforeAll; | ||
|
||
import java.io.IOException; | ||
import java.sql.SQLException; | ||
|
||
@{pascalname}LightweightTest | ||
public class NestedData{pascalname}Test extends AbstractNestedDataTest { | ||
|
||
private static final String PROPERTIES_FILE = "/nested/{lowername}/nested-{lowername}.properties"; | ||
private static final String OBDA_FILE = "/nested/nested.obda"; | ||
private static final String LENS_FILE = "/nested/{lowername}/nested-lenses.json"; | ||
|
||
@BeforeAll | ||
public static void before() throws IOException, SQLException { | ||
initOBDA(OBDA_FILE, OWL_FILE, PROPERTIES_FILE, LENS_FILE); | ||
} | ||
|
||
@AfterAll | ||
public static void after() throws SQLException { | ||
release(); | ||
} | ||
|
||
} |
123 changes: 123 additions & 0 deletions
123
skeleton/test/lightweight-tests/src/test/resources/nested/{lowername}/nested-lenses.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"relations": [ | ||
{ | ||
"name": [ "lenses", "company_data_arrays" ], | ||
"baseRelation": [ "company_data_arrays" ], | ||
"uniqueConstraints": { | ||
"added": [ | ||
{ | ||
"name": "uc", | ||
"determinants": [ "id" ] | ||
} | ||
] | ||
}, | ||
"type": "BasicLens" | ||
}, | ||
{ | ||
"name": ["lenses","flattened_dates"], | ||
"baseRelation": ["lenses", "company_data_arrays"], | ||
"flattenedColumn": { | ||
"name": "days", | ||
"datatype": "array<timestamp>" | ||
}, | ||
"columns": { | ||
"kept": [ | ||
"id" | ||
], | ||
"new": "invoice_date", | ||
"position": "index" | ||
}, | ||
"type": "FlattenLens" | ||
}, | ||
{ | ||
"name": ["lenses","flattened_income"], | ||
"baseRelation": ["lenses", "company_data_arrays"], | ||
"flattenedColumn": { | ||
"name": "income", | ||
"datatype": "array<integer>" | ||
}, | ||
"columns": { | ||
"kept": [ | ||
"id" | ||
], | ||
"new": "period_income", | ||
"position": "index" | ||
}, | ||
"type": "FlattenLens" | ||
}, | ||
{ | ||
"name": ["lenses","flattened_workers_mid"], | ||
"baseRelation": ["lenses", "company_data_arrays"], | ||
"flattenedColumn": { | ||
"name": "workers", | ||
"datatype": "array<array<string>>" | ||
}, | ||
"columns": { | ||
"kept": [ | ||
"id" | ||
], | ||
"new": "worker_list", | ||
"position": "index" | ||
}, | ||
"type": "FlattenLens" | ||
}, | ||
{ | ||
"name": ["lenses","flattened_workers"], | ||
"baseRelation": ["lenses","flattened_workers_mid"], | ||
"flattenedColumn": { | ||
"name": "worker_list", | ||
"datatype": "array<string>" | ||
}, | ||
"columns": { | ||
"kept": [ | ||
"id", | ||
"index" | ||
], | ||
"new": "name" | ||
}, | ||
"type": "FlattenLens" | ||
}, | ||
{ | ||
"name": ["lenses","flattened_managers"], | ||
"baseRelation": ["lenses", "company_data_arrays"], | ||
"flattenedColumn": { | ||
"name": "managers", | ||
"datatype": "array<string>" | ||
}, | ||
"columns": { | ||
"kept": [ | ||
"id" | ||
], | ||
"new": "manager", | ||
"position": "index" | ||
}, | ||
"type": "FlattenLens" | ||
}, | ||
{ | ||
"name": ["lenses","managers"], | ||
"baseRelation": ["lenses","flattened_managers"], | ||
"columns": { | ||
"added": [ | ||
{ | ||
"name": "firstname", | ||
"expression": "CAST(GET_JSON_OBJECT(manager, '$.firstName') AS string)" | ||
}, | ||
{ | ||
"name": "lastname", | ||
"expression": "CAST(GET_JSON_OBJECT(manager, '$.lastName') AS string)" | ||
}, | ||
{ | ||
"name": "age", | ||
"expression": "CAST(GET_JSON_OBJECT(manager, '$.age') AS integer)" | ||
} | ||
], | ||
"hidden": [ | ||
"manager" | ||
] | ||
}, | ||
"type": "BasicLens" | ||
} | ||
] | ||
} | ||
|
||
|
4 changes: 4 additions & 0 deletions
4
...est/lightweight-tests/src/test/resources/nested/{lowername}/nested-{lowername}.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
jdbc.url = {url} | ||
jdbc.user = {user} | ||
jdbc.password = {password} | ||
jdbc.driver = {classname} |