Permalink
Browse files

Improved unit test

  • Loading branch information...
1 parent 9f5a55a commit 64cfac837e4f773ec7d3c9b00255d920e1e9f7ad ajs6f committed Nov 20, 2013
Showing with 17 additions and 1 deletion.
  1. +17 −1 fcrepo-kernel/src/test/java/org/fcrepo/kernel/utils/iterators/RdfStreamTest.java
@@ -26,6 +26,7 @@
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
@@ -34,15 +35,16 @@
import java.util.Map;
import javax.jcr.RepositoryException;
+import javax.jcr.Session;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
+import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.rdf.model.Model;
@@ -300,4 +302,18 @@ public void testHashCode() {
testStreamToCompare.namespace(prefix1, uri1);
assertNotEquals(testStream.hashCode(), testStreamToCompare.hashCode());
}
+
+ @Test
+ public void testContext() {
+ final Session mockSession = mock(Session.class);
+ assertEquals("Didn't retrieve the session we stored!", mockSession,
+ testStream.session(mockSession).session());
+ }
+
+ @Test
+ public void testTopic() {
+ final Node mockNode = mock(Node.class);
+ assertEquals("Didn't retrieve the session we stored!", mockNode,
+ testStream.topic(mockNode).topic());
+ }
}

0 comments on commit 64cfac8

Please sign in to comment.