Search in sources :

Example 1 with NamingServer

use of com.tencent.polaris.test.mock.discovery.NamingServer in project sofa-rpc by sofastack.

the class PolarisRegistryTest method setup.

@BeforeClass
public static void setup() {
    polaris = new NamingServer(8091);
    polaris.getNamingService().addService(new ServiceKey(NAMESPACE, SERVICE_1));
    try {
        polaris.start();
    } catch (IOException e) {
        e.printStackTrace();
        return;
    }
    registryConfig = new RegistryConfig().setProtocol("polaris").setAddress("127.0.0.1:8091").setRegister(true);
    registry = (PolarisRegistry) RegistryFactory.getRegistry(registryConfig);
    registry.init();
}
Also used : RegistryConfig(com.alipay.sofa.rpc.config.RegistryConfig) NamingServer(com.tencent.polaris.test.mock.discovery.NamingServer) ServiceKey(com.tencent.polaris.api.pojo.ServiceKey) IOException(java.io.IOException) BeforeClass(org.junit.BeforeClass)

Aggregations

RegistryConfig (com.alipay.sofa.rpc.config.RegistryConfig)1 ServiceKey (com.tencent.polaris.api.pojo.ServiceKey)1 NamingServer (com.tencent.polaris.test.mock.discovery.NamingServer)1 IOException (java.io.IOException)1 BeforeClass (org.junit.BeforeClass)1