1 64 65 package com.jcorporate.expresso.core.cache; 66 67 72 73 import com.jcorporate.expresso.core.registry.ExpressoThread; 74 import org.apache.log4j.Logger; 75 76 77 public class CacheTestThread 78 extends ExpressoThread { 79 private static Logger log = Logger.getLogger(CacheTestThread.class); 80 private String myName = null; 81 private static final int NUM_ITERATIONS = 30; 82 83 88 public CacheTestThread(String name) { 89 super(name); 90 myName = name; 91 } 92 93 96 public void run() { 97 super.run(); 98 try { 99 CacheTest myTest = new CacheTest("thread"); 100 myTest.setCacheName(myName); 101 102 for (int i = 0; i < NUM_ITERATIONS && !interrupted(); i++) { 103 myTest.setUp(); 104 105 if (!interrupted()) { 106 log.debug("Starting: testSimpleCaching()"); 107 myTest.testSimpleCaching(); 108 } 109 if (!interrupted()) { 110 log.debug("Starting: testCreateCache()"); 111 myTest.testCreateCache(); 112 } 113 if (!interrupted()) { 114 log.debug("Starting: testMultipleItems()"); 115 myTest.testMultipleItems(); 116 } 117 118 if (!interrupted()) { 119 log.debug("Starting: testRelatedCaches()"); 120 myTest.testRelatedCaches(); 121 } 122 123 if (!interrupted()) { 124 log.debug("Starting: testRandomCache()"); 125 myTest.testRandomCaches(); 126 } 127 128 myTest.tearDown(); 129 } 130 } catch (Throwable e) { 131 e.printStackTrace(); 132 log.error(e); 133 } 134 } 135 136 } 137 138 139 | Popular Tags |