[Proxool-cvs] proxool/src/java-test/org/logicalcobwebs/proxool AbstractProxoolTest.java,1.3,1.4
UNMAINTAINED!
Brought to you by:
billhorsman
From: <bil...@us...> - 2003-09-30 19:09:51
|
Update of /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv3855 Modified Files: AbstractProxoolTest.java Log Message: Now uses a readwrite lock to make sure that each test runs sequentially. This should be true all the time, but sometimes tests fail and it is always because of some timing issue that is very hard to track down. This is an attempt to fix that. Index: AbstractProxoolTest.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool/AbstractProxoolTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractProxoolTest.java 4 Mar 2003 10:11:09 -0000 1.3 --- AbstractProxoolTest.java 30 Sep 2003 19:09:46 -0000 1.4 *************** *** 9,12 **** --- 9,13 ---- import org.logicalcobwebs.logging.Log; import org.logicalcobwebs.logging.LogFactory; + import org.logicalcobwebs.concurrent.ReaderPreferenceReadWriteLock; import java.util.Stack; *************** *** 25,28 **** --- 26,31 ---- private String alias; + private static ReaderPreferenceReadWriteLock testLock = new ReaderPreferenceReadWriteLock(); + private Stack threadNames = new Stack(); *************** *** 37,40 **** --- 40,44 ---- protected void setUp() throws Exception { GlobalTest.globalSetup(); + testLock.writeLock().acquire(); threadNames.push(Thread.currentThread().getName()); LOG.debug("Thread '" + Thread.currentThread().getName() + "' -> '" + alias + "'"); *************** *** 47,50 **** --- 51,55 ---- protected void tearDown() throws Exception { GlobalTest.globalTeardown(alias); + testLock.writeLock().release(); Thread.currentThread().setName((String) threadNames.pop()); LOG.debug("Thread '" + alias + "' -> '" + Thread.currentThread().getName() + "'"); *************** *** 57,60 **** --- 62,70 ---- Revision history: $Log$ + Revision 1.4 2003/09/30 19:09:46 billhorsman + Now uses a readwrite lock to make sure that each test runs sequentially. This should be true all the time, but sometimes + tests fail and it is always because of some timing issue that is very hard to track down. This is an attempt to + fix that. + Revision 1.3 2003/03/04 10:11:09 billhorsman actually made abstract |