01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: package org.apache.axis2.addressing.miheaders;
21:
22: import junit.framework.TestCase;
23: import junit.textui.TestRunner;
24: import org.apache.axis2.addressing.RelatesTo;
25:
26: public class RelatesToTest extends TestCase {
27: private RelatesTo relatesTo;
28: String address = "www.someaddress.com";
29: String relationshipType = "Reply";
30:
31: public static void main(String[] args) {
32: TestRunner.run(RelatesToTest.class);
33:
34: }
35:
36: protected void setUp() throws Exception {
37:
38: }
39:
40: public void testGetAddress() {
41: relatesTo = new RelatesTo(address, relationshipType);
42:
43: assertEquals(
44: "RelatesTo address has not been set properly in the constructor",
45: relatesTo.getValue(), address);
46:
47: String newAddress = "www.newRelation.org";
48: relatesTo.setValue(newAddress);
49: assertEquals("RelatesTo address has not been get/set properly",
50: relatesTo.getValue(), newAddress);
51:
52: }
53:
54: public void testGetRelationshipType() {
55: relatesTo = new RelatesTo(address, relationshipType);
56:
57: assertEquals(
58: "RelatesTo RelationshipType has not been set properly in the constructor",
59: relatesTo.getRelationshipType(), relationshipType);
60:
61: String newRelationshipType = "AnyOtherType";
62: relatesTo.setRelationshipType(newRelationshipType);
63: assertEquals("RelatesTo address has not been get/set properly",
64: relatesTo.getRelationshipType(), newRelationshipType);
65: }
66:
67: public void testSingleArgumentConstructor() {
68: relatesTo = new RelatesTo(address);
69: assertEquals(
70: "RelatesTo address has not been set properly in the constructor",
71: relatesTo.getValue(), address);
72:
73: }
74:
75: }
|