com.buglabs.osgi.http.test
Class BinaryTestCases

java.lang.Object
  extended by TestCase
      extended by com.buglabs.osgi.http.test.BinaryTestCases

public class BinaryTestCases
extends TestCase


Field Summary
 boolean doDeleteCalled
           
 boolean doGetCalled
           
 boolean doPostCalled
           
 boolean doPutCalled
           
static java.lang.String SERVLET_ALIAS
           
static java.lang.String TARGET_HOST
           
 
Constructor Summary
BinaryTestCases()
           
 
Method Summary
protected  void setUp()
           
static byte[] streamToByteArray(java.io.InputStream in)
           
 void testDoGet()
           
 void testDoPost()
           
 void testDoPostBase64BinaryFile()
          This tests that POST message body does not get mangled by the server.
 void testDoPostBinaryFile()
          This tests that POST message body does not get mangled by the server.
 void testDoPostFile()
          This tests that POST message body does not get mangled by the server.
 void testDoPostFileUnicode()
          This tests that POST message body does not get mangled by the server.
 void testDoPut()
           
 void testGetHTTPService()
           
 void testRegisterServlet()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doPostCalled

public boolean doPostCalled

doPutCalled

public boolean doPutCalled

doGetCalled

public boolean doGetCalled

doDeleteCalled

public boolean doDeleteCalled

TARGET_HOST

public static java.lang.String TARGET_HOST

SERVLET_ALIAS

public static java.lang.String SERVLET_ALIAS
Constructor Detail

BinaryTestCases

public BinaryTestCases()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Throws:
java.lang.Exception

testGetHTTPService

public void testGetHTTPService()

testRegisterServlet

public void testRegisterServlet()
                         throws javax.servlet.ServletException,
                                org.osgi.service.http.NamespaceException,
                                java.net.MalformedURLException,
                                java.io.IOException,
                                org.xml.sax.SAXException
Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
java.net.MalformedURLException
java.io.IOException
org.xml.sax.SAXException

testDoPut

public void testDoPut()
               throws javax.servlet.ServletException,
                      org.osgi.service.http.NamespaceException,
                      java.net.MalformedURLException,
                      java.io.IOException,
                      org.xml.sax.SAXException
Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
java.net.MalformedURLException
java.io.IOException
org.xml.sax.SAXException

testDoPostBinaryFile

public void testDoPostBinaryFile()
                          throws javax.servlet.ServletException,
                                 org.osgi.service.http.NamespaceException,
                                 java.net.MalformedURLException,
                                 java.io.IOException,
                                 org.xml.sax.SAXException
This tests that POST message body does not get mangled by the server. It does this by passing in a specific message, relying on the servlet on passing the message back after writing it to a file, and then comparing them.

Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
java.net.MalformedURLException
java.io.IOException
org.xml.sax.SAXException

testDoGet

public void testDoGet()
               throws javax.servlet.ServletException,
                      org.osgi.service.http.NamespaceException,
                      java.net.MalformedURLException,
                      java.io.IOException,
                      org.xml.sax.SAXException,
                      java.lang.InterruptedException
Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
java.net.MalformedURLException
java.io.IOException
org.xml.sax.SAXException
java.lang.InterruptedException

testDoPostFile

public void testDoPostFile()
                    throws javax.servlet.ServletException,
                           org.osgi.service.http.NamespaceException,
                           java.net.MalformedURLException,
                           java.io.IOException,
                           org.xml.sax.SAXException
This tests that POST message body does not get mangled by the server. It does this by passing in a specific message, relying on the servlet on passing the message back after writing it to a file, and then comparing them.

Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
java.net.MalformedURLException
java.io.IOException
org.xml.sax.SAXException

testDoPostFileUnicode

public void testDoPostFileUnicode()
                           throws javax.servlet.ServletException,
                                  org.osgi.service.http.NamespaceException,
                                  java.net.MalformedURLException,
                                  java.io.IOException,
                                  org.xml.sax.SAXException
This tests that POST message body does not get mangled by the server. It does this by passing in a specific message, relying on the servlet on passing the message back after writing it to a file, and then comparing them.

Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
java.net.MalformedURLException
java.io.IOException
org.xml.sax.SAXException

testDoPostBase64BinaryFile

public void testDoPostBase64BinaryFile()
                                throws javax.servlet.ServletException,
                                       org.osgi.service.http.NamespaceException,
                                       java.net.MalformedURLException,
                                       java.io.IOException,
                                       org.xml.sax.SAXException
This tests that POST message body does not get mangled by the server. It does this by passing in a specific message, relying on the servlet on passing the message back after writing it to a file, and then comparing them.

Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
java.net.MalformedURLException
java.io.IOException
org.xml.sax.SAXException

testDoPost

public void testDoPost()
                throws javax.servlet.ServletException,
                       org.osgi.service.http.NamespaceException,
                       java.net.MalformedURLException,
                       java.io.IOException,
                       org.xml.sax.SAXException
Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
java.net.MalformedURLException
java.io.IOException
org.xml.sax.SAXException

streamToByteArray

public static byte[] streamToByteArray(java.io.InputStream in)
                                throws java.io.IOException
Throws:
java.io.IOException