@Before public void setUp() throws Throwable { host.startServiceAndWait(ConfigurationFactoryService.class, ConfigurationFactoryService.SELF_LINK); host.startServiceAndWait(NodeHealthCheckService.class, NodeHealthCheckService.SELF_LINK); availableServicesPaths.addAll(Arrays.asList(ConfigurationFactoryService.SELF_LINK)); }
@Before public void setUp() throws Throwable { sender = host.getTestRequestSender(); // start services host.startServiceAndWait(ConfigurationFactoryService.class, ConfigurationFactoryService.SELF_LINK); host.startServiceAndWait(ExtensibilitySubscriptionManager.class, ExtensibilitySubscriptionManager.SELF_LINK); host.startServiceAndWait(ExtensibilitySubscriptionFactoryService.class, ExtensibilitySubscriptionFactoryService.SELF_LINK); }
@Before public void setUp() throws Exception { try { this.host.startServiceAndWait(CounterFactoryService.class, CounterFactoryService.SELF_LINK); } catch (Throwable e) { throw new RuntimeException(e); } }
private void setUpHostWithAdditionalServices(VerificationHost h) throws Throwable { h.setTransactionService(null); if (h.getServiceStage(SimpleTransactionFactoryService.SELF_LINK) == null) { h.startServiceAndWait(SimpleTransactionFactoryService.class, SimpleTransactionFactoryService.SELF_LINK); h.startServiceAndWait(BankAccountFactoryService.class, BankAccountFactoryService.SELF_LINK); } }
URI createIndexedMetadataFactoryService(VerificationHost h) throws Throwable { Service indexedMetadataFactory = IndexedMetadataExampleService.createFactory(); indexedMetadataFactory = h.startServiceAndWait(indexedMetadataFactory, IndexedMetadataExampleService.FACTORY_LINK, null); return indexedMetadataFactory.getUri(); }
URI createImmutableFactoryService(VerificationHost h) throws Throwable { Service immutableFactory = ExampleImmutableService.createFactory(); immutableFactory = h.startServiceAndWait(immutableFactory, "immutable-examples", null); URI factoryUri = immutableFactory.getUri(); return factoryUri; }
@Before public void setUp() throws Throwable { if (host.getServiceStage(TestFailingStatefulService.FACTORY_LINK) == null) { host.startServiceAndWait(TestFailingStatefulService.class, TestFailingStatefulService.FACTORY_LINK); } }
URI createIndexedMetadataFactoryService(VerificationHost h) throws Throwable { Service indexedMetadataFactory = IndexedMetadataExampleService.createFactory(); indexedMetadataFactory = h.startServiceAndWait(indexedMetadataFactory, IndexedMetadataExampleService.FACTORY_LINK, null); return indexedMetadataFactory.getUri(); }
URI createInMemoryExampleServiceFactory(VerificationHost h) throws Throwable { Service exampleFactory = InMemoryExampleService.createFactory(); exampleFactory = h.startServiceAndWait(exampleFactory, InMemoryExampleService.FACTORY_LINK, null); URI factoryUri = exampleFactory.getUri(); return factoryUri; }
@Test public void throughputPost() throws Throwable { Service s = this.host.startServiceAndWait(new StatelessTestService(), "stateless/service", null); for (int i = 0; i < this.iterationCount; i++) { doThroughputPost(s); System.gc(); } }
@Test public void throughputPost() throws Throwable { Service s = this.host.startServiceAndWait(new StatelessTestService(), "stateless/service", null); for (int i = 0; i < this.iterationCount; i++) { doThroughputPost(s); System.gc(); } }
@Test public void expirationInducedDeleteHandlerVerification() throws Throwable { DeleteVerificationTestFactory f = new DeleteVerificationTestFactory(); DeleteVerificationTestFactory factoryService = (DeleteVerificationTestFactory) this.host .startServiceAndWait(f, DeleteVerificationTestFactory.SELF_LINK, null); expirationInducedDeleteHandlerVerificationDo(factoryService, DeleteVerificationTestFactory.SELF_LINK); }
@Test public void expirationInducedDeleteHandlerVerification() throws Throwable { DeleteVerificationTestFactory f = new DeleteVerificationTestFactory(); DeleteVerificationTestFactory factoryService = (DeleteVerificationTestFactory) this.host .startServiceAndWait(f, DeleteVerificationTestFactory.SELF_LINK, null); expirationInducedDeleteHandlerVerificationDo(factoryService, DeleteVerificationTestFactory.SELF_LINK); }
private void setUpMultiNode() throws Throwable { this.host.setUpPeerHosts(this.nodeCount); this.host.joinNodesAndVerifyConvergence(this.nodeCount - 1); for (VerificationHost h : this.host.getInProcessHostMap().values()) { h.startServiceAndWait(new StatelessOwnerSelectedTestService(), StatelessOwnerSelectedTestService.SELF_LINK, null); } }
@Override public void beforeHostStart(VerificationHost host) throws Throwable { host.setMaintenanceIntervalMicros(TimeUnit.MILLISECONDS.toMicros( VerificationHost.FAST_MAINT_INTERVAL_MILLIS)); this.host.addPrivilegedService(InMemoryLuceneDocumentIndexService.class); this.host.startServiceAndWait(InMemoryLuceneDocumentIndexService.class, InMemoryLuceneDocumentIndexService.SELF_LINK); this.host.startFactory(InMemoryExampleService.class, InMemoryExampleService::createFactory); this.host.startFactory(ExampleODLService.class, ExampleODLService::createFactory); }
@Test public void allocateExecutor() throws Throwable { setUp(false); Service s = this.host.startServiceAndWait(MinimalTestService.class, UUID.randomUUID() .toString()); ExecutorService exec = this.host.allocateExecutor(s); this.host.testStart(1); exec.execute(() -> { this.host.completeIteration(); }); this.host.testWait(); }
@Test public void testWithProxyWithList() throws Throwable { setProperty(RegistryAdapterService.REGISTRY_PROXY_PARAM_NAME, proxyAddress); setProperty(RegistryAdapterService.REGISTRY_NO_PROXY_LIST_PARAM_NAME, noProxyList); RegistryAdapterService registryAdapterService = (RegistryAdapterService) host .startServiceAndWait(RegistryAdapterService.class, RegistryAdapterService.SELF_LINK); assertClients(registryAdapterService, proxyAddress, noProxyList); }
@Test public void testStartServices() throws Throwable { MockCommonInitialBootService mockCommonInitialBootService = new MockCommonInitialBootService(); host.startServiceAndWait(mockCommonInitialBootService, MockCommonInitialBootService.SELF_LINK, new ServiceDocument()); mockCommonInitialBootService.behaviour = 0; HostInitCommonServiceConfig.startServices(host); }
@Before public void injectHost() throws Throwable { host.assumeIdentity(buildUserServicePath(USER_EMAIL_ADMIN)); provider.init(host.startServiceAndWait(SessionService.class, SessionService.SELF_LINK + "-test")); }
@Before public void setup() throws Throwable { this.host = VerificationHost.create(0); this.host.start(); this.host.startServiceAndWait(new NsOwner(), NsOwner.SELF_LINK, new ServiceDocument()); }