//package com.eactive.eai.transformer;
//
//import com.eactive.eai.common.util.Logger;
//import com.eactive.eai.transformer.engine.TransformEngine;
//import com.eactive.eai.transformer.engine.Transformer;
//import com.eactive.eai.transformer.message.Message;
//import com.eactive.eai.transformer.message.MessageFactory;
//import com.eactive.eai.transformer.message.UJSONMessage;
//import com.eactive.eai.transformer.message.XMLMessage;
//
//import junit.framework.Test;
//import junit.framework.TestCase;
//import junit.framework.TestSuite;
//
//
//public class TransformJsonToJson extends TestCase {
//	protected static Logger logger = Logger.getLogger("transformer");
//
//	TransformEngine engine = null;
//    
//    
//    public TransformJsonToJson(String name) {
//        super(name);
//    }
//
//    public static Test suite() {
//        /*
//        * the dynamic way
//        */
//        return new TestSuite(TransformJsonToJson.class);
//    }
//
//    public void setUp() throws Exception {
//        // 변환 초기화
//        engine = TransformEngine.getInstance();
//
//        if (!engine.isStarted()) {
//            engine.start();
//        }
//    }
//
//    public void tearDown() throws Exception {
//        //
//    }
//    
//    public void atestXmlToJsonTransform() throws Exception {
//  		System.out.println("Json TO XML  ==============================================================");
//        //logger.debug("Transform08900001Test | testTransform()");
//
//        //----------------------------------------------------------------------
//        // source message 생성
//        //----------------------------------------------------------------------
//    	String data ="";
//    	data = 
//    			//"{\"KGI_BNC71900R0_REQ1\":"
//    			"<KGI_BNC71900R0_REQ1>"
//    			+"{\"InData\":{\"custMgtNo\":\"99999\",\"custNm\":\"사용자\",\"resvYn\":\"0\",\"msgCtnt\":\"19.12.26(목)~20.01.10(금)까지 제로페이Biz 앱사용이 불가하오니 참고바랍니다.\",\"sendBrncd\":\"0197\",\"templType\":\"T\",\"custCphnNo\":\"01042672324     \",\"resvYmd\":\"20200506\",\"rsultRetunYn\":\"0\",\"rplyTelno\":\"0220733452\",\"afPrcssPgmName\":\"\",\"msgCretnCd\":\"KGI101\",\"resvTtm\":\"135106\",\"bzwkRceptIdnfiID\":\"\",\"sendEmpid\":\"C900043\",\"groupCoCd\":\"KB0\",\"custIdnfr\":\"9999999999\"}}"
//    			+ "</KGI_BNC71900R0_REQ1>";
////    			+"}";
//
//    	
//        Message source = MessageFactory.getFactory().getMessage("KGI_BNC71900R0_REQ1");
//        
//		String rootItemName = ((XMLMessage)source).getLayout().getRootItem().getName();
//
////        JSONObject value = (JSONObject)JSONValue.parse(data);
////        JSONObject root = new JSONObject();
////        root.put(rootItemName, value);
////        data = root.toJSONString();  
//
//        System.out.println("before="+source);
//        source.setData(data);
//        System.out.println("source="+source);
//
//        //----------------------------------------------------------------------
//        // 변환 방식 1
//        //----------------------------------------------------------------------
//        Transformer transformer = engine.getTransformer();
//        Message target = transformer.transform("TRANSFORM_KGI_BNC71900R0KGI_REQ", new Message[] { source });
//
//        System.out.println(target.toString());
//        
//    }
//    
//    public void atestJsonToJsonTransform() throws Exception {
//  		System.out.println("Json TO XML  ==============================================================");
//        //logger.debug("Transform08900001Test | testTransform()");
//
//        //----------------------------------------------------------------------
//        // source message 생성
//        //----------------------------------------------------------------------
//    	String data ="";
//    	data = "{\"KGN_KGN04I0141_RES1\":"
//    			+"{\"OutChnlTxCd\":\"KGN04I0141\",\"OutForms\":[],\"OutData\":{\"univDstcd\":\"044\",\"univName\":\"배재대학교\",\"univRspblPsnID\":\"TEST0044\",\"univTtnfRspblPsnDstcd\":\"1\",\"rspblPsnName\":\"허유\",\"rspblPsnPwdOW\":\"BD9369CECC1F1B9A8328CD79AF65438E70292D3D\",\"rspblDvsnName\":\"윤일만\",\"rspblPsnTelno\":\"042-520-6070\",\"rspblPsnCphnNo\":\"010-3171-2524\",\"pwdMstkInptNotms\":0,\"pwdModfiYn\":\"1\",\"bzwkAthCtnt\":\"SRP\",\"delDstic\":\"\",\"ttnfAprvalAthDstic\":\"\",\"useAbilIPCtnt\":\"\",\"iPValdnYn\":\"0\",\"useAbilMadrCtnt\":\"\",\"madrValdnYn\":\"0\",\"aray\":[{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"J\",\"studtDsticSumnDstcd\":\"전체\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"090J\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"100\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"P\",\"studtDsticSumnDstcd\":\"전체\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"113S\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"S\",\"studtDsticSumnDstcd\":\"전체\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"113S\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"X\",\"studtDsticSumnDstcd\":\"전체\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"101X\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"Y\",\"studtDsticSumnDstcd\":\"전체\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"097J\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"Z\",\"studtDsticSumnDstcd\":\"전체\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"088S\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"20\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"J\",\"studtDsticSumnDstcd\":\"분납\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"090J\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"100\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"S\",\"studtDsticSumnDstcd\":\"수시\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"113S\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"X\",\"studtDsticSumnDstcd\":\"일반\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"101X\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"Y\",\"studtDsticSumnDstcd\":\"일반\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"097J\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"Z\",\"studtDsticSumnDstcd\":\"생활관\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"088S\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"20\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"J\",\"studtDsticSumnDstcd\":\"계절제\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"090J\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"100\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"S\",\"studtDsticSumnDstcd\":\"정시\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"113S\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"X\",\"studtDsticSumnDstcd\":\"특수\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"101X\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"Y\",\"studtDsticSumnDstcd\":\"특수\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"097J\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"J\",\"studtDsticSumnDstcd\":\"기숙사\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"090J\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"100\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"S\",\"studtDsticSumnDstcd\":\"수시예치금\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"113S\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"X\",\"studtDsticSumnDstcd\":\"전문\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"101X\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"Y\",\"studtDsticSumnDstcd\":\"전문\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"097J\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"S\",\"studtDsticSumnDstcd\":\"정시예치금\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"113S\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"X\",\"studtDsticSumnDstcd\":\"기숙사\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"101X\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"Y\",\"studtDsticSumnDstcd\":\"기숙사\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"097J\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"S\",\"studtDsticSumnDstcd\":\"기숙사\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"113S\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"X\",\"studtDsticSumnDstcd\":\"예치금\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"101X\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"},{\"univDstcd\":\"044\",\"regiStudtDstcd\":\"X\",\"studtDsticSumnDstcd\":\"특별\",\"crculmSumnDstcd\":null,\"thorDataFmatCtnt\":\"101X\",\"hdrEonot\":\"0\",\"trailEonot\":\"0\",\"maxSendSizeCnt\":\"10\",\"thorBkdataFmatDstcd\":\"F\",\"fldDstdlNo\":\"\"}]}}"
//    			+"}";
//
//    	
//        Message source = MessageFactory.getFactory().getMessage("KGN_KGN04I0141_RES1");
//        
//		String rootItemName = ((UJSONMessage)source).getLayout().getRootItem().getName();
//
////        JSONObject value = (JSONObject)JSONValue.parse(data);
////        JSONObject root = new JSONObject();
////        root.put(rootItemName, value);
////        data = root.toJSONString();  
//
//        System.out.println("before="+source);
//        source.setData(data);
//        System.out.println("source="+source);
//
//        //----------------------------------------------------------------------
//        // 변환 방식 1
//        //----------------------------------------------------------------------
//        Transformer transformer = engine.getTransformer();
//        Message target = transformer.transform("TRANSFORM_BFG_KGN04I0141BFG_RES", new Message[] { source });
//
//        System.out.println(target.toString());
//        
//    }
//    
//    public void testJsonToJson2Transform() throws Exception {
//  		System.out.println("Json TO XML  ==============================================================");
//        //logger.debug("Transform08900001Test | testTransform()");
//
//        //----------------------------------------------------------------------
//        // source message 생성
//        //----------------------------------------------------------------------
//    	String data ="";
//    	data = "{\"RBF_RBF040GA40_RES1\":"
//    			+"{\"OutChnlTxCd\":\"RBF040GA40\",\"OutForms\":[],\"OutData\":{\"bzwkCmnDvsn\":{\"operGroupCd\":\"KH1\",\"brnCd\":\"9800\",\"mainPrcssYn\":\"\",\"acctgInptBookRepsntYn\":\"\",\"bzwkGroupCd\":\"\",\"outptSpareItem1\":\"20200506091532713000\",\"outptSpareItem2\":\"20200506091532723\"},\"outItem\":{\"totalLineCnt\":\"2\",\"dataGrid\":[{\"brifAcnoKnd\":\"1\",\"brifCncycd\":\"USD\",\"brifAcnCnt\":2,\"brifTotalBal\":306.19,\"brifTotalLnBal\":0,\"natnlCd\":\"KH\"},{\"brifAcnoKnd\":\"1\",\"brifCncycd\":\"KHR\",\"brifAcnCnt\":1,\"brifTotalBal\":80338.00,\"brifTotalLnBal\":0,\"natnlCd\":\"KH\"}],\"totalLineCnt2\":\"3\",\"dataGrid2\":[{\"acnoKnd\":\"1\",\"ovsesCustOcntryName\":\"YOUNG INNER(CAMBODIA)CO.,LTD.\",\"brncoPrdctCd\":\"110100100001\",\"brncoPrdctPtrnCd\":\"01\",\"brncoPrdctSbjctCd\":\"001\",\"wwwBnkgJoinAbilYn\":\"0\",\"ovsesRcptDstcd\":\"01\",\"prdctName\":\"보통예금\",\"acnoAls\":\"보통예금\",\"acno\":\"980041010005\",\"cncycd\":\"USD\",\"bal\":305.00,\"newYmd\":\"20120305\",\"expirYmd\":\"\",\"cracAgreAmt\":0,\"agreIrt\":0,\"agreYmd\":\"\",\"agreExpirYmd\":\"\",\"cnpr\":0,\"ctrcTrmCnt\":0,\"ctrcUnitDstcd\":\"\",\"autoExtenTrm\":0,\"totalExtenCnt\":0,\"ctrcTrm\":0,\"indpCtrcUnitDstcd\":\"\",\"lnAmt\":0,\"lnBal\":0,\"lnExeYMS\":\"\",\"lnExpirYmd\":\"\",\"lastTranYmd\":\"\",\"limtAplyStartYmd\":\"\",\"limtAplyExpirYmd\":\"\",\"ovsesIrtDstcd\":\"FIXED\",\"acnStus\":\"\",\"transferOrderYn\":\"Y\",\"custIdnfr\":\"G160007845\",\"custMgtNo\":\"00000\",\"acctNatnlCd\":\"KH\"},{\"acnoKnd\":\"1\",\"ovsesCustOcntryName\":\"YOUNG INNER(CAMBODIA)CO.,LTD.\",\"brncoPrdctCd\":\"110100200001\",\"brncoPrdctPtrnCd\":\"01\",\"brncoPrdctSbjctCd\":\"002\",\"wwwBnkgJoinAbilYn\":\"0\",\"ovsesRcptDstcd\":\"01\",\"prdctName\":\"저축예금\",\"acnoAls\":\"저축예금\",\"acno\":\"980011010407\",\"cncycd\":\"USD\",\"bal\":1.19,\"newYmd\":\"20120305\",\"expirYmd\":\"\",\"cracAgreAmt\":0,\"agreIrt\":0,\"agreYmd\":\"\",\"agreExpirYmd\":\"\",\"cnpr\":0,\"ctrcTrmCnt\":0,\"ctrcUnitDstcd\":\"\",\"autoExtenTrm\":0,\"totalExtenCnt\":0,\"ctrcTrm\":0,\"indpCtrcUnitDstcd\":\"\",\"lnAmt\":0,\"lnBal\":0,\"lnExeYMS\":\"\",\"lnExpirYmd\":\"\",\"lastTranYmd\":\"\",\"limtAplyStartYmd\":\"\",\"limtAplyExpirYmd\":\"\",\"ovsesIrtDstcd\":\"FIXED\",\"acnStus\":\"\",\"transferOrderYn\":\"Y\",\"custIdnfr\":\"G160007845\",\"custMgtNo\":\"00000\",\"acctNatnlCd\":\"KH\"},{\"acnoKnd\":\"1\",\"ovsesCustOcntryName\":\"YOUNG INNER(CAMBODIA)CO.,LTD.\",\"brncoPrdctCd\":\"110100200001\",\"brncoPrdctPtrnCd\":\"01\",\"brncoPrdctSbjctCd\":\"002\",\"wwwBnkgJoinAbilYn\":\"0\",\"ovsesRcptDstcd\":\"01\",\"prdctName\":\"저축예금\",\"acnoAls\":\"저축예금\",\"acno\":\"980012050065\",\"cncycd\":\"KHR\",\"bal\":80338.00,\"newYmd\":\"20190801\",\"expirYmd\":\"\",\"cracAgreAmt\":0,\"agreIrt\":0,\"agreYmd\":\"\",\"agreExpirYmd\":\"\",\"cnpr\":0,\"ctrcTrmCnt\":0,\"ctrcUnitDstcd\":\"\",\"autoExtenTrm\":0,\"totalExtenCnt\":0,\"ctrcTrm\":0,\"indpCtrcUnitDstcd\":\"\",\"lnAmt\":0,\"lnBal\":0,\"lnExeYMS\":\"\",\"lnExpirYmd\":\"\",\"lastTranYmd\":\"\",\"limtAplyStartYmd\":\"\",\"limtAplyExpirYmd\":\"\",\"ovsesIrtDstcd\":\"FIXED\",\"acnStus\":\"\",\"transferOrderYn\":\"Y\",\"custIdnfr\":\"G160007845\",\"custMgtNo\":\"00000\",\"acctNatnlCd\":\"KH\"}]}}}"
//    			+"}";
//
//    	
//        Message source = MessageFactory.getFactory().getMessage("RBF_RBF040GA40_RES1");
//        
//		String rootItemName = ((UJSONMessage)source).getLayout().getRootItem().getName();
//
////        JSONObject value = (JSONObject)JSONValue.parse(data);
////        JSONObject root = new JSONObject();
////        root.put(rootItemName, value);
////        data = root.toJSONString();  
//
//        System.out.println("before="+source);
//        source.setData(data);
//        System.out.println("source="+source);
//
//        //----------------------------------------------------------------------
//        // 변환 방식 1
//        //----------------------------------------------------------------------
//        Transformer transformer = engine.getTransformer();
//        Message target = transformer.transform("TRANSFORM_BFC_RBF040GA40BFC_RES", new Message[] { source });
//
//        System.out.println(target.toString());
//        
//    }
//    
//}
