refactor on proxypool
parent
b871b210c5
commit
61c28a0130
|
@ -51,7 +51,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
*
|
*
|
||||||
* @author yxssfxwzy@sina.com <br>
|
* @author yxssfxwzy@sina.com <br>
|
||||||
* @since 0.5.1
|
* @since 0.5.1
|
||||||
* @see ProxyPool
|
* @see SimpleProxyPool
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Proxy implements Delayed, Serializable {
|
public class Proxy implements Delayed, Serializable {
|
||||||
|
|
|
@ -22,7 +22,7 @@ import java.util.concurrent.DelayQueue;
|
||||||
* @see Proxy
|
* @see Proxy
|
||||||
* @since 0.5.1
|
* @since 0.5.1
|
||||||
*/
|
*/
|
||||||
public class SimpleProxyPool implements IProxyPool{
|
public class SimpleProxyPool implements ProxyPool {
|
||||||
|
|
||||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class ProxyTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testProxy() {
|
public void testProxy() {
|
||||||
ProxyPool proxyPool = new ProxyPool(httpProxyList);
|
SimpleProxyPool proxyPool = new SimpleProxyPool(httpProxyList);
|
||||||
proxyPool.setReuseInterval(500);
|
proxyPool.setReuseInterval(500);
|
||||||
assertThat(proxyPool.getIdleNum()).isEqualTo(4);
|
assertThat(proxyPool.getIdleNum()).isEqualTo(4);
|
||||||
assertThat(new File(proxyPool.getProxyFilePath()).exists()).isEqualTo(true);
|
assertThat(new File(proxyPool.getProxyFilePath()).exists()).isEqualTo(true);
|
||||||
|
|
Loading…
Reference in New Issue