01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.webwork.components;
06:
07: import com.opensymphony.webwork.components.AbstractRichtexteditorConnector.CreateFolderResult;
08: import com.opensymphony.webwork.components.AbstractRichtexteditorConnector.FileUploadResult;
09: import com.opensymphony.webwork.components.AbstractRichtexteditorConnector.Folder;
10: import com.opensymphony.webwork.components.AbstractRichtexteditorConnector.FoldersAndFiles;
11:
12: /**
13: *
14: * @author tm_jee
15: * @version $Date: 2006-02-17 16:21:02 +0100 (Fri, 17 Feb 2006) $ $Id: MockRichtexteditorConnector.java 2199 2006-02-17 15:21:02Z tmjee $
16: */
17: public class MockRichtexteditorConnector extends
18: AbstractRichtexteditorConnector {
19:
20: public boolean isCalculateServerPathCalled = false;
21: public boolean isGetFoldersCalled = false;
22: public boolean isGetFoldersAndFilesCalled = false;
23: public boolean isCreateFolderCalled = false;
24: public boolean isFileUploadCalled = false;
25: public boolean isUnknownCommandCalled = false;
26:
27: public Folder[] _Folder = null;
28: public FoldersAndFiles _FoldersAndFiles = null;
29: public CreateFolderResult _CreateFolderResult = null;
30: public FileUploadResult _FileUploadResult = null;
31:
32: protected String calculateServerPath(String serverPath,
33: String folderPath, String type) throws Exception {
34: isCalculateServerPathCalled = true;
35: return "/calculated" + serverPath;
36: }
37:
38: protected Folder[] getFolders(String virtualFolderPath, String type)
39: throws Exception {
40: isGetFoldersCalled = true;
41: return _Folder;
42: }
43:
44: protected FoldersAndFiles getFoldersAndFiles(
45: String virtualFolderPath, String type) throws Exception {
46: isGetFoldersAndFilesCalled = true;
47: return _FoldersAndFiles;
48: }
49:
50: protected CreateFolderResult createFolder(String virtualFolderPath,
51: String type, String newFolderName) throws Exception {
52: isCreateFolderCalled = true;
53: return _CreateFolderResult;
54: }
55:
56: protected FileUploadResult fileUpload(String virtualFolderPath,
57: String type, String filename, String contentType,
58: java.io.File newFile) throws Exception {
59: isFileUploadCalled = true;
60: return _FileUploadResult;
61: }
62:
63: protected void unknownCommand(String command,
64: String virtualFolderPath, String type, String filename,
65: String contentType, java.io.File newFile) throws Exception {
66: isUnknownCommandCalled = true;
67: }
68:
69: public void reset() {
70: isCalculateServerPathCalled = false;
71: isCreateFolderCalled = false;
72: isFileUploadCalled = false;
73: isGetFoldersAndFilesCalled = false;
74: isGetFoldersCalled = false;
75: isUnknownCommandCalled = false;
76: }
77:
78: }
|