com.hammingweight.hammock.mocks.microedition.io
Class MockHttpConnection

java.lang.Object
  extended by com.hammingweight.hammock.AMockObject
      extended by com.hammingweight.hammock.mocks.microedition.io.MockHttpConnection
All Implemented Interfaces:
IHammockExceptionErrors, IMockObject, javax.microedition.io.Connection, javax.microedition.io.ContentConnection, javax.microedition.io.HttpConnection, javax.microedition.io.InputConnection, javax.microedition.io.OutputConnection, javax.microedition.io.StreamConnection

public class MockHttpConnection
extends AMockObject
implements javax.microedition.io.HttpConnection


Field Summary
static MockMethod MTHD_CLOSE
           
static MockMethod MTHD_GET_DATE
           
static MockMethod MTHD_GET_ENCODING
           
static MockMethod MTHD_GET_EXPIRATION
           
static MockMethod MTHD_GET_FILE
           
static MockMethod MTHD_GET_HEADER_FIELD_$_INT
           
static MockMethod MTHD_GET_HEADER_FIELD_$_STRING
           
static MockMethod MTHD_GET_HEADER_FIELD_DATE_$_STRING_LONG
           
static MockMethod MTHD_GET_HEADER_FIELD_INT_$_STRING_INT
           
static MockMethod MTHD_GET_HEADER_FIELD_KEY_$_INT
           
static MockMethod MTHD_GET_HOST
           
static MockMethod MTHD_GET_LAST_MODIFIED
           
static MockMethod MTHD_GET_LENGTH
           
static MockMethod MTHD_GET_PORT
           
static MockMethod MTHD_GET_PROTOCOL
           
static MockMethod MTHD_GET_QUERY
           
static MockMethod MTHD_GET_REF
           
static MockMethod MTHD_GET_REQUEST_METHOD
           
static MockMethod MTHD_GET_REQUEST_PROPERTY_$_STRING
           
static MockMethod MTHD_GET_RESPONSE_CODE
           
static MockMethod MTHD_GET_RESPONSE_MESSAGE
           
static MockMethod MTHD_GET_TYPE
           
static MockMethod MTHD_GET_URL
           
static MockMethod MTHD_OPEN_DATA_INPUT_STREAM
           
static MockMethod MTHD_OPEN_DATA_OUTPUT_STREAM
           
static MockMethod MTHD_OPEN_INPUT_STREAM
           
static MockMethod MTHD_OPEN_OUTPUT_STREAM
           
static MockMethod MTHD_SET_REQUEST_METHOD_$_STRING
           
static MockMethod MTHD_SET_REQUEST_PROPERTY_$_STRING_STRING
           
 
Fields inherited from interface javax.microedition.io.HttpConnection
GET, HEAD, HTTP_ACCEPTED, HTTP_BAD_GATEWAY, HTTP_BAD_METHOD, HTTP_BAD_REQUEST, HTTP_CLIENT_TIMEOUT, HTTP_CONFLICT, HTTP_CREATED, HTTP_ENTITY_TOO_LARGE, HTTP_EXPECT_FAILED, HTTP_FORBIDDEN, HTTP_GATEWAY_TIMEOUT, HTTP_GONE, HTTP_INTERNAL_ERROR, HTTP_LENGTH_REQUIRED, HTTP_MOVED_PERM, HTTP_MOVED_TEMP, HTTP_MULT_CHOICE, HTTP_NO_CONTENT, HTTP_NOT_ACCEPTABLE, HTTP_NOT_AUTHORITATIVE, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_NOT_MODIFIED, HTTP_OK, HTTP_PARTIAL, HTTP_PAYMENT_REQUIRED, HTTP_PRECON_FAILED, HTTP_PROXY_AUTH, HTTP_REQ_TOO_LONG, HTTP_RESET, HTTP_SEE_OTHER, HTTP_TEMP_REDIRECT, HTTP_UNAUTHORIZED, HTTP_UNAVAILABLE, HTTP_UNSUPPORTED_RANGE, HTTP_UNSUPPORTED_TYPE, HTTP_USE_PROXY, HTTP_VERSION, POST
 
Fields inherited from interface com.hammingweight.hammock.IHammockExceptionErrors
ARGUMENT_MATCHER_ALREADY_SET, CANT_SET_VOID_RETURN_VALUE, CLASS_IS_NOT_THROWABLE, DOES_NOT_SUBCLASS_MOCK_OBJECT, HANDLER_NOT_SET, INCORRECT_MOCK_OBJECT, INCORRECT_RETURN_CLASS, INCORRECT_THROWABLE_CLASS, METHOD_CANNOT_BE_EVALUATED, METHOD_INVOKED_OUT_OF_SEQUENCE, METHOD_INVOKED_TOO_MANY_TIMES, METHOD_INVOKED_UNEXPECTED_NUMBER_OF_TIMES, NO_RETURN_VALUE, NO_RETURN_VALUE_SET, NUM_INVOCATIONS_ALREADY_SET, RETURN_VALUE_ALREADY_SET, WRONG_ARGUMENT_CLASS, WRONG_NUMBER_OF_ARGS
 
