Skip to content

Commit

Permalink
Improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lszeremeta committed Apr 20, 2021
1 parent fc69245 commit 4d293be
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/test/java/pl/edu/uwb/ii/sdfeater/OutputTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand All @@ -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:"};
Expand All @@ -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"};
Expand Down Expand Up @@ -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));
}

Expand All @@ -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:"};
Expand All @@ -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"};
Expand Down

0 comments on commit 4d293be

Please sign in to comment.