use of com.weibo.api.motan.protocol.example.MockWorld in project motan by weibocom.
the class MockServiceConfig method mockIWorldServiceConfig.
protected static ServiceConfig<IWorld> mockIWorldServiceConfig() {
ServiceConfig<IWorld> serviceConfig = new ServiceConfig<IWorld>();
serviceConfig.setRef(new MockWorld());
serviceConfig.setApplication(application);
serviceConfig.setModule(module);
serviceConfig.setCheck("true");
serviceConfig.setInterface(IWorld.class);
serviceConfig.setGroup(group);
serviceConfig.setShareChannel(true);
return serviceConfig;
}
use of com.weibo.api.motan.protocol.example.MockWorld in project motan by weibocom.
the class RefererConfigTest method testGetRef.
@Test
public void testGetRef() {
MockWorld mWorld = new MockWorld();
serviceConfig.setRef(mWorld);
serviceConfig.export();
IWorld ref = refererConfig.getRef();
assertNotNull(ref);
assertEquals(refererConfig.getClusterSupports().size(), 1);
int times = 3;
for (int i = 0; i < times; i++) {
ref.world("test");
}
assertEquals(times, mWorld.stringCount.get());
serviceConfig.unexport();
// destroy
refererConfig.destroy();
assertFalse(refererConfig.getInitialized().get());
}
Aggregations