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