mondrian.util
Class MemoryMonitorTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
mondrian.test.FoodMartTestCase
mondrian.util.MemoryMonitorTest
- All Implemented Interfaces:
- Test
public class MemoryMonitorTest
- extends FoodMartTestCase
Test case for ObjectPool
.
- Version:
- $Id: //open/mondrian/testsrc/main/mondrian/util/MemoryMonitorTest.java#13 $
- Author:
- Richard Emberson
Methods inherited from class mondrian.test.FoodMartTestCase |
allMember, assertAxisReturns, assertAxisThrows, assertBooleanExprReturns, assertExprReturns, assertExprThrows, assertQueriesReturnSimilarResults, assertQueryReturns, assertQueryThrows, assertSize, cubeByName, execute, executeExpr, executeQuery, executeSingletonAxis, genderMembersIncludingAll, getConnection, getDimensionWithName, getTestContext, getTestContext, isDefaultNullMemberRepresentation, isGroupingSetsSupported, member, productMembersPotScrubbersPotsAndPans, storeMembersCAAndOR, storeMembersUsaAndCanada, warehouseMembersCanadaMexicoUsa |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PERCENT_100
static final int PERCENT_100
- See Also:
- Constant Field Values
enabled
protected boolean enabled
MemoryMonitorTest
public MemoryMonitorTest()
MemoryMonitorTest
public MemoryMonitorTest(java.lang.String name)
convertThresholdToPercentage
protected static int convertThresholdToPercentage(long threshold,
long maxMemory)
causeGC
public boolean causeGC(MemoryMonitor mm)
- Get the difference between the maximum memory and the used memory
and divide that by 1000. This is the size of allocation chunks.
Keep allocating chunks until an
OutOfMemoryError
is
created.
setUp
protected void setUp()
throws java.lang.Exception
- Overrides:
setUp
in class TestCase
- Throws:
java.lang.Exception
tearDown
protected void tearDown()
throws java.lang.Exception
- Overrides:
tearDown
in class FoodMartTestCase
- Throws:
java.lang.Exception
testDeltaUsage
public void testDeltaUsage()
throws java.lang.Exception
- Throws:
java.lang.Exception
_testQuery
public void _testQuery()
throws java.lang.Exception
- Run this by itself and it works across 2 orders of magnitude.
Run it with other tests and its hard to pick the right
values for the percentage and how much to allocate for it
to always work.
- Throws:
java.lang.Exception