Source Code Cross Referenced for Test02Boolean.java in  » Net » lucene-connector » org » apache » lucene » queryParser » surround » query » 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 » Net » lucene connector » org.apache.lucene.queryParser.surround.query 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.apache.lucene.queryParser.surround.query;
002:
003:        /**
004:         * Licensed to the Apache Software Foundation (ASF) under one or more
005:         * contributor license agreements.  See the NOTICE file distributed with
006:         * this work for additional information regarding copyright ownership.
007:         * The ASF licenses this file to You under the Apache License, Version 2.0
008:         * (the "License"); you may not use this file except in compliance with
009:         * the License.  You may obtain a copy of the License at
010:         *
011:         *     http://www.apache.org/licenses/LICENSE-2.0
012:         *
013:         * Unless required by applicable law or agreed to in writing, software
014:         * distributed under the License is distributed on an "AS IS" BASIS,
015:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016:         * See the License for the specific language governing permissions and
017:         * limitations under the License.
018:         */
019:
020:        import junit.framework.TestCase;
021:        import junit.framework.TestSuite;
022:        import junit.textui.TestRunner;
023:
024:        public class Test02Boolean extends TestCase {
025:            public static void main(String args[]) {
026:                TestRunner.run(new TestSuite(Test02Boolean.class));
027:            }
028:
029:            final String fieldName = "bi";
030:            boolean verbose = false;
031:            int maxBasicQueries = 16;
032:
033:            String[] docs1 = { "word1 word2 word3", "word4 word5",
034:                    "ord1 ord2 ord3", "orda1 orda2 orda3 word2 worda3",
035:                    "a c e a b c" };
036:
037:            SingleFieldTestDb db1 = new SingleFieldTestDb(docs1, fieldName);
038:
039:            public void normalTest1(String query, int[] expdnrs)
040:                    throws Exception {
041:                BooleanQueryTst bqt = new BooleanQueryTst(query, expdnrs, db1,
042:                        fieldName, this , new BasicQueryFactory(maxBasicQueries));
043:                bqt.setVerbose(verbose);
044:                bqt.doTest();
045:            }
046:
047:            public void test02Terms01() throws Exception {
048:                int[] expdnrs = { 0 };
049:                normalTest1("word1", expdnrs);
050:            }
051:
052:            public void test02Terms02() throws Exception {
053:                int[] expdnrs = { 0, 1, 3 };
054:                normalTest1("word*", expdnrs);
055:            }
056:
057:            public void test02Terms03() throws Exception {
058:                int[] expdnrs = { 2 };
059:                normalTest1("ord2", expdnrs);
060:            }
061:
062:            public void test02Terms04() throws Exception {
063:                int[] expdnrs = {};
064:                normalTest1("kxork*", expdnrs);
065:            }
066:
067:            public void test02Terms05() throws Exception {
068:                int[] expdnrs = { 0, 1, 3 };
069:                normalTest1("wor*", expdnrs);
070:            }
071:
072:            public void test02Terms06() throws Exception {
073:                int[] expdnrs = {};
074:                normalTest1("ab", expdnrs);
075:            }
076:
077:            public void test02Terms10() throws Exception {
078:                int[] expdnrs = {};
079:                normalTest1("abc?", expdnrs);
080:            }
081:
082:            public void test02Terms13() throws Exception {
083:                int[] expdnrs = { 0, 1, 3 };
084:                normalTest1("word?", expdnrs);
085:            }
086:
087:            public void test02Terms14() throws Exception {
088:                int[] expdnrs = { 0, 1, 3 };
089:                normalTest1("w?rd?", expdnrs);
090:            }
091:
092:            public void test02Terms20() throws Exception {
093:                int[] expdnrs = { 0, 1, 3 };
094:                normalTest1("w*rd?", expdnrs);
095:            }
096:
097:            public void test02Terms21() throws Exception {
098:                int[] expdnrs = { 3 };
099:                normalTest1("w*rd??", expdnrs);
100:            }
101:
102:            public void test02Terms22() throws Exception {
103:                int[] expdnrs = { 3 };
104:                normalTest1("w*?da?", expdnrs);
105:            }
106:
107:            public void test02Terms23() throws Exception {
108:                int[] expdnrs = {};
109:                normalTest1("w?da?", expdnrs);
110:            }
111:
112:            public void test03And01() throws Exception {
113:                int[] expdnrs = { 0 };
114:                normalTest1("word1 AND word2", expdnrs);
115:            }
116:
117:            public void test03And02() throws Exception {
118:                int[] expdnrs = { 3 };
119:                normalTest1("word* and ord*", expdnrs);
120:            }
121:
122:            public void test03And03() throws Exception {
123:                int[] expdnrs = { 0 };
124:                normalTest1("and(word1,word2)", expdnrs);
125:            }
126:
127:            public void test04Or01() throws Exception {
128:                int[] expdnrs = { 0, 3 };
129:                normalTest1("word1 or word2", expdnrs);
130:            }
131:
132:            public void test04Or02() throws Exception {
133:                int[] expdnrs = { 0, 1, 2, 3 };
134:                normalTest1("word* OR ord*", expdnrs);
135:            }
136:
137:            public void test04Or03() throws Exception {
138:                int[] expdnrs = { 0, 3 };
139:                normalTest1("OR (word1, word2)", expdnrs);
140:            }
141:
142:            public void test05Not01() throws Exception {
143:                int[] expdnrs = { 3 };
144:                normalTest1("word2 NOT word1", expdnrs);
145:            }
146:
147:            public void test05Not02() throws Exception {
148:                int[] expdnrs = { 0 };
149:                normalTest1("word2* not ord*", expdnrs);
150:            }
151:
152:            public void test06AndOr01() throws Exception {
153:                int[] expdnrs = { 0 };
154:                normalTest1("(word1 or ab)and or(word2,xyz, defg)", expdnrs);
155:            }
156:
157:            public void test07AndOrNot02() throws Exception {
158:                int[] expdnrs = { 0 };
159:                normalTest1("or( word2* not ord*, and(xyz,def))", expdnrs);
160:            }
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.