Skip to content

Commit

Permalink
Add JcrRdfTools unit test
Browse files Browse the repository at this point in the history
- Move unit test to correct package
  • Loading branch information
Andrew Woods committed May 18, 2014
1 parent 57490c2 commit 80e7b1b
Showing 1 changed file with 15 additions and 4 deletions.
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.fcrepo.kernel.utils;
package org.fcrepo.kernel.rdf;

import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDbyte;
import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDlong;
Expand Down Expand Up @@ -86,6 +86,7 @@
import javax.jcr.Session;
import javax.jcr.Value;
import javax.jcr.ValueFactory;
import javax.jcr.ValueFormatException;
import javax.jcr.Workspace;
import javax.jcr.nodetype.NodeDefinition;
import javax.jcr.nodetype.NodeType;
Expand All @@ -101,11 +102,11 @@
import javax.jcr.version.VersionManager;

import org.fcrepo.kernel.RdfLexicon;
import org.fcrepo.kernel.rdf.HierarchyRdfContextOptions;
import org.fcrepo.kernel.rdf.IdentifierTranslator;
import org.fcrepo.kernel.rdf.JcrRdfTools;
import org.fcrepo.kernel.rdf.impl.DefaultIdentifierTranslator;
import org.fcrepo.kernel.testutilities.TestPropertyIterator;
import org.fcrepo.kernel.utils.CacheEntry;
import org.fcrepo.kernel.utils.FixityResult;
import org.fcrepo.kernel.utils.FixityResultImpl;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
Expand Down Expand Up @@ -406,6 +407,16 @@ public final void shouldMapRdfValuesToJcrPropertyValues()

}

@Test(expected = ValueFormatException.class)
public final void shouldMapRdfValuesToJcrPropertyValuesError()
throws RepositoryException {
when(mockNode.getSession().getValueFactory()).thenReturn(mockValueFactory);

// non-uri references - error
final RDFNode n = createResource();
testObj.createValue(mockNode, n, REFERENCE);
}

@Test
public final void testJcrNodeIteratorModel() throws RepositoryException {
when(mockNodes.hasNext()).thenReturn(false);
Expand Down

0 comments on commit 80e7b1b

Please sign in to comment.