Skip to content

Commit

Permalink
Corrected expected values for tests.
Browse files Browse the repository at this point in the history
Default behaviour for returning results for x.names (with no @ tag) and
no language preference (list) is to return ALL.
  • Loading branch information
OwenR-York committed Dec 19, 2024
1 parent 12578c8 commit ccdbeac
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ public void getNamesWithoutPrefix() throws Exception {
for (RDFModelElement o : model.allContents()) {
names.addAll((Collection<String>) pGetter.invoke(o, "name", context));
}
assertEquals(new HashSet<>(Arrays.asList(SPIDERMAN_NAME, GREEN_GOBLIN_NAME)), names);
assertEquals("With no language preference and no tag, all values return", ALL_NAMES, names);;
}

@Test
public void getNamesWithPrefix() throws Exception {
RDFResource res = (RDFResource) model.getElementById(SPIDERMAN_URI);
Set<String> names = new HashSet<>((Collection<String>) pGetter.invoke(res, "foaf:name", context));
assertEquals(Collections.singleton(SPIDERMAN_NAME), names);
assertEquals("With no language preference and no tag, all values return", SPIDERMAN_NAMES, names);
}

@Test
public void getNamesWithDoubleColonPrefix() throws Exception {
RDFResource res = (RDFResource) model.getElementById(SPIDERMAN_URI);
Set<String> names = new HashSet<>((Collection<String>) pGetter.invoke(res, "foaf::name", context));
assertEquals(Collections.singleton(SPIDERMAN_NAME), names);
assertEquals("With no language preference and no tag, all values return", SPIDERMAN_NAMES, names);
}

@Test
Expand All @@ -103,7 +103,7 @@ public void getNameLiteralsWithPrefix() throws Exception {
for (RDFLiteral l : (Collection<RDFLiteral>) pGetter.invoke(res, "foaf:name_literal", context)) {
names.add((String) l.getValue());
}
assertEquals(Collections.singleton(SPIDERMAN_NAME), names);
assertEquals("With no language preference and no tag, all values return", SPIDERMAN_NAMES, names);
}

@Test
Expand Down

0 comments on commit ccdbeac

Please sign in to comment.