1 package org.jboss.test.marshal.test; 2 3 import junit.framework.Test; 4 import org.jboss.test.JBossTestCase; 5 import org.jboss.test.marshal.TestPayload; 6 import org.jboss.test.marshal.interfaces.MarshalSession; 7 import org.jboss.test.marshal.interfaces.MarshalSessionHome; 8 9 import java.rmi.MarshalException ; 10 11 17 public class EjbUnMarshalUnitTestCase extends JBossTestCase 18 { 19 public EjbUnMarshalUnitTestCase(String name) 20 { 21 super(name); 22 } 23 24 public static Test suite() 25 throws Exception 26 { 27 return getDeploySetup(EjbUnMarshalUnitTestCase.class, "test-ejb-unmarshal.jar"); 28 } 29 30 36 public void testUnMarshalException() throws Exception 37 { 38 MarshalSessionHome marshalHome = (MarshalSessionHome)getInitialContext().lookup("marshal/MarshallSession"); 39 MarshalSession marshalSession = marshalHome.create(); 40 41 TestPayload payload = new TestPayload(); 42 try 43 { 44 marshalSession.testMethod(payload); 45 assertTrue("Call on MarshalSession.testMethod() should have thrown UnmarshalException, but did not", false); 46 } 47 catch (MarshalException e) 48 { 49 assertTrue(true); 50 } 51 catch (Throwable thr) 52 { 53 thr.printStackTrace(); 54 throw new Exception (thr); 55 } 56 57 } 58 59 } 60 | Popular Tags |