Package ru.decipher.mock

Examples of ru.decipher.mock.MockIncrementalGoodHttpProxyNoDelayLoader


    private static final HttpProxyConfig PROXY4 = new HttpProxyConfig("test4.host", 31337);
    private ProxyManager manager;

    @Before
    public void setUp() throws Exception {
        manager = new DefaultProxyManager(new MockIncrementalGoodHttpProxyNoDelayLoader(), 10, 100, 10, 0);
    }
View Full Code Here


        manager.ban(PROXY1);
    }

    @Test
    public void testConcurrentTakeAndBack() throws Exception {
        final DefaultProxyManager manager = new DefaultProxyManager(new MockIncrementalGoodHttpProxyNoDelayLoader(), 10, 100, 10, 0);
        ExecutorService service = Executors.newFixedThreadPool(20);
        Collection<Callable<Object>> tasks = new ArrayList<>();
        final AtomicInteger done = new AtomicInteger(0);
        final Random random = new Random();
        for (int i = 0; i < 100; i++) {
View Full Code Here

        assertNotNull(actual);
    }

    @Test
    public void testThatCheckedProxiesGoFirst() throws Exception {
        manager = new DefaultProxyManager(new MockIncrementalGoodHttpProxyNoDelayLoader(), 10, 100, 10, 0);
        final HttpProxyConfig firstProxy = manager.take();
        final HttpProxyConfig secondProxy = manager.take();
        final HttpProxyConfig third = manager.take();
        final HttpProxyConfig fourth = manager.take();
View Full Code Here

TOP

Related Classes of ru.decipher.mock.MockIncrementalGoodHttpProxyNoDelayLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.