01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU General Public License as published by
09: * the Free Software Foundation; either version 2 of the License, or
10: * (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307
20: * USA
21: *
22: *
23: *
24: */
25: package com.bostechcorp.cbesb.common.sa.service;
26:
27: import java.io.IOException;
28:
29: import junit.framework.TestCase;
30:
31: import com.bostechcorp.cbesb.common.sa.vo.ComponentVO;
32: import com.bostechcorp.cbesb.common.sa.vo.EndPointVO;
33:
34: public class TestHTTPComponent extends TestCase {
35: private ComponentVO cVo;
36: private EndPointVO evo;
37: private EndPointVO evo2;
38:
39: protected void setUp() throws Exception {
40: cVo = new ComponentVO();
41: cVo.setComponentID(987654321);
42: cVo.setComponentType("HTTP");
43: cVo.setDescription("TEST HTTP");
44: cVo.setInterfaceName("HTTPInterFace");
45: cVo.setName("TestHTTP");
46: cVo.setServiceName("HTTPService");
47:
48: evo = new EndPointVO();
49: evo.setName("name");
50: evo.setRole("consumer");
51:
52: evo2 = new EndPointVO();
53: evo2.setName("name2");
54: evo2.setRole("provider");
55:
56: }
57:
58: protected void tearDown() throws Exception {
59: super .tearDown();
60: }
61:
62: public void testJMSComponent() throws IOException {
63: EndPoint ep = new EndPoint(evo);
64: EndPoint ep2 = new EndPoint(evo2);
65:
66: ep.addSetting(PropertiesKey.HTTP_WSDL_SERVER_DEFAULTMEP,
67: "InOut");
68: ep.addSetting(PropertiesKey.HTTP_WSDL_SERVER_SOAP_ENABLE,
69: "enable");
70: ep.addSetting(PropertiesKey.HTTP_WSDL_SERVER_SOAP_DEFAULTMEP,
71: "InOnly");
72: ep
73: .addSetting(PropertiesKey.HTTP_WSDL_SERVER_LOCATIONURL,
74: "aaa");
75:
76: ep2.addSetting(PropertiesKey.HTTP_WSDL_CLIENT_DEFAULTMEP,
77: "InOnly");
78: ep2.addSetting(PropertiesKey.HTTP_WSDL_CLIENT_LOCATIONURL,
79: "BBB");
80:
81: HTTPComponent hComponent = new HTTPComponent(cVo);
82: hComponent.endPointList.add(ep);
83: hComponent.endPointList.add(ep2);
84: // hComponent.addSetting(pKey.HTTP_WSDL_ROLE,"provider");
85: // hComponent.addSetting(pKey.HTTP_WSDL_CLIENT_LOCATIONURL,"aaa");
86: // hComponent.addSetting("Http.Server.defaultMep","in-only");
87: //
88: // hComponent.addSetting(pKey.HTTP_WSDL_SERVER_ROLE,"consumer");
89: // hComponent.addSetting(pKey.HTTP_WSDL_SERVER_LOCATIONURL,"bbb");
90: // hComponent.addSetting(pKey.HTTP_WSDL_SERVER_DEFAULTMEP,"InOut");
91:
92: try {
93: hComponent.generateWSDL("target/test-data/out", "sa");
94: } catch (Exception e) {
95: e.printStackTrace();
96: }
97:
98: }
99: }
|