01: /*
02: * Copyright 2007 The Kuali Foundation
03: *
04: * Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php
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: package edu.iu.uis.eden.messaging;
17:
18: import java.net.URL;
19: import java.util.ArrayList;
20:
21: import org.junit.Test;
22: import org.kuali.bus.test.KSBTestCase;
23:
24: /**
25: *
26: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
27: * @version $Revision: 1.2.16.1.6.1 $ $Date: 2007/10/17 20:32:05 $
28: * @since 0.9
29: *
30: */
31: public class SoapServiceDefinitionTest extends KSBTestCase {
32:
33: private SOAPServiceDefinition soapDefinition;
34:
35: public void setUp() throws Exception {
36: super .setUp();
37: this .soapDefinition = new SOAPServiceDefinition();
38: this .soapDefinition.setLocalServiceName("testServiceName");
39: this .soapDefinition.setServiceEndPoint(new URL(
40: "http://www.rutgers.edu"));
41: this .soapDefinition.setService(new ArrayList<String>());
42: this .soapDefinition.validate();
43: }
44:
45: @Test
46: public void testIsSameSuccessWithSameDefinition() {
47: assertTrue(this .soapDefinition.isSame(this .soapDefinition));
48: }
49:
50: @Test
51: public void testIsSameSuccessWithDifferentDefinition()
52: throws Exception {
53: final SOAPServiceDefinition soapServiceDefinition = new SOAPServiceDefinition();
54: soapServiceDefinition.setLocalServiceName("testServiceName");
55: soapServiceDefinition.setServiceEndPoint(new URL(
56: "http://www.rutgers.edu"));
57: soapServiceDefinition.setService(new ArrayList<String>());
58: soapServiceDefinition.validate();
59:
60: assertTrue(this .soapDefinition.isSame(soapServiceDefinition));
61: }
62:
63: @Test
64: public void testIsSameFailureWithDifferentClass() throws Exception {
65: final JavaServiceDefinition javaServiceDefinition = new JavaServiceDefinition();
66: javaServiceDefinition.setBusSecurity(Boolean.FALSE);
67: javaServiceDefinition.setLocalServiceName("testServiceName");
68: javaServiceDefinition.setServiceEndPoint(new URL(
69: "http://www.rutgers.edu"));
70: javaServiceDefinition.setService(new ArrayList<String>());
71: javaServiceDefinition.validate();
72: assertFalse(this.soapDefinition.isSame(javaServiceDefinition));
73: }
74: }
|