尝试一个新的DruidDataSource

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@260 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-06-05 13:30:34 +00:00
parent e7aaa8a66d
commit aaea3928fa
7 changed files with 1639 additions and 28 deletions
@@ -0,0 +1,31 @@
package com.alibaba.druid;
import junit.framework.TestCase;
import com.alibaba.druid.util.LinkedTransferQueue;
public class TestLinkedTransferQueue extends TestCase {
public void test_0() throws Exception {
final LinkedTransferQueue<Object> q = new LinkedTransferQueue<Object>();
Thread takeThread = new Thread("Take Thread") {
public void run() {
try {
for (;;) {
q.take();
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
};
takeThread.start();
// q.take();
q.put(1);
q.put(2);
System.out.println(q.size());
}
}