mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add testcase
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.alibaba.druid.bvt.support.http;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Assert;
|
||||
@@ -63,5 +65,8 @@ public class WebStatFilterTest extends TestCase {
|
||||
|
||||
Assert.assertFalse(WebAppStatManager.getInstance().getWebAppStatSet().contains(appStat));
|
||||
Assert.assertFalse(StatFilterContext.getInstance().getListeners().contains(filter.getStatFilterContextListener()));
|
||||
|
||||
Map<String, Object> statData = appStat.getStatData();
|
||||
Assert.assertEquals(1L, statData.get("RequestCount"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.alibaba.druid.bvt.utils;
|
||||
|
||||
import com.alibaba.druid.util.ThreadLocalRandom;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class ThreadLocalRandomTest extends TestCase {
|
||||
public void test_random() throws Exception {
|
||||
ThreadLocalRandom.current().nextBoolean();
|
||||
ThreadLocalRandom.current().nextDouble();
|
||||
ThreadLocalRandom.current().nextFloat();
|
||||
ThreadLocalRandom.current().nextInt();
|
||||
ThreadLocalRandom.current().nextLong();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user