提交 d72558fa authored 作者: Noel Grandin's avatar Noel Grandin

fix TestJmx for in-memory and multi-threaded cases

上级 f01b7990
...@@ -257,10 +257,10 @@ public abstract class TestBase { ...@@ -257,10 +257,10 @@ public abstract class TestBase {
// name = addOption(name, "RETENTION_TIME", "10"); // name = addOption(name, "RETENTION_TIME", "10");
// name = addOption(name, "WRITE_DELAY", "10"); // name = addOption(name, "WRITE_DELAY", "10");
} }
if (config.memory) { int idx = name.indexOf(':');
if (idx == -1 && config.memory) {
name = "mem:" + name; name = "mem:" + name;
} else { } else {
int idx = name.indexOf(':');
if (idx < 0 || idx > 10) { if (idx < 0 || idx > 10) {
// index > 10 if in options // index > 10 if in options
name = getBaseDir() + "/" + name; name = getBaseDir() + "/" + name;
......
...@@ -77,8 +77,13 @@ public class TestJmx extends TestBase { ...@@ -77,8 +77,13 @@ public class TestJmx extends TestBase {
} }
assertEquals("REGULAR", mbeanServer. assertEquals("REGULAR", mbeanServer.
getAttribute(name, "Mode").toString()); getAttribute(name, "Mode").toString());
assertEquals("false", mbeanServer. if (config.multiThreaded) {
getAttribute(name, "MultiThreaded").toString()); assertEquals("true", mbeanServer.
getAttribute(name, "MultiThreaded").toString());
} else {
assertEquals("false", mbeanServer.
getAttribute(name, "MultiThreaded").toString());
}
if (config.mvStore) { if (config.mvStore) {
assertEquals("true", mbeanServer. assertEquals("true", mbeanServer.
getAttribute(name, "Mvcc").toString()); getAttribute(name, "Mvcc").toString());
...@@ -136,10 +141,18 @@ public class TestJmx extends TestBase { ...@@ -136,10 +141,18 @@ public class TestJmx extends TestBase {
Set set = mbeanServer.queryNames(name, null); Set set = mbeanServer.queryNames(name, null);
name = (ObjectName) set.iterator().next(); name = (ObjectName) set.iterator().next();
assertEquals("16384", mbeanServer. if (config.memory) {
getAttribute(name, "CacheSizeMax").toString()); assertEquals("0", mbeanServer.
getAttribute(name, "CacheSizeMax").toString());
} else {
assertEquals("16384", mbeanServer.
getAttribute(name, "CacheSizeMax").toString());
}
mbeanServer.setAttribute(name, new Attribute("CacheSizeMax", 1)); mbeanServer.setAttribute(name, new Attribute("CacheSizeMax", 1));
if (config.mvStore) { if (config.memory) {
assertEquals("0", mbeanServer.
getAttribute(name, "CacheSizeMax").toString());
} else if (config.mvStore) {
assertEquals("1024", mbeanServer. assertEquals("1024", mbeanServer.
getAttribute(name, "CacheSizeMax").toString()); getAttribute(name, "CacheSizeMax").toString());
assertEquals("0", mbeanServer. assertEquals("0", mbeanServer.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论