提交 f390421d authored 作者: Thomas Mueller's avatar Thomas Mueller

MVStore: tests

上级 247644d9
...@@ -115,6 +115,7 @@ import org.h2.test.store.TestDataUtils; ...@@ -115,6 +115,7 @@ import org.h2.test.store.TestDataUtils;
import org.h2.test.store.TestFreeSpace; import org.h2.test.store.TestFreeSpace;
import org.h2.test.store.TestMVRTree; import org.h2.test.store.TestMVRTree;
import org.h2.test.store.TestMVStore; import org.h2.test.store.TestMVStore;
import org.h2.test.store.TestMVStoreBenchmark;
import org.h2.test.store.TestMVTableEngine; import org.h2.test.store.TestMVTableEngine;
import org.h2.test.store.TestObjectDataType; import org.h2.test.store.TestObjectDataType;
import org.h2.test.store.TestSpinLock; import org.h2.test.store.TestSpinLock;
...@@ -710,6 +711,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -710,6 +711,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
new TestFreeSpace().runTest(this); new TestFreeSpace().runTest(this);
new TestMVRTree().runTest(this); new TestMVRTree().runTest(this);
new TestMVStore().runTest(this); new TestMVStore().runTest(this);
new TestMVStoreBenchmark().runTest(this);
new TestMVTableEngine().runTest(this); new TestMVTableEngine().runTest(this);
new TestObjectDataType().runTest(this); new TestObjectDataType().runTest(this);
new TestSpinLock().runTest(this); new TestSpinLock().runTest(this);
......
...@@ -402,6 +402,15 @@ public abstract class TestBase { ...@@ -402,6 +402,15 @@ public abstract class TestBase {
* @return the used megabytes * @return the used megabytes
*/ */
public static int getMemoryUsed() { public static int getMemoryUsed() {
return (int) (getMemoryUsedBytes() / 1024 / 1024);
}
/**
* Get the number of bytes heap memory in use.
*
* @return the used bytes
*/
public static long getMemoryUsedBytes() {
Runtime rt = Runtime.getRuntime(); Runtime rt = Runtime.getRuntime();
long memory = Long.MAX_VALUE; long memory = Long.MAX_VALUE;
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
...@@ -412,8 +421,7 @@ public abstract class TestBase { ...@@ -412,8 +421,7 @@ public abstract class TestBase {
} }
memory = memNow; memory = memNow;
} }
int mb = (int) (memory / 1024 / 1024); return memory;
return mb;
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论