lin
2025-08-01 633231e833e21d5b8b1c00cb15aedb62b3b78e8f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package test;
 
import org.testng.Assert;
 
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
 
public class BaseDistributedTest {
  private boolean m_verbose = false;
 
  protected void verifyTests(String title, String[] exp, Map found) {
    Map expected = new HashMap();
    for (String element : exp) {
      expected.put(element, element);
    }
 
    Assert.assertEquals(found.size(), expected.size(),
        "Verification for " + title + " tests failed:");
 
    for (Object o : expected.values()) {
      String name = (String) o;
      if (null == found.get(name)) {
        dumpMap("Expected", expected);
        dumpMap("Found", found);
      }
 
      Assert.assertNotNull(found.get(name),
              "Expected to find method " + name + " in " + title
                      + " but didn't find it.");
    }
  }
 
  protected void dumpMap(String title, Map<?, ?> m) {
    if (m_verbose) {
      System.out.println("==== " + title);
      for (Map.Entry<?, ?> entry : m.entrySet()) {
        ppp(entry.getKey() + "  => " + entry.getValue());
      }
    }
  }
  private void ppp(String s) {
    if (m_verbose) {
      System.out.println("[BaseDistributedTest] " + s);
    }
  }
 
 
}