Java Doc for HttpTester.java in  » Sevlet-Container » jetty-extras » org » mortbay » jetty » testing » 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 » Sevlet Container » jetty extras » org.mortbay.jetty.testing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mortbay.jetty.testing.HttpTester

HttpTester
public class HttpTester (Code)
Test support class. Assist with parsing and generating HTTP requests and responses.
 HttpTester tester = new HttpTester();
 tester.parse(
 "GET /uri HTTP/1.1\r\n"+
 "Host: fakehost\r\n"+
 "Content-Length: 10\r\n" +
 "\r\n");
 System.err.println(tester.getMethod());
 System.err.println(tester.getURI());
 System.err.println(tester.getVersion());
 System.err.println(tester.getHeader("Host"));
 System.err.println(tester.getContent());
 

author:
   gregw
See Also:   org.mortbay.jetty.testing.ServletTester


Field Summary
protected  HttpFields_fields
    
protected  byte[]_genContent
    
protected  String_method
    
protected  ByteArrayOutputStream2_parsedContent
    
protected  String_reason
    
protected  int_status
    
protected  String_uri
    
protected  String_version
    

Constructor Summary
public  HttpTester()
    

Method Summary
public  voidaddDateHeader(String name, long date)
    
public  voidaddHeader(String name, String value)
    
public  voidaddLongHeader(String name, long value)
    
public  voidaddSetCookie(Cookie cookie)
    
public  Stringgenerate()
    
public  StringgetContent()
    
public  longgetDateHeader(String name)
    
public  StringgetHeader(String name)
    
public  EnumerationgetHeaderNames()
    
public  EnumerationgetHeaderValues(String name)
    
public  longgetLongHeader(String name)
    
public  StringgetMethod()
    
public  StringgetReason()
    
public  intgetStatus()
    
public  StringgetURI()
    
public  StringgetVersion()
    
public  Stringparse(String rawHTTP)
    
public  voidremoveHeader(String name)
    
public  voidreset()
    
public  voidsetContent(String content)
    
public  voidsetDateHeader(String name, long date)
    
public  voidsetHeader(String name, String value)
    
public  voidsetLongHeader(String name, long value)
    
public  voidsetMethod(String method)
    
public  voidsetReason(String reason)
    
public  voidsetStatus(int status)
    
public  voidsetURI(String uri)
    
public  voidsetVersion(String version)
    

Field Detail
_fields
protected HttpFields _fields(Code)



_genContent
protected byte[] _genContent(Code)



_method
protected String _method(Code)



_parsedContent
protected ByteArrayOutputStream2 _parsedContent(Code)



_reason
protected String _reason(Code)



_status
protected int _status(Code)



_uri
protected String _uri(Code)



_version
protected String _version(Code)




Constructor Detail
HttpTester
public HttpTester()(Code)




Method Detail
addDateHeader
public void addDateHeader(String name, long date)(Code)

Parameters:
  name -
Parameters:
  date -
See Also:   org.mortbay.jetty.HttpFields.addDateField(java.lang.Stringlong)



addHeader
public void addHeader(String name, String value) throws IllegalArgumentException(Code)

Parameters:
  name -
Parameters:
  value -
throws:
  IllegalArgumentException -
See Also:   org.mortbay.jetty.HttpFields.add(java.lang.Stringjava.lang.String)



addLongHeader
public void addLongHeader(String name, long value)(Code)

Parameters:
  name -
Parameters:
  value -
See Also:   org.mortbay.jetty.HttpFields.addLongField(java.lang.Stringlong)



addSetCookie
public void addSetCookie(Cookie cookie)(Code)

Parameters:
  cookie -
See Also:   org.mortbay.jetty.HttpFields.addSetCookie(javax.servlet.http.Cookie)



generate
public String generate() throws IOException(Code)



getContent
public String getContent()(Code)



getDateHeader
public long getDateHeader(String name)(Code)

Parameters:
  name -
See Also:   org.mortbay.jetty.HttpFields.getDateField(java.lang.String)



getHeader
public String getHeader(String name)(Code)

Parameters:
  name -
See Also:   org.mortbay.jetty.HttpFields.getStringField(java.lang.String)



getHeaderNames
public Enumeration getHeaderNames()(Code)

See Also:   org.mortbay.jetty.HttpFields.getFieldNames



getHeaderValues
public Enumeration getHeaderValues(String name)(Code)

Parameters:
  name -
See Also:   org.mortbay.jetty.HttpFields.getValues(java.lang.String)



getLongHeader
public long getLongHeader(String name) throws NumberFormatException(Code)

Parameters:
  name -
throws:
  NumberFormatException -
See Also:   org.mortbay.jetty.HttpFields.getLongField(java.lang.String)



getMethod
public String getMethod()(Code)
the method



getReason
public String getReason()(Code)
the reason



getStatus
public int getStatus()(Code)
the status



getURI
public String getURI()(Code)
the uri



getVersion
public String getVersion()(Code)
the version



parse
public String parse(String rawHTTP) throws IOException(Code)
Parse one HTTP request or response
Parameters:
  rawHTTP - Raw HTTP to parse Any unparsed data in the rawHTTP (eg pipelined requests)
throws:
  IOException -



removeHeader
public void removeHeader(String name)(Code)

Parameters:
  name -
See Also:   org.mortbay.jetty.HttpFields.remove(java.lang.String)



reset
public void reset()(Code)



setContent
public void setContent(String content)(Code)



setDateHeader
public void setDateHeader(String name, long date)(Code)

Parameters:
  name -
Parameters:
  date -
See Also:   org.mortbay.jetty.HttpFields.putDateField(java.lang.Stringlong)



setHeader
public void setHeader(String name, String value)(Code)

Parameters:
  name -
Parameters:
  value -
See Also:   org.mortbay.jetty.HttpFields.put(java.lang.Stringjava.lang.String)



setLongHeader
public void setLongHeader(String name, long value)(Code)

Parameters:
  name -
Parameters:
  value -
See Also:   org.mortbay.jetty.HttpFields.putLongField(java.lang.Stringlong)



setMethod
public void setMethod(String method)(Code)

Parameters:
  method - the method to set



setReason
public void setReason(String reason)(Code)

Parameters:
  reason - the reason to set



setStatus
public void setStatus(int status)(Code)

Parameters:
  status - the status to set



setURI
public void setURI(String uri)(Code)

Parameters:
  uri - the uri to set



setVersion
public void setVersion(String version)(Code)

Parameters:
  version - the version to set



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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