Package org.h2.test.unit
Class TestValueMemory
java.lang.Object
org.h2.test.TestBase
org.h2.test.unit.TestValueMemory
- All Implemented Interfaces:
DataHandler
Tests the memory consumption of values. Values can estimate how much memory
they occupy, and this tests if this estimation is correct.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.h2.test.TestBase
org.h2.test.TestBase.VoidCallable -
Field Summary
Fields inherited from class org.h2.test.TestBase
BASE_TEST_DIR, config, start, uniqueId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck if the simulated power failure occurred.voidCheck if writing is allowed.Return compare mode.Get the database path.Get the lob file list cache if it is used.Get the lob storage mechanism to use.Get the synchronization object for lob operations.intGet the maximum length of a in-place large objectGet the temp file deleter mechanism.static voidRun just this test.Open a file at the given location.intreadLob(long lobId, byte[] hmac, long offset, byte[] buff, int off, int length) Read from a lob.voidtest()This method will be called by the test framework.Methods inherited from class org.h2.test.TestBase
assertContains, assertEmpty, assertEqualDatabases, assertEqualReaders, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualStreams, assertFalse, assertFalse, assertKnownException, assertKnownException, assertNotContaining, assertNotNull, assertNotNull, assertNull, assertResult, assertResultRowCount, assertResultSetMeta, assertResultSetOrdered, assertResultSetOrdered, assertSame, assertSingleValue, assertSmaller, assertStartsWith, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertTrue, assertTrue, checkErrorCode, crash, createCaller, createFailingStream, eatMemory, execute, execute, fail, fail, freeMemory, getBaseDir, getClassPath, getFilePassword, getJVM, getMemoryUsed, getMemoryUsedBytes, getPassword, getPassword, getPowerOffCount, getSize, getTestDir, getTestName, getUser, init, init, isEnabled, logError, logErrorMessage, println, printTime, printTimeMemory, readString, runTest, setPowerOffCount, testFromMain, throwException, trace, trace, traceMemory
-
Constructor Details
-
TestValueMemory
public TestValueMemory()
-
-
Method Details
-
main
Run just this test.- Parameters:
a- ignored- Throws:
Exception
-
test
Description copied from class:org.h2.test.TestBaseThis method will be called by the test framework.- Specified by:
testin classorg.h2.test.TestBase- Throws:
SQLException
-
checkPowerOff
public void checkPowerOff()Description copied from interface:DataHandlerCheck if the simulated power failure occurred. This call will decrement the countdown.- Specified by:
checkPowerOffin interfaceDataHandler
-
checkWritingAllowed
public void checkWritingAllowed()Description copied from interface:DataHandlerCheck if writing is allowed.- Specified by:
checkWritingAllowedin interfaceDataHandler
-
getDatabasePath
Description copied from interface:DataHandlerGet the database path.- Specified by:
getDatabasePathin interfaceDataHandler- Returns:
- the database path
-
getLobSyncObject
Description copied from interface:DataHandlerGet the synchronization object for lob operations.- Specified by:
getLobSyncObjectin interfaceDataHandler- Returns:
- the synchronization object
-
getMaxLengthInplaceLob
public int getMaxLengthInplaceLob()Description copied from interface:DataHandlerGet the maximum length of a in-place large object- Specified by:
getMaxLengthInplaceLobin interfaceDataHandler- Returns:
- the maximum size
-
openFile
Description copied from interface:DataHandlerOpen a file at the given location.- Specified by:
openFilein interfaceDataHandler- Parameters:
name- the file namemode- the modemustExist- whether the file must already exist- Returns:
- the file
-
getLobFileListCache
Description copied from interface:DataHandlerGet the lob file list cache if it is used.- Specified by:
getLobFileListCachein interfaceDataHandler- Returns:
- the cache or null
-
getTempFileDeleter
Description copied from interface:DataHandlerGet the temp file deleter mechanism.- Specified by:
getTempFileDeleterin interfaceDataHandler- Returns:
- the temp file deleter
-
getLobStorage
Description copied from interface:DataHandlerGet the lob storage mechanism to use.- Specified by:
getLobStoragein interfaceDataHandler- Returns:
- the lob storage mechanism
-
readLob
public int readLob(long lobId, byte[] hmac, long offset, byte[] buff, int off, int length) Description copied from interface:DataHandlerRead from a lob.- Specified by:
readLobin interfaceDataHandler- Parameters:
lobId- the lob idhmac- the message authentication codeoffset- the offset within the lobbuff- the target bufferoff- the offset within the target bufferlength- the number of bytes to read- Returns:
- the number of bytes read
-
getCompareMode
Description copied from interface:DataHandlerReturn compare mode.- Specified by:
getCompareModein interfaceDataHandler- Returns:
- Compare mode.
-