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 TestTransformerComponent extends TestCase {
35: private ComponentVO cVo;
36: private EndPointVO evo;
37:
38: // PropertiesKey pKey = new PropertiesKey();
39:
40: protected void setUp() throws Exception {
41: cVo = new ComponentVO();
42: cVo.setComponentID(987654321);
43: cVo.setComponentType("Transformer");
44: cVo.setDescription("TEST");
45: cVo.setInterfaceName("TransformerInterFace");
46: cVo.setName("TestTransformer");
47: cVo.setServiceName("TransformerService");
48:
49: evo = new EndPointVO();
50: evo.setName("Transformer");
51: evo.setRole("consumer");
52: }
53:
54: protected void tearDown() throws Exception {
55: super .tearDown();
56: }
57:
58: public void testTransformerComponent() throws IOException {
59: TransformerComponent tComponent = new TransformerComponent(cVo);
60: EndPoint ep = new EndPoint(evo);
61: ep.addSetting(PropertiesKey.TRANSFORMER_WSDL_TRNFILE,
62: "where is it");
63: tComponent.endPointList.add(ep);
64: // tComponent.addSetting(pKey.TRANSFORMER_WSDL_TRNFILE,
65: // "Xlate/fixed2Xml.trn");
66: try {
67: tComponent.generateWSDL("target/test-data/out", "sa");
68: } catch (Exception e) {
69: e.printStackTrace();
70: }
71: // String rsuleString=FileUtil.readStringFromFile("target/test-data/out/TestTransformer/Transformer.wsdl");
72: // String beginString=FileUtil.readStringFromFile("target/test-data/result/Transformer.txt");
73: // assertTrue(rsuleString.equals(beginString));
74: }
75: }
|