01: /*
02: * Copyright 2005 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.w3c.dom.Document;
20: import org.w3c.dom.Element;
21:
22: public class DomPayloadEndpointTest extends
23: AbstractPayloadEndpointTestCase {
24:
25: protected PayloadEndpoint createNoResponseEndpoint()
26: throws Exception {
27: return new AbstractDomPayloadEndpoint() {
28:
29: protected Element invokeInternal(Element requestElement,
30: Document document) throws Exception {
31: return null;
32: }
33: };
34: }
35:
36: protected PayloadEndpoint createResponseEndpoint() throws Exception {
37: return new AbstractDomPayloadEndpoint() {
38:
39: protected Element invokeInternal(Element requestElement,
40: Document responseDocument) throws Exception {
41: assertNotNull("No requestElement passed",
42: requestElement);
43: assertNotNull("No responseDocument passed",
44: responseDocument);
45: assertEquals("Invalid request element",
46: REQUEST_ELEMENT, requestElement.getLocalName());
47: assertEquals("Invalid request element", NAMESPACE_URI,
48: requestElement.getNamespaceURI());
49: return responseDocument.createElementNS(NAMESPACE_URI,
50: RESPONSE_ELEMENT);
51: }
52: };
53: }
54:
55: protected PayloadEndpoint createNoRequestEndpoint()
56: throws Exception {
57: return new AbstractDomPayloadEndpoint() {
58:
59: protected Element invokeInternal(Element requestElement,
60: Document responseDocument) throws Exception {
61: assertNull("RequestElement passed", requestElement);
62: return null;
63: }
64: };
65: }
66: }
|