01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: * See the GNU Lesser General Public License for more details at gnu.org.
11: */
12:
13: package com.eviware.soapui.impl.wsdl.panels.mockoperation;
14:
15: import com.eviware.soapui.impl.wsdl.WsdlOperation;
16: import com.eviware.soapui.impl.wsdl.mock.WsdlMockResult;
17: import com.eviware.soapui.impl.wsdl.submit.WsdlMessageExchange;
18: import com.eviware.soapui.model.iface.Attachment;
19: import com.eviware.soapui.support.types.StringToStringMap;
20:
21: /**
22: * WsdlMessageExchange for a WsdlMockResult, required for validations
23: *
24: * @author ole.matzura
25: */
26:
27: public class WsdlMockResultMessageExchange extends WsdlMessageExchange {
28: private final WsdlMockResult mockResult;
29:
30: public WsdlMockResultMessageExchange(WsdlMockResult mockResult) {
31: this .mockResult = mockResult;
32: }
33:
34: public Attachment[] getRequestAttachments() {
35: return mockResult.getMockRequest().getRequestAttachments();
36: }
37:
38: public String getRequestContent() {
39: if (mockResult == null || mockResult.getMockRequest() == null)
40: return null;
41:
42: return mockResult.getMockRequest().getRequestContent();
43: }
44:
45: public StringToStringMap getRequestHeaders() {
46: return mockResult.getMockRequest().getRequestHeaders();
47: }
48:
49: public Attachment[] getResponseAttachments() {
50: return mockResult.getMockResponse().getAttachments();
51: }
52:
53: public String getResponseContent() {
54: return mockResult.getResponseContent();
55: }
56:
57: public StringToStringMap getResponseHeaders() {
58: return mockResult.getResponseHeaders();
59: }
60:
61: public WsdlOperation getOperation() {
62: return mockResult.getMockResponse().getMockOperation()
63: .getOperation();
64: }
65:
66: public long getTimeTaken() {
67: return mockResult.getTimeTaken();
68: }
69:
70: public long getTimestamp() {
71: return mockResult.getTimestamp();
72: }
73: }
|