use of com.alipay.sofa.ark.spi.service.registry.RegistryService in project sofa-ark by alipay.
the class InjectionServiceTest method test.
@Test
public void test() {
RegistryService registryService = ArkServiceContainerHolder.getContainer().getService(RegistryService.class);
PluginMockService pluginMockService = new PluginMockService();
registryService.publishService(PluginMockService.class, pluginMockService, new ContainerServiceProvider());
Assert.assertNotNull(pluginMockService.getBizFactoryService());
Assert.assertNotNull(pluginMockService.getBizManagerService());
Assert.assertNull(pluginMockService.getClassLoaderService());
}
use of com.alipay.sofa.ark.spi.service.registry.RegistryService in project sofa-ark by alipay.
the class CommandHandlerTest method test.
@Test
public void test() {
ArkCommandHandler arkCommandHandler = new ArkCommandHandler();
RegistryService registryService = ArkServiceContainerHolder.getContainer().getService(RegistryService.class);
registryService.publishService(CommandProvider.class, new MockCommandProvider(), new ContainerServiceProvider());
Assert.assertTrue(arkCommandHandler.handleCommand("any").contains("mock help"));
Assert.assertTrue("mock command provider".equals(arkCommandHandler.handleCommand("mock")));
}
use of com.alipay.sofa.ark.spi.service.registry.RegistryService in project sofa-ark by alipay.
the class RegistryServiceTest method before.
@Before
public void before() {
ArkServiceContainer arkServiceContainer = new ArkServiceContainer();
arkServiceContainer.start();
registryService = ArkServiceContainerHolder.getContainer().getService(RegistryService.class);
pluginManagerService = ArkServiceContainerHolder.getContainer().getService(PluginManagerService.class);
pluginDeployService = ArkServiceContainerHolder.getContainer().getService(PluginDeployService.class);
classloaderService = ArkServiceContainerHolder.getContainer().getService(ClassloaderService.class);
}
Aggregations