ContextHelperTest.java :  » Testing » webtest » com » canoo » webtest » engine » Java Open Source

Java Open Source » Testing » webtest 
webtest » com » canoo » webtest » engine » ContextHelperTest.java
// Copyright  2002-2005 Canoo Engineering AG, Switzerland.
package com.canoo.webtest.engine;

import com.canoo.webtest.self.LogCatchingTestCase;

import java.io.File;

/**
 * Tests for {@link com.canoo.webtest.engine.ContextHelper}.
 * @author Marc Guillemot
 * @author Paul King
 */
public class ContextHelperTest extends LogCatchingTestCase
{
    /**
     * Tests that no exception is thrown when an IOException occurs but that it gets logged.
     */
    public void testWriteResponseFileIOExceptionHandling() {
        ContextHelper.writeResponseFile(null, new File(""));
        assertTrue(getSpoofAppender().allMessagesToString().indexOf("Failed writing current response to") > -1);
    }

    protected void setUp() throws Exception {
        super.setUp();
        setUpCatchLoggerMessages();
    }

    protected void tearDown() throws Exception {
        super.tearDown();
        tearDownCatchLoggerMessages();
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.