@BeforeClass public static void before() throws Throwable { // create a host just to setup logging HOST = VerificationHost.create(0); HOST.start(); Logger rootLogger = Logger.getLogger(""); rootLogger.setLevel(Level.FINE); for (Handler h : rootLogger.getHandlers()) { h.setLevel(Level.FINE); } }
@Before public void setup() throws Throwable { this.host = VerificationHost.create(0); this.host.start(); this.host.startServiceAndWait(new NsOwner(), NsOwner.SELF_LINK, new ServiceDocument()); }
private VerificationHost createVerificationHost() throws Throwable { VerificationHost host = VerificationHost.create(0); host.start(); // in-memory index related services host.addPrivilegedService(InMemoryLuceneDocumentIndexService.class); InMemoryLuceneDocumentIndexService inMemoryIndexService = new InMemoryLuceneDocumentIndexService(); Service inMemoryExampleFactory = InMemoryExampleService.createFactory(); host.startService(Operation.createPost(host, ServiceUriPaths.CORE_IN_MEMORY_DOCUMENT_INDEX), inMemoryIndexService); host.startService(Operation.createPost(host, InMemoryExampleService.FACTORY_LINK), inMemoryExampleFactory); host.waitForServiceAvailable(ServiceUriPaths.CORE_IN_MEMORY_DOCUMENT_INDEX, InMemoryExampleService.FACTORY_LINK); return host; }
private void checkReusableHostAndCleanup(VerificationHost host) throws Throwable { if (host.isStopping() || !host.isStarted()) { host.start(); host.startFactory(new LegacyMigrationTaskService()); host.startFactory(new ImmutableExampleService()); host.waitForServiceAvailable(ExampleService.FACTORY_LINK); host.waitForServiceAvailable(ImmutableExampleService.FACTORY_LINK); host.waitForServiceAvailable(LegacyMigrationTaskService.FACTORY_LINK); } host.deleteAllChildServices(UriUtils.buildUri(host, LegacyMigrationTaskService.FACTORY_LINK)); host.deleteAllChildServices(UriUtils.buildUri(host, ExampleService.FACTORY_LINK)); }
@BeforeClass public static void before() throws Throwable { // create a host just to setup logging HOST = VerificationHost.create(0); HOST.start(); Logger rootLogger = Logger.getLogger(""); rootLogger.setLevel(Level.FINE); for (Handler h : rootLogger.getHandlers()) { h.setLevel(Level.FINE); } }
private VerificationHost createVerificationHost() throws Throwable { VerificationHost host = VerificationHost.create(0); host.start(); // in-memory index related services host.addPrivilegedService(InMemoryLuceneDocumentIndexService.class); InMemoryLuceneDocumentIndexService inMemoryIndexService = new InMemoryLuceneDocumentIndexService(); Service inMemoryExampleFactory = InMemoryExampleService.createFactory(); host.startService(Operation.createPost(host, ServiceUriPaths.CORE_IN_MEMORY_DOCUMENT_INDEX), inMemoryIndexService); host.startService(Operation.createPost(host, InMemoryExampleService.FACTORY_LINK), inMemoryExampleFactory); host.waitForServiceAvailable(ServiceUriPaths.CORE_IN_MEMORY_DOCUMENT_INDEX, InMemoryExampleService.FACTORY_LINK); return host; }
@Before public void setup() throws Throwable { this.host = VerificationHost.create(0); this.host.start(); this.host.startServiceAndWait(new NsOwner(), NsOwner.SELF_LINK, new ServiceDocument()); }
private void checkReusableHostAndCleanup(VerificationHost host) throws Throwable { if (host.isStopping() || !host.isStarted()) { host.start(); host.startFactory(new MigrationTaskService()); host.startFactory(new ImmutableExampleService()); host.waitForServiceAvailable(ExampleService.FACTORY_LINK); host.waitForServiceAvailable(ImmutableExampleService.FACTORY_LINK); host.waitForServiceAvailable(MigrationTaskService.FACTORY_LINK); } host.deleteAllChildServices(UriUtils.buildUri(host, MigrationTaskService.FACTORY_LINK)); host.deleteAllChildServices(UriUtils.buildUri(host, ExampleService.FACTORY_LINK)); }
private VerificationHost createAndStartHost(boolean enableAuth) throws Throwable { VerificationHost host = VerificationHost.create(0); host.setAuthorizationEnabled(enableAuth); // to speed up tests, set short maintenance interval. // it needs to "explicitly" set for VerificationHost instance host.setMaintenanceIntervalMicros( TimeUnit.MILLISECONDS.toMicros(VerificationHost.FAST_MAINT_INTERVAL_MILLIS)); host.start(); // add to the list for cleanup after each test run this.hostsToCleanup.add(host); return host; }
private VerificationHost createVerificationHost() throws Throwable { VerificationHost host = new VerificationHost(); ServiceHost.Arguments args = VerificationHost.buildDefaultServiceHostArguments(0); VerificationHost.initialize(host, args); host.start(); host.setMaintenanceIntervalMicros(TimeUnit.MILLISECONDS.toMicros(100)); return host; }
private static VerificationHost createHost() throws Throwable { ServiceHost.Arguments args = new ServiceHost.Arguments(); args.sandbox = null; // ask runtime to pick a random storage location args.port = 0; // ask runtime to pick a random port args.isAuthorizationEnabled = false; VerificationHost h = new VerificationHost(); h = VerificationHost.initialize(h, args); h.start(); return h; }
private VerificationHost setupMetricHost() throws Throwable { // Start a metric Host separately. VerificationHost metricHost = VerificationHost.create(0); metricHost.start(); ServiceTypeCluster.METRIC_SERVICE.setUri(metricHost.getUri().toString()); PhotonModelMetricServices.startServices(metricHost); return metricHost; }
private VerificationHost createHost() throws Throwable { ServiceHost.Arguments args = new ServiceHost.Arguments(); args.sandbox = null; // ask runtime to pick a random storage location args.port = 0; // ask runtime to pick a random port args.isAuthorizationEnabled = false; VerificationHost h = new VerificationHost(); h = VerificationHost.initialize(h, args); h.start(); return h; }
private VerificationHost setupMetricHost() throws Throwable { // Start a metric Host separately. VerificationHost metricHost = VerificationHost.create(0); metricHost.start(); ServiceTypeCluster.METRIC_SERVICE.setUri(metricHost.getUri().toString()); PhotonModelMetricServices.startServices(metricHost); return metricHost; }
@Before public void setup() throws Throwable { // Start a metric Host separately. this.metricHost = VerificationHost.create(0); this.metricHost.start(); ServiceTypeCluster.METRIC_SERVICE.setUri(this.metricHost.getUri().toString()); PhotonModelMetricServices.startServices(this.metricHost); }
private void restartHostAndWaitAvailable() throws Throwable { this.host.stop(); this.host.setPort(0); this.host.start(); this.host.waitForReplicatedFactoryServiceAvailable(UriUtils.buildUri(this.host, ExampleService.FACTORY_LINK)); }
private void restartHostAndWaitAvailable() throws Throwable { this.host.stop(); this.host.setPort(0); this.host.start(); this.host.waitForReplicatedFactoryServiceAvailable(UriUtils.buildUri(this.host, ExampleService.FACTORY_LINK)); }
@Test public void remoteAndReliableSubscriptionsLoop() throws Throwable { for (int i = 0; i < this.iterationCount; i++) { tearDown(); this.host = createHost(); initializeHost(this.host); beforeHostStart(this.host); this.host.start(); remoteAndReliableSubscriptions(); } }
@Override protected void before() throws Throwable { CommandLineArgumentParser.parseFromProperties(BasicTestCase.this); BasicTestCase.this.host = createHost(); CommandLineArgumentParser.parseFromProperties(BasicTestCase.this.host); BasicTestCase.this.host.setStressTest(BasicTestCase.this.isStressTest); initializeHost(BasicTestCase.this.host); beforeHostStart(BasicTestCase.this.host); BasicTestCase.this.host.start(); }
@Test public void remoteAndReliableSubscriptionsLoop() throws Throwable { for (int i = 0; i < this.iterationCount; i++) { tearDown(); this.host = createHost(); initializeHost(this.host); beforeHostStart(this.host); this.host.start(); remoteAndReliableSubscriptions(); } }