Skip to content

Commit

Permalink
Added new test types to scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
DRovara committed Jun 29, 2023
1 parent 0c20419 commit 0bf5631
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 0 deletions.
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();
}

}
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();
}

}
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"
}
]
}


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}

0 comments on commit 0bf5631

Please sign in to comment.