cp usage jodd-http

This commit is contained in:
ecoolper
2017-04-22 00:29:42 +08:00
parent 0b0b5a90fc
commit 5726ca9c04
16 changed files with 40 additions and 24 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,11 @@
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.apache.http.HttpHost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -19,8 +22,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,CloseableHttpClient, HttpHost, 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"/>