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