private Config createConfigWithDummyTxService() { Config config = new Config(); ServicesConfig servicesConfig = config.getServicesConfig(); servicesConfig.addServiceConfig( new ServiceConfig() .setName(DUMMY_TX_SERVICE) .setEnabled(true) .setServiceImpl( new MapTransactionStressTest.DummyTransactionalService(DUMMY_TX_SERVICE))); return config; }
@Test public void testServiceConfig() { ServiceConfig serviceConfig = config.getServicesConfig().getServiceConfig("my-service"); assertEquals("com.hazelcast.spring.MyService", serviceConfig.getClassName()); assertEquals("prop1-value", serviceConfig.getProperties().getProperty("prop1")); assertEquals("prop2-value", serviceConfig.getProperties().getProperty("prop2")); MyServiceConfig configObject = (MyServiceConfig) serviceConfig.getConfigObject(); assertNotNull(configObject); assertEquals("prop1", configObject.stringProp); assertEquals(123, configObject.intProp); assertTrue(configObject.boolProp); }
@BeforeClass public static void setUp() { Config config = new Config(); Services services = config.getServicesConfig(); ActorServiceConfig actorServiceConfig = new ActorServiceConfig(); actorServiceConfig.setEnabled(true); services.addServiceConfig(actorServiceConfig); hzInstance = Hazelcast.newHazelcastInstance(config); actorRuntime = (ActorService.ActorRuntimeProxyImpl) hzInstance.getServiceProxy(ActorService.NAME, "foo"); monitorMap = hzInstance.getMap("monitorMap"); actorFactory = new BasicActorFactory(); nodeService = (NodeServiceImpl) actorRuntime.getNodeService(); }