Search in sources :

Example 1 with ArkContainerServiceProvider

use of com.alipay.sofa.ark.container.registry.ArkContainerServiceProvider in project sofa-ark by alipay.

the class RegistryServiceTest method testContainerService.

@Test
public void testContainerService() {
    registryService.publishService(ITest.class, new TestObjectA(), new ArkContainerServiceProvider("test1", 20000));
    registryService.publishService(ITest.class, new TestObjectB(), new ArkContainerServiceProvider("test2", 100));
    registryService.publishService(ITest.class, new TestObjectC());
    Assert.assertEquals(TestObjectB.OUTPUT, registryService.referenceService(ITest.class).getService().test());
    Assert.assertEquals(3, registryService.referenceServices(ITest.class).size());
}
Also used : TestObjectC(com.alipay.sofa.ark.container.testdata.impl.TestObjectC) TestObjectA(com.alipay.sofa.ark.container.testdata.impl.TestObjectA) ArkContainerServiceProvider(com.alipay.sofa.ark.container.registry.ArkContainerServiceProvider) TestObjectB(com.alipay.sofa.ark.container.testdata.impl.TestObjectB) ITest(com.alipay.sofa.ark.container.testdata.ITest) BaseTest(com.alipay.sofa.ark.container.BaseTest) ITest(com.alipay.sofa.ark.container.testdata.ITest) Test(org.junit.Test)

Aggregations

BaseTest (com.alipay.sofa.ark.container.BaseTest)1 ArkContainerServiceProvider (com.alipay.sofa.ark.container.registry.ArkContainerServiceProvider)1 ITest (com.alipay.sofa.ark.container.testdata.ITest)1 TestObjectA (com.alipay.sofa.ark.container.testdata.impl.TestObjectA)1 TestObjectB (com.alipay.sofa.ark.container.testdata.impl.TestObjectB)1 TestObjectC (com.alipay.sofa.ark.container.testdata.impl.TestObjectC)1 Test (org.junit.Test)1