|Home >> All >> org >> apache >> [ cactus Javadoc ]|
Page 1 2
org.apache.cactus: Javadoc index of package org.apache.cactus.
org.apache.cactus.integration.ant.deployment.webapp: Contains classes that support deployment aspects like parsing deployment descriptors and extracting resources from deployment archives.
org.apache.cactus.spi.client.connector: Contains Cactus client-side SPI classes required to implement new protocols other than the Cactus-implemented ones.
org.apache.cactus.integration.ant.container.weblogic: Contains classes and interfaces that constitute the support for container startup and shutdown in the Ant integration.
org.apache.cactus.server.runner: Contains the Cactus redirectors and the Cactus wrappers around all Servlet, Filter and JSP implicit objects.
org.apache.cactus.integration.ant.util: Contains the tasks and types provided for integration of Cactus with Ant.
org.apache.cactus.internal.client.connector.http: Contains the classes implementing of the client side of Cactus.
org.apache.cactus.internal.server.runner: Contains the classes implementing the server side of Cactus.
org.apache.cactus.client.authentication: Contains all classes needed for writing Cactus tests.
org.apache.cactus.internal.configuration: Contains Cactus internal implementation classes.
JspTagLifecycle: Convenience class that supports the testing of JSP tag by managing the tag's lifecycle as required by the JSP specification. This class is basically a stub implementation of the tag management facilities that an actual JSP container would provide. The implementation attempts to follow the specification as closely as possible, but the tag handling functionality of real JSP implementations may vary in some details. Although this class works quite well when used in the test methods of a JspTestCase , it can also safely be used outside of the Cactus testing framework, for example when following a mock ...
ProtocolHandler: Any communication protocol (e.g HTTP) used to connect between Cactus client side and Cactus server side must implement this lifecycle interface. This interface is part of the connector SPI. Here is the lifecycle followed by Cactus core: Call createRequest() 55 to create a request object that will be passed to the begin() and beginXXX() methods. They will in turn enrich it with values set by the user. Call begin() and beginXXX() methods. Call runTest(junit.framework.Test, junit.framework.Test, org.apache.cactus.Request) 55 to execute the tests. Call createResponseObjectFactory(org.apache.cactus.spi.client.connector.ProtocolState) ...
ServletURL: Simulate an HTTP URL by breaking it into its different parts. URL = "http://" + serverName (including port) + requestURI ? queryString requestURI = contextPath + servletPath + pathInfo From the Servlet 2.2 specification : Context Path : The path prefix associated with the ServletContext that this servlet is a part of. If this context is the default context rooted at the base of the web server's URL namespace, this path will be an empty string. Otherwise, this path starts with a "/" character but does not end with a "/" character. Servlet Path : The path section that directly corresponds to the ...
RunServerTestsTask: Task to automate running in-container unit test. It has the following syntax when used in Ant : <runservertests testURL="&t;url>" starttarget="<start target name>" stoptarget="<stop target name>" testtarget="<test target name>"/> where <url> is the URL that is used by this task to ensure that the server is running. Indeed, the algorithm is as follow : Checks if server is running by trying to open an HTTP connection to the URL, If it fails, call the start target and loop until the HTTP connection the URL can be established, Call the test target. This target is supposed ...
AbstractHttpServletRequestWrapper: Abstract wrapper around javax.servlet.http.HttpServletRequest . This class provides a common implementation of the wrapper for the different Servlet APIs. This is an implementation that delegates all the call to the javax.servlet.http.HttpServletRequest object passed in the constructor except for some overidden methods which are use to simulate a URL. This is to be able to simulate any URL that would have been used to call the test method : if this was not done, the URL that would be returned (by calling the HttpServletRequest.getRequestURI() > HttpServletRequest.getRequestURI() 55 method or others ...
ProtocolState: Hold protocol-related information that need to be exchanged during the lifecycle of the ProtocolHandler . For example the HTTP protocol handler needs to pass the HTTP connection around to the different lifecycle methods. However, as this kind of state information is highly protocol dependent, we needed to abstract out the state information, hence this tagging interface. The implementation is free to have any kind of methods. These methods will only be used in the ProtocolHandler implementation classes.
ServletExceptionWrapper: Wrapper around a Throwable object. Whenever an exception occurs in a test case executed on the server side, the text of this exception along with the stack trace as a String are sent back in the HTTP response. This is because some exceptions are not serializable and because the stack trace is implemented as a transient variable by the JDK so it cannot be transported in the response. However, we need to send a real exception object to JUnit so that the exception stack trace will be printed in the JUnit console. This class does this by being a Throwable and overloading the printStackTrace() methods ...
AntLog: Support class that lets classes log to Ant using the Commons Logging API. This is not intended to be a general solution, rather as a thin separation layer to not have to pass around full-blown Ant Project , Target or Task objects just to enable logging. Note that as there is no log level in Commons-Logging that corresponds to Ant's VERBOSE level (the level between INFO and DEBUG ), the TRACE level of Commons-Logging gets mapped to VERBOSE , which is probably inappropriate for components that do not know they are using the AntLog class.
CactusScanner: Process org.apache.tools.ant.types.FileSet and extracts classes that are Cactus tests. As a Cactus test can be a simple JUnit test case wrapped in a Cactus suite, it is very difficult to find out only Cactus tests. Thus, in this version, we are only finding JUnit tests. A class is considered to be a JUnit Test Case if: It extends junit.framework.TestCase It is not abstract It has at least one method that starts with "test", returns void and takes no parameters
AbstractAuthentication: This class was designed with the simple assumption that ALL authentication implementations will have a String Name and a String Password . Two abstract functions validateName and validatePassword provide for concrete implementations to perform character validation. All the work is then done in the configure abstract function. In the BasicAuthentication class, for example, the configuring is done by adding the request property "Authorization" with a value "Basic <base64encode of 'userid:password'>".
AbstractServletContextWrapper: Abstract wrapper around ServletContext . This class provides a common implementation of the wrapper for the different servlet API. In addition to implementing the ServletContext interface it provides additional features helpful for writing unit tests. More specifically the getRequestDispatcher() method is overrided to return an request dispatcher wrapper. In addition logs generated by calls to the log() methods can be retrieved and asserted by calling the getLogs() method.
GenericResponseWrapper: Wrapper around a HttpServletResponse that we use to easily write filters that manipulate the output stream. Indeed, we cannot pass the output stream of our filter direectly to the next filter in the chain because then we won't be able to write to it (the response will have been committed). Instead, we pass this wrapper class and then copy its data to our filter output stream. Note: This code was adapted from the Filter tutorial found here
AutoReadHttpURLConnection: Wrapper class for the real HttpURLConnection to the test servlet that reads the complete input stream into an internal buffer on the first call to getInputStream(). This is to ensure that the test servlet is not blocked on i/o when the test caller asks for the results. The wrapper returns the buffered input stream from getInputStream and delegates the rest of the calls. This class is final so we don't have to provide access to protected instance variables and methods of the wrapped connection.
FormAuthentication: Form-based authentication implementation. An instance of this class can be reused across several tests as it caches the session cookie. Thus the first time it is used to authenticate the user, it calls the security URL (which is by default the context URL prepended by "j_security_check"), caches the returned session cookie and adds the cookie for the next request. The second time it is called, it simply addes the session cookie for the next request.
ClientTestCaseCaller: Provides the ability to run common code before and after each test on the client side. All the methods provided are independent of any communication protocol between client side and server side (HTTP, JMS, etc). Any protocol dependent methods must be provided and implemented in the org.apache.cactus.spi.client.connector.ProtocolHandler implementation class.
TestSetURLSpecific: Test the J2EE 1.3 specifics of the WebRequest.setURL(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) > WebRequest.setURL(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) 55 method (specifically verify calls to getRequestURL ).
ServletTestRunner: Helper servlet to start a JUnit Test Runner in a webapp. This class currently does a couple of reflection tricks to avoid a direct dependancy on the TraX API ( javax.xml.transform.* ), encapsulated in the org.apache.cactus.internal.server.runner.XMLTransformer class.
TestCactifyWarTask: Unit tests for CactifyWarTask . TODO: test whether all files contained by the source WAR are also added to the cactified WAR TODO: test whether the mergewebxml is actually merged into the cactified web.xml
AbstractCactusTestCase: Base class for all Cactus test case extensions. Note: We must not add any method that can be called by the end user to this class as users will those methods and it will create a runtime dependency to this class. We will then have to break binary compatibility if we wish to move this class around or change its implementation.
CactusScannerTag: Cactus Jelly Tag that scans Ant FileSets and return a list of qualified class name that are Cactus TestCases (i.e. ServletTestCase, JspTestCase or FilterTestCase) or subclasses of Cactus TestCases. Note: This is useful when used with the <junit> Ant task for example, in order to find out the list of tests to execute.
TestClientServerSynchronization: Verify that the Cactus client side only reads the test result *after* the test is finished (ie after the test result has been saved in the application scope). This JUnit test need to be the first one to be run. Otherwise, the test result might be that of the previous test and not the current test one, thus proving nothing !!
FilterServletOutputStream: Helper class to help write filters that manipulates the output stream. This is because normally, the ServletOutputStream cannot be modified after a resource has committed it. Note: This code was adapted from the Filter tutorial found here
TestSetURL: Test the WebRequest.setURL(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) > WebRequest.setURL(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) 55 method.