将WxAccessToken放到common里

This commit is contained in:
Daniel Qian 2014-10-21 19:09:24 +08:00
parent 7becf8e4f2
commit 137601edee
29 changed files with 50 additions and 54 deletions

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.enterprise.bean;
package me.chanjar.weixin.common.bean;
import me.chanjar.weixin.enterprise.util.json.WxCpGsonBuilder;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common;
package me.chanjar.weixin.common.util;
import javax.xml.bind.annotation.adapters.XmlAdapter;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common;
package me.chanjar.weixin.common.util;
import java.io.File;
import java.io.FileOutputStream;

View File

@ -6,7 +6,7 @@
* arose from modification of the original source, or other redistribution of this source
* is not permitted without written permission of the KINGSTAR MEDIA SOLUTIONS LTD.
*/
package me.chanjar.weixin.common;
package me.chanjar.weixin.common.util;
import com.google.gson.JsonElement;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common;
package me.chanjar.weixin.common.util;
import javax.xml.bind.annotation.adapters.XmlAdapter;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common;
package me.chanjar.weixin.common.util;
import java.io.IOException;
import java.io.InputStream;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.enterprise.api;
import me.chanjar.weixin.enterprise.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.WxAccessToken;
/**
* 微信客户端配置存储

View File

@ -8,6 +8,7 @@ import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.enterprise.bean.*;
import me.chanjar.weixin.enterprise.util.http.SimpleGetRequestExecutor;
import me.chanjar.weixin.enterprise.util.crypto.SHA1;
@ -25,7 +26,7 @@ import me.chanjar.weixin.enterprise.bean.result.WxError;
import me.chanjar.weixin.enterprise.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.enterprise.bean.result.WxUser;
import me.chanjar.weixin.enterprise.exception.WxErrorException;
import me.chanjar.weixin.common.FileUtils;
import me.chanjar.weixin.common.util.FileUtils;
import me.chanjar.weixin.enterprise.util.http.MediaDownloadRequestExecutor;
import me.chanjar.weixin.enterprise.util.http.MediaUploadRequestExecutor;
import me.chanjar.weixin.enterprise.util.http.RequestExecutor;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.enterprise.api;
import me.chanjar.weixin.enterprise.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.WxAccessToken;
/**
* 基于内存的微信配置provider在实际生产环境中应该将这些配置持久化

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.enterprise.bean;
import me.chanjar.weixin.enterprise.api.WxCpConfigStorage;
import me.chanjar.weixin.common.AdapterCDATA;
import me.chanjar.weixin.common.XmlTransformer;
import me.chanjar.weixin.common.util.AdapterCDATA;
import me.chanjar.weixin.common.util.XmlTransformer;
import me.chanjar.weixin.enterprise.util.crypto.WxCryptUtil;
import org.apache.commons.io.IOUtils;

View File

@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import me.chanjar.weixin.enterprise.api.WxCpConsts;
import me.chanjar.weixin.common.MediaIdMarshaller;
import me.chanjar.weixin.common.util.MediaIdMarshaller;
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)

View File

@ -14,8 +14,8 @@ import me.chanjar.weixin.enterprise.bean.outxmlbuilder.TextBuilder;
import me.chanjar.weixin.enterprise.bean.outxmlbuilder.VideoBuilder;
import me.chanjar.weixin.enterprise.bean.outxmlbuilder.VoiceBuilder;
import me.chanjar.weixin.enterprise.util.crypto.WxCryptUtil;
import me.chanjar.weixin.common.AdapterCDATA;
import me.chanjar.weixin.common.XmlTransformer;
import me.chanjar.weixin.common.util.AdapterCDATA;
import me.chanjar.weixin.common.util.XmlTransformer;
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)

View File

@ -11,7 +11,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import me.chanjar.weixin.enterprise.api.WxCpConsts;
import me.chanjar.weixin.common.AdapterCDATA;
import me.chanjar.weixin.common.util.AdapterCDATA;
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)

View File

@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import me.chanjar.weixin.enterprise.api.WxCpConsts;
import me.chanjar.weixin.common.AdapterCDATA;
import me.chanjar.weixin.common.util.AdapterCDATA;
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)

View File

@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import me.chanjar.weixin.enterprise.api.WxCpConsts;
import me.chanjar.weixin.common.AdapterCDATA;
import me.chanjar.weixin.common.util.AdapterCDATA;
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)

View File

@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import me.chanjar.weixin.enterprise.api.WxCpConsts;
import me.chanjar.weixin.common.MediaIdMarshaller;
import me.chanjar.weixin.common.util.MediaIdMarshaller;
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)

View File

@ -15,7 +15,7 @@ import org.apache.http.entity.ContentType;
import me.chanjar.weixin.enterprise.bean.result.WxError;
import me.chanjar.weixin.enterprise.exception.WxErrorException;
import me.chanjar.weixin.common.FileUtils;
import me.chanjar.weixin.common.util.FileUtils;
/**
* 下载媒体文件请求执行器请求的参数是String, 返回的结果是File

View File

@ -9,8 +9,8 @@
package me.chanjar.weixin.enterprise.util.json;
import com.google.gson.*;
import me.chanjar.weixin.common.GsonHelper;
import me.chanjar.weixin.enterprise.bean.WxAccessToken;
import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.common.bean.WxAccessToken;
import java.lang.reflect.Type;

View File

@ -10,7 +10,7 @@ package me.chanjar.weixin.enterprise.util.json;
import java.lang.reflect.Type;
import me.chanjar.weixin.common.GsonHelper;
import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.WxCpDepart;
import com.google.gson.JsonDeserializationContext;

View File

@ -3,6 +3,7 @@ package me.chanjar.weixin.enterprise.util.json;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.enterprise.bean.*;
import me.chanjar.weixin.enterprise.bean.result.*;

View File

@ -9,7 +9,7 @@
package me.chanjar.weixin.enterprise.util.json;
import com.google.gson.*;
import me.chanjar.weixin.common.GsonHelper;
import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.result.WxMediaUploadResult;
import java.lang.reflect.Type;

View File

@ -10,7 +10,7 @@ package me.chanjar.weixin.enterprise.util.json;
import java.lang.reflect.Type;
import me.chanjar.weixin.common.GsonHelper;
import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.WxCpMenu;
import com.google.gson.JsonArray;

View File

@ -10,7 +10,7 @@ package me.chanjar.weixin.enterprise.util.json;
import java.lang.reflect.Type;
import me.chanjar.weixin.common.GsonHelper;
import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.result.WxUser;
import com.google.gson.JsonDeserializationContext;

View File

@ -10,7 +10,7 @@ package me.chanjar.weixin.enterprise.util.json;
import java.lang.reflect.Type;
import me.chanjar.weixin.common.GsonHelper;
import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.result.WxUserList;
import com.google.gson.JsonArray;

View File

@ -9,7 +9,7 @@
package me.chanjar.weixin.enterprise.util.json;
import com.google.gson.*;
import me.chanjar.weixin.common.GsonHelper;
import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.result.WxError;
import java.lang.reflect.Type;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.enterprise.bean;
package me.chanjar.weixin.common.bean;
import me.chanjar.weixin.enterprise.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.WxAccessToken;
import org.testng.Assert;
import org.testng.annotations.Test;

View File

@ -16,7 +16,7 @@ import com.google.inject.Inject;
*/
@Test(groups = "baseAPI")
@Guice(modules = ApiTestModule.class)
public class WxBaseAPITest {
public class WxCpBaseAPITest {
@Inject
protected WxCpServiceImpl wxService;

View File

@ -18,8 +18,7 @@ import me.chanjar.weixin.enterprise.exception.WxErrorException;
* @author Daniel Qian
*
*/
//@Test(groups="menuAPI", dependsOnGroups="baseAPI")
@Test
@Test(groups="menuAPI", dependsOnGroups="baseAPI")
@Guice(modules = ApiTestModule.class)
public class WxCpMenuAPITest {

View File

@ -3,33 +3,28 @@
<suite name="Weixin-java-tool-suite" verbose="1">
<test name="API_Test">
<classes>
<class name="WxBaseAPITest" />
<class name="WxCustomMessageAPITest" />
<class name="WxMenuAPITest" />
<class name="WxGroupAPITest" />
<class name="WxMassMessageAPITest" />
<class name="WxMediaAPITest" />
<class name="WxUserAPITest" />
<class name="WxQrCodeAPITest" />
<class name="WxShortUrlAPITest" />
<class name="WxMessageRouterTest" />
<class name="me.chanjar.weixin.enterprise.api.WxCpBaseAPITest" />
<class name="me.chanjar.weixin.enterprise.api.WxCpMessageAPITest" />
<class name="me.chanjar.weixin.enterprise.api.WxCpMenuAPITest" />
<class name="me.chanjar.weixin.enterprise.api.WxGroupAPITest" />
<class name="me.chanjar.weixin.enterprise.api.WxMediaAPITest" />
<class name="me.chanjar.weixin.enterprise.api.WxCpMessageRouterTest" />
</classes>
</test>
<test name="Bean_Test">
<classes>
<class name="WxAccessTokenTest" />
<class name="WxCustomMessageTest" />
<class name="WxErrorTest" />
<class name="WxMenuTest" />
<class name="WxXmlMessageTest" />
<class name="WxXmlOutImageMessageTest" />
<class name="WxXmlOutMusicMessageTest" />
<class name="WxXmlOutNewsMessageTest" />
<class name="WxXmlOutVideoMessageTest" />
<class name="WxXmlOutVoiceMessageTest" />
<class name="WxXmlOutTextMessageTest" />
<class name="WxCryptUtilTest" />
<class name="me.chanjar.weixin.common.bean.WxAccessTokenTest" />
<class name="me.chanjar.weixin.enterprise.bean.WxCpMessageTest" />
<class name="me.chanjar.weixin.enterprise.bean.WxErrorTest" />
<class name="me.chanjar.weixin.enterprise.bean.WxCpMenuTest" />
<class name="me.chanjar.weixin.enterprise.bean.WxCpXmlMessageTest" />
<class name="me.chanjar.weixin.enterprise.bean.WxCpXmlOutImageMessageTest" />
<class name="me.chanjar.weixin.enterprise.bean.WxCpXmlOutNewsMessageTest" />
<class name="me.chanjar.weixin.enterprise.bean.WxCpXmlOutVideoMessageTest" />
<class name="me.chanjar.weixin.enterprise.bean.WxCpXmlOutVoiceMessageTest" />
<class name="me.chanjar.weixin.enterprise.bean.WxCpXmlOutTextMessageTest" />
<class name="me.chanjar.weixin.enterprise.util.crypto.WxCryptUtilTest" />
</classes>
</test>
</suite>