//package com.eactive.eai.transformer;
//
//import org.json.simple.JSONObject;
//import org.json.simple.JSONValue;
//
//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 junit.framework.Test;
//import junit.framework.TestCase;
//import junit.framework.TestSuite;
//
//
//public class TransformBizTest extends TestCase {
//	protected static Logger logger = Logger.getLogger("transformer");
//
//	TransformEngine engine = null;
//    
//    
//    public TransformBizTest(String name) {
//        super(name);
//    }
//
//    public static Test suite() {
//        /*
//        * the dynamic way
//        */
//        return new TestSuite(TransformBizTest.class);
//    }
//
//    public void setUp() throws Exception {
//        // 변환 초기화
//        engine = TransformEngine.getInstance();
//
//        if (!engine.isStarted()) {
//            engine.start();
//        }
//    }
//
//    public void tearDown() throws Exception {
//        //
//    }
//    
//    public void testJsonToFlatTransform() throws Exception {
//		System.out.println("Json TO Flat ==============================================================");
//    //logger.debug("Transform08900001Test | testTransform()");
//
//    //----------------------------------------------------------------------
//    // source message 생성
//    //----------------------------------------------------------------------
//	String data ="";
//	data = 
//	"{\"InData\":{\"telInfoCnt\":1,\"telInfoArray\":[{\"billAcntNo\":\"552005724628\",\"aceNo\":\"300105266377\",\"prodNo\":\"01035603973\",\"entrNo\":\"500204205165\"}]}}" 	;
////	"{\"InData\":{\"telInfoCnt\":\"01\",\"telInfoArray\":[{\"billAcntNo\":\"552005724628\",\"aceNo\":\"300105266377\",\"prodNo\":\"01035603973\",\"entrNo\":\"500204205165\"}]}}" 	;
//		
////	data = "{\"BFB_KGP04L0144_REQ1\":"+
////			"{\"InData\":{\"telInfoCnt\":1,\"telInfoArray\":[{\"billAcntNo\":\"552005724628\",\"aceNo\":\"300105266377\",\"prodNo\":\"01035603973\",\"entrNo\":\"500204205165\"}]}}"
////			+ "}";
////	
//    Message source = MessageFactory.getFactory().getMessage("BFB_KGP04L0144_REQ1");
//    
//	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("data="+data);
//    source.setData(data.getBytes());
//    System.out.println("source="+source);
//
//    //----------------------------------------------------------------------
//    // 변환 방식 1
//    //----------------------------------------------------------------------
//    Transformer transformer = engine.getTransformer();
//    Message target = transformer.transform("TRANSFORM_BFB_KGP04L0144BFB_REQ", new Message[] { source });
//
//    System.out.println(target.toString());
////    
//}
//    
//public void atestFlatToJsonTransform() throws Exception {
//  		System.out.println("Flat TO Json ==============================================================");
//        //----------------------------------------------------------------------
//        // source message 생성
//        //----------------------------------------------------------------------
//    	String data ="00                                                                                                                    0000100023";
//        Message source = MessageFactory.getFactory().getMessage("TST_CCMMCI0023RS1JBB_REQ2");
//        source.setData(data.getBytes());
////        System.out.println(source);
//
//        //----------------------------------------------------------------------
//        // 변환 방식 1
//        //----------------------------------------------------------------------
//        Transformer transformer = engine.getTransformer();
//        Message target = transformer.transform("TRANSFORM_TST_CCMMCI9999S1_RES", new Message[] { source });
//
//        
////        System.out.println(target);
//        System.out.println(target.toString());
//        System.out.println("testFlatToJsonTransform >> [["+target.getData()+"]]");
//        
//    }  
//    	
//	}
