1 25 26 package org.objectweb.jonas.jtests.clients.entity; 27 28 import javax.naming.NamingException ; 29 import javax.rmi.PortableRemoteObject ; 30 import junit.framework.Test; 31 import junit.framework.TestSuite; 32 import org.objectweb.jonas.jtests.beans.fbasic.SimpleHome; 33 import org.objectweb.jonas.jtests.beans.fbasic.Simple; 34 import java.util.Enumeration ; 35 36 42 public abstract class B_BasicHomeInterfaceEC extends B_BasicHomeInterface { 43 44 public B_BasicHomeInterfaceEC(String name) { 45 super(name); 46 } 47 48 49 54 61 public void testFinderBetween() throws Exception { 62 int value = 991959; 63 getHome().create("991959_1", value, value); 64 getHome().create("991959_2", value, value); 65 Simple entity = null; 66 Enumeration eList = null; 67 eList = getHome().findInfo_beetwen(value, value); 68 int nb = 0; 69 while (eList.hasMoreElements()) { 70 entity = (Simple) javax.rmi.PortableRemoteObject.narrow(eList.nextElement(), Simple.class); 71 nb++; 72 assertEquals("Wrong Info value", entity.getInfo(), value); 73 assertEquals("Wrong NumTest value", entity.getNumTest(), value); 74 } 75 assertEquals("Wrong number of entities found", 2, nb); 76 getHome().remove("991959_1"); 77 getHome().remove("991959_2"); 78 } 79 80 public void testFinderBetweenSansVerif() throws Exception { 81 int value = 991959; 82 getHome().create("991959_1", value, value); 83 getHome().create("991959_2", value, value); 84 Simple entity = null; 85 Enumeration eList = null; 86 eList = getHome().findInfo_beetwen(value, value); 87 88 getHome().remove("991959_1"); 89 getHome().remove("991959_2"); 90 } 91 92 93 95 public void testCreateRemoveFinderBetween() throws Exception { 96 int value = 991959; 97 getHome().create("991959_1", value, value); 98 getHome().create("991959_2", value, value); 99 Simple entity = null; 100 Enumeration eList = null; 101 102 getHome().remove("991959_1"); 103 getHome().remove("991959_2"); 104 } 105 112 public void testFinderEqualOne() throws Exception { 113 Simple entity = null; 114 Enumeration eList = null; 115 eList = getHome().findEqualOne(80); 116 int nb = 0; 117 while (eList.hasMoreElements()) { 118 entity = (Simple) javax.rmi.PortableRemoteObject.narrow(eList.nextElement(), Simple.class); 119 nb++; 120 assertEquals(80, entity.getInfo()); 121 assertEquals(80, entity.getNumTest()); 122 } 123 assertEquals(2, nb); 124 } 125 126 133 public void testFinderEqualTwo() throws Exception { 134 Simple entity = null; 135 Enumeration eList = null; 136 eList = getHome().findEqualTwo(100, 90); 137 int nb = 0; 138 while (eList.hasMoreElements()) { 139 entity = (Simple) javax.rmi.PortableRemoteObject.narrow(eList.nextElement(), Simple.class); 140 nb++; 141 assertEquals(100, entity.getInfo()); 142 assertEquals(90, entity.getNumTest()); 143 } 144 assertEquals(1, nb); 145 } 146 147 } 148 149 | Popular Tags |