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.jdom.Element;
20: import org.jdom.Namespace;
21:
22: public class JDomPayloadEndpointTest extends
23: AbstractPayloadEndpointTestCase {
24:
25: protected PayloadEndpoint createNoResponseEndpoint()
26: throws Exception {
27: return new AbstractJDomPayloadEndpoint() {
28:
29: protected Element invokeInternal(Element requestElement)
30: throws Exception {
31: return null;
32: }
33: };
34: }
35:
36: protected PayloadEndpoint createResponseEndpoint() throws Exception {
37: return new AbstractJDomPayloadEndpoint() {
38:
39: protected Element invokeInternal(Element requestElement)
40: throws Exception {
41: assertNotNull("No requestElement passed",
42: requestElement);
43: assertEquals("Invalid request element",
44: REQUEST_ELEMENT, requestElement.getName());
45: assertEquals("Invalid request element", NAMESPACE_URI,
46: requestElement.getNamespaceURI());
47: return new Element(RESPONSE_ELEMENT, Namespace
48: .getNamespace("tns", NAMESPACE_URI));
49: }
50: };
51: }
52:
53: protected PayloadEndpoint createNoRequestEndpoint()
54: throws Exception {
55: return new AbstractJDomPayloadEndpoint() {
56:
57: protected Element invokeInternal(Element requestElement)
58: throws Exception {
59: assertNull("RequestElement passed", requestElement);
60: return null;
61: }
62: };
63: }
64: }
|