Java Doc for GeoServerTestSupport.java in  » GIS » GeoServer » org » geoserver » 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 » GIS » GeoServer » org.geoserver.test 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.geoserver.test.GeoServerTestSupport

All known Subclasses:   org.geoserver.wfs.SrsNameTest,  org.geoserver.test.ows.KvpRequestReaderTestSupport,  org.vfny.geoserver.jetty.SpringContextTest,  org.geoserver.wms.WMSTestSupport,  org.geoserver.wfs.WFSTestSupport,
GeoServerTestSupport
public class GeoServerTestSupport extends TestCase (Code)
Base test class for GeoServer unit tests.

Deriving from this test class provides the test case with preconfigured geoserver and catalog objects.

This test case provides a spring application context which loads the application contexts from all modules on the classpath.


author:
   Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org


Field Summary
final protected static  LoggerLOGGER
    
protected  GeoServerTestApplicationContextapplicationContext
    
protected  MockDatadataDirectory
    


Method Summary
protected  MockHttpServletRequestcreateRequest(String path)
     Convenience method for subclasses to create mock http servlet requests.
protected  Documentdom(InputStream input)
     Parses a stream into a dom.
protected  InputStreamget(String path)
     Executes an ows request using the GET method.
protected  DocumentgetAsDOM(String path)
     Executes an ows request using the GET method and returns the result as an xml document.
protected  MockHttpServletResponsegetAsServletResponse(String path)
     Executes an ows request using the GET method.
protected  StringgetAsString(String path)
    
protected  DatagetCatalog()
     Accessor for global catalog instance from the test application context.
protected  StringgetDefaultLogConfiguration()
     Returns the logging configuration path.
protected  FeatureSourcegetFeatureSource(QName typeName)
     Loads a feature source from the catalog.
protected  ElementgetFirstElementByTagName(Element element, String name)
     Convenience method for element.getElementsByTagName() to return the first element in the resulting node list.
protected  ElementgetFirstElementByTagName(Document dom, String name)
     Convenience method for element.getElementsByTagName() to return the first element in the resulting node list.
protected  GeoServergetGeoServer()
     Accessor for global geoserver instance from the test application context.
protected  GeoServerResourceLoadergetResourceLoader()
     Accessor for global resource loader instance from the test application context.
protected  String[]getSpringContextLocations()
     Returns the spring context locations to be used in order to build the GeoServer Spring context.
protected  InputStreampost(String path)
     Executes an ows request using the POST method with key value pairs form encoded.
protected  InputStreampost(String path, String xml)
     Executes an ows request using the POST method.


Parameters:
  path - The porition of the request after the context ( no query string ), example: 'wms'.
protected  DocumentpostAsDOM(String path)
     Executes an ows request using the POST method with key value pairs form encoded, returning the result as a dom.
protected  DocumentpostAsDOM(String path, String xml)
     Executes an ows request using the POST method and returns the result as an xml document.


Parameters:
  path - The porition of the request after the context ( no query string ), example: 'wms'.
protected  voidprint(Document dom)
     Utility method to print out a dom.
protected  voidsetUp()
     If subclasses overide they *must* call super.setUp() first.
protected  voidsetupLogging(InputStream loggingConfigStream)
    
protected  voidsetupTemplate(QName featureTypeName, String template, String body)
     Sets up a template in a feature type directory.
protected  Stringstring(InputStream input)
    
protected  voidtearDown()
     If subclasses overide they *must* call super.tearDown() first.

Field Detail
LOGGER
final protected static Logger LOGGER(Code)
Common logger for test cases



applicationContext
protected GeoServerTestApplicationContext applicationContext(Code)
Application context



dataDirectory
protected MockData dataDirectory(Code)
mock GeoServer data directory





Method Detail
createRequest
protected MockHttpServletRequest createRequest(String path)(Code)
Convenience method for subclasses to create mock http servlet requests.

Examples of using this method are:

 
 createRequest( "wfs?request=GetCapabilities" );  //get
 createRequest( "wfs" ); //post
 
 


Parameters:
  path - The path for the request and optional the query string.



dom
protected Document dom(InputStream input) throws Exception(Code)
Parses a stream into a dom.



