/* First test space identifiers. */
// Null identifier (invalid).
try {
shouldBeNull = factory.createOntologySpace(null, SpaceType.CORE, new BlankOntologySource());
fail("Expected IllegalArgumentException not thrown despite null scope identifier.");
} catch (IllegalArgumentException ex) {}
assertNull(shouldBeNull);
// More than one slash in identifier (invalid).
try {
shouldBeNull = factory.createOntologySpace("Sc0/p3", SpaceType.CORE, new BlankOntologySource());
fail("Expected IllegalArgumentException not thrown despite null scope identifier.");
} catch (IllegalArgumentException ex) {}
assertNull(shouldBeNull);
/* Now test namespaces. */
// Null namespace (invalid).
factory.setDefaultNamespace(null);
try {
shouldBeNull = factory.createOntologySpace("Sc0p3", SpaceType.CORE, new BlankOntologySource());
fail("Expected IllegalArgumentException not thrown despite null OntoNet namespace.");
} catch (IllegalArgumentException ex) {}
assertNull(shouldBeNull);
// Namespace with query (invalid).
factory.setDefaultNamespace(IRI.create("http://stanbol.apache.org/ontology/?query=true"));
try {
shouldBeNull = factory.createOntologySpace("Sc0p3", SpaceType.CORE, new BlankOntologySource());
fail("Expected IllegalArgumentException not thrown despite query in OntoNet namespace.");
} catch (IllegalArgumentException ex) {}
assertNull(shouldBeNull);
// Namespace with fragment (invalid).
factory.setDefaultNamespace(IRI.create("http://stanbol.apache.org/ontology#fragment"));
try {
shouldBeNull = factory.createOntologySpace("Sc0p3", SpaceType.CORE, new BlankOntologySource());
fail("Expected IllegalArgumentException not thrown despite fragment in OntoNet namespace.");
} catch (IllegalArgumentException ex) {}
assertNull(shouldBeNull);
// Namespace ending with hash (invalid).