KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > TransparencySpeedTestVerifier


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tctest;
5
6 import com.tc.util.Assert;
7
8 import java.util.HashMap JavaDoc;
9 import java.util.Iterator JavaDoc;
10 import java.util.Map JavaDoc;
11
12 /**
13  * @author steve To change the template for this generated type comment go to Window>Preferences>Java>Code
14  * Generation>Code and Comments
15  */

16 public class TransparencySpeedTestVerifier {
17   private Map JavaDoc resultRoot = new HashMap JavaDoc();
18
19
20   public boolean verify() throws Exception JavaDoc {
21     synchronized (resultRoot) {
22       int desiredSize = TransparencySpeedTestApp.MUTATOR_COUNT * TransparencySpeedTestApp.ADD_COUNT;
23       while(resultRoot.size() < desiredSize) {
24         System.out.println("Verifier SIZE:" + resultRoot.size());
25         resultRoot.wait();
26       }
27       Assert.eval(resultRoot.size() == desiredSize);
28       int count = 0;
29       for (Iterator JavaDoc i = resultRoot.keySet().iterator(); i.hasNext();) {
30         i.next();
31         count++;
32         // System.out.println("Got:" + count++ + " for:" + o);
33
}
34       Assert.eval(count == desiredSize);
35
36       System.out.println("Done:" + count + " expected:" + desiredSize );
37       return true;
38     }
39   }
40 }
Free Books   Free Magazines  
Popular Tags