From 4d293be0781f4b51a7d0746f5741444e4c029cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Szeremeta?= Date: Tue, 20 Apr 2021 18:28:33 +0200 Subject: [PATCH] Improve tests --- .../java/pl/edu/uwb/ii/sdfeater/OutputTest.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/test/java/pl/edu/uwb/ii/sdfeater/OutputTest.java b/src/test/java/pl/edu/uwb/ii/sdfeater/OutputTest.java index 4fb1ec6..455373a 100644 --- a/src/test/java/pl/edu/uwb/ii/sdfeater/OutputTest.java +++ b/src/test/java/pl/edu/uwb/ii/sdfeater/OutputTest.java @@ -615,14 +615,13 @@ void rdfaContainsAllMoleculeData() { } /** - * Test if RDFa output have IRI subject + * Test if RDFa output have IRI subject with id */ @Test void rdfaHaveIRISubject() { - initializeJenaModel(); file.parse(molecule, SDFEater.Format.rdfa, SDFEater.Subject.iri); String out = outputStreamCaptor.toString(); - String[] required = {"http", "example.com", "molecule", "#", "entity"}; + String[] required = {"http", "example.com", "molecule", "#", "entity", " id='"}; assertTrue(stringContainsAllValues(out, required)); } @@ -631,7 +630,6 @@ void rdfaHaveIRISubject() { */ @Test void rdfaHaveUUIDSubject() { - initializeJenaModel(); file.parse(molecule, SDFEater.Format.rdfa, SDFEater.Subject.uuid); String out = outputStreamCaptor.toString(); String[] required = {"urn:uuid:"}; @@ -643,7 +641,6 @@ void rdfaHaveUUIDSubject() { */ @Test void rdfaHaveBNodeSubject() { - initializeJenaModel(); file.parse(molecule, SDFEater.Format.rdfa, SDFEater.Subject.bnode); String out = outputStreamCaptor.toString(); String[] required = {"_:b"}; @@ -684,14 +681,13 @@ void microdataContainsAllMoleculeData() { } /** - * Test if Microdata output have IRI subject + * Test if Microdata output have IRI subject with id */ @Test void microdataIRISubject() { - initializeJenaModel(); file.parse(molecule, SDFEater.Format.microdata, SDFEater.Subject.iri); String out = outputStreamCaptor.toString(); - String[] required = {"http", "example.com", "molecule", "#", "entity"}; + String[] required = {"http", "example.com", "molecule", "#", "entity", " id='"}; assertTrue(stringContainsAllValues(out, required)); } @@ -700,7 +696,6 @@ void microdataIRISubject() { */ @Test void microdataHaveUUIDSubject() { - initializeJenaModel(); file.parse(molecule, SDFEater.Format.microdata, SDFEater.Subject.uuid); String out = outputStreamCaptor.toString(); String[] required = {"urn:uuid:"}; @@ -712,7 +707,6 @@ void microdataHaveUUIDSubject() { */ @Test void microdataHaveBNodeSubject() { - initializeJenaModel(); file.parse(molecule, SDFEater.Format.microdata, SDFEater.Subject.bnode); String out = outputStreamCaptor.toString(); String[] required = {"_:b"};