1
0
mirror of synced 2025-12-25 20:17:56 +08:00

使用装饰模式,支持apache-http和jodd-http (#194)

This commit is contained in:
crskyp
2017-04-25 10:14:33 +08:00
committed by Binary Wang
parent a8d443e13b
commit 885db18ebc
54 changed files with 2092 additions and 179 deletions

View File

@@ -9,6 +9,7 @@ import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
import me.chanjar.weixin.cp.api.impl.apache.WxCpServiceImpl;
public class ApiTestModule implements Module {

View File

@@ -2,6 +2,7 @@ package me.chanjar.weixin.cp.api;
import java.util.List;
import me.chanjar.weixin.cp.api.impl.apache.WxCpServiceImpl;
import org.testng.Assert;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;

View File

@@ -5,6 +5,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import me.chanjar.weixin.cp.api.impl.apache.WxCpServiceImpl;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Guice;

View File

@@ -1,6 +1,7 @@
package me.chanjar.weixin.cp.api;
import com.google.inject.Inject;
import me.chanjar.weixin.cp.api.impl.apache.WxCpServiceImpl;
import me.chanjar.weixin.cp.bean.WxCpTag;
import me.chanjar.weixin.cp.bean.WxCpUser;
import org.testng.Assert;

View File

@@ -2,6 +2,7 @@ package me.chanjar.weixin.cp.api;
import com.google.inject.Inject;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.cp.api.impl.apache.WxCpServiceImpl;
import me.chanjar.weixin.cp.bean.WxCpDepart;
import me.chanjar.weixin.cp.bean.WxCpUser;
import org.testng.Assert;

View File

@@ -5,6 +5,7 @@ import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.bean.menu.WxMenu;
import me.chanjar.weixin.common.bean.menu.WxMenuButton;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.cp.api.impl.apache.WxCpServiceImpl;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Guice;

View File

@@ -1,7 +1,9 @@
package me.chanjar.weixin.cp.api;
package me.chanjar.weixin.cp.api.impl.apache;
import com.google.inject.Inject;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.cp.api.ApiTestModule;
import me.chanjar.weixin.cp.api.WxCpConfigStorage;
import org.apache.commons.lang3.StringUtils;
import org.testng.Assert;
import org.testng.annotations.Guice;

View File

@@ -1,8 +1,9 @@
package me.chanjar.weixin.cp.api;
package me.chanjar.weixin.cp.api.impl.apache;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.cp.api.WxCpService;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -19,8 +20,8 @@ public class WxCpBusyRetryTest {
WxCpService service = new WxCpServiceImpl() {
@Override
protected synchronized <T, E> T executeInternal(
RequestExecutor<T, E> executor, String uri, E data)
public synchronized <T, E> T executeInternal(
RequestExecutor<T, E> executor, String uri, E data)
throws WxErrorException {
this.log.info("Executed");
WxError error = new WxError();

View File

@@ -1,13 +1,12 @@
package me.chanjar.weixin.cp.api;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
package me.chanjar.weixin.cp.api.impl.apache;
import com.google.inject.Inject;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.cp.api.ApiTestModule;
import me.chanjar.weixin.cp.bean.WxCpMessage;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
/***
* 测试发送消息

View File

@@ -13,7 +13,7 @@ import me.chanjar.weixin.cp.api.WxCpConfigStorage;
import me.chanjar.weixin.cp.api.WxCpMessageHandler;
import me.chanjar.weixin.cp.api.WxCpMessageRouter;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.api.WxCpServiceImpl;
import me.chanjar.weixin.cp.api.impl.apache.WxCpServiceImpl;
import me.chanjar.weixin.cp.bean.WxCpXmlMessage;
import me.chanjar.weixin.cp.bean.WxCpXmlOutMessage;
import me.chanjar.weixin.cp.bean.WxCpXmlOutTextMessage;

View File

@@ -3,9 +3,9 @@
<suite name="Weixin-java-tool-suite" verbose="1">
<test name="API_Test">
<classes>
<class name="me.chanjar.weixin.cp.api.WxCpBusyRetryTest"/>
<class name="me.chanjar.weixin.cp.api.WxCpBaseAPITest"/>
<class name="me.chanjar.weixin.cp.api.WxCpMessageAPITest"/>
<class name="me.chanjar.weixin.cp.api.impl.apache.WxCpBusyRetryTest"/>
<class name="me.chanjar.weixin.cp.api.impl.apache.WxCpBaseAPITest"/>
<class name="me.chanjar.weixin.cp.api.impl.apache.WxCpMessageAPITest"/>
<class name="me.chanjar.weixin.cp.api.WxMenuAPITest"/>
<class name="me.chanjar.weixin.cp.api.WxCpDepartAPITest"/>
<class name="me.chanjar.weixin.cp.api.WxCpMediaAPITest"/>