Package org.apache.cactus.internal.client

Examples of org.apache.cactus.internal.client.ClientTestCaseCaller


     *            for the current test case.
     * @see AbstractTestCase#runTest()
     */
    protected void runTest() throws Throwable
    {
        ClientTestCaseCaller delegator = new ClientTestCaseCaller(
            this, this, new HttpProtocolHandler(new ServletConfiguration()));

        try
        {
            // Call the begin method
            WebRequest request = new WebRequestImpl(new ServletConfiguration());

            delegator.callBeginMethod(request);

            // Create a mock HttpURLConnection as it is needed by HttpUnit
            // for creating a WebResponse
            MockHttpURLConnection connection = new MockHttpURLConnection(
                new URL("http://something"));

            // Set the values expected by Http Unit. Note: only the test
            // cases that have an end method with an HttpUnit WebReponse
            // will use the HttpURLConnection.
            connection.setExpectedGetHeaderField("HTTP/1.1 200 OK");
            connection.setExpectedGetInputStream(
                new ByteArrayInputStream("".getBytes()));

            // Create a WebResponse object and call the end method
            delegator.callEndMethod(request,
                new WebResponseObjectFactory(connection));
        }
        catch (AssertionFailedError e)
        {
            // Perform asserts
View Full Code Here


    
     * @param theTest a pure JUnit Test that Cactus will wrap
     */
    private void init(Test theTest)
    {
        setClientCaller(new ClientTestCaseCaller(this, theTest,
            createProtocolHandler()));
        setServerCaller(new ServerTestCaseCaller(this, theTest));
    }
View Full Code Here

    
     * @param theTest a pure JUnit Test that Cactus will wrap
     */
    private void init(Test theTest)
    {
        setClientCaller(new ClientTestCaseCaller(this, theTest,
            createProtocolHandler()));
        setServerCaller(new ServerTestCaseCaller(this, theTest));
    }
View Full Code Here

     *            for the current test case.
     * @see AbstractTestCase#runTest()
     */
    protected void runTest() throws Throwable
    {
        ClientTestCaseCaller delegator = new ClientTestCaseCaller(
            this, this,
            new HttpProtocolHandler(new DefaultServletConfiguration()));

        try
        {
            // Call the begin method
            WebRequest request =
                new WebRequestImpl(new DefaultServletConfiguration());

            delegator.callBeginMethod(request);

            // Create a mock HttpURLConnection as it is needed by HttpUnit
            // for creating a WebResponse
            MockHttpURLConnection connection = new MockHttpURLConnection(
                new URL("http://something"));

            // Set the values expected by Http Unit. Note: only the test
            // cases that have an end method with an HttpUnit WebReponse
            // will use the HttpURLConnection.
            connection.setExpectedGetHeaderField("HTTP/1.1 200 OK");
            connection.setExpectedGetInputStream(
                new ByteArrayInputStream("".getBytes()));

            // Create a WebResponse object and call the end method
            delegator.callEndMethod(request,
                new WebResponseObjectFactory(connection));
        }
        catch (AssertionFailedError e)
        {
            // Perform asserts
View Full Code Here

     *            for the current test case.
     * @see AbstractTestCase#runTest()
     */
    protected void runTest() throws Throwable
    {
        ClientTestCaseCaller delegator = new ClientTestCaseCaller(
            this, this,
            new HttpProtocolHandler(new DefaultServletConfiguration()));

        try
        {
            // Call the begin method
            WebRequest request =
                new WebRequestImpl(new DefaultServletConfiguration());

            delegator.callBeginMethod(request);

            // Create a mock HttpURLConnection as it is needed by HttpUnit
            // for creating a WebResponse
            MockHttpURLConnection connection = new MockHttpURLConnection(
                new URL("http://something"));

            // Set the values expected by Http Unit. Note: only the test
            // cases that have an end method with an HttpUnit WebReponse
            // will use the HttpURLConnection.
            connection.setExpectedGetHeaderField("HTTP/1.1 200 OK");
            connection.setExpectedGetInputStream(
                new ByteArrayInputStream("".getBytes()));

            // Create a WebResponse object and call the end method
            delegator.callEndMethod(request,
                new WebResponseObjectFactory(connection));
        }
        catch (AssertionFailedError e)
        {
            // Perform asserts
View Full Code Here

    
     * @param theTest a pure JUnit Test that Cactus will wrap
     */
    private void init(Test theTest)
    {
        setClientCaller(new ClientTestCaseCaller(this, theTest,
            createProtocolHandler()));
        setServerCaller(new ServerTestCaseCaller(this, theTest));
    }
View Full Code Here

     *            for the current test case.
     * @see AbstractTestCase#runTest()
     */
    protected void runTest() throws Throwable
    {
        ClientTestCaseCaller delegator = new ClientTestCaseCaller(
            this, this,
            new HttpProtocolHandler(new DefaultServletConfiguration()));

        try
        {
            // Call the begin method
            WebRequest request =
                new WebRequestImpl(new DefaultServletConfiguration());

            delegator.callBeginMethod(request);

            // Create a mock HttpURLConnection as it is needed by HttpUnit
            // for creating a WebResponse
            MockHttpURLConnection connection = new MockHttpURLConnection(
                new URL("http://something"));

            // Set the values expected by Http Unit. Note: only the test
            // cases that have an end method with an HttpUnit WebReponse
            // will use the HttpURLConnection.
            connection.setExpectedGetHeaderField("HTTP/1.1 200 OK");
            connection.setExpectedGetInputStream(
                new ByteArrayInputStream("".getBytes()));

            // Create a WebResponse object and call the end method
            delegator.callEndMethod(request,
                new WebResponseObjectFactory(connection));
        }
        catch (AssertionFailedError e)
        {
            // Perform asserts
View Full Code Here

    
     * @param theTest a pure JUnit Test that Cactus will wrap
     */
    private void init(Test theTest)
    {
        setClientCaller(new ClientTestCaseCaller(this, theTest,
            createProtocolHandler()));
        setServerCaller(new ServerTestCaseCaller(this, theTest));
    }
View Full Code Here

TOP

Related Classes of org.apache.cactus.internal.client.ClientTestCaseCaller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.