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 TestSerquencerComponent extends TestCase {
35:
36: private EndPointVO evo;
37: private ComponentVO cVo;
38:
39: protected void setUp() throws Exception {
40:
41: cVo = new ComponentVO();
42: cVo.setComponentID(987654321);
43: cVo.setComponentType("Sq");
44: cVo.setDescription("TestSq");
45: cVo.setInterfaceName("SqInterFace");
46: cVo.setName("TestSq");
47: cVo.setServiceName("SqService");
48:
49: evo = new EndPointVO();
50: evo.setName("XXX");
51: evo.setRole("consumer");
52:
53: }
54:
55: protected void tearDown() throws Exception {
56: super .tearDown();
57: }
58:
59: public void test() throws IOException {
60: EndPoint ep = new EndPoint(evo);
61: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE_MAXORDER,
62: "4");
63:
64: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "1"
65: + ".name", "aaa");
66: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "1"
67: + ".operation", "ccc");
68: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "1"
69: + ".timeOut", "333");
70:
71: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "2"
72: + ".name2", "bbb");
73: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "2"
74: + ".timeOut", "444");
75:
76: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "3"
77: + ".name3", "aaa2");
78: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "3"
79: + ".operation", "qqq");
80: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "3"
81: + ".timeOut", "555");
82:
83: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "4"
84: + ".name4", "aaa3");
85: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "4"
86: + ".operation", "ppp");
87: ep.addSetting(PropertiesKey.SEQUENCER_WSDL_SERVICE + "4"
88: + ".timeOut", "666");
89:
90: SequencerComponent fComponent = new SequencerComponent(cVo);
91: fComponent.endPointList.add(ep);
92:
93: try {
94: fComponent.generateWSDL("target/test-data/out", "sa");
95: } catch (Exception e) {
96: e.printStackTrace();
97: }
98: }
99: }
|