Search in sources :

Example 1 with ArkCommandHandler

use of com.alipay.sofa.ark.container.session.handler.ArkCommandHandler 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")));
}
Also used : ArkCommandHandler(com.alipay.sofa.ark.container.session.handler.ArkCommandHandler) ContainerServiceProvider(com.alipay.sofa.ark.container.registry.ContainerServiceProvider) RegistryService(com.alipay.sofa.ark.spi.service.registry.RegistryService) BaseTest(com.alipay.sofa.ark.container.BaseTest) Test(org.junit.Test)

Aggregations

BaseTest (com.alipay.sofa.ark.container.BaseTest)1 ContainerServiceProvider (com.alipay.sofa.ark.container.registry.ContainerServiceProvider)1 ArkCommandHandler (com.alipay.sofa.ark.container.session.handler.ArkCommandHandler)1 RegistryService (com.alipay.sofa.ark.spi.service.registry.RegistryService)1 Test (org.junit.Test)1