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;
}
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;
}
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);
}
Aggregations