Skip to content

Commit

Permalink
new test
Browse files Browse the repository at this point in the history
  • Loading branch information
karolina-telicent committed Oct 28, 2024
1 parent 86f1afa commit 7045d67
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ services:
settings:
- name: "upload"
operation: authz:upload
database: "abac-db"
database: "abac-tdb2-db-test"

databases:
- name: "abac-db"
- name: "abac-tdb2-db-test"
dbtype: ABAC
dataset: "dataset-under"
dataset: "dataset-under-test"
attributes: "attribute-store.ttl"
labels-store: "target/labels-store"
labels-store: "target/labels-test"

- name: "dataset-under"
- name: "dataset-under-test"
dbtype: TDB2
location: "target/test-abac-DB"
26 changes: 7 additions & 19 deletions scg-system/src/test/java/io/telicent/TestYamlConfigParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,15 @@ void yaml_config_abac_tim() {
assertTrue(equals);
}

// TODO
/*@Test
@Test
void yaml_config_abac_labels_store() {
List<String> arguments = List.of("--conf",DIR + "/yaml/config-abac-labelsstore-path.yaml");
List<String> arguments = List.of("--conf",DIR + "/yaml/config-abac-labels-store.yaml");
server = construct(arguments.toArray(new String[0])).start();

Dataset dataset = TDB2Factory.connectDataset("target/labels-store");
// it only works if it's target/labels, so it's probably working thanks to some other test
// that's why it fails after clean
// but the data does get uploaded both to the labels and the database
Dataset dataset = TDB2Factory.connectDataset("target/labels-test");
dataset.begin(org.apache.jena.query.ReadWrite.WRITE);
try {
Model labelsStoreModel = dataset.getDefaultModel();
Expand All @@ -252,29 +254,15 @@ void yaml_config_abac_labels_store() {
dataset.end();
}

dataset.begin(org.apache.jena.query.ReadWrite.READ);
try {
System.out.println("======= Default Graph =======");
Model defaultModel = dataset.getDefaultModel();
defaultModel.write(System.out, "TTL"); // Print the default graph in Turtle format
} catch (Exception e) {
log.error(e.getMessage());
} finally {
dataset.end();
}
RowSetRewindable actualResponseRSR;
String URL = "http://localhost:" + server.getPort() + serviceName;
String uploadURL = URL + "/upload";
load(uploadURL, DIR + "/yaml/data-no-labels.trig");
actualResponseRSR = query(server, "u1");
actualResponseRSR = query(server, "u2");
actualResponseRSR = query(server, "u3");
actualResponseRSR = query(server, "u1");
expectedRSR.reset();
boolean equals = ResultSetCompare.isomorphic(expectedRSR, actualResponseRSR);
assertTrue(equals);
}*/
}

@Test
void yaml_config_abac_attributes_store() {
Expand Down

0 comments on commit 7045d67

Please # to comment.