01: /*
02: (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
03: [See end of file]
04: $Id: TestPrefixMapping.java,v 1.18 2008/01/10 19:03:29 ian_dickinson Exp $
05: */
06:
07: package com.hp.hpl.jena.shared.test;
08:
09: import com.hp.hpl.jena.assembler.JA;
10: import com.hp.hpl.jena.shared.*;
11: import com.hp.hpl.jena.shared.impl.*;
12: import com.hp.hpl.jena.vocabulary.*;
13: import junit.framework.*;
14:
15: /**
16: Tests PrefixMappingImpl by subclassing AbstractTestPrefixMapping, qv.
17: @author kers
18: */
19:
20: public class TestPrefixMapping extends AbstractTestPrefixMapping {
21: public TestPrefixMapping(String name) {
22: super (name);
23: }
24:
25: public static TestSuite suite() {
26: return new TestSuite(TestPrefixMapping.class);
27: }
28:
29: protected PrefixMapping getMapping() {
30: return new PrefixMappingImpl();
31: }
32:
33: public void testStandard() {
34: testStandard(PrefixMapping.Standard);
35: }
36:
37: public void testExtended() {
38: testExtended(PrefixMapping.Extended);
39: }
40:
41: public void testStandard(PrefixMapping st) {
42: assertEquals(RDF.getURI(), st.getNsPrefixURI("rdf"));
43: assertEquals(RDFS.getURI(), st.getNsPrefixURI("rdfs"));
44: assertEquals(DC.getURI(), st.getNsPrefixURI("dc"));
45: assertEquals(OWL.getURI(), st.getNsPrefixURI("owl"));
46: }
47:
48: public void testExtended(PrefixMapping st) {
49: testStandard(st);
50: assertEquals(DAMLVocabulary.NAMESPACE_DAML_2001_03_URI, st
51: .getNsPrefixURI("daml"));
52: assertEquals(RSS.getURI(), st.getNsPrefixURI("rss"));
53: assertEquals(VCARD.getURI(), st.getNsPrefixURI("vcard"));
54: assertEquals(JenaModelSpec.getURI(), st.getNsPrefixURI("jms"));
55: assertEquals(JA.getURI(), st.getNsPrefixURI("ja"));
56: assertEquals("http://www.example.org/", st.getNsPrefixURI("eg"));
57: }
58:
59: }
60:
61: /*
62: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
63: All rights reserved.
64:
65: Redistribution and use in source and binary forms, with or without
66: modification, are permitted provided that the following conditions
67: are met:
68:
69: 1. Redistributions of source code must retain the above copyright
70: notice, this list of conditions and the following disclaimer.
71:
72: 2. Redistributions in binary form must reproduce the above copyright
73: notice, this list of conditions and the following disclaimer in the
74: documentation and/or other materials provided with the distribution.
75:
76: 3. The name of the author may not be used to endorse or promote products
77: derived from this software without specific prior written permission.
78:
79: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
80: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
81: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
82: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
83: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
84: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
85: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
86: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
87: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
88: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
89: */
|