Skip to content

Commit

Permalink
Updates based on fcrepo modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Woods committed Sep 19, 2014
1 parent 8cdc497 commit ba0eeee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Expand Up @@ -34,6 +34,7 @@
import org.fcrepo.http.commons.session.SessionFactory;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.exception.RepositoryRuntimeException;
import org.fcrepo.kernel.impl.rdf.impl.PropertiesRdfContext;
import org.fcrepo.kernel.rdf.IdentifierTranslator;
import org.fcrepo.kernel.impl.rdf.impl.DefaultIdentifierTranslator;
import org.fcrepo.kernel.services.NodeService;
Expand Down Expand Up @@ -185,7 +186,7 @@ public final EvaluationResult findAttribute(final URI attributeType,
// Get the properties of the resource
Model properties;
try {
properties = resource.getTriples(idTranslator).asModel();
properties = resource.getTriples(idTranslator, PropertiesRdfContext.class).asModel();

} catch (final RepositoryRuntimeException e) {
LOGGER.debug("Cannot retrieve any properties for [{}]: {}", resourceId, e);
Expand Down
Expand Up @@ -23,6 +23,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
Expand All @@ -36,6 +37,7 @@
import org.fcrepo.http.commons.session.SessionFactory;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.exception.RepositoryRuntimeException;
import org.fcrepo.kernel.impl.rdf.impl.PropertiesRdfContext;
import org.fcrepo.kernel.rdf.IdentifierTranslator;
import org.fcrepo.kernel.services.NodeService;
import org.fcrepo.kernel.utils.iterators.RdfStream;
Expand Down Expand Up @@ -163,7 +165,8 @@ public void testFindAttribute() throws RepositoryException {
final String resourceId = "/{ns}path/{ns}to/{ns}resource";

when(mockNodeService.getObject(mockSession, resourceId)).thenReturn(mockFedoraResource);
when(mockFedoraResource.getTriples(any(IdentifierTranslator.class))).thenReturn(mockRdfStream);
when(mockFedoraResource.getTriples(any(IdentifierTranslator.class), eq(PropertiesRdfContext.class))).thenReturn(
mockRdfStream);
when(mockIdentifierTranslator.getSubject(any(String.class))).thenReturn(mockResource);
when(mockFedoraResource.getPath()).thenReturn(resourceId);
when(mockRdfStream.asModel()).thenReturn(mockModel);
Expand Down Expand Up @@ -297,7 +300,7 @@ public void testFindAttributeBadProperties() throws RepositoryException {
final String[] actions = { "read" };

when(mockNodeService.getObject(mockSession, resourceId)).thenReturn(mockFedoraResource);
when(mockFedoraResource.getTriples(any(IdentifierTranslator.class))).thenThrow(
when(mockFedoraResource.getTriples(any(IdentifierTranslator.class), eq(PropertiesRdfContext.class))).thenThrow(
new RepositoryRuntimeException("expected"));

final EvaluationResult result = doFindAttribute(resourceId, actions);
Expand Down

0 comments on commit ba0eeee

Please sign in to comment.