01: // Copyright © 2002-2005 Canoo Engineering AG, Switzerland.
02: package com.canoo.webtest.engine;
03:
04: import com.canoo.webtest.self.LogCatchingTestCase;
05:
06: import java.io.File;
07:
08: /**
09: * Tests for {@link com.canoo.webtest.engine.ContextHelper}.
10: * @author Marc Guillemot
11: * @author Paul King
12: */
13: public class ContextHelperTest extends LogCatchingTestCase {
14: /**
15: * Tests that no exception is thrown when an IOException occurs but that it gets logged.
16: */
17: public void testWriteResponseFileIOExceptionHandling() {
18: ContextHelper.writeResponseFile(null, new File(""));
19: assertTrue(getSpoofAppender().allMessagesToString().indexOf(
20: "Failed writing current response to") > -1);
21: }
22:
23: protected void setUp() throws Exception {
24: super .setUp();
25: setUpCatchLoggerMessages();
26: }
27:
28: protected void tearDown() throws Exception {
29: super.tearDown();
30: tearDownCatchLoggerMessages();
31: }
32: }
|