01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: * See the GNU Lesser General Public License for more details at gnu.org.
11: */
12:
13: package com.eviware.soapui.impl.wsdl;
14:
15: import junit.framework.TestCase;
16:
17: import com.eviware.soapui.config.InterfaceConfig;
18:
19: public class WsdlInterfaceTestCase extends TestCase {
20: private WsdlProject project;
21: private InterfaceConfig interfaceConfig;
22: private WsdlInterface iface;
23:
24: public void setUp() throws Exception {
25: project = new WsdlProject();
26: interfaceConfig = InterfaceConfig.Factory.newInstance();
27: iface = new WsdlInterface(project, interfaceConfig);
28:
29: assertEquals(0, iface.getEndpoints().length);
30: }
31:
32: public void testAddEndpoints() throws Exception {
33: iface.addEndpoint("testEndpoint");
34: assertEquals(1, iface.getEndpoints().length);
35: assertEquals("testEndpoint", iface.getEndpoints()[0]);
36:
37: iface.addEndpoint("testEndpoint");
38: assertEquals(1, iface.getEndpoints().length);
39: assertEquals("testEndpoint", iface.getEndpoints()[0]);
40:
41: iface.addEndpoint("testEndpoint2");
42: assertEquals(2, iface.getEndpoints().length);
43: assertEquals("testEndpoint", iface.getEndpoints()[0]);
44: assertEquals("testEndpoint2", iface.getEndpoints()[1]);
45: }
46:
47: public void testRemoveEndpoints() throws Exception {
48: iface.addEndpoint("testEndpoint");
49: iface.addEndpoint("testEndpoint2");
50:
51: iface.removeEndpoint("testEndpoint");
52: assertEquals(1, iface.getEndpoints().length);
53:
54: iface.removeEndpoint("testEndpoint2");
55: assertEquals(0, iface.getEndpoints().length);
56: }
57: }
|