1 package org.jboss.ejb3.test.regression.ejbthree440.unit; 2 3 import junit.framework.Test; 4 import org.jboss.ejb3.test.regression.ejbthree440.model.MyResource; 5 import org.jboss.ejb3.test.regression.ejbthree440.session.i.IInheritanceDemo; 6 import org.jboss.test.JBossTestCase; 7 import org.jnp.interfaces.NamingContextFactory; 8 9 import javax.naming.Context ; 10 import javax.naming.InitialContext ; 11 import javax.transaction.UserTransaction ; 12 import java.util.Properties ; 13 import org.jboss.serial.io.MarshalledObject; 14 15 16 21 public class FailingTestCase extends JBossTestCase 22 { 23 org.jboss.logging.Logger log = getLog(); 24 25 static boolean deployed = false; 26 static int test = 0; 27 28 public FailingTestCase(String name) 29 { 30 31 super(name); 32 33 } 34 35 public void testSerializationError() throws Exception 36 { 37 try 38 { 39 UserTransaction tx = null; 40 Context ctx = getInitialContext(); 41 42 tx = (UserTransaction ) ctx.lookup("UserTransaction"); 43 IInheritanceDemo playground = (IInheritanceDemo) ctx.lookup("InheritanceDemo/remote"); 44 45 tx.begin(); 46 playground.create(); 47 tx.commit(); 48 49 tx.begin(); 50 MarshalledObject mo = playground.readFromMO(); 51 MyResource r = (MyResource)mo.get(); 52 r = (MyResource) playground.read(); 53 playground.remove(); 54 tx.commit(); 55 tx = null; 56 } 57 catch (Exception e) 58 { 59 e.printStackTrace(); 60 throw e; 61 } 62 } 63 64 65 public static Test suite() throws Exception 66 { 67 return getDeploySetup(FailingTestCase.class, "ejbthree440.ear"); 68 } 69 } 70 | Popular Tags |