org.hd.d.pg2k.test.dev
Class MemoryToolsTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.hd.d.pg2k.test.dev.MemoryToolsTest
All Implemented Interfaces:
junit.framework.Test

public final class MemoryToolsTest
extends junit.framework.TestCase

Tests of the memory tools.


Field Summary
private static java.util.Random rnd
          Private source of OK pseudo-random numbers.
 
Constructor Summary
MemoryToolsTest(java.lang.String name)
           
 
Method Summary
static void testBasicGCInteractions()
          Tests some interactions with the GC system.
 void testIntern()
          Test our intern() for various supported data types.
 void testRunMemoryIntensiveOperation()
          Simple test of runMemoryIntensiveOperation().
static void testSimpleLRUMapAutoSizeForHitRate()
          Test behaviour of SimpleLRUMapAutoSizeForHitRate.
static void testSimpleProbabilisticCache()
          Test behaviour of SimpleProbabilisticCache.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rnd

private static final java.util.Random rnd
Private source of OK pseudo-random numbers.

Constructor Detail

MemoryToolsTest

public MemoryToolsTest(java.lang.String name)
Method Detail

testBasicGCInteractions

public static void testBasicGCInteractions()
Tests some interactions with the GC system. At least attempts to show that the interactions are not immediately toxic.


testRunMemoryIntensiveOperation

public void testRunMemoryIntensiveOperation()
Simple test of runMemoryIntensiveOperation(). Tests that:

TODO: add test that we can run these concurrently without difficulty.


testIntern

public void testIntern()
Test our intern() for various supported data types. This also tests refusal to intern various mutable data types.


testSimpleLRUMapAutoSizeForHitRate

public static void testSimpleLRUMapAutoSizeForHitRate()
Test behaviour of SimpleLRUMapAutoSizeForHitRate.


testSimpleProbabilisticCache

public static void testSimpleProbabilisticCache()
Test behaviour of SimpleProbabilisticCache.


DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.