project.getPolicySource();
PolicyBuilderAccessor accessor = source.getPolicyBuilderAccessor();
try {
PolicyBuilder policyBuilder = accessor.retrievePolicyBuilder(
repositoryConnection.getUnderLyingConnection(),
repository.getDefaultProject(),
name);
if(policyBuilder!=null && isNegativeTest) {
fail("Component " + name + " exists when it should not.");
} else if(!isNegativeTest) {
assertEquals(name, policyBuilder.getName());
}
} catch(RepositoryException e) {
assertTrue("Component " + name + " does not exist when " +
"it should", !isNegativeTest);
if(!isNegativeTest) {