01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.webwork.views.jsp.ui;
06:
07: import com.opensymphony.webwork.components.AbstractRichtexteditorConnector;
08:
09: /**
10: *
11: * @author tm_jee
12: * @version $Date: 2006-02-17 16:21:02 +0100 (Fri, 17 Feb 2006) $ $Id: RichtexteditorFileUploadResultTest.java 2199 2006-02-17 15:21:02Z tmjee $
13: */
14: public class RichtexteditorFileUploadResultTest extends
15: AbstractRichtexteditorTest {
16:
17: public void testExecuteResultWithFileChange() throws Exception {
18: invocation
19: .getStack()
20: .getContext()
21: .put(
22: "__richtexteditorFileUpload",
23: AbstractRichtexteditorConnector.FileUploadResult
24: .uploadCompleteWithFilenamChanged("newFile.txt"));
25:
26: RichtexteditorFileUploadResult result = new RichtexteditorFileUploadResult();
27: result.execute(invocation);
28:
29: verify(RichtexteditorFileUploadResultTest.class
30: .getResourceAsStream("RichtexteditorFileUploadResultTest1.txt"));
31: }
32:
33: public void testExecuteResultWithError() throws Exception {
34: invocation.getStack().getContext().put(
35: "__richtexteditorFileUpload",
36: AbstractRichtexteditorConnector.FileUploadResult
37: .invalidFile());
38:
39: RichtexteditorFileUploadResult result = new RichtexteditorFileUploadResult();
40: result.execute(invocation);
41:
42: verify(RichtexteditorFileUploadResultTest.class
43: .getResourceAsStream("RichtexteditorFileUploadResultTest2.txt"));
44: }
45:
46: public void testExecuteResultWithSuccess() throws Exception {
47: invocation.getStack().getContext().put(
48: "__richtexteditorFileUpload",
49: AbstractRichtexteditorConnector.FileUploadResult
50: .uploadComplete());
51:
52: RichtexteditorFileUploadResult result = new RichtexteditorFileUploadResult();
53: result.execute(invocation);
54:
55: verify(RichtexteditorFileUploadResultTest.class
56: .getResourceAsStream("RichtexteditorFileUploadResultTest3.txt"));
57: }
58: }
|