public class TestUtil extends Object
| Constructor and Description |
|---|
TestUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
baseURIFixture()
Return a base URI that is guaranteed not to resolve.
|
static boolean |
isOnlyValue(com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Property predicate,
com.hp.hpl.jena.rdf.model.RDFNode object)
Test that the given resource/property has the given object value and ONLY the given object value.
|
static com.hp.hpl.jena.rdf.model.Model |
modelFixture(String content)
Create a
Model as a text fixture |
static com.hp.hpl.jena.rdf.model.Property |
propertyFixture(com.hp.hpl.jena.rdf.model.Model m,
String uri)
Return a property with the given URI.
|
static com.hp.hpl.jena.rdf.model.Resource |
resourceFixture(com.hp.hpl.jena.rdf.model.Model m,
String uri)
Return a resource with the given URI.
|
static com.hp.hpl.jena.rdf.model.Resource |
resourceFixture(String src)
Return a resource which is the (assumed sole) root subject of the model given by the turtle source.
|
static <E> void |
testArray(Collection<E> actual,
E[] expected) |
static <E> void |
testArray(E[] actual,
E[] expected) |
static <E> void |
testArray(Iterator<E> actual,
E[] expected) |
static void |
testResourcesMatch(com.hp.hpl.jena.rdf.model.Resource expected,
com.hp.hpl.jena.rdf.model.Resource actual,
com.hp.hpl.jena.rdf.model.Property... omit)
Compare the properties of two resources, omitting any of the list of blocked properties.
|
public static <E> void testArray(E[] actual,
E[] expected)
public static <E> void testArray(Collection<E> actual, E[] expected)
public static <E> void testArray(Iterator<E> actual, E[] expected)
public static com.hp.hpl.jena.rdf.model.Model modelFixture(String content)
Model as a text fixturecontent - The model content in Turtle. Common prefixes may be assumed.public static com.hp.hpl.jena.rdf.model.Resource resourceFixture(com.hp.hpl.jena.rdf.model.Model m,
String uri)
m - Optional model. If null, the resource will be created using the ResourceFactoryuri - Resource URI. If the URI starts with http:, it will be left intact otherwise
it is assumed relative to the baseURIFixture()public static com.hp.hpl.jena.rdf.model.Resource resourceFixture(String src)
public static com.hp.hpl.jena.rdf.model.Property propertyFixture(com.hp.hpl.jena.rdf.model.Model m,
String uri)
m - Optional model. If null, the property will be created using the ResourceFactoryuri - Resource URI. If the URI starts with http:, it will be left intact otherwise
it is assumed relative to the baseURIFixture()public static String baseURIFixture()
public static boolean isOnlyValue(com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Property predicate,
com.hp.hpl.jena.rdf.model.RDFNode object)
subject - subject resourcepredicate - property to testobject - the expected value or null to not test the value, just that there is onepublic static void testResourcesMatch(com.hp.hpl.jena.rdf.model.Resource expected,
com.hp.hpl.jena.rdf.model.Resource actual,
com.hp.hpl.jena.rdf.model.Property... omit)
Copyright © 2015. All rights reserved.