Source Code Cross Referenced for ParseCapabilitesTest.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » wfs » 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 » GIS » GeoTools 2.4.1 » org.geotools.data.wfs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2004-2006, Geotools Project Managment Committee (PMC)
005:         *
006:         *    This library is free software; you can redistribute it and/or
007:         *    modify it under the terms of the GNU Lesser General Public
008:         *    License as published by the Free Software Foundation; either
009:         *    version 2.1 of the License, or (at your option) any later version.
010:         *
011:         *    This library is distributed in the hope that it will be useful,
012:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *    Lesser General Public License for more details.
015:         */
016:        package org.geotools.data.wfs;
017:
018:        import java.io.InputStream;
019:        import java.util.HashMap;
020:        import java.util.Map;
021:        import java.util.logging.Level;
022:
023:        import org.geotools.TestData;
024:        import org.geotools.data.ows.WFSCapabilities;
025:        import org.geotools.filter.FilterCapabilities;
026:        import org.geotools.filter.function.FilterFunction_distance;
027:        import org.geotools.filter.function.FilterFunction_geometryType;
028:        import org.geotools.filter.function.math.FilterFunction_abs;
029:        import org.geotools.xml.DocumentFactory;
030:
031:        import junit.framework.TestCase;
032:
033:        /**
034:         * Test the ability to read a capabilities document.  The emphasis is in making sure that 
035:         * the Function expressions are constructed correctly.
036:         * 
037:         * @author Jesse
038:         */
039:        public class ParseCapabilitesTest extends TestCase {
040:
041:            protected void setUp() throws Exception {
042:                super .setUp();
043:            }
044:
045:            public void testNoSupportedFunctionExpression() throws Exception {
046:                Map hints = new HashMap();
047:                InputStream in = TestData
048:                        .openStream("xml/capabilities/WFSGetCapsNoFunctionExpressions.xml");
049:                WFSCapabilities obj = (WFSCapabilities) DocumentFactory
050:                        .getInstance(in, hints, Level.WARNING);
051:                FilterCapabilities filterCapabilities = obj
052:                        .getFilterCapabilities();
053:                assertFalse(filterCapabilities
054:                        .supports(FilterCapabilities.FUNCTIONS));
055:
056:                assertTrue(filterCapabilities
057:                        .supports(FilterCapabilities.SPATIAL_DISJOINT));
058:                assertTrue(filterCapabilities
059:                        .supports(FilterCapabilities.SPATIAL_EQUALS));
060:                assertTrue(filterCapabilities
061:                        .supports(FilterCapabilities.SPATIAL_DWITHIN));
062:                assertTrue(filterCapabilities
063:                        .supports(FilterCapabilities.SPATIAL_BEYOND));
064:                assertTrue(filterCapabilities
065:                        .supports(FilterCapabilities.SPATIAL_INTERSECT));
066:                assertTrue(filterCapabilities
067:                        .supports(FilterCapabilities.SPATIAL_TOUCHES));
068:                assertTrue(filterCapabilities
069:                        .supports(FilterCapabilities.SPATIAL_CROSSES));
070:                assertTrue(filterCapabilities
071:                        .supports(FilterCapabilities.SPATIAL_WITHIN));
072:                assertTrue(filterCapabilities
073:                        .supports(FilterCapabilities.SPATIAL_CONTAINS));
074:                assertTrue(filterCapabilities
075:                        .supports(FilterCapabilities.SPATIAL_OVERLAPS));
076:                assertTrue(filterCapabilities
077:                        .supports(FilterCapabilities.SPATIAL_BBOX));
078:
079:                assertTrue(filterCapabilities
080:                        .supports(FilterCapabilities.LOGICAL));
081:                assertTrue(filterCapabilities
082:                        .supports(FilterCapabilities.SIMPLE_ARITHMETIC));
083:                assertTrue(filterCapabilities
084:                        .supports(FilterCapabilities.SIMPLE_COMPARISONS));
085:
086:                assertTrue(filterCapabilities
087:                        .supports(FilterCapabilities.BETWEEN));
088:                assertTrue(filterCapabilities
089:                        .supports(FilterCapabilities.NULL_CHECK));
090:                assertTrue(filterCapabilities.supports(FilterCapabilities.LIKE));
091:
092:            }
093:
094:            public void testSomeSupportedFunctionExpression() throws Exception {
095:                Map hints = new HashMap();
096:                InputStream in = TestData
097:                        .openStream("xml/capabilities/WFSGetCapsSomeFunctionExpressions.xml");
098:                WFSCapabilities obj = (WFSCapabilities) DocumentFactory
099:                        .getInstance(in, hints, Level.WARNING);
100:                FilterCapabilities filterCapabilities = obj
101:                        .getFilterCapabilities();
102:                assertTrue(filterCapabilities
103:                        .supports(FilterCapabilities.FUNCTIONS));
104:
105:                assertTrue(filterCapabilities
106:                        .supports(FilterFunction_distance.class));
107:                assertFalse(filterCapabilities
108:                        .supports(FilterFunction_abs.class));
109:                assertFalse(filterCapabilities
110:                        .supports(FilterFunction_geometryType.class));
111:
112:                assertTrue(filterCapabilities
113:                        .supports(FilterCapabilities.SPATIAL_DISJOINT));
114:                assertTrue(filterCapabilities
115:                        .supports(FilterCapabilities.SPATIAL_EQUALS));
116:                assertTrue(filterCapabilities
117:                        .supports(FilterCapabilities.SPATIAL_DWITHIN));
118:                assertTrue(filterCapabilities
119:                        .supports(FilterCapabilities.SPATIAL_BEYOND));
120:                assertTrue(filterCapabilities
121:                        .supports(FilterCapabilities.SPATIAL_INTERSECT));
122:                assertTrue(filterCapabilities
123:                        .supports(FilterCapabilities.SPATIAL_TOUCHES));
124:                assertTrue(filterCapabilities
125:                        .supports(FilterCapabilities.SPATIAL_CROSSES));
126:                assertTrue(filterCapabilities
127:                        .supports(FilterCapabilities.SPATIAL_WITHIN));
128:                assertTrue(filterCapabilities
129:                        .supports(FilterCapabilities.SPATIAL_CONTAINS));
130:                assertTrue(filterCapabilities
131:                        .supports(FilterCapabilities.SPATIAL_OVERLAPS));
132:                assertTrue(filterCapabilities
133:                        .supports(FilterCapabilities.SPATIAL_BBOX));
134:
135:                assertTrue(filterCapabilities
136:                        .supports(FilterCapabilities.LOGICAL));
137:                assertTrue(filterCapabilities
138:                        .supports(FilterCapabilities.SIMPLE_ARITHMETIC));
139:                assertTrue(filterCapabilities
140:                        .supports(FilterCapabilities.SIMPLE_COMPARISONS));
141:
142:                assertTrue(filterCapabilities
143:                        .supports(FilterCapabilities.BETWEEN));
144:                assertTrue(filterCapabilities
145:                        .supports(FilterCapabilities.NULL_CHECK));
146:                assertTrue(filterCapabilities.supports(FilterCapabilities.LIKE));
147:            }
148:
149:            public void testGeoserverSupportedFunctionExpression()
150:                    throws Exception {
151:                Map hints = new HashMap();
152:                InputStream in = TestData
153:                        .openStream("xml/capabilities/WFSGetCapsGeoserverFunctionExpressions.xml");
154:                WFSCapabilities obj = (WFSCapabilities) DocumentFactory
155:                        .getInstance(in, hints, Level.WARNING);
156:                FilterCapabilities filterCapabilities = obj
157:                        .getFilterCapabilities();
158:                assertTrue(filterCapabilities
159:                        .supports(FilterCapabilities.FUNCTIONS));
160:
161:                assertTrue(filterCapabilities
162:                        .supports(FilterFunction_distance.class));
163:                assertTrue(filterCapabilities
164:                        .supports(FilterFunction_abs.class));
165:                assertTrue(filterCapabilities
166:                        .supports(FilterFunction_geometryType.class));
167:
168:                assertTrue(filterCapabilities
169:                        .supports(FilterCapabilities.SPATIAL_DISJOINT));
170:                assertTrue(filterCapabilities
171:                        .supports(FilterCapabilities.SPATIAL_EQUALS));
172:                assertTrue(filterCapabilities
173:                        .supports(FilterCapabilities.SPATIAL_DWITHIN));
174:                assertTrue(filterCapabilities
175:                        .supports(FilterCapabilities.SPATIAL_BEYOND));
176:                assertTrue(filterCapabilities
177:                        .supports(FilterCapabilities.SPATIAL_INTERSECT));
178:                assertTrue(filterCapabilities
179:                        .supports(FilterCapabilities.SPATIAL_TOUCHES));
180:                assertTrue(filterCapabilities
181:                        .supports(FilterCapabilities.SPATIAL_CROSSES));
182:                assertTrue(filterCapabilities
183:                        .supports(FilterCapabilities.SPATIAL_WITHIN));
184:                assertTrue(filterCapabilities
185:                        .supports(FilterCapabilities.SPATIAL_CONTAINS));
186:                assertTrue(filterCapabilities
187:                        .supports(FilterCapabilities.SPATIAL_OVERLAPS));
188:                assertTrue(filterCapabilities
189:                        .supports(FilterCapabilities.SPATIAL_BBOX));
190:
191:                assertTrue(filterCapabilities
192:                        .supports(FilterCapabilities.LOGICAL));
193:                assertTrue(filterCapabilities
194:                        .supports(FilterCapabilities.SIMPLE_ARITHMETIC));
195:                assertTrue(filterCapabilities
196:                        .supports(FilterCapabilities.SIMPLE_COMPARISONS));
197:
198:                assertTrue(filterCapabilities
199:                        .supports(FilterCapabilities.BETWEEN));
200:                assertTrue(filterCapabilities
201:                        .supports(FilterCapabilities.NULL_CHECK));
202:                assertTrue(filterCapabilities.supports(FilterCapabilities.LIKE));
203:            }
204:
205:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.