KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > shared > test > TestPrefixMapping


1 /*
2   (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: TestPrefixMapping.java,v 1.13 2005/04/10 12:45:52 chris-dollin Exp $
5 */

6
7 package com.hp.hpl.jena.shared.test;
8
9 import com.hp.hpl.jena.shared.*;
10 import com.hp.hpl.jena.shared.impl.*;
11 import com.hp.hpl.jena.vocabulary.*;
12 import junit.framework.*;
13
14 /**
15     Tests PrefixMappingImpl by subclassing AbstractTestPrefixMapping, qv.
16     @author kers
17 */

18
19 public class TestPrefixMapping extends AbstractTestPrefixMapping
20     {
21     public TestPrefixMapping( String JavaDoc name )
22         { super( name ); }
23         
24     public static TestSuite suite()
25         { return new TestSuite( TestPrefixMapping.class ); }
26     
27     protected PrefixMapping getMapping()
28         { return new PrefixMappingImpl(); }
29         
30     public void testStandard()
31         { testStandard( PrefixMapping.Standard ); }
32     
33     public void testExtended()
34         { testExtended( PrefixMapping.Extended ); }
35     
36     public void testStandard( PrefixMapping st )
37         {
38         assertEquals( RDF.getURI(), st.getNsPrefixURI( "rdf" ) );
39         assertEquals( RDFS.getURI(), st.getNsPrefixURI( "rdfs" ) );
40         assertEquals( DC.getURI(), st.getNsPrefixURI( "dc" ) );
41         assertEquals( OWL.getURI(), st.getNsPrefixURI( "owl" ) );
42         assertEquals( DAMLVocabulary.NAMESPACE_DAML_2001_03_URI, st.getNsPrefixURI( "daml" ) );
43         }
44     
45     public void testExtended( PrefixMapping st )
46         {
47         testStandard( st );
48         assertEquals( RSS.getURI(), st.getNsPrefixURI( "rss" ) );
49         assertEquals( VCARD.getURI(), st.getNsPrefixURI( "vcard" ) );
50         assertEquals( JenaModelSpec.getURI(), st.getNsPrefixURI( "jms" ) );
51         }
52         
53     }
54
55
56 /*
57     (c) Copyright 2004, 2005 Hewlett-Packard Development Company, LP
58     All rights reserved.
59
60     Redistribution and use in source and binary forms, with or without
61     modification, are permitted provided that the following conditions
62     are met:
63
64     1. Redistributions of source code must retain the above copyright
65        notice, this list of conditions and the following disclaimer.
66
67     2. Redistributions in binary form must reproduce the above copyright
68        notice, this list of conditions and the following disclaimer in the
69        documentation and/or other materials provided with the distribution.
70
71     3. The name of the author may not be used to endorse or promote products
72        derived from this software without specific prior written permission.
73
74     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
75     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
76     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
77     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
78     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
79     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
80     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
81     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
82     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
83     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
84 */
Popular Tags