Source Code Cross Referenced for TestModelFactory.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » rdf » model » test » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.rdf.model.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:          (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003:          [See end of file]
004:          $Id: TestModelFactory.java,v 1.36 2008/01/02 12:04:41 andy_seaborne Exp $
005:         */
006:
007:        package com.hp.hpl.jena.rdf.model.test;
008:
009:        import com.hp.hpl.jena.rdf.model.*;
010:        import com.hp.hpl.jena.rdf.model.impl.*;
011:        import com.hp.hpl.jena.ontology.*;
012:        import com.hp.hpl.jena.reasoner.InfGraph;
013:        import com.hp.hpl.jena.reasoner.Reasoner;
014:        import com.hp.hpl.jena.reasoner.rulesys.*;
015:        import com.hp.hpl.jena.shared.*;
016:        import com.hp.hpl.jena.graph.compose.Union;
017:
018:        import junit.framework.*;
019:
020:        /**
021:         Tests the ModelFactory code. Very skeletal at the moment. It's really
022:         testing that the methods actually exists, but it doesn't check much in
023:         the way of behaviour.
024:        
025:         @author kers
026:         */
027:
028:        public class TestModelFactory extends ModelTestBase {
029:            public static final Resource DAMLLangResource = resource(ProfileRegistry.DAML_LANG);
030:
031:            public TestModelFactory(String name) {
032:                super (name);
033:            }
034:
035:            public static TestSuite suite() {
036:                return new TestSuite(TestModelFactory.class);
037:            }
038:
039:            /**
040:                Test that ModelFactory.createDefaultModel() exists. [Should check that the Model
041:                is truly a "default" model.]
042:             */
043:            public void testCreateDefaultModel() {
044:                ModelFactory.createDefaultModel().close();
045:            }
046:
047:            public void testGetDefaultPrefixMapping() {
048:                assertSame(ModelCom.getDefaultModelPrefixes(), ModelFactory
049:                        .getDefaultModelPrefixes());
050:            }
051:
052:            public void testSetDefaultPrefixMapping() {
053:                PrefixMapping original = ModelCom.getDefaultModelPrefixes();
054:                PrefixMapping pm = PrefixMapping.Factory.create();
055:                ModelFactory.setDefaultModelPrefixes(pm);
056:                assertSame(pm, ModelCom.getDefaultModelPrefixes());
057:                assertSame(pm, ModelFactory.getDefaultModelPrefixes());
058:                ModelCom.setDefaultModelPrefixes(original);
059:            }
060:
061:            public void testCreateInfModel() {
062:                String rule = "-> (eg:r eg:p eg:v).";
063:                Reasoner r = new GenericRuleReasoner(Rule.parseRules(rule));
064:                InfGraph ig = r.bind(ModelFactory.createDefaultModel()
065:                        .getGraph());
066:                InfModel im = ModelFactory.createInfModel(ig);
067:                assertInstanceOf(InfModel.class, im);
068:                assertEquals(1, im.size());
069:            }
070:
071:            /**
072:                 test that a union model is a model over the union of the two underlying
073:                 graphs. (We don't check that Union works - that's done in the Union
074:                 tests, we hope.)
075:             */
076:            public void testCreateUnion() {
077:                Model m1 = ModelFactory.createDefaultModel();
078:                Model m2 = ModelFactory.createDefaultModel();
079:                Model m = ModelFactory.createUnion(m1, m2);
080:                assertInstanceOf(Union.class, m.getGraph());
081:                assertSame(m1.getGraph(), ((Union) m.getGraph()).getL());
082:                assertSame(m2.getGraph(), ((Union) m.getGraph()).getR());
083:            }
084:
085:            public void testAssembleModelFromModel() {
086:                // TODO Model ModelFactory.assembleModelFrom( Model singleRoot )
087:            }
088:
089:            public void testFindAssemblerRoots() {
090:                // TODO Set ModelFactory.findAssemblerRoots( Model m )
091:            }
092:
093:            public void testAssmbleModelFromRoot() {
094:                // TODO Model assembleModelFrom( Resource root )
095:            }
096:        }
097:
098:        /*
099:         (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
100:         All rights reserved.
101:
102:         Redistribution and use in source and binary forms, with or without
103:         modification, are permitted provided that the following conditions
104:         are met:
105:
106:         1. Redistributions of source code must retain the above copyright
107:         notice, this list of conditions and the following disclaimer.
108:
109:         2. Redistributions in binary form must reproduce the above copyright
110:         notice, this list of conditions and the following disclaimer in the
111:         documentation and/or other materials provided with the distribution.
112:
113:         3. The name of the author may not be used to endorse or promote products
114:         derived from this software without specific prior written permission.
115:
116:         THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
117:         IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
118:         OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
119:         IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
120:         INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
121:         NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
122:         DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
123:         THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
124:         (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
125:         THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
126:         */
w__ww__.__j___av__a__2__s_._c_o__m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.