public void testNoDomain() { testURI("app://calendar/event",true); } public void testLong() {
public void testURI(String uri, boolean ok) { IRI ref = factory.create(uri); if (ok && ref.hasViolation(false)) { Violation v = ref.violations(false).next(); fail("<" + uri + "> is expected to be a URI, but: "+v.getLongMessage()); } assertEquals("<" + uri + "> is"+(ok?" ":" not ")+"a URI", ok, !ref.hasViolation(false)); } public void testNoDomain() {
private TestPackage() { super("ARP") ; addTest( org.apache.jena.rdfxml.xmlinput.TestARPMain.suite()); addTest( org.apache.jena.rdfxml.xmlinput.MoreTests.suite()); addTest( org.apache.jena.rdfxml.xmlinput.states.TestARPStates.suite()); addTest( org.apache.jena.rdfxml.xmlinput.URITests.suite()); addTest( org.apache.jena.rdfxml.xmlinput.TaintingTests.suite()); addTest( org.apache.jena.rdfxml.xmlinput.SAX2RDFTest.suite()); addTest( org.apache.jena.rdfxml.xmlinput.StAX2ModelTest.suite()); }
static public Test suite() { TestSuite suite = new TestSuite("URIs"); suite.addTest(new URITests("testNoDomain")); suite.addTest(new URITests("testLong")); suite.addTest(new URITests("testBadScheme")); suite.addTest(new URITests("testJustScheme")); // TODO: not for 2.3. are these tests right? // suite.addTest(new URITests("testBadHost")); // suite.addTest(new URITests("testBadPort")); // suite.addTest(new URITests("testBadUserHost")); suite.addTest(new URITests("testHostPortNoSlashWithFragment")); suite.addTest(new URITests("testHostNoSlashWithFragment")); suite.addTest(new URITests("testBadAuthority")); suite.addTest(new URITests("testTwoHashes")); suite.addTest(new URITests("testTwoHashes2")); return suite; }
public void testURI(String uri, boolean ok) { IRI ref = factory.create(uri); if (ok && ref.hasViolation(false)) { Violation v = ref.violations(false).next(); fail("<" + uri + "> is expected to be a URI, but: "+v.getLongMessage()); } assertEquals("<" + uri + "> is"+(ok?" ":" not ")+"a URI", ok, !ref.hasViolation(false)); } public void testNoDomain() {
private TestPackage() { super("ARP") ; addTest( org.apache.jena.rdfxml.xmlinput.TestARPMain.suite()); addTest( org.apache.jena.rdfxml.xmlinput.MoreTests.suite()); addTest( org.apache.jena.rdfxml.xmlinput.states.TestARPStates.suite()); addTest( org.apache.jena.rdfxml.xmlinput.URITests.suite()); addTest( org.apache.jena.rdfxml.xmlinput.TaintingTests.suite()); addTest( org.apache.jena.rdfxml.xmlinput.SAX2RDFTest.suite()); addTest( org.apache.jena.rdfxml.xmlinput.StAX2ModelTest.suite()); }
static public Test suite() { TestSuite suite = new TestSuite("URIs"); suite.addTest(new URITests("testNoDomain")); suite.addTest(new URITests("testLong")); suite.addTest(new URITests("testBadScheme")); suite.addTest(new URITests("testJustScheme")); // TODO: not for 2.3. are these tests right? // suite.addTest(new URITests("testBadHost")); // suite.addTest(new URITests("testBadPort")); // suite.addTest(new URITests("testBadUserHost")); suite.addTest(new URITests("testHostPortNoSlashWithFragment")); suite.addTest(new URITests("testHostNoSlashWithFragment")); suite.addTest(new URITests("testBadAuthority")); suite.addTest(new URITests("testTwoHashes")); suite.addTest(new URITests("testTwoHashes2")); return suite; }
public void testHostNoSlashWithFragment() { testURI("http://www.w#3.org/demo.mp3",true); } public void testHostPortNoSlashWithFragment() {
public void testJustScheme() { testURI("http:",false); } public void testBadPort() {
public void testBadPort() { testURI("http://www.w3.org:1+4/demo.mp3",false); } public void testBadUserHost() {
public void testBadAuthority() { testURI("http://jjc^3.org/demo.mp3",false); } public void testTwoHashes() {
public void testBadUserHost() { testURI("http://jjc@www.w@3.org/demo.mp3",false); } public void testBadAuthority() {
public void testTwoHashes() { testURI("ht#tp://jjc3.org/demo.mp3#frag",false); } public void testTwoHashes2() {
public void testNoDomain() { testURI("app://calendar/event",true); } public void testLong() {
public void testHostPortNoSlashWithFragment() { testURI("http://www.w3.org:1#4/demo.mp3",true); }
public void testBadUserHost() { testURI("http://jjc@www.w@3.org/demo.mp3",false); } public void testBadAuthority() {
public void testBadScheme() { testURI("ht^tp://www.w3.org/demo.mp3",false); }
public void testLong() { testURI("http://46229EFFE16A9BD60B9F1BE88B2DB047ADDED785/demo.mp3",true); }
public void testBadScheme() { testURI("ht^tp://www.w3.org/demo.mp3",false); }
public void testBadHost() { testURI("http://www.w+3.org/demo.mp3",false); }