Search in sources :

Example 1 with TestConfig

use of org.apache.sling.discovery.impl.setup.TestConfig in project sling by apache.

the class VotingHandlerTest method setUp.

@Before
public void setUp() throws Exception {
    slingId1 = UUID.randomUUID().toString();
    slingId2 = UUID.randomUUID().toString();
    slingId3 = UUID.randomUUID().toString();
    slingId4 = UUID.randomUUID().toString();
    slingId5 = UUID.randomUUID().toString();
    factory = new DummyResourceResolverFactory();
    resetRepo();
    config = new TestConfig("/var/discovery/impltesting/");
    config.setHeartbeatInterval(999);
    config.setHeartbeatTimeout(60);
    votingHandler1 = VotingHandler.testConstructor(new DummySlingSettingsService(slingId1), factory, config);
    votingHandler2 = VotingHandler.testConstructor(new DummySlingSettingsService(slingId2), factory, config);
    votingHandler3 = VotingHandler.testConstructor(new DummySlingSettingsService(slingId3), factory, config);
    votingHandler4 = VotingHandler.testConstructor(new DummySlingSettingsService(slingId4), factory, config);
    votingHandler5 = VotingHandler.testConstructor(new DummySlingSettingsService(slingId5), factory, config);
    resourceResolver = factory.getServiceResourceResolver(null);
    ModifiableThreadPoolConfig tpConfig = new ModifiableThreadPoolConfig();
    tpConfig.setMinPoolSize(80);
    tpConfig.setMaxPoolSize(80);
    threadPool = new DefaultThreadPool("testing", tpConfig);
}
Also used : DummyResourceResolverFactory(org.apache.sling.discovery.base.its.setup.mock.DummyResourceResolverFactory) TestConfig(org.apache.sling.discovery.impl.setup.TestConfig) DefaultThreadPool(org.apache.sling.commons.threads.impl.DefaultThreadPool) ModifiableThreadPoolConfig(org.apache.sling.commons.threads.ModifiableThreadPoolConfig) DummySlingSettingsService(org.apache.sling.discovery.commons.providers.spi.base.DummySlingSettingsService) Before(org.junit.Before)

Aggregations

ModifiableThreadPoolConfig (org.apache.sling.commons.threads.ModifiableThreadPoolConfig)1 DefaultThreadPool (org.apache.sling.commons.threads.impl.DefaultThreadPool)1 DummyResourceResolverFactory (org.apache.sling.discovery.base.its.setup.mock.DummyResourceResolverFactory)1 DummySlingSettingsService (org.apache.sling.discovery.commons.providers.spi.base.DummySlingSettingsService)1 TestConfig (org.apache.sling.discovery.impl.setup.TestConfig)1 Before (org.junit.Before)1