get
protected InputStream get(String path) throws Exception(Code)
Executes an ows request using the GET method.
Parameters:
  path - The porition of the request after hte context, example: 'wms?request=GetMap&version=1.1.1&..." An input stream which is the result of the request.
throws:
  Exception -



getAsDOM
protected Document getAsDOM(String path) throws Exception(Code)
Executes an ows request using the GET method and returns the result as an xml document.
Parameters:
  path - The porition of the request after hte context, example: 'wms?request=GetMap&version=1.1.1&..." A result of the request parsed into a dom.
throws:
  Exception -



getAsServletResponse
protected MockHttpServletResponse getAsServletResponse(String path) throws Exception(Code)
Executes an ows request using the GET method.
Parameters:
  path - The porition of the request after hte context, example: 'wms?request=GetMap&version=1.1.1&..." the mock servlet response
throws:
  Exception -



getAsString
protected String getAsString(String path) throws Exception(Code)



getCatalog
protected Data getCatalog()(Code)
Accessor for global catalog instance from the test application context.



getDefaultLogConfiguration
protected String getDefaultLogConfiguration()(Code)
Returns the logging configuration path. The default value is "/TEST_LOGGING.properties", which is a pretty quiet configuration. Should you need more verbose logging override this method in subclasses and choose a different configuration, for example "/DEFAULT_LOGGING.properties".



getFeatureSource
protected FeatureSource getFeatureSource(QName typeName) throws IOException(Code)
Loads a feature source from the catalog.
Parameters:
  typeName - The qualified type name of the feature source.



getFirstElementByTagName
protected Element getFirstElementByTagName(Element element, String name)(Code)
Convenience method for element.getElementsByTagName() to return the first element in the resulting node list.



getFirstElementByTagName
protected Element getFirstElementByTagName(Document dom, String name)(Code)
Convenience method for element.getElementsByTagName() to return the first element in the resulting node list.



getGeoServer
protected GeoServer getGeoServer()(Code)
Accessor for global geoserver instance from the test application context.



getResourceLoader
protected GeoServerResourceLoader getResourceLoader()(Code)
Accessor for global resource loader instance from the test application context.



getSpringContextLocations
protected String[] getSpringContextLocations()(Code)
Returns the spring context locations to be used in order to build the GeoServer Spring context. Subclasses might want to provide extra locations in order to test extension points.



post
protected InputStream post(String path) throws Exception(Code)
Executes an ows request using the POST method with key value pairs form encoded.
Parameters:
  path - The porition of the request after hte context, example: 'wms?request=GetMap&version=1.1.1&..." An input stream which is the result of the request.
throws:
  Exception -



post
protected InputStream post(String path, String xml) throws Exception(Code)
Executes an ows request using the POST method.


Parameters:
  path - The porition of the request after the context ( no query string ), example: 'wms'. An input stream which is the result of the request.
throws:
  Exception -



postAsDOM
protected Document postAsDOM(String path) throws Exception(Code)
Executes an ows request using the POST method with key value pairs form encoded, returning the result as a dom.
Parameters:
  path - The porition of the request after hte context, example: 'wms?request=GetMap&version=1.1.1&..." An input stream which is the result of the request.
throws:
  Exception -



postAsDOM
protected Document postAsDOM(String path, String xml) throws Exception(Code)
Executes an ows request using the POST method and returns the result as an xml document.


Parameters:
  path - The porition of the request after the context ( no query string ), example: 'wms'. An input stream which is the result of the request.
throws:
  Exception -



print
protected void print(Document dom) throws Exception(Code)
Utility method to print out a dom.



setUp
protected void setUp() throws Exception(Code)
If subclasses overide they *must* call super.setUp() first.



setupLogging
protected void setupLogging(InputStream loggingConfigStream) throws Exception(Code)



setupTemplate
protected void setupTemplate(QName featureTypeName, String template, String body) throws IOException(Code)
Sets up a template in a feature type directory.
Parameters:
  featureTypeName - The name of the feature type.
Parameters:
  template - The name of the template.
Parameters:
  body - The content of the template.
throws:
  IOException -



string
protected String string(InputStream input) throws Exception(Code)
Parses a stream into a String



tearDown
protected void tearDown() throws Exception(Code)
If subclasses overide they *must* call super.tearDown() first.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.