提交 36ad925a authored 作者: Noel Grandin's avatar Noel Grandin

fix cache size calculation in TestJmx

in pagestore mode we scale it by the size of available RAM
上级 e5abed47
...@@ -16,7 +16,9 @@ import javax.management.MBeanInfo; ...@@ -16,7 +16,9 @@ import javax.management.MBeanInfo;
import javax.management.MBeanOperationInfo; import javax.management.MBeanOperationInfo;
import javax.management.MBeanServer; import javax.management.MBeanServer;
import javax.management.ObjectName; import javax.management.ObjectName;
import org.h2.engine.Constants;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.util.Utils;
/** /**
* Tests the JMX feature. * Tests the JMX feature.
...@@ -29,7 +31,10 @@ public class TestJmx extends TestBase { ...@@ -29,7 +31,10 @@ public class TestJmx extends TestBase {
* @param a ignored * @param a ignored
*/ */
public static void main(String... a) throws Exception { public static void main(String... a) throws Exception {
TestBase.createCaller().init().test(); TestBase base = TestBase.createCaller().init();
base.config.mvStore = false;
base.config.mvcc = false;
base.test();
} }
@Override @Override
...@@ -144,7 +149,9 @@ public class TestJmx extends TestBase { ...@@ -144,7 +149,9 @@ public class TestJmx extends TestBase {
assertEquals("0", mbeanServer. assertEquals("0", mbeanServer.
getAttribute(name, "CacheSizeMax").toString()); getAttribute(name, "CacheSizeMax").toString());
} else { } else {
assertEquals("16384", mbeanServer. int cacheSize = Utils.scaleForAvailableMemory(
Constants.CACHE_SIZE_DEFAULT);
assertEquals("" + cacheSize, mbeanServer.
getAttribute(name, "CacheSizeMax").toString()); getAttribute(name, "CacheSizeMax").toString());
} }
mbeanServer.setAttribute(name, new Attribute("CacheSizeMax", 1)); mbeanServer.setAttribute(name, new Attribute("CacheSizeMax", 1));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论