1 16 package scriptella.driver.velocity; 17 18 import scriptella.AbstractTestCase; 19 20 import java.io.ByteArrayOutputStream ; 21 import java.util.concurrent.CountDownLatch ; 22 23 29 public class VelocityPerfTest extends AbstractTestCase { 30 33 public void test() throws InterruptedException { 34 final CountDownLatch cdl = new CountDownLatch (5); 35 for (int t=0;t<5;t++) { 36 new Thread (new Runnable () { 37 public void run() { 38 try { 39 ByteArrayOutputStream out = new ByteArrayOutputStream (); 40 VelocityConnection con = VelocityConnectionTest.createConnection(out); 41 for (int i=0;i<5000;i++) { 42 VelocityConnectionTest.run(con); 43 out.reset(); 44 } 45 con.close(); 46 } finally { 47 cdl.countDown(); 48 } 49 } 50 }).start(); 51 } 52 cdl.await(); 53 } 54 } 55 | Popular Tags |