01: /*
02: * Copyright 2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springframework.ws.server.endpoint;
18:
19: import org.dom4j.Document;
20: import org.dom4j.Element;
21:
22: public class Dom4jPayloadEndpointTest extends
23: AbstractPayloadEndpointTestCase {
24:
25: protected PayloadEndpoint createResponseEndpoint() {
26: return new AbstractDom4jPayloadEndpoint() {
27:
28: protected Element invokeInternal(Element requestElement,
29: Document responseDocument) throws Exception {
30: assertNotNull("No requestElement passed",
31: requestElement);
32: assertNotNull("No responseDocument passed",
33: responseDocument);
34: assertEquals("Invalid request element",
35: REQUEST_ELEMENT, requestElement.getName());
36: assertEquals("Invalid request element", NAMESPACE_URI,
37: requestElement.getNamespaceURI());
38: return responseDocument.addElement(RESPONSE_ELEMENT,
39: NAMESPACE_URI);
40: }
41: };
42: }
43:
44: protected PayloadEndpoint createNoResponseEndpoint()
45: throws Exception {
46: return new AbstractDom4jPayloadEndpoint() {
47:
48: protected Element invokeInternal(Element requestElement,
49: Document responseDocument) throws Exception {
50: return null;
51: }
52: };
53: }
54:
55: protected PayloadEndpoint createNoRequestEndpoint()
56: throws Exception {
57: return new AbstractDom4jPayloadEndpoint() {
58:
59: protected Element invokeInternal(Element requestElement,
60: Document responseDocument) throws Exception {
61: assertNull("RequestElement passed", requestElement);
62: return null;
63: }
64: };
65: }
66:
67: }
|