001: /*
002: (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003: All rights reserved - see end of file.
004: $Id: TestBuiltinAssemblerGroup.java,v 1.7 2008/01/21 12:09:49 chris-dollin Exp $
005: */
006:
007: package com.hp.hpl.jena.assembler.test;
008:
009: import com.hp.hpl.jena.assembler.*;
010: import com.hp.hpl.jena.assembler.assemblers.*;
011: import com.hp.hpl.jena.rdf.model.Resource;
012:
013: public class TestBuiltinAssemblerGroup extends AssemblerTestBase {
014: public TestBuiltinAssemblerGroup(String name) {
015: super (name);
016: }
017:
018: protected Class getAssemblerClass() {
019: return null;
020: }
021:
022: public void testGeneralRegistration() {
023: assertAssemblerClass(JA.DefaultModel,
024: DefaultModelAssembler.class);
025: assertAssemblerClass(JA.PrefixMapping,
026: PrefixMappingAssembler.class);
027: assertAssemblerClass(JA.FileModel, FileModelAssembler.class);
028: assertAssemblerClass(JA.OntModel, OntModelAssembler.class);
029: assertAssemblerClass(JA.OntModelSpec,
030: OntModelSpecAssembler.class);
031: assertAssemblerClass(JA.RDBModel, RDBModelAssembler.class);
032: assertAssemblerClass(JA.Connection, ConnectionAssembler.class);
033: assertAssemblerClass(JA.Content, ContentAssembler.class);
034: assertAssemblerClass(JA.ContentItem, ContentAssembler.class);
035: assertAssemblerClass(JA.ReasonerFactory,
036: ReasonerFactoryAssembler.class);
037: assertAssemblerClass(JA.InfModel, InfModelAssembler.class);
038: assertAssemblerClass(JA.MemoryModel, MemoryModelAssembler.class);
039: assertAssemblerClass(JA.RuleSet, RuleSetAssembler.class);
040: assertAssemblerClass(JA.LocationMapper,
041: LocationMapperAssembler.class);
042: assertAssemblerClass(JA.FileManager, FileManagerAssembler.class);
043: assertAssemblerClass(JA.DocumentManager,
044: DocumentManagerAssembler.class);
045: assertAssemblerClass(JA.UnionModel, UnionModelAssembler.class);
046: assertAssemblerClass(JA.ModelSource, ModelSourceAssembler.class);
047: assertAssemblerClass(JA.RDBModelSource,
048: ModelSourceAssembler.class);
049: }
050:
051: public void testVariables() {
052: assertInstanceOf(DefaultModelAssembler.class,
053: Assembler.defaultModel);
054: assertInstanceOf(PrefixMappingAssembler.class,
055: Assembler.prefixMapping);
056: assertInstanceOf(FileModelAssembler.class, Assembler.fileModel);
057: assertInstanceOf(OntModelAssembler.class, Assembler.ontModel);
058: assertInstanceOf(OntModelSpecAssembler.class,
059: Assembler.ontModelSpec);
060: assertInstanceOf(RDBModelAssembler.class, Assembler.rdbModel);
061: assertInstanceOf(ConnectionAssembler.class,
062: Assembler.connection);
063: assertInstanceOf(ContentAssembler.class, Assembler.content);
064: assertInstanceOf(ReasonerFactoryAssembler.class,
065: Assembler.reasonerFactory);
066: assertInstanceOf(InfModelAssembler.class, Assembler.infModel);
067: assertInstanceOf(MemoryModelAssembler.class,
068: Assembler.memoryModel);
069: assertInstanceOf(RuleSetAssembler.class, Assembler.ruleSet);
070: assertInstanceOf(LocationMapperAssembler.class,
071: Assembler.locationMapper);
072: assertInstanceOf(FileManagerAssembler.class,
073: Assembler.fileManager);
074: assertInstanceOf(DocumentManagerAssembler.class,
075: Assembler.documentManager);
076: assertInstanceOf(UnionModelAssembler.class,
077: Assembler.unionModel);
078: }
079:
080: private void assertAssemblerClass(Resource type, Class C) {
081: assertInstanceOf(C, Assembler.general.assemblerFor(type));
082: }
083: }
084:
085: /*
086: * (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
087: * All rights reserved.
088: *
089: * Redistribution and use in source and binary forms, with or without
090: * modification, are permitted provided that the following conditions
091: * are met:
092: * 1. Redistributions of source code must retain the above copyright
093: * notice, this list of conditions and the following disclaimer.
094: * 2. Redistributions in binary form must reproduce the above copyright
095: * notice, this list of conditions and the following disclaimer in the
096: * documentation and/or other materials provided with the distribution.
097: * 3. The name of the author may not be used to endorse or promote products
098: * derived from this software without specific prior written permission.
099: *
100: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
101: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
102: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
103: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
104: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
105: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
106: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
107: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
108: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
109: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
110: */
|