001: /*
002: (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003: All rights reserved - see end of file.
004: $Id: NewRegressionContainers.java,v 1.4 2008/01/02 12:07:04 andy_seaborne Exp $
005: */
006:
007: package com.hp.hpl.jena.regression;
008:
009: import junit.framework.*;
010:
011: import com.hp.hpl.jena.rdf.model.*;
012: import com.hp.hpl.jena.rdf.model.test.ModelTestBase;
013: import com.hp.hpl.jena.vocabulary.RDF;
014:
015: public class NewRegressionContainers extends ModelTestBase {
016: public NewRegressionContainers(String name) {
017: super (name);
018: }
019:
020: public static TestSuite suite() {
021: return new TestSuite(NewRegressionContainers.class);
022: }
023:
024: protected Model getModel() {
025: return ModelFactory.createDefaultModel();
026: }
027:
028: protected Model m;
029:
030: public void setUp() {
031: m = getModel();
032: }
033:
034: public void tearDown() {
035: m = null;
036: }
037:
038: public void testCreateAnonBag() {
039: Bag tv = m.createBag();
040: assertTrue(tv.isAnon());
041: assertTrue(m.contains(tv, RDF.type, RDF.Bag));
042: }
043:
044: public void testCreateNamedBag() {
045: String uri = "http://aldabaran/foo";
046: Bag tv = m.createBag(uri);
047: assertEquals(uri, tv.getURI());
048: assertTrue(m.contains(tv, RDF.type, RDF.Bag));
049: }
050:
051: public void testCreateAnonAlt() {
052: Alt tv = m.createAlt();
053: assertTrue(tv.isAnon());
054: assertTrue(m.contains(tv, RDF.type, RDF.Alt));
055: }
056:
057: public void testCreateNamedAlt() {
058: String uri = "http://aldabaran/sirius";
059: Alt tv = m.createAlt(uri);
060: assertEquals(uri, tv.getURI());
061: assertTrue(m.contains(tv, RDF.type, RDF.Alt));
062: }
063:
064: public void testCreateAnonSeq() {
065: Seq tv = m.createSeq();
066: assertTrue(tv.isAnon());
067: assertTrue(m.contains(tv, RDF.type, RDF.Seq));
068: }
069:
070: public void testCreateNamedSeq() {
071: String uri = "http://aldabaran/andromeda";
072: Seq tv = m.createSeq(uri);
073: assertEquals(uri, tv.getURI());
074: assertTrue(m.contains(tv, RDF.type, RDF.Seq));
075: }
076: }
077:
078: /*
079: * (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
080: * All rights reserved.
081: *
082: * Redistribution and use in source and binary forms, with or without
083: * modification, are permitted provided that the following conditions
084: * are met:
085: * 1. Redistributions of source code must retain the above copyright
086: * notice, this list of conditions and the following disclaimer.
087: * 2. Redistributions in binary form must reproduce the above copyright
088: * notice, this list of conditions and the following disclaimer in the
089: * documentation and/or other materials provided with the distribution.
090: * 3. The name of the author may not be used to endorse or promote products
091: * derived from this software without specific prior written permission.
092: *
093: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
094: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
095: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
096: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
097: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
098: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
099: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
100: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
101: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
102: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
103: */
|