diff --git a/scg-system/src/test/files/yaml/config-abac-labelsstore-path.yaml b/scg-system/src/test/files/yaml/config-abac-labels-store.yaml similarity index 69% rename from scg-system/src/test/files/yaml/config-abac-labelsstore-path.yaml rename to scg-system/src/test/files/yaml/config-abac-labels-store.yaml index daeffc7..2eb6378 100644 --- a/scg-system/src/test/files/yaml/config-abac-labelsstore-path.yaml +++ b/scg-system/src/test/files/yaml/config-abac-labels-store.yaml @@ -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" \ No newline at end of file diff --git a/scg-system/src/test/java/io/telicent/TestYamlConfigParser.java b/scg-system/src/test/java/io/telicent/TestYamlConfigParser.java index 0e36b5d..b50406d 100644 --- a/scg-system/src/test/java/io/telicent/TestYamlConfigParser.java +++ b/scg-system/src/test/java/io/telicent/TestYamlConfigParser.java @@ -233,13 +233,15 @@ void yaml_config_abac_tim() { assertTrue(equals); } - // TODO - /*@Test + @Test void yaml_config_abac_labels_store() { - List arguments = List.of("--conf",DIR + "/yaml/config-abac-labelsstore-path.yaml"); + List 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(); @@ -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() {