We're updating the issue view to help you get more done. 

RepositoryConnectionTest doesn't test the behavior of RepositoryConnection.getNamespace(String)

Description

The following method in the Workbench application was questioned during a code review as having checking more appropriate to test code:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 private String getNamespace(String prefix) throws RepositoryException { RepositoryConnection con = repository.getConnection(); try { String namespace = con.getNamespace(prefix); if (namespace == null) { for (Namespace n : Iterations.asList(con.getNamespaces())) { if (prefix.equals(n.getPrefix())) { namespace = n.getName(); } } if (namespace != null) { LOGGER.error("Namespace could not be found, but it does exist"); } } return namespace; } finally { con.close(); } }

I looked, and this correlation with getNamespaces is never checked in the relevant test code. Indeed, getNamespace(String) has no tests checking it at all.

Environment

None

Status

Assignee

Dale W. Visser

Reporter

Dale W. Visser

Labels

None

Components

Fix versions

Affects versions

2.7.0-beta2

Priority

Minor