KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2   (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: TestReificationStyle.java,v 1.4 2005/02/21 12:18:50 andy_seaborne 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.rdf.model.test.*;
11
12 import junit.framework.*;
13
14 /**
15     TestReificationStyle: test that ReificationStyle sets its fields correctly from its
16     constructor arguments, and that the defined constants have the correct fields.
17
18     @author kers
19 */

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