package com.eactive.eai.transformer;

import java.util.Iterator;

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.layout.Item;
import com.eactive.eai.transformer.message.Message;
import com.eactive.eai.transformer.message.MessageFactory;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite; 

public class LayoutJSONAllTest extends TestCase {
	protected static Logger logger = Logger.getLogger("transformer");

	TransformEngine engine = null;
	
	public static void setSystemPropertyIfNull(String key, String value) {
		if (System.getProperties().contains(key) == false) {
			System.setProperty(key, value);
		}
	}
    
    public LayoutJSONAllTest(String name) {
        super(name);
    }

    public static Test suite() {
		setSystemPropertyIfNull("module", "TEST_DB");
		setSystemPropertyIfNull("eai.tableowner", "IIAPKG");
		setSystemPropertyIfNull("prefix", "local.mcc.oracle");
        /*
        * the dynamic way
        */
        return new TestSuite(LayoutJSONAllTest.class);
    }

    public void setUp() throws Exception {
        // 변환 초기화
        engine = TransformEngine.getInstance();

        if (!engine.isStarted()) {
            engine.start();
        } 
    }

    public void tearDown() throws Exception {
        //
    }
	public void atestUJSON2Bytes() throws Exception {
		System.out.println("JSON int Test ==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();

		data = "{    \"TST_UJSONGRID1DEPTH_REQ\": {        \"GRID_ROWCNT\": 2,        \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abcd\",                \"MM_SDR_PRC\": 1.1,                \"YR_SDR_PRC\": 1            },            {                \"CTRT_CURY_CD\": \"2abcd\",                \"MM_SDR_PRC\": 2.1,                \"YR_SDR_PRC\": 2            }                    ]    }} ";
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTH_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTH_REQ", new Message[] { source });
		System.out.println(target);
		System.out.println("["+new String((byte[])target.getData())+"]");

		data = "{    \"TST_UJSONGRID1DEPTHWITHOUTREF_REQ\": {              \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abcd\",                \"MM_SDR_PRC\": 1.1,                \"YR_SDR_PRC\": 1            },            {                \"CTRT_CURY_CD\": \"2abcd\",                \"MM_SDR_PRC\": 2.1,                \"YR_SDR_PRC\": 2            }                    ]    }} ";
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTHWITHOUTREF_REQ");
		 source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHWITHOUTREF_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");

		data = "{    \"TST_UJSONGRID1DEPTHMAXCOUNT_REQ\": {        \"GRID_ROWCNT\": 2,        \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abcd\",                \"MM_SDR_PRC\": 1.1,                \"YR_SDR_PRC\": 1            },            {                \"CTRT_CURY_CD\": \"2abcd\",                \"MM_SDR_PRC\": 2.1,                \"YR_SDR_PRC\": 2            }                    ]    }} ";
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTHMAXCOUNT_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHMAXCOUNT_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		data = "{    \"TST_UJSONGRIDMULTI_REQ\": {        \"GRID_ROWCNT\": 2,        \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abcd\",                \"MM_SDR_PRC\": 1.1,                \"YR_SDR_PRC\": 1            },            {                \"CTRT_CURY_CD\": \"2abcd\",                \"MM_SDR_PRC\": 2.1,                \"YR_SDR_PRC\": 2            }                    ],        \"GRID_ROWCNT1\": 2,        \"GRID_DATAGRID1\": [            {                \"CTRT_CURY_CD\": \"abcd\",                \"MM_SDR_PRC\": 1.1,                \"YR_SDR_PRC\": 1            },            {                \"CTRT_CURY_CD\": \"2abcd\",                \"MM_SDR_PRC\": 2.1,                \"YR_SDR_PRC\": 2            }                    ]            }}";
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRIDMULTI_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRIDMULTI_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");

		data ="{    \"TST_UJSONGRID2DEPTH_REQ\": {        \"GRID_ROWCNT\": 2,        \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abcd\",                \"MM_SDR_PRC\": 1.1,                \"YR_SDR_PRC\": 1,		        \"GRID_ROWCNT1\": 3,		        \"GRID_DATAGRID1\": [		            {		                \"CTRT_CURY_CD\": \"abcd\",		                \"MM_SDR_PRC\": 1.1,		                \"YR_SDR_PRC\": 1		            },		            {		                \"CTRT_CURY_CD\": \"2abcd\",		                \"MM_SDR_PRC\": 2.1,		                \"YR_SDR_PRC\": 2		            },		            {		                \"CTRT_CURY_CD\": \"2abcd\",		                \"MM_SDR_PRC\": 3.1,		                \"YR_SDR_PRC\": 3		            }             		        ]                },            {                \"CTRT_CURY_CD\": \"2abcd\",                \"MM_SDR_PRC\": 2.1,                \"YR_SDR_PRC\": 2,		        \"GRID_ROWCNT1\": 2,		        \"GRID_DATAGRID1\": [		            {		                \"CTRT_CURY_CD\": \"abcd\",		                \"MM_SDR_PRC\": 1.1,		                \"YR_SDR_PRC\": 1		            },		            {		                \"CTRT_CURY_CD\": \"2abcd\",		                \"MM_SDR_PRC\": 2.1,		                \"YR_SDR_PRC\": 2		            }            		        ]             }                    ]        }}";
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID2DEPTH_REQ");
		 source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTH_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");

		data ="{    \"TST_UJSONGRID2DEPTHWITHOUTREF_REQ\": {        \"GRID_ROWCNT\": 2,        \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abcd\",                \"MM_SDR_PRC\": 1.1,                \"YR_SDR_PRC\": 1,		        		        \"GRID_DATAGRID1\": [		            {		                \"CTRT_CURY_CD\": \"abcd\",		                \"MM_SDR_PRC\": 1.1,		                \"YR_SDR_PRC\": 1		            },		            {		                \"CTRT_CURY_CD\": \"2abcd\",		                \"MM_SDR_PRC\": 2.1,		                \"YR_SDR_PRC\": 2		            },		            {		                \"CTRT_CURY_CD\": \"2abcd\",		                \"MM_SDR_PRC\": 3.1,		                \"YR_SDR_PRC\": 3		            }             		        ]                },            {                \"CTRT_CURY_CD\": \"2abcd\",                \"MM_SDR_PRC\": 2.1,                \"YR_SDR_PRC\": 2,		        		        \"GRID_DATAGRID1\": [		            {		                \"CTRT_CURY_CD\": \"abcd\",		                \"MM_SDR_PRC\": 1.1,		                \"YR_SDR_PRC\": 1		            },		            {		                \"CTRT_CURY_CD\": \"2abcd\",		                \"MM_SDR_PRC\": 2.1,		                \"YR_SDR_PRC\": 2		            }            		        ]             }                    ]        }}";
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID2DEPTHWITHOUTREF_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTHWITHOUTREF_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		data ="{    \"TST_UJSONARRAY_REQ\": {        \"CTRT_CURY_CD\": [\"abcd\", \"abcd1\"] }}";
		source = MessageFactory.getFactory().getMessage("TST_UJSONARRAY_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4ARRAY_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		data ="{    \"TST_UJSONGROUP_REQ\": {      \"GRID_ROWCNT\": 99,   \"GRID_DATAGRID\":        {                \"CTRT_CURY_CD\": \"abcd\",                \"MM_SDR_PRC\": 1.1,                \"YR_SDR_PRC\": 1		        		        }}}";
		source = MessageFactory.getFactory().getMessage("TST_UJSONGROUP_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GROUP_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		

	} 
	public void atestBYTES2JSON() throws Exception {
		System.out.println("BYTES int Test ==============================================================");
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		data ="000002abc000001100000000000000100Tab000002100000000000000200";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID1DEPTH_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTH_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		data ="000002abc000001100000000000000100Tab000002100000000000000200";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID1DEPTH_REQ");
		source.setData(data.getBytes());
		System.out.println(source);		
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHWITHOUTREF_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		
		data ="000002abc000001100000000000000100Tab000002100000000000000200";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID1DEPTHMAXCOUNT_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHMAXCOUNT_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		

		data ="000002abc000001100000000000000100Tab000002100000000000000200000002abc000001100000000000000100Tab000002100000000000000200";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRIDMULTI_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRIDMULTI_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");

		
		data ="000002abc000001100000000000000100000003abc0000011000000000000002002ab0000021000000000000003002ab0000031000000000000004002ab000002100000000000000500000002abc0000011000000000000006002ab000002100000000000000700";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID2DEPTH_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTH_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");

		
		data ="000002abc000001100000000000000100000003abc0000011000000000000002002ab0000021000000000000003002ab0000031000000000000004002ab000002100000000000000500000002abc0000011000000000000006002ab000002100000000000000700";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID2DEPTH_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTHWITHOUTREF_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");

		
		data ="00002abcd abcd1";
		System.out.println(data);
		source = MessageFactory.getFactory().getMessage("TST_BYTESARRAY_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4ARRAY_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");

		
		data ="000099abc000011100000000011100000";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGROUP_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GROUP_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		
		
	} 	


	public void testGRID1DEPTH_BYTES2UJSON() throws Exception {
		System.out.println("testGRID1DEPTH_BYTES2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//BYTES => UJSON
		data = "000002abc0000011000000000000000012ab000002100000000000000002";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID1DEPTH_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTH_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		//UJSON => BYTES
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTH_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTH_REQ", new Message[] { source });
		System.out.println(target);
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//결과체크
		assertEquals(data, new String((byte[])target.getData()));
		System.out.println("testGRID1DEPTH_BYTES2UJSON Test start==============================================================");
	}
	public void testGRID1DEPTH_UJSON2BYTES() throws Exception {	
		System.out.println("testGRID1DEPTH_UJSON2BYTES Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();		
		//UJSON => BYTES
//		data = "{    \"TST_UJSONGRID1DEPTH_REQ\": {        \"GRID_ROWCNT\": 2,        \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abc\",                \"MM_SDR_PRC\": 1.100000,                \"YR_SDR_PRC\": 100           },            {                \"CTRT_CURY_CD\": \"2ab\",                \"MM_SDR_PRC\": 2.100000,                \"YR_SDR_PRC\": 2            }                    ]    }} ";
		data = "{    \"TST_UJSONGRID1DEPTH_REQ\": {               \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abc\",                \"MM_SDR_PRC\": 1.100000,                \"YR_SDR_PRC\": 100           },            {                \"CTRT_CURY_CD\": \"2ab\",                \"MM_SDR_PRC\": 2.100000,                \"YR_SDR_PRC\": 2            }                    ] , \"GRID_ROWCNT\": 2   }} ";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTH_REQ");
		source.setData(data);
		System.out.println(source);
		String jsonSource = (String)source.getData();
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTH_REQ", new Message[] { source });
		System.out.println(target);
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		
		//BYTES => UJSON
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID1DEPTH_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTH_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		//결과체크
		assertEquals(jsonSource, (String)target.getData());
		
		System.out.println("testGRID1DEPTH_UJSON2BYTES Test end==============================================================");
		
	}
	public void testGRID1DEPTHWITHOUTREF_BYTES2UJSON() throws Exception {
		System.out.println("testGRID1DEPTHWITHOUTREF_BYTES2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		//BYTES => UJSON
		data = "000002abc0000011000000000000000012ab000002100000000000000002";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID1DEPTH_REQ");
		source.setData(data.getBytes());
		System.out.println(source);		
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHWITHOUTREF_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		
		//UJSON => BYTES
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTHWITHOUTREF_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHWITHOUTREF_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//결과체크
		assertEquals(data, new String((byte[])target.getData()));
		
		System.out.println("testGRID1DEPTHWITHOUTREF_BYTES2UJSON Test end==============================================================");
		
	}
	public void testGRID1DEPTHWITHOUTREF_UJSON2BYTES() throws Exception {
		System.out.println("testGRID1DEPTHWITHOUTREF_UJSON2BYTES Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		data = "{    \"TST_UJSONGRID1DEPTHWITHOUTREF_REQ\": {              \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abc\",                \"MM_SDR_PRC\": 1.100000,                \"YR_SDR_PRC\": 1            },            {                \"CTRT_CURY_CD\": \"2ab\",                \"MM_SDR_PRC\": 2.100000,                \"YR_SDR_PRC\": 2            }                    ]    }} ";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		//UJSON => BYTES
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTHWITHOUTREF_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHWITHOUTREF_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//BYTES => UJSON
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID1DEPTH_REQ");
		source.setData(target.getData());
		System.out.println(source);		
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHWITHOUTREF_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		//결과체크
		assertEquals(data, (String)target.getData());
		
		System.out.println("testGRID1DEPTHWITHOUTREF_UJSON2BYTES Test end==============================================================");
		
	}
	public void testGRID1DEPTHMAXCOUNT_BYTES2UJSON() throws Exception {
		System.out.println("testGRID1DEPTHMAXCOUNT_BYTES2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		//BYTES => UJSON
		data = "000002abc0000011000000000000000012ab000002100000000000000002";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID1DEPTHMAXCOUNT_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHMAXCOUNT_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		//UJSON => BYTES
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTHMAXCOUNT_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHMAXCOUNT_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//결과체크
		assertEquals(data, new String((byte[])target.getData()));

		System.out.println("testGRID1DEPTHMAXCOUNT_BYTES2UJSON Test end==============================================================");
		
	}
	public void testGRID1DEPTHMAXCOUNT_UJSON2BYTES() throws Exception {
		System.out.println("testGRID1DEPTHMAXCOUNT_UJSON2BYTES Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//UJSON => BYTES
		data = "{    \"TST_UJSONGRID1DEPTHMAXCOUNT_REQ\": {        \"GRID_ROWCNT\": 2,        \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abc\",                \"MM_SDR_PRC\": 1.100000,                \"YR_SDR_PRC\": 1            },            {                \"CTRT_CURY_CD\": \"2ab\",                \"MM_SDR_PRC\": 2.100000,                \"YR_SDR_PRC\": 2            }                    ]    }} ";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTHMAXCOUNT_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHMAXCOUNT_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//BYTES => UJSON
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID1DEPTHMAXCOUNT_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHMAXCOUNT_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		
		//결과체크
		assertEquals(data, (String)target.getData());
		
		System.out.println("testGRID1DEPTHMAXCOUNT_UJSON2BYTES Test end==============================================================");
		
	}
	public void testGRIDMULTI_BYTES2UJSON() throws Exception {
		System.out.println("testGRIDMULTI_BYTES2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//BYTES => UJSON
		data ="000002abc0000011000000000000000012ab000002100000000000000002000002abc0000021000000000000000012ab000002100000000000000002";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRIDMULTI_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRIDMULTI_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		//UJSON => BYTES
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRIDMULTI_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRIDMULTI_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//결과체크
		assertEquals(data, new String((byte[])target.getData()));

		System.out.println("testGRIDMULTI_BYTES2UJSON Test end==============================================================");
		
	}
	public void testGRIDMULTI_UJSON2BYTES() throws Exception {
		System.out.println("testGRIDMULTI_UJSON2BYTES Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//UJSON => BYTES
		data = "{    \"TST_UJSONGRIDMULTI_REQ\": {        \"GRID_ROWCNT\": 2,        \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abc\",                \"MM_SDR_PRC\": 1.100000,                \"YR_SDR_PRC\": 1            },            {                \"CTRT_CURY_CD\": \"2ab\",                \"MM_SDR_PRC\": 2.100000,                \"YR_SDR_PRC\": 2            }                    ],        \"GRID_ROWCNT1\": 2,        \"GRID_DATAGRID1\": [            {                \"CTRT_CURY_CD\": \"abc\",                \"MM_SDR_PRC\": 1.100000,                \"YR_SDR_PRC\": 1            },            {                \"CTRT_CURY_CD\": \"2ab\",                \"MM_SDR_PRC\": 2.100000,                \"YR_SDR_PRC\": 2            }                    ]            }}";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}		
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRIDMULTI_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRIDMULTI_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//BYTES => UJSON
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRIDMULTI_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRIDMULTI_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		
		//결과체크
		assertEquals(data, (String)target.getData());
		
		System.out.println("testGRIDMULTI_UJSON2BYTES Test end==============================================================");
		
	}
	public void testGRID1DEPTHFIXCOUNT_UJSON2BYTES() throws Exception {
		System.out.println("testGRID1DEPTHFIXCOUNT_UJSON2BYTES Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//UJSON => BYTES
		data = "{    \"TST_UJSONGRID1DEPTHFIXCOUNT_REQ\": {        \"GRID_ROWCNT\": 2,        \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abcd\",                \"MM_SDR_PRC\": 1.1,                \"YR_SDR_PRC\": 1            },            {                \"CTRT_CURY_CD\": \"2abcd\",                \"MM_SDR_PRC\": 2.1,                \"YR_SDR_PRC\": 2            }     ,{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}               ]    }} ";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTHFIXCOUNT_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHFIXCOUNT_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//BYTES => UJSON
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID1DEPTHFIXCOUNT_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID1DEPTHFIXCOUNT_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		
		//결과체크
		//assertEquals(data, (String)target.getData());
		
		System.out.println("testGRID1DEPTHFIXCOUNT_UJSON2BYTES Test end==============================================================");
		
	}
	public void testGRID2DEPTH_BYTES2UJSON() throws Exception {
		System.out.println("testGRID2DEPTH_BYTES2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//BYTES => UJSON
		data ="000002abc000001100000000000000100000003abc0000021000000000000002002ab0000031000000000000003002ab0000041000000000000004002ab000005100000000000000500000002abc0000061000000000000006002ab000007100000000000000700";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID2DEPTH_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTH_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		//UJSON => BYTES
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID2DEPTH_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTH_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//결과체크
		assertEquals(data, new String((byte[])target.getData()));
		
		System.out.println("testGRID2DEPTH_BYTES2UJSON Test end==============================================================");
		
	}
	public void testGRID2DEPTH_UJSON2BYTES() throws Exception {
		System.out.println("testGRID2DEPTH_UJSON2BYTES Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		//UJSON => BYTES
		data ="{    \"TST_UJSONGRID2DEPTH_REQ\": {        \"GRID_ROWCNT\": 2,        \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"abc\",                \"MM_SDR_PRC\": 1.100000,                \"YR_SDR_PRC\": 1,		        \"GRID_ROWCNT1\": 3,		        \"GRID_DATAGRID1\": [		            {		                \"CTRT_CURY_CD\": \"abc\",		                \"MM_SDR_PRC\": 1.100000,		                \"YR_SDR_PRC\": 1		            },		            {		                \"CTRT_CURY_CD\": \"2ab\",		                \"MM_SDR_PRC\": 2.100000,		                \"YR_SDR_PRC\": 2		            },		            {		                \"CTRT_CURY_CD\": \"bcd\",		                \"MM_SDR_PRC\": 3.100000,		                \"YR_SDR_PRC\": 3		            }             		        ]                },            {                \"CTRT_CURY_CD\": \"2cd\",                \"MM_SDR_PRC\": 2.000001,                \"YR_SDR_PRC\": 2,		        \"GRID_ROWCNT1\": 2,		        \"GRID_DATAGRID1\": [		            {		                \"CTRT_CURY_CD\": \"acd\",		                \"MM_SDR_PRC\": 1.100000,		                \"YR_SDR_PRC\": 1		            },		            {		                \"CTRT_CURY_CD\": \"bcd\",		                \"MM_SDR_PRC\": 2.100000,		                \"YR_SDR_PRC\": 2		            }            		        ]             }                    ]        }}";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID2DEPTH_REQ");
		 source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTH_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");		
		
		//BYTES => UJSON
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID2DEPTH_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTH_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
	
		//결과체크
		assertEquals(data, (String)target.getData());
		
		System.out.println("testGRID2DEPTH_UJSON2BYTES Test end==============================================================");
		
	}
	public void testGRID2DEPTHWITHOUTREF_BYTES2UJSON() throws Exception {
		System.out.println("testGRID2DEPTHWITHOUTREF_BYTES2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//BYTES => UJSON
		data ="000002abc000001100000000000000100000003abc0000011000000000000002002ab0000021000000000000003002ab0000031000000000000004002ab000002100000000000000500000002abc0000011000000000000006002ab000002100000000000000700";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID2DEPTH_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTHWITHOUTREF_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		//UJSON => BYTES
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID2DEPTHWITHOUTREF_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTHWITHOUTREF_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//결과체크
		assertEquals(data, new String((byte[])target.getData()));
		
		System.out.println("testGRID2DEPTHWITHOUTREF_BYTES2UJSON Test end==============================================================");
		
	}
	public void testGRID2DEPTHWITHOUTREF_UJSON2BYTES() throws Exception {
		System.out.println("testGRID2DEPTHWITHOUTREF_UJSON2BYTES Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		//UJSON => BYTES
		data ="{    \"TST_UJSONGRID2DEPTHWITHOUTREF_REQ\": {             \"GRID_DATAGRID\": [            {                \"CTRT_CURY_CD\": \"bcd\",                \"MM_SDR_PRC\": 1.100000,                \"YR_SDR_PRC\": 1,		        		        \"GRID_DATAGRID1\": [		            {		                \"CTRT_CURY_CD\": \"223\",		                \"MM_SDR_PRC\": 1.100000,		                \"YR_SDR_PRC\": 1		            },		            {		                \"CTRT_CURY_CD\": \"444\",		                \"MM_SDR_PRC\": 2.100000,		                \"YR_SDR_PRC\": 2		            },		            {		                \"CTRT_CURY_CD\": \"bcd\",		                \"MM_SDR_PRC\": 3.100000,		                \"YR_SDR_PRC\": 3		            }             		        ]                },            {                \"CTRT_CURY_CD\": \"123\",                \"MM_SDR_PRC\": 2.100000,                \"YR_SDR_PRC\": 2,		        		        \"GRID_DATAGRID1\": [		            {		                \"CTRT_CURY_CD\": \"bcd\",		                \"MM_SDR_PRC\": 1.100000,		                \"YR_SDR_PRC\": 1		            },		            {		                \"CTRT_CURY_CD\": \"222\",		                \"MM_SDR_PRC\": 2.100000,		                \"YR_SDR_PRC\": 2		            }            		        ]             }                    ]        }}";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID2DEPTHWITHOUTREF_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTHWITHOUTREF_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//BYTES => UJSON
		source = MessageFactory.getFactory().getMessage("TST_BYTESGRID2DEPTH_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GRID2DEPTHWITHOUTREF_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		//결과체크  다시 체크해야됨
		assertEquals(data, (String)target.getData());
		
		System.out.println("testGRID2DEPTHWITHOUTREF_UJSON2BYTES Test end==============================================================");
		
	}
	public void testARRAY_BYTES2UJSON() throws Exception {
		System.out.println("testARRAY_BYTES2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//BYTES => UJSON
		data ="00002abcd abcd1";
		System.out.println(data);
		source = MessageFactory.getFactory().getMessage("TST_BYTESARRAY_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4ARRAY_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		
		//UJSON => BYTES
		source = MessageFactory.getFactory().getMessage("TST_UJSONARRAY_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4ARRAY_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//결과체크
		assertEquals(data, new String((byte[])target.getData()));
		
		System.out.println("testARRAY_BYTES2UJSON Test end==============================================================");
		
	}
	public void testARRAY_UJSON2BYTES() throws Exception {
		System.out.println("testARRAY_UJSON2BYTES Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		//UJSON => BYTES
		data ="{    \"TST_UJSONARRAY_REQ\": {        \"CTRT_CURY_CD\": [\"abcd1\", \"abcd2\"] }}";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}		
		source = MessageFactory.getFactory().getMessage("TST_UJSONARRAY_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4ARRAY_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//BYTES => UJSON
		System.out.println(data);
		source = MessageFactory.getFactory().getMessage("TST_BYTESARRAY_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4ARRAY_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");
		

		
		//결과체크
		assertEquals(data, (String)target.getData());
		
		System.out.println("testARRAY_UJSON2BYTES Test end==============================================================");
		
	}
	public void testGROUP_BYTES2UJSON() throws Exception {
		System.out.println("testGROUP_BYTES2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//BYTES => UJSON
		data ="000099abc000011100000000011100000";
		source = MessageFactory.getFactory().getMessage("TST_BYTESGROUP_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GROUP_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");		
		
		source = MessageFactory.getFactory().getMessage("TST_UJSONGROUP_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GROUP_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//결과체크
		assertEquals(data, new String((byte[])target.getData()));
		
		System.out.println("testGROUP_BYTES2UJSON Test end==============================================================");
		
	}
	public void testGROUP_UJSON2BYTES() throws Exception {
		System.out.println("testGROUP_UJSON2BYTES Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//UJSON  => BYTES
		data ="{    \"TST_UJSONGROUP_REQ\": {      \"GRID_ROWCNT\": 99,   \"GRID_DATAGRID\":        {                \"CTRT_CURY_CD\": \"abc\",                \"MM_SDR_PRC\": 1.100000,                \"YR_SDR_PRC\": 1		        		        }}}";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		source = MessageFactory.getFactory().getMessage("TST_UJSONGROUP_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GROUP_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//BYTES => UJSON
		source = MessageFactory.getFactory().getMessage("TST_BYTESGROUP_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2BYTES4GROUP_RES", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");		
		
		
		//결과체크
		assertEquals(data, (String)target.getData());
		
		System.out.println("testGROUP_UJSON2BYTES Test end==============================================================");
		
	}
	public void test1DEPTH_VBYTES2UJSON() throws Exception {
		System.out.println("test1DEPTH_VBYTES2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//BYTES => UJSON
		data ="0010ABCDEFGHIJ0011A0123456789";
		source = MessageFactory.getFactory().getMessage("TST_VFIELD_REQ");
		source.setData(data.getBytes());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_VFIELD2UJSON_REQ", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");		
		
		source = MessageFactory.getFactory().getMessage("TST_UJSONVFIELD_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2VFIELD_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//결과체크
		assertEquals(data, new String((byte[])target.getData()));
		
		System.out.println("test1DEPTH_VBYTES2UJSON Test end==============================================================");
		
	}
	public void test1DEPTH_UJSON2VBYTES() throws Exception {
		System.out.println("test1DEPTH_UJSON2VBYTES Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//UJSON  => BYTES
		data = "{\"TST_UJSONVFIELD_REQ\" : { \"reqCount1\":\"0010\",\"reqMsgP1\":\"ABCDEFGHIJ\",\"reqCount2\":\"0011\",\"reqMsgP2\":\"A1234567890\"}}";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		source = MessageFactory.getFactory().getMessage("TST_UJSONVFIELD_REQ");
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2VFIELD_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+new String((byte[])target.getData())+"]");
		
		//BYTES => UJSON
		source = MessageFactory.getFactory().getMessage("TST_VFIELD_REQ");
		source.setData(target.getData());
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_VFIELD2UJSON_REQ", new Message[] { source });
		System.out.println(target);
		System.out.println("["+target.getData()+"]");		
		
		
		//결과체크
		assertEquals(data, (String)target.getData());
		
		System.out.println("test1DEPTH_UJSON2VBYTES Test end==============================================================");
		
	}
	public void testMASS_UJSON2UJSON() throws Exception {
		System.out.println("testMASS_UJSON2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//UJSON  => UJSON  mass 오류
		data = "{\"TST_UJSONGRID1DEPTH_REQ\" : { \"GRID_DATAGRID\" : [] }}";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTH_REQ");

		//mass 처리 시작
		for (Iterator iter = source.fullIterator(); iter.hasNext(); ) {
			Item x = (Item) iter.next();
			if (x.getOccRef() !=null && x.getOccRef().trim().length() > 0 ){
				x.setOccRef("");
			}
		}
		//mass 처리 종료
		
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2UJSON4GRID1DEPTH_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+(String)target.getData()+"]");
		
		
		data = "{\"TST_UJSONGRID1DEPTH_REQ\" : { }}";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		source = MessageFactory.getFactory().getMessage("TST_UJSONGRID1DEPTH_REQ");

		//mass 처리 시작
		for (Iterator iter = source.fullIterator(); iter.hasNext(); ) {
			Item x = (Item) iter.next();
			if (x.getOccRef() !=null && x.getOccRef().trim().length() > 0 ){
				x.setOccRef("");
			}
		}
		//mass 처리 종료
		
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_TST_UJSON2UJSON4GRID1DEPTH_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+(String)target.getData()+"]");		
		
		
//		//BYTES => UJSON
//		source = MessageFactory.getFactory().getMessage("TST_VFIELD_REQ");
//		source.setData(target.getData());
//		System.out.println(source);
//		target = transformer.transform("TRANSFORM_TST_VFIELD2UJSON_REQ", new Message[] { source });
//		System.out.println(target);
//		System.out.println("["+target.getData()+"]");		
//		
//		
//		//결과체크
//		assertEquals(data, (String)target.getData());
		
		System.out.println("testMASS_UJSON2UJSON Test end==============================================================");
		
	}
	public void testnotMASS_UJSON2UJSON() throws Exception {
		System.out.println("testnotMASS_UJSON2UJSON Test start==============================================================");
		// ----------------------------------------------------------------------
		// source message 생성
		// ----------------------------------------------------------------------
		String data = "";
		Message source = null;
		Message target = null;
		Transformer transformer = engine.getTransformer();
		
		//UJSON  => UJSON  mass 오류
		data = "{\"ATF_SUTM00024526_REQ\" : { }}";
		try{
			data = ((JSONObject)JSONValue.parse(data)).toJSONString();
		}catch(Exception e){
		}
		source = MessageFactory.getFactory().getMessage("ATF_SUTM00024526_REQ");
		
		source.setData(data);
		System.out.println(source);
		target = transformer.transform("TRANSFORM_ATF_MUTMDAS00022509S1_REQ", new Message[] { source });
		System.out.println(target);		
		System.out.println("["+(String)target.getData()+"]");
		
//		//BYTES => UJSON
//		source = MessageFactory.getFactory().getMessage("TST_VFIELD_REQ");
//		source.setData(target.getData());
//		System.out.println(source);
//		target = transformer.transform("TRANSFORM_TST_VFIELD2UJSON_REQ", new Message[] { source });
//		System.out.println(target);
//		System.out.println("["+target.getData()+"]");		
//		
//		
//		//결과체크
//		assertEquals(data, (String)target.getData());
		
		System.out.println("testnotMASS_UJSON2UJSON Test end==============================================================");
		
	}
}
