本文整理汇总了Java中com.alibaba.dubbo.common.utils.DubboAppender.clear方法的典型用法代码示例。如果您正苦于以下问题:Java DubboAppender.clear方法的具体用法?Java DubboAppender.clear怎么用?Java DubboAppender.clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.dubbo.common.utils.DubboAppender
的用法示例。
在下文中一共展示了DubboAppender.clear方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_multi_destory
import com.alibaba.dubbo.common.utils.DubboAppender; //导入方法依赖的package包/类
/**
* 测试invoker多次destory不会导致计数器多次减少
*/
@Test
public void test_multi_destory(){
init(0);
DubboAppender.doStart();
DubboAppender.clear();
demoServiceInvoker.destroy();
demoServiceInvoker.destroy();
Assert.assertEquals("hello", helloService.hello());
Assert.assertEquals("should not warning message", 0, LogUtil.findMessage(errorMsg));
LogUtil.checkNoError();
DubboAppender.doStop();
destoy();
}
示例2: test_counter_error
import com.alibaba.dubbo.common.utils.DubboAppender; //导入方法依赖的package包/类
/**
* 测试计数器错误,调用成功
*/
@Test
public void test_counter_error(){
init(0);
DubboAppender.doStart();
DubboAppender.clear();
ReferenceCountExchangeClient client = getReferenceClient(helloServiceInvoker);
//close一次,计数器从2减少到1,不能warning
client.close();
Assert.assertEquals("hello", helloService.hello());
Assert.assertEquals("should not warning message", 0, LogUtil.findMessage(errorMsg));
//计数器错误,调用正常
client.close();
Assert.assertEquals("hello", helloService.hello());
Assert.assertEquals("should warning message", 1, LogUtil.findMessage(errorMsg));
//调用5千次输出一个错误
Assert.assertEquals("hello", helloService.hello());
Assert.assertEquals("should warning message", 1, LogUtil.findMessage(errorMsg));
DubboAppender.doStop();
//重新调用一次后status已经是available.
Assert.assertEquals("client status available", true, helloServiceInvoker.isAvailable());
client.close();
//client已经被替换为lazyclient lazy client从referenceclientmap中获取,获取到的是上次的client(已经被调用过一次),所以close状态为false
Assert.assertEquals("client status close", false, client.isClosed());
Assert.assertEquals("client status close", false, helloServiceInvoker.isAvailable());
destoy();
}
示例3: test_multi_destory
import com.alibaba.dubbo.common.utils.DubboAppender; //导入方法依赖的package包/类
/**
* 测试invoker多次destory不会导致计数器多次减少
*/
@Test
public void test_multi_destory() {
init(0);
DubboAppender.doStart();
DubboAppender.clear();
demoServiceInvoker.destroy();
demoServiceInvoker.destroy();
Assert.assertEquals("hello", helloService.hello());
Assert.assertEquals("should not warning message", 0, LogUtil.findMessage(errorMsg));
LogUtil.checkNoError();
DubboAppender.doStop();
destoy();
}
示例4: test_counter_error
import com.alibaba.dubbo.common.utils.DubboAppender; //导入方法依赖的package包/类
/**
* 测试计数器错误,调用成功
*/
@Test
public void test_counter_error() {
init(0);
DubboAppender.doStart();
DubboAppender.clear();
ReferenceCountExchangeClient client = getReferenceClient(helloServiceInvoker);
//close一次,计数器从2减少到1,不能warning
client.close();
Assert.assertEquals("hello", helloService.hello());
Assert.assertEquals("should not warning message", 0, LogUtil.findMessage(errorMsg));
//计数器错误,调用正常
client.close();
Assert.assertEquals("hello", helloService.hello());
Assert.assertEquals("should warning message", 1, LogUtil.findMessage(errorMsg));
//调用5千次输出一个错误
Assert.assertEquals("hello", helloService.hello());
Assert.assertEquals("should warning message", 1, LogUtil.findMessage(errorMsg));
DubboAppender.doStop();
//重新调用一次后status已经是available.
Assert.assertEquals("client status available", true, helloServiceInvoker.isAvailable());
client.close();
//client已经被替换为lazyclient lazy client从referenceclientmap中获取,获取到的是上次的client(已经被调用过一次),所以close状态为false
Assert.assertEquals("client status close", false, client.isClosed());
Assert.assertEquals("client status close", false, helloServiceInvoker.isAvailable());
destoy();
}
示例5: clear
import com.alibaba.dubbo.common.utils.DubboAppender; //导入方法依赖的package包/类
@Before
public void clear() {
DubboAppender.clear();
}