Source Code Cross Referenced for GeometrylessTest.java in  » GIS » GeoServer » org » geoserver » 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 » GeoServer » org.geoserver.wfs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.geoserver.wfs;
002:
003:        import org.w3c.dom.Document;
004:        import org.w3c.dom.NodeList;
005:
006:        public class GeometrylessTest extends WFSTestSupport {
007:
008:            public void testGetFeature10() throws Exception {
009:                Document doc = getAsDOM("wfs?request=GetFeature&typename=cite:Geometryless&version=1.0.0&service=wfs");
010:                assertEquals("wfs:FeatureCollection", doc.getDocumentElement()
011:                        .getNodeName());
012:                //        print(doc);
013:
014:                NodeList featureMembers = doc
015:                        .getElementsByTagName("gml:featureMember");
016:                assertFalse(featureMembers.getLength() == 0);
017:                NodeList features = doc
018:                        .getElementsByTagName("cite:Geometryless");
019:                assertEquals(3, featureMembers.getLength());
020:            }
021:
022:            public void testGetFeatureReproject10() throws Exception {
023:                getWFS().setFeatureBounding(true);
024:                Document doc = getAsDOM("wfs?request=GetFeature&typename=cite:Geometryless&version=1.0.0&service=wfs&srsName=EPSG:900913");
025:                assertEquals("wfs:FeatureCollection", doc.getDocumentElement()
026:                        .getNodeName());
027:                //        print(doc);
028:
029:                NodeList featureMembers = doc
030:                        .getElementsByTagName("gml:featureMember");
031:                assertFalse(featureMembers.getLength() == 0);
032:                NodeList features = doc
033:                        .getElementsByTagName("cite:Geometryless");
034:                assertEquals(3, featureMembers.getLength());
035:            }
036:
037:            public void testGetFeature11() throws Exception {
038:                Document doc = getAsDOM("wfs?request=GetFeature&typename=cite:Geometryless&version=1.1.0&service=wfs");
039:                assertEquals("wfs:FeatureCollection", doc.getDocumentElement()
040:                        .getNodeName());
041:                //        print(doc);
042:
043:                NodeList featureMembers = doc
044:                        .getElementsByTagName("gml:featureMembers");
045:                assertFalse(featureMembers.getLength() == 0);
046:                NodeList features = doc
047:                        .getElementsByTagName("cite:Geometryless");
048:                assertEquals(3, features.getLength());
049:            }
050:
051:            public void testGetFeatureReproject11() throws Exception {
052:                getWFS().setFeatureBounding(true);
053:                Document doc = getAsDOM("wfs?request=GetFeature&typename=cite:Geometryless&version=1.1.0&service=wfs&srsName=EPSG:900913");
054:                assertEquals("wfs:FeatureCollection", doc.getDocumentElement()
055:                        .getNodeName());
056:
057:                NodeList featureMembers = doc
058:                        .getElementsByTagName("gml:featureMembers");
059:                assertFalse(featureMembers.getLength() == 0);
060:                NodeList features = doc
061:                        .getElementsByTagName("cite:Geometryless");
062:                assertEquals(3, features.getLength());
063:            }
064:
065:            public void testGetFeatureReprojectPost() throws Exception {
066:                String request = "<wfs:GetFeature service=\"WFS\" xmlns:wfs=\"http://www.opengis.net/wfs\" "
067:                        + "version=\"1.0.0\"  outputFormat=\"GML2\" "
068:                        + "xmlns:topp=\"http://www.openplans.org/topp\" "
069:                        + "xmlns:ogc=\"http://www.opengis.net/ogc\" "
070:                        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
071:                        + "xsi:schemaLocation=\"http://www.opengis.net/wfs "
072:                        + "http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd\">"
073:                        + "<wfs:Query typeName=\"cite:Geometryless\" srsName=\"EPSG:900913\"/></wfs:GetFeature>";
074:                System.out.println(request);
075:                Document doc = postAsDOM("wfs", request);
076:
077:                assertEquals("wfs:FeatureCollection", doc.getDocumentElement()
078:                        .getNodeName());
079:
080:                NodeList featureMembers = doc
081:                        .getElementsByTagName("gml:featureMember");
082:                assertEquals(3, featureMembers.getLength());
083:                NodeList features = doc
084:                        .getElementsByTagName("cite:Geometryless");
085:                assertEquals(3, features.getLength());
086:            }
087:
088:            public void testUpdate() throws Exception {
089:                // perform an update
090:                String update = "<wfs:Transaction service=\"WFS\" version=\"1.0.0\" "
091:                        + "xmlns:cite=\"http://www.opengis.net/cite\" "
092:                        + "xmlns:ogc=\"http://www.opengis.net/ogc\" "
093:                        + "xmlns:wfs=\"http://www.opengis.net/wfs\" "
094:                        + "xmlns:gml=\"http://www.opengis.net/gml\"> "
095:                        + "<wfs:Update typeName=\"cite:Geometryless\" > "
096:                        + "<wfs:Property>"
097:                        + "<wfs:Name>name</wfs:Name>"
098:                        + "<wfs:Value>AnotherName</wfs:Value>"
099:                        + "</wfs:Property>"
100:                        + "<ogc:Filter>"
101:                        + "<ogc:FeatureId fid=\"Geometryless.2\"/>"
102:                        + "</ogc:Filter>"
103:                        + "</wfs:Update>"
104:                        + "</wfs:Transaction>";
105:
106:                Document dom = postAsDOM("wfs", update);
107:                assertTrue(dom.getElementsByTagName("wfs:SUCCESS").getLength() != 0);
108:
109:                // do another get feature
110:                dom = getAsDOM("wfs?request=GetFeature&typename=cite:Geometryless&version=1.0.0&service=wfs&featureId=Geometryless.2");
111:                assertEquals("AnotherName", dom.getElementsByTagName(
112:                        "cite:name").item(0).getFirstChild().getNodeValue());
113:            }
114:
115:            public void testDelete() throws Exception {
116:                // perform an update
117:                String insert = "<wfs:Transaction service=\"WFS\" version=\"1.0.0\" "
118:                        + "xmlns:cite=\"http://www.opengis.net/cite\" "
119:                        + "xmlns:ogc=\"http://www.opengis.net/ogc\" "
120:                        + "xmlns:wfs=\"http://www.opengis.net/wfs\" "
121:                        + "xmlns:gml=\"http://www.opengis.net/gml\"> "
122:                        + "<wfs:Delete typeName=\"cite:Geometryless\" > "
123:                        + "<ogc:Filter>"
124:                        + "<ogc:FeatureId fid=\"Geometryless.2\"/>"
125:                        + "</ogc:Filter>"
126:                        + "</wfs:Delete>"
127:                        + "</wfs:Transaction>";
128:
129:                Document dom = postAsDOM("wfs", insert);
130:                assertTrue(dom.getElementsByTagName("wfs:SUCCESS").getLength() != 0);
131:
132:                // do another get feature
133:                dom = getAsDOM("wfs?request=GetFeature&typename=cite:Geometryless&version=1.0.0&service=wfs&featureId=Geometryless.2");
134:                assertEquals(0, dom.getElementsByTagName("cite:Geometryless")
135:                        .getLength());
136:            }
137:
138:            public void testInsert() throws Exception {
139:                // perform an insert
140:                String insert = "<wfs:Transaction service=\"WFS\" version=\"1.0.0\" "
141:                        + "xmlns:cite=\"http://www.opengis.net/cite\" "
142:                        + "xmlns:ogc=\"http://www.opengis.net/ogc\" "
143:                        + "xmlns:wfs=\"http://www.opengis.net/wfs\" "
144:                        + "xmlns:gml=\"http://www.opengis.net/gml\"> "
145:                        + "<wfs:Insert > "
146:                        + "<cite:Geometryless fid=\"Geometryless.4\">"
147:                        + "<cite:name>Gimbo</cite:name>"
148:                        + "<cite:number>1000</cite:number>"
149:                        + "</cite:Geometryless>"
150:                        + "</wfs:Insert>"
151:                        + "</wfs:Transaction>";
152:
153:                Document dom = postAsDOM("wfs", insert);
154:                assertTrue(dom.getElementsByTagName("wfs:SUCCESS").getLength() != 0);
155:                assertTrue(dom.getElementsByTagName("wfs:InsertResult")
156:                        .getLength() != 0);
157:
158:                // do another get feature
159:                dom = getAsDOM("wfs?request=GetFeature&typename=cite:Geometryless&version=1.0.0&service=wfs");
160:                assertEquals(4, dom.getElementsByTagName("cite:Geometryless")
161:                        .getLength());
162:            }
163:
164:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.