1   /*
2    * Copyright 2007 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
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 NonReflectiveXomPayloadEndpointTest extends AbstractPayloadEndpointTestCase {
22  
23      protected PayloadEndpoint createNoResponseEndpoint() throws Exception {
24          return new AbstractXomPayloadEndpoint(false) {
25  
26              protected Element invokeInternal(Element requestElement) throws Exception {
27                  return null;
28              }
29          };
30      }
31  
32      protected PayloadEndpoint createResponseEndpoint() throws Exception {
33          return new AbstractXomPayloadEndpoint(false) {
34  
35              protected Element invokeInternal(Element requestElement) throws Exception {
36                  assertNotNull("No requestElement passed", requestElement);
37                  assertEquals("Invalid request element", REQUEST_ELEMENT, requestElement.getLocalName());
38                  assertEquals("Invalid request element", NAMESPACE_URI, requestElement.getNamespaceURI());
39                  return new Element(RESPONSE_ELEMENT, NAMESPACE_URI);
40              }
41          };
42      }
43  
44      protected PayloadEndpoint createNoRequestEndpoint() throws Exception {
45          return new AbstractXomPayloadEndpoint(false) {
46  
47              protected Element invokeInternal(Element requestElement) throws Exception {
48                  assertNull("RequestElement passed", requestElement);
49                  return null;
50              }
51          };
52      }
53  
54      public void testStaxSourceEventReader() throws Exception {
55          // overriden, because XOM doesn not support it
56      }
57  
58      public void testStaxSourceStreamReader() throws Exception {
59          // overriden, because XOM doesn not support it
60      }
61  }