1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.ksb.messaging;
17
18 import static org.junit.Assert.assertFalse;
19 import static org.junit.Assert.assertTrue;
20
21 import java.net.URL;
22 import java.util.ArrayList;
23
24 import org.junit.Test;
25 import org.kuali.rice.ksb.api.bus.support.JavaServiceDefinition;
26 import org.kuali.rice.ksb.api.bus.support.SoapServiceDefinition;
27 import org.kuali.rice.ksb.test.KSBTestCase;
28
29
30
31
32
33
34
35 public class SoapServiceDefinitionTest extends KSBTestCase {
36
37 private SoapServiceDefinition soapDefinition;
38
39 public void setUp() throws Exception {
40 super.setUp();
41 this.soapDefinition = new SoapServiceDefinition();
42 this.soapDefinition.setLocalServiceName("testServiceName");
43 this.soapDefinition.setEndpointUrl(new URL("http://www.rutgers.edu"));
44 this.soapDefinition.setService(new ArrayList<String>());
45 this.soapDefinition.validate();
46 }
47
48 @Test
49 public void testIsSameSuccessWithSameDefinition() {
50 assertTrue(this.soapDefinition.equals(this.soapDefinition));
51 }
52
53 @Test
54 public void testIsSameSuccessWithDifferentDefinition() throws Exception {
55 final SoapServiceDefinition soapServiceDefinition = new SoapServiceDefinition();
56 soapServiceDefinition.setLocalServiceName("testServiceName");
57 soapServiceDefinition.setEndpointUrl(new URL("http://www.rutgers.edu"));
58 soapServiceDefinition.setService(new ArrayList<String>());
59 soapServiceDefinition.validate();
60
61 assertTrue(this.soapDefinition.equals(soapServiceDefinition));
62 }
63
64 @Test
65 public void testIsSameFailureWithDifferentClass() throws Exception {
66 final JavaServiceDefinition javaServiceDefinition = new JavaServiceDefinition();
67 javaServiceDefinition.setBusSecurity(Boolean.FALSE);
68 javaServiceDefinition.setLocalServiceName("testServiceName");
69 javaServiceDefinition.setEndpointUrl(new URL("http://www.rutgers.edu"));
70 javaServiceDefinition.setService(new ArrayList<String>());
71 javaServiceDefinition.validate();
72 assertFalse(this.soapDefinition.equals(javaServiceDefinition));
73 }
74 }