Package ru.decipher.mock

Source Code of ru.decipher.mock.MockIncrementalGoodHttpProxyNoDelayLoader

package ru.decipher.mock;

import org.apache.log4j.Logger;
import ru.decipher.proxy.HttpProxyConfigLoader;
import ru.decipher.proxy.impl.HttpProxyConfig;

import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Set;

/**
* User: Alexander Paderin (apocarteres@gmail.com)
* Date: 10/21/13
* Time: 1:44 PM
*/
public class MockIncrementalGoodHttpProxyNoDelayLoader implements HttpProxyConfigLoader {

    private static final Logger log = Logger.getLogger(MockIncrementalGoodHttpProxyNoDelayLoader.class);

    private final Set<HttpProxyConfig> configs = new LinkedHashSet<HttpProxyConfig>() {{
        add(new HttpProxyConfig("test1.host", 31337));
        add(new HttpProxyConfig("test2.host", 31337));
    }};

    @Override
    public Collection<HttpProxyConfig> load() throws Exception {
        configs.add(new HttpProxyConfig("test" + (configs.size() + 1) + ".host", 31337));
        log.debug("returned mocked proxy configs on demand");
        return configs;
    }
}
TOP

Related Classes of ru.decipher.mock.MockIncrementalGoodHttpProxyNoDelayLoader

TOP
Copyright © 2018 www.massapi.com. 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.