Java Doc for JettyTestSetup.java in  » Testing » jakarta-cactus » org » apache » cactus » extension » jetty » 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 » Testing » jakarta cactus » org.apache.cactus.extension.jetty 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cactus.extension.jetty.JettyTestSetup

JettyTestSetup
public class JettyTestSetup extends TestSetup (Code)
Custom JUnit test setup to use to automatically start Jetty. Example:
 public static Test suite()
 {
 TestSuite suite = new TestSuite(Myclass.class);
 return new JettyTestSetup(suite);
 }
 

version:
   $Id: JettyTestSetup.java 239036 2004-08-17 10:35:57Z vmassol $



Constructor Summary
public  JettyTestSetup(Test theTest)
    
public  JettyTestSetup(Test theTest, Configuration theBaseConfiguration, ServletConfiguration theServletConfiguration, FilterConfiguration theFilterConfiguration)
    

Method Summary
final protected  FilegetConfigFile()
    
final protected  FilegetResourceDir()
    
protected  booleanisAvailable(int theCode)
     Tests whether an HTTP return code corresponds to a valid connection to the test URL or not.
protected  booleanisRunning()
    
protected  voidreadFully(HttpURLConnection theConnection)
     Fully reads the input stream from the passed HTTP URL connection to prevent (harmless) server-side exception.
public  voidrun(TestResult theResult)
     Make sure that JettyTestSetup.tearDown is called if JettyTestSetup.setUp fails to start the container properly.
final public  voidsetConfigFile(File theConfigFile)
     Sets the configuration file to use for initializing Jetty.
final public  voidsetForceShutdown(boolean isForcedShutdown)
    
final public  voidsetResourceDir(File theResourceDir)
     Sets the directory in which Jetty will look for the web-application resources.
protected  voidsetUp()
     Start an embedded Jetty server.
protected  voidtearDown()
     Stop the running Jetty server.
protected  inttestConnectivity(URL theUrl)
     Tests whether we are able to connect to the HTTP server identified by the specified URL.


Constructor Detail
JettyTestSetup
public JettyTestSetup(Test theTest)(Code)

Parameters:
  theTest - the test we are decorating (usually a test suite)



JettyTestSetup
public JettyTestSetup(Test theTest, Configuration theBaseConfiguration, ServletConfiguration theServletConfiguration, FilterConfiguration theFilterConfiguration)(Code)

Parameters:
  theTest - the test we are decorating (usually a test suite)
Parameters:
  theBaseConfiguration - the base configuration object used toconfigure Jetty
Parameters:
  theServletConfiguration - the servlet configuration object usedto configure Jetty
Parameters:
  theFilterConfiguration - the filter configuration object usedto configure Jetty




Method Detail
getConfigFile
final protected File getConfigFile()(Code)
The resource directory, or null if it has not beenset



getResourceDir
final protected File getResourceDir()(Code)
The resource directory, or null if it has not beenset



isAvailable
protected boolean isAvailable(int theCode)(Code)
Tests whether an HTTP return code corresponds to a valid connection to the test URL or not. Success is 200 up to but excluding 300.
Parameters:
  theCode - the HTTP response code to verify true if the test URL could be called without error,false otherwise



isRunning
protected boolean isRunning()(Code)
true if the server is running or false otherwise



readFully
protected void readFully(HttpURLConnection theConnection) throws IOException(Code)
Fully reads the input stream from the passed HTTP URL connection to prevent (harmless) server-side exception.
Parameters:
  theConnection - the HTTP URL connection to read from
exception:
  IOException - if an error happens during the read



run
public void run(TestResult theResult)(Code)
Make sure that JettyTestSetup.tearDown is called if JettyTestSetup.setUp fails to start the container properly. The default TestSetup.run(TestResult) method does not provide this feature unfortunately.
See Also:   TestSetup.run(TestResult)



setConfigFile
final public void setConfigFile(File theConfigFile)(Code)
Sets the configuration file to use for initializing Jetty.
Parameters:
  theConfigFile - The configuration file to set



setForceShutdown
final public void setForceShutdown(boolean isForcedShutdown)(Code)

Parameters:
  isForcedShutdown - if true the container will be stopped evenif it has not been started by us



setResourceDir
final public void setResourceDir(File theResourceDir)(Code)
Sets the directory in which Jetty will look for the web-application resources.
Parameters:
  theResourceDir - The resource directory to set



setUp
protected void setUp() throws Exception(Code)
Start an embedded Jetty server. It is allowed to pass a Jetty XML as a system property (cactus.jetty.config) to further configure Jetty. Example: -Dcactus.jetty.config=./jetty.xml.
exception:
  Exception - if an error happens during initialization



tearDown
protected void tearDown() throws Exception(Code)
Stop the running Jetty server.
exception:
  Exception - if an error happens during the shutdown



testConnectivity
protected int testConnectivity(URL theUrl)(Code)
Tests whether we are able to connect to the HTTP server identified by the specified URL.
Parameters:
  theUrl - The URL to check the HTTP response code or -1 if no connection could be established



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