1 /*
2 * Copyright 2005-2010 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.test.server;
18
19 /**
20 * Allows for setting up expectations on XPath expressions.
21 * <p/>
22 * Implementations of this interface are returned by {@link org.springframework.ws.test.client.RequestMatchers#xpath(String)} and {@link
23 * org.springframework.ws.test.client.RequestMatchers#xpath(String, java.util.Map)}, as part of the fluent API. As such, it is not typical to implement this
24 * interface yourself.
25 *
26 * @author Lukas Krecan
27 * @author Arjen Poutsma
28 * @see org.springframework.ws.test.client.RequestMatchers#xpath(String)
29 * @see org.springframework.ws.test.client.RequestMatchers#xpath(String, java.util.Map)
30 * @since 2.0
31 */
32 public interface ResponseXPathExpectations {
33
34 /**
35 * Expects the XPath expression to exist.
36 *
37 * @return the request matcher
38 */
39 ResponseMatcher exists();
40
41 /**
42 * Expects the XPath expression to not exist.
43 *
44 * @return the request matcher
45 */
46 ResponseMatcher doesNotExist();
47
48 /**
49 * Expects the XPath expression to evaluate to the given boolean.
50 *
51 * @param expectedValue the expected value
52 * @return the request matcher
53 */
54 ResponseMatcher evaluatesTo(final boolean expectedValue);
55
56 /**
57 * Expects the XPath expression to evaluate to the given integer.
58 *
59 * @param expectedValue the expected value
60 * @return the request matcher
61 */
62 ResponseMatcher evaluatesTo(int expectedValue);
63
64 /**
65 * Expects the XPath expression to evaluate to the given double.
66 *
67 * @param expectedValue the expected value
68 * @return the request matcher
69 */
70 ResponseMatcher evaluatesTo(double expectedValue);
71
72 /**
73 * Expects the XPath expression to evaluate to the given string.
74 *
75 * @param expectedValue the expected value
76 * @return the request matcher
77 */
78 ResponseMatcher evaluatesTo(String expectedValue);
79
80 }