1 25 26 package org.objectweb.jonas.jtests.clients.entity; 27 28 import java.util.Enumeration ; 29 30 import org.objectweb.jonas.jtests.beans.ebasic.Simple; 31 import org.objectweb.jonas.jtests.beans.ebasic.SimpleHome; 32 import org.objectweb.jonas.jtests.util.JTestCase; 33 34 37 public abstract class B_Isolation extends JTestCase { 38 39 public B_Isolation(String name) { 40 super(name); 41 } 42 43 protected void setUp() { 44 super.setUp(); 45 useBeans("ebasic", true); 46 } 47 48 51 abstract public SimpleHome getHome(); 52 53 54 55 58 public void testCreatesFindINfoForNumOutTx() throws Exception { 59 int found2 = 0; 60 int found3 = 0; 61 int newval = 14; 62 Simple s1 = null; 63 Simple s2 = null; 64 try { 65 s1 = getHome().create("n3", 1001, newval); 66 s2 = getHome().create("n4", 1002, 2); 67 s2.setNumTest(newval); 68 Enumeration list = getHome().findInfoForNum(newval); 69 while (list.hasMoreElements()) { 70 list.nextElement(); 71 found2++; 72 } 73 assertEquals("first try", 2, found2); 74 } finally { 75 if (s1 != null) { 77 s1.remove(); 78 } 79 if (s2 != null) { 80 s2.remove(); 81 } 82 } 83 } 84 85 86 } 87 | Popular Tags |