package com.qikemi.packages.test;

import org.junit.Test;

import com.qikemi.packages.test.bean.Message;
import com.qikemi.packages.xmlandjson.Xml2JavaBean;

/**
 * 
 * Create Date: 2014年9月28日 下午8:28:30
 * Author XieXianbin<a.b@hotmail.com>
 * Source Repositories Address: <https://github.com/qikemi/open-wechat-sdk>
 */
public class Tes {

	@Test
	public void tes1(){
		String xml = " <xml> <ToUserName><![CDATA[toUser]]></ToUserName> <FromUserName><![CDATA[fromUser]]></FromUserName> <CreateTime>1348831860</CreateTime> <MsgType><![CDATA[text]]></MsgType> <Content><![CDATA[this is a test]]></Content> <MsgId>1234567890123456</MsgId> </xml>";
		Message message = (Message) Xml2JavaBean.convert2JavaBean(xml, Message.class);
		
		System.out.println(message.getFromUserName());
		System.out.println(message.getToUserName());
//		System.out.println(message.getContent());
		System.out.println(message.getCreateTime());
		System.out.println(message.getMsgType());
//		System.out.println(message.getMsgId());
		
	}
}

@@ -137,14 +137,145 @@
 .xml
-andjso
+JsonAndJavaBean.JavaBean2Json;%0D%0Aimport com.qikemi.packages.xmlJsonAndJavaBean.JavaBean2Xml;%0D%0Aimport com.qikemi.packages.xmlJsonAndJavaBea
 n.Xm
@@ -1160,15 +1160,227 @@
 );%0D%0A
+%09%7D%0D%0A%09%0D%0A%09@Test%0D%0A%09public void tes2s()%7B%0D%0A%09%09Message message = new Message(%22fromUserName%22, %22msgId%22, %22createTime%22, %22content%22, %22toUserName%22, %22msgType%22);%0D%0A%09%09System.out.println(JavaBean2Xml.convert2Xml(message, %22xml%22));%0D%0A
 %09%09%0D%0A%09%7D%0D%0A
 %7D%0D%0A
@@ -1376,11 +1376,14 @@
 %09%09%0D%0A%09%7D%0D%0A
+%09%0D%0A
 %7D%0D%0A

add junit test