Source Code Cross Referenced for TestCase.java in  » Rule-Engine » Mandarax » org » mandarax » kernel » validation » 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 » Rule Engine » Mandarax » org.mandarax.kernel.validation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 1999-2004 <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</a>
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2 of the License, or (at your option) any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */
018:
019:        package org.mandarax.kernel.validation;
020:
021:        import org.mandarax.kernel.*;
022:
023:        /**
024:         * Test case that can be used to validate a knowledge base.
025:         * Modelled after JUnit test cases, although this interface does not depend on JUnit.
026:         * A reference implementation based on JUnit is provided as well. 
027:         * <p>
028:         * The test case can validate the following:
029:         * <ol>
030:         * <li>whether a ground query yields true or false</li>
031:         * <li>the expected variable replacements in a query containing variables</li>
032:         * <li>the number of expected results</li>
033:         * </ol>
034:         * @author <A HREF="mailto:j.b.dietrich@massey.ac.nz">Jens Dietrich</A>
035:         * @version 3.4 <7 March 05>
036:         * @since 3.4
037:         */
038:        public interface TestCase extends PropertiesSupport {
039:
040:            // public constants representing policies how assumptions should be integrated into the kb
041:            // ON_TOP can be used in conjunction with the ExtendedKnowledgeBase that has an API to give
042:            // clause sets top priority
043:            public static final int ON_TOP = 0;
044:            public static final int AT_BOTTOM = 1;
045:
046:            /**
047:             * Prepares the test case.
048:             */
049:            public void prepare() throws Exception;
050:
051:            /**
052:             * Releases the test case.
053:             */
054:            public void release() throws Exception;
055:
056:            /**
057:             * Execute the test case.
058:             */
059:            public abstract void execute() throws Exception;
060:
061:            /**
062:             * Get the assumptions.
063:             * @return Returns the assumptions.
064:             */
065:            public ClauseSet[] getAssumptions();
066:
067:            /**
068:             * Set the assumptions.
069:             * @param assumptions The assumptions to set.
070:             */
071:            public void setAssumptions(ClauseSet[] assumptions);
072:
073:            /**
074:             * Get the test knowledge base.
075:             * @return Returns the kb.
076:             */
077:            public KnowledgeBase getKb();
078:
079:            /**
080:             * Set the test knowledge base.
081:             * @param kb The kb to set.
082:             */
083:            public void setKb(KnowledgeBase kb);
084:
085:            /**
086:             * Set the test query.
087:             * @return Returns the query.
088:             */
089:            public Query getQuery();
090:
091:            /**
092:             * Set the test query.
093:             * @param query The query to set.
094:             */
095:            public void setQuery(Query query);
096:
097:            /**
098:             * @return Returns the expectedNumberOfResults.
099:             */
100:            public int getExpectedNumberOfResults();
101:
102:            /**
103:             * @param expectedNumberOfResults The expectedNumberOfResults to set.
104:             */
105:            public void setExpectedNumberOfResults(int expectedNumberOfResults);
106:
107:            /**
108:             * Get an array of maps containing variable term -> constant term mapping expected in the result
109:             * at this position.
110:             * Can be null indicating that this condition will not be checked in this test case.
111:             * @return Returns the expectedReplacements.
112:             */
113:            public java.util.Map[] getExpectedReplacements();
114:
115:            /**
116:             * Set an array of maps containing variable term -> constant term mapping expected in the result
117:             * at this position.
118:             * Can be null indicating that this condition will not be checked in this test case.
119:             * @param expectedReplacements The expectedReplacements to set.
120:             */
121:            public void setExpectedReplacements(
122:                    java.util.Map[] expectedReplacements);
123:
124:            /**
125:             * Indicates whether a test case must yield true.
126:             * Only used if the query is ground (does not have variables).
127:             * @return Returns the mustBeTrue.
128:             */
129:            public boolean isMustBeTrue();
130:
131:            /**
132:             * Sets whether a test case must yield true.
133:             * Only used if the query is ground (does not have variables).
134:             * @param mustBeTrue The mustBeTrue to set.
135:             */
136:            public void setMustBeTrue(boolean mustBeTrue);
137:
138:            /**
139:             * Set the policy to add an assumption. 
140:             * @param policy the (encoded) policy = one of the constants defined in TestCase
141:             */
142:            public void setPolicyToAddAssumptionsToKB(int policy);
143:
144:            /**
145:             * Get the policy to add an assumption. 
146:             * @return an integer, the (encoded) policy = one of the constants defined in TestCase
147:             */
148:            public int getPolicyToAddAssumptionsToKB();
149:
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.