1 25 26 package org.objectweb.jonas.stests.manac; 27 28 29 import org.objectweb.jonas.stests.util.JTestCase; 30 31 32 public abstract class A_manac extends JTestCase { 33 34 static final int initialValue = 1000; 35 public static boolean threadfail; 36 37 public A_manac(String name) { 38 super(name); 39 } 40 41 public abstract String getManagerHomeName(); 42 public abstract Manager getManager(); 43 44 45 46 47 58 public void manac(int accounts, int delay, int loops, int amount, int threads, int cl, int tt) throws Exception { 59 60 if (tt > 0) { 62 stopTxAt(tt); 63 } 64 65 A_thread[] t_thr = new A_thread[threads]; 67 for (int i = 0; i < threads; i++) { 68 t_thr[i] = new A_thread(getManagerHomeName(), i, ictx, accounts, delay, loops, amount, cl); 69 t_thr[i].start(); 70 } 71 72 for (int p = 0; p < threads; p++) { 74 t_thr[p].join(); 75 } 76 77 if (threadfail) { 79 fail("Error in a thread"); 80 } 81 82 if (cl != 0 && ! getManager().checkAll()) { 84 fail("bad accounts"); 85 } 86 } 87 88 89 } 90 | Popular Tags |