Search in sources :

Example 1 with DummyResourceResolverFactory

use of org.apache.sling.discovery.base.its.setup.mock.DummyResourceResolverFactory in project sling by apache.

the class FullJR2VirtualInstanceBuilder method createNewRepository.

@Override
public VirtualInstanceBuilder createNewRepository() throws Exception {
    DummyResourceResolverFactory dummyFactory = new DummyResourceResolverFactory();
    dummyFactory.setArtificialDelay(delay);
    this.factory = dummyFactory;
    return this;
}
Also used : DummyResourceResolverFactory(org.apache.sling.discovery.base.its.setup.mock.DummyResourceResolverFactory)

Example 2 with DummyResourceResolverFactory

use of org.apache.sling.discovery.base.its.setup.mock.DummyResourceResolverFactory in project sling by apache.

the class FullJR2VirtualInstanceBuilder method useRepositoryOf.

@Override
public VirtualInstanceBuilder useRepositoryOf(VirtualInstanceBuilder other) throws Exception {
    super.useRepositoryOf(other);
    DummyResourceResolverFactory dummyFactory = new DummyResourceResolverFactory();
    DummyResourceResolverFactory originalFactory = (DummyResourceResolverFactory) this.factory;
    // force repository to be created now..
    originalFactory.getServiceResourceResolver(null);
    dummyFactory.setSlingRepository(originalFactory.getSlingRepository());
    dummyFactory.setArtificialDelay(getDelay());
    this.factory = dummyFactory;
    return this;
}
Also used : DummyResourceResolverFactory(org.apache.sling.discovery.base.its.setup.mock.DummyResourceResolverFactory)

Example 3 with DummyResourceResolverFactory

use of org.apache.sling.discovery.base.its.setup.mock.DummyResourceResolverFactory 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

DummyResourceResolverFactory (org.apache.sling.discovery.base.its.setup.mock.DummyResourceResolverFactory)3 ModifiableThreadPoolConfig (org.apache.sling.commons.threads.ModifiableThreadPoolConfig)1 DefaultThreadPool (org.apache.sling.commons.threads.impl.DefaultThreadPool)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