001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.ws.addressing;
019:
020: import javax.xml.namespace.QName;
021:
022: import org.junit.Assert;
023: import org.junit.Before;
024: import org.junit.Test;
025:
026: public class AddressingConstantsImplTest extends Assert {
027: private AddressingConstants constants;
028:
029: @Before
030: public void setUp() {
031: constants = new AddressingConstantsImpl();
032: }
033:
034: @Test
035: public void testGetNamespaceURI() throws Exception {
036: assertEquals("unexpected constant",
037: "http://www.w3.org/2005/08/addressing", constants
038: .getNamespaceURI());
039: }
040:
041: @Test
042: public void testGetWSDLNamespaceURI() throws Exception {
043: assertEquals("unexpected constant",
044: "http://www.w3.org/2005/02/addressing/wsdl", constants
045: .getWSDLNamespaceURI());
046: }
047:
048: @Test
049: public void testGetWSDLExtensibility() throws Exception {
050: assertEquals("unexpected constant", new QName(
051: "http://www.w3.org/2005/02/addressing/wsdl",
052: "UsingAddressing"), constants
053: .getWSDLExtensibilityQName());
054: }
055:
056: @Test
057: public void testGetWSDLActionQName() throws Exception {
058: assertEquals("unexpected constant", new QName(
059: "http://www.w3.org/2005/02/addressing/wsdl", "Action"),
060: constants.getWSDLActionQName());
061: }
062:
063: @Test
064: public void testGetAnonymousURI() throws Exception {
065: assertEquals("unexpected constant",
066: "http://www.w3.org/2005/08/addressing/anonymous",
067: constants.getAnonymousURI());
068: }
069:
070: @Test
071: public void testGetNoneURI() throws Exception {
072: assertEquals("unexpected constant",
073: "http://www.w3.org/2005/08/addressing/none", constants
074: .getNoneURI());
075: }
076:
077: @Test
078: public void testGetFromQName() throws Exception {
079: assertEquals("unexpected constant", new QName(
080: "http://www.w3.org/2005/08/addressing", "From"),
081: constants.getFromQName());
082: }
083:
084: @Test
085: public void testGetToQName() throws Exception {
086: assertEquals("unexpected constant", new QName(
087: "http://www.w3.org/2005/08/addressing", "To"),
088: constants.getToQName());
089: }
090:
091: @Test
092: public void testGetReplyToQName() throws Exception {
093: assertEquals("unexpected constant", new QName(
094: "http://www.w3.org/2005/08/addressing", "ReplyTo"),
095: constants.getReplyToQName());
096: }
097:
098: @Test
099: public void testGetFaultToQName() throws Exception {
100: assertEquals("unexpected constant", new QName(
101: "http://www.w3.org/2005/08/addressing", "FaultTo"),
102: constants.getFaultToQName());
103: }
104:
105: @Test
106: public void testGetActionQName() throws Exception {
107: assertEquals("unexpected constant", new QName(
108: "http://www.w3.org/2005/08/addressing", "Action"),
109: constants.getActionQName());
110: }
111:
112: @Test
113: public void testGetMessageIDQName() throws Exception {
114: assertEquals("unexpected constant", new QName(
115: "http://www.w3.org/2005/08/addressing", "MessageID"),
116: constants.getMessageIDQName());
117: }
118:
119: @Test
120: public void testGetRelationshipReply() throws Exception {
121: assertEquals("unexpected constant",
122: "http://www.w3.org/2005/08/addressing/reply", constants
123: .getRelationshipReply());
124: }
125:
126: @Test
127: public void testGetRelatesToQName() throws Exception {
128: assertEquals("unexpected constant", new QName(
129: "http://www.w3.org/2005/08/addressing", "RelatesTo"),
130: constants.getRelatesToQName());
131: }
132:
133: @Test
134: public void testGetRelationshipTypeQName() throws Exception {
135: assertEquals("unexpected constant", new QName(
136: "http://www.w3.org/2005/08/addressing",
137: "RelationshipType"), constants
138: .getRelationshipTypeQName());
139: }
140:
141: @Test
142: public void testGetMetadataQName() throws Exception {
143: assertEquals("unexpected constant", new QName(
144: "http://www.w3.org/2005/08/addressing", "Metadata"),
145: constants.getMetadataQName());
146: }
147:
148: @Test
149: public void testGetAddressQName() throws Exception {
150: assertEquals("unexpected constant", new QName(
151: "http://www.w3.org/2005/08/addressing", "Address"),
152: constants.getAddressQName());
153: }
154:
155: @Test
156: public void testGetPackageName() throws Exception {
157: assertEquals("unexpected constant",
158: "org.apache.cxf.ws.addressing", constants
159: .getPackageName());
160: }
161:
162: @Test
163: public void testGetIsReferenceParameterQName() throws Exception {
164: assertEquals("unexpected constant", new QName(
165: "http://www.w3.org/2005/08/addressing",
166: "IsReferenceParameter"), constants
167: .getIsReferenceParameterQName());
168: }
169:
170: @Test
171: public void testGetInvalidMapQName() throws Exception {
172: assertEquals("unexpected constant", new QName(
173: "http://www.w3.org/2005/08/addressing",
174: "InvalidMessageAddressingProperty"), constants
175: .getInvalidMapQName());
176: }
177:
178: @Test
179: public void testMapRequiredQName() throws Exception {
180: assertEquals("unexpected constant", new QName(
181: "http://www.w3.org/2005/08/addressing",
182: "MessageAddressingPropertyRequired"), constants
183: .getMapRequiredQName());
184: }
185:
186: @Test
187: public void testDestinationUnreachableQName() throws Exception {
188: assertEquals("unexpected constant", new QName(
189: "http://www.w3.org/2005/08/addressing",
190: "DestinationUnreachable"), constants
191: .getDestinationUnreachableQName());
192: }
193:
194: @Test
195: public void testActionNotSupportedQName() throws Exception {
196: assertEquals("unexpected constant", new QName(
197: "http://www.w3.org/2005/08/addressing",
198: "ActionNotSupported"), constants
199: .getActionNotSupportedQName());
200: }
201:
202: @Test
203: public void testEndpointUnavailableQName() throws Exception {
204: assertEquals("unexpected constant", new QName(
205: "http://www.w3.org/2005/08/addressing",
206: "EndpointUnavailable"), constants
207: .getEndpointUnavailableQName());
208: }
209:
210: @Test
211: public void testDefaultFaultAction() throws Exception {
212: assertEquals("unexpected constant",
213: "http://www.w3.org/2005/08/addressing/fault", constants
214: .getDefaultFaultAction());
215: }
216:
217: @Test
218: public void testActionNotSupportedText() throws Exception {
219: assertEquals("unexpected constant", "Action {0} not supported",
220: constants.getActionNotSupportedText());
221: }
222:
223: @Test
224: public void testDestinationUnreachableText() throws Exception {
225: assertEquals("unexpected constant",
226: "Destination {0} unreachable", constants
227: .getDestinationUnreachableText());
228: }
229:
230: @Test
231: public void testEndpointUnavailableText() throws Exception {
232: assertEquals("unexpected constant", "Endpoint {0} unavailable",
233: constants.getEndpointUnavailableText());
234: }
235:
236: @Test
237: public void testGetInvalidMapText() throws Exception {
238: assertEquals("unexpected constant",
239: "Invalid Message Addressing Property {0}", constants
240: .getInvalidMapText());
241: }
242:
243: @Test
244: public void testMapRequiredText() throws Exception {
245: assertEquals("unexpected constant",
246: "Message Addressing Property {0} required", constants
247: .getMapRequiredText());
248: }
249:
250: @Test
251: public void testDuplicateMessageIDText() throws Exception {
252: assertEquals("unexpected constant", "Duplicate Message ID {0}",
253: constants.getDuplicateMessageIDText());
254: }
255: }
|