Constructor Summary
MockHttpConnection()
           
MockHttpConnection(IInvocationHandler handler)
           
 
Method Summary
 void close()
           
 long getDate()
           
 java.lang.String getEncoding()
           
 long getExpiration()
           
 java.lang.String getFile()
           
 java.lang.String getHeaderField(int arg0)
           
 java.lang.String getHeaderField(java.lang.String arg0)
           
 long getHeaderFieldDate(java.lang.String arg0, long arg1)
           
 int getHeaderFieldInt(java.lang.String arg0, int arg1)
           
 java.lang.String getHeaderFieldKey(int arg0)
           
 java.lang.String getHost()
           
 long getLastModified()
           
 long getLength()
           
 int getPort()
           
 java.lang.String getProtocol()
           
 java.lang.String getQuery()
           
 java.lang.String getRef()
           
 java.lang.String getRequestMethod()
           
 java.lang.String getRequestProperty(java.lang.String arg0)
           
 int getResponseCode()
           
 java.lang.String getResponseMessage()
           
 java.lang.String getType()
           
 java.lang.String getURL()
           
 java.io.DataInputStream openDataInputStream()
           
 java.io.DataOutputStream openDataOutputStream()
           
 java.io.InputStream openInputStream()
           
 java.io.OutputStream openOutputStream()
           
 void setRequestMethod(java.lang.String arg0)
           
 void setRequestProperty(java.lang.String arg0, java.lang.String arg1)
           
 
Methods inherited from class com.hammingweight.hammock.AMockObject
assertReturnNotNull, getInvocationHandler, setInvocationHandler
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MTHD_CLOSE

public static final MockMethod MTHD_CLOSE

MTHD_GET_DATE

public static final MockMethod MTHD_GET_DATE

MTHD_GET_ENCODING

public static final MockMethod MTHD_GET_ENCODING

MTHD_GET_EXPIRATION

public static final MockMethod MTHD_GET_EXPIRATION

MTHD_GET_FILE

public static final MockMethod MTHD_GET_FILE

MTHD_GET_HEADER_FIELD_$_INT

public static final MockMethod MTHD_GET_HEADER_FIELD_$_INT

MTHD_GET_HEADER_FIELD_$_STRING

public static final MockMethod MTHD_GET_HEADER_FIELD_$_STRING

MTHD_GET_HEADER_FIELD_DATE_$_STRING_LONG

public static final MockMethod MTHD_GET_HEADER_FIELD_DATE_$_STRING_LONG

MTHD_GET_HEADER_FIELD_INT_$_STRING_INT

public static final MockMethod MTHD_GET_HEADER_FIELD_INT_$_STRING_INT

MTHD_GET_HEADER_FIELD_KEY_$_INT

public static final MockMethod MTHD_GET_HEADER_FIELD_KEY_$_INT

MTHD_GET_HOST

public static final MockMethod MTHD_GET_HOST

MTHD_GET_LAST_MODIFIED

public static final MockMethod MTHD_GET_LAST_MODIFIED

MTHD_GET_LENGTH

public static final MockMethod MTHD_GET_LENGTH

MTHD_GET_PORT

public static final MockMethod MTHD_GET_PORT

MTHD_GET_PROTOCOL

public static final MockMethod MTHD_GET_PROTOCOL

MTHD_GET_QUERY

public static final MockMethod MTHD_GET_QUERY

MTHD_GET_REF

public static final MockMethod MTHD_GET_REF

MTHD_GET_REQUEST_METHOD

public static final MockMethod MTHD_GET_REQUEST_METHOD

MTHD_GET_REQUEST_PROPERTY_$_STRING

public static final MockMethod MTHD_GET_REQUEST_PROPERTY_$_STRING

MTHD_GET_RESPONSE_CODE

public static final MockMethod MTHD_GET_RESPONSE_CODE

MTHD_GET_RESPONSE_MESSAGE

public static final MockMethod MTHD_GET_RESPONSE_MESSAGE

MTHD_GET_TYPE

public static final MockMethod MTHD_GET_TYPE

MTHD_GET_URL

public static final MockMethod MTHD_GET_URL

MTHD_OPEN_DATA_INPUT_STREAM

public static final MockMethod MTHD_OPEN_DATA_INPUT_STREAM

MTHD_OPEN_DATA_OUTPUT_STREAM

public static final MockMethod MTHD_OPEN_DATA_OUTPUT_STREAM

MTHD_OPEN_INPUT_STREAM

