001: package com.hp.hpl.jena.rdf.model.test;
002:
003: /*
004: (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
005: [See end of file]
006: $Id: TestReifiedStatements.java,v 1.17 2008/01/02 12:04:41 andy_seaborne Exp $
007: */
008:
009: import com.hp.hpl.jena.rdf.model.*;
010: import com.hp.hpl.jena.shared.ReificationStyle;
011:
012: import junit.framework.*;
013:
014: /**
015: test the properties required of ReifiedStatement objects.
016: @author kers
017: */
018: public class TestReifiedStatements extends ModelTestBase {
019: public TestReifiedStatements(String name) {
020: super (name);
021: }
022:
023: public static TestSuite suite() {
024: TestSuite result = new TestSuite();
025: result.addTest(new TestSuite(TestStandard.class));
026: result.addTest(new TestSuite(TestConvenient.class));
027: result.addTest(new TestSuite(TestMinimal.class));
028: return result;
029: }
030:
031: public Model getModel() {
032: return ModelFactory.createDefaultModel();
033: }
034:
035: public static class TestStandard extends
036: AbstractTestReifiedStatements {
037: public TestStandard(String name) {
038: super (name);
039: }
040:
041: public static final ReificationStyle style = ModelFactory.Standard;
042:
043: public Model getModel() {
044: return ModelFactory.createDefaultModel(style);
045: }
046:
047: public void testStyle() {
048: assertEquals(style, getModel().getReificationStyle());
049: }
050: }
051:
052: public static class TestConvenient extends
053: AbstractTestReifiedStatements {
054: public TestConvenient(String name) {
055: super (name);
056: }
057:
058: public static final ReificationStyle style = ModelFactory.Convenient;
059:
060: public Model getModel() {
061: return ModelFactory.createDefaultModel(style);
062: }
063:
064: public void testStyle() {
065: assertEquals(style, getModel().getReificationStyle());
066: }
067: }
068:
069: public static class TestMinimal extends
070: AbstractTestReifiedStatements {
071: public TestMinimal(String name) {
072: super (name);
073: }
074:
075: public static final ReificationStyle style = ModelFactory.Minimal;
076:
077: public Model getModel() {
078: return ModelFactory.createDefaultModel(style);
079: }
080:
081: public void testStyle() {
082: assertEquals(style, getModel().getReificationStyle());
083: }
084: }
085: }
086:
087: /*
088: (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
089: All rights reserved.
090:
091: Redistribution and use in source and binary forms, with or without
092: modification, are permitted provided that the following conditions
093: are met:
094:
095: 1. Redistributions of source code must retain the above copyright
096: notice, this list of conditions and the following disclaimer.
097:
098: 2. Redistributions in binary form must reproduce the above copyright
099: notice, this list of conditions and the following disclaimer in the
100: documentation and/or other materials provided with the distribution.
101:
102: 3. The name of the author may not be used to endorse or promote products
103: derived from this software without specific prior written permission.
104:
105: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
106: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
107: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
108: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
109: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
110: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
111: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
112: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
113: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
114: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
115: */
|