| java.lang.Object com.hp.hpl.jena.reasoner.test.TestUtil
TestUtil | public class TestUtil (Code) | | Collection of utilities to assist with unit testing.
author: Dave Reynolds version: $Revision: 1.19 $ on $Date: 2008/01/02 12:08:31 $ |
Method Summary | |
public static void | assertIteratorLength(Iterator it, int expectedLength) Check the length of an iterator. | public static void | assertIteratorValues(TestCase testCase, Iterator it, Object[] vals) | public static void | assertIteratorValues(TestCase testCase, Iterator it, Object[] vals, int countAnon) Helper method to test an iterator against a list of objects - order independent, and
can optionally check the count of anonymous resources. | protected static boolean | isAnonValue(Object n) For the purposes of counting, a value is anonymous if (a) it is an anonymous resource,
or (b) it is a statement with a bNode subject or (c) it is a statement with a bNode
object. | public static String | normalizeWhiteSpace(String src) Replace all blocks of white space by a single space character, just
used for creating test cases. |
assertIteratorLength | public static void assertIteratorLength(Iterator it, int expectedLength)(Code) | | Check the length of an iterator.
|
assertIteratorValues | public static void assertIteratorValues(TestCase testCase, Iterator it, Object[] vals)(Code) | | Helper method to test an iterator against a list of objects - order independent
Parameters: testCase - The JUnit test case that is invoking this helper Parameters: it - The iterator to test Parameters: vals - The expected values of the iterator |
assertIteratorValues | public static void assertIteratorValues(TestCase testCase, Iterator it, Object[] vals, int countAnon)(Code) | | Helper method to test an iterator against a list of objects - order independent, and
can optionally check the count of anonymous resources. This allows us to test a
iterator of resource values which includes both URI nodes and bNodes.
Parameters: testCase - The JUnit test case that is invoking this helper Parameters: it - The iterator to test Parameters: vals - The expected values of the iterator Parameters: anonCount - If non zero, count the number of anonymous resources returned by it ,and don't check these resources against the expected vals . |
isAnonValue | protected static boolean isAnonValue(Object n)(Code) | | For the purposes of counting, a value is anonymous if (a) it is an anonymous resource,
or (b) it is a statement with a bNode subject or (c) it is a statement with a bNode
object. This is because we cannot check bNode identity against fixed expected data values.
Parameters: n - A value True if n is anonymous |
normalizeWhiteSpace | public static String normalizeWhiteSpace(String src)(Code) | | Replace all blocks of white space by a single space character, just
used for creating test cases.
Parameters: src - the original string normalized version of src |
|
|