public static final MockMethod MTHD_OPEN_INPUT_STREAM

MTHD_OPEN_OUTPUT_STREAM

public static final MockMethod MTHD_OPEN_OUTPUT_STREAM

MTHD_SET_REQUEST_METHOD_$_STRING

public static final MockMethod MTHD_SET_REQUEST_METHOD_$_STRING

MTHD_SET_REQUEST_PROPERTY_$_STRING_STRING

public static final MockMethod MTHD_SET_REQUEST_PROPERTY_$_STRING_STRING
Constructor Detail

MockHttpConnection

public MockHttpConnection()

MockHttpConnection

public MockHttpConnection(IInvocationHandler handler)
Method Detail

close

public void close()
           throws java.io.IOException
Specified by:
close in interface javax.microedition.io.Connection
Throws:
java.io.IOException

getDate

public long getDate()
             throws java.io.IOException
Specified by:
getDate in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

getEncoding

public java.lang.String getEncoding()
Specified by:
getEncoding in interface javax.microedition.io.ContentConnection

getExpiration

public long getExpiration()
                   throws java.io.IOException
Specified by:
getExpiration in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

getFile

public java.lang.String getFile()
Specified by:
getFile in interface javax.microedition.io.HttpConnection

getHeaderField

public java.lang.String getHeaderField(int arg0)
                                throws java.io.IOException
Specified by:
getHeaderField in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

getHeaderField

public java.lang.String getHeaderField(java.lang.String arg0)
                                throws java.io.IOException
Specified by:
getHeaderField in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

getHeaderFieldDate

public long getHeaderFieldDate(java.lang.String arg0,
                               long arg1)
                        throws java.io.IOException
Specified by:
getHeaderFieldDate in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

getHeaderFieldInt

public int getHeaderFieldInt(java.lang.String arg0,
                             int arg1)
                      throws java.io.IOException
Specified by:
getHeaderFieldInt in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

getHeaderFieldKey

public java.lang.String getHeaderFieldKey(int arg0)
                                   throws java.io.IOException
Specified by:
getHeaderFieldKey in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

getHost

public java.lang.String getHost()
Specified by:
getHost in interface javax.microedition.io.HttpConnection

getLastModified

public long getLastModified()
                     throws java.io.IOException
Specified by:
getLastModified in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

getLength

public long getLength()
Specified by:
getLength in interface javax.microedition.io.ContentConnection

getPort

public int getPort()
Specified by:
getPort in interface javax.microedition.io.HttpConnection

getProtocol

public java.lang.String getProtocol()
Specified by:
getProtocol in interface javax.microedition.io.HttpConnection

getQuery

public java.lang.String getQuery()
Specified by:
getQuery in interface javax.microedition.io.HttpConnection

getRef

public java.lang.String getRef()
Specified by:
getRef in interface javax.microedition.io.HttpConnection

getRequestMethod

public java.lang.String getRequestMethod()
Specified by:
getRequestMethod in interface javax.microedition.io.HttpConnection

getRequestProperty

public java.lang.String getRequestProperty(java.lang.String arg0)
Specified by:
getRequestProperty in interface javax.microedition.io.HttpConnection

getResponseCode

public int getResponseCode()
                    throws java.io.IOException
Specified by:
getResponseCode in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

getResponseMessage

public java.lang.String getResponseMessage()
                                    throws java.io.IOException
Specified by:
getResponseMessage in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

getType

public java.lang.String getType()
Specified by:
getType in interface javax.microedition.io.ContentConnection

getURL

public java.lang.String getURL()
Specified by:
getURL in interface javax.microedition.io.HttpConnection

openDataInputStream

public java.io.DataInputStream openDataInputStream()
                                            throws java.io.IOException
Specified by:
openDataInputStream in interface javax.microedition.io.InputConnection
Throws:
java.io.IOException

openDataOutputStream

public java.io.DataOutputStream openDataOutputStream()
                                              throws java.io.IOException
Specified by:
openDataOutputStream in interface javax.microedition.io.OutputConnection
Throws:
java.io.IOException

openInputStream

public java.io.InputStream openInputStream()
                                    throws java.io.IOException
Specified by:
openInputStream in interface javax.microedition.io.InputConnection
Throws:
java.io.IOException

openOutputStream

public java.io.OutputStream openOutputStream()
                                      throws java.io.IOException
Specified by:
openOutputStream in interface javax.microedition.io.OutputConnection
Throws:
java.io.IOException

setRequestMethod

public void setRequestMethod(java.lang.String arg0)
                      throws java.io.IOException
Specified by:
setRequestMethod in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException

setRequestProperty

public void setRequestProperty(java.lang.String arg0,
                               java.lang.String arg1)
                        throws java.io.IOException
Specified by:
setRequestProperty in interface javax.microedition.io.HttpConnection
Throws:
java.io.IOException