Package javax.ejb

Examples of javax.ejb.SessionContext


*/
public class EjbSupportTests extends TestCase {

  public void testSfsb() throws CreateException {
    MockControl mc = MockControl.createControl(SessionContext.class);
    SessionContext sc = (SessionContext) mc.getMock();
    mc.replay();
   
    final BeanFactory bf = new StaticListableBeanFactory();
    BeanFactoryLocator bfl = new BeanFactoryLocator() {
      public BeanFactoryReference useBeanFactory(String factoryKey)
View Full Code Here


   */
  public void testHelpfulNamingLookupMessage() throws NamingException, CreateException {
    SimpleNamingContextBuilder.emptyActivatedContextBuilder();
   
    MockControl mc = MockControl.createControl(SessionContext.class);
    SessionContext sc = (SessionContext) mc.getMock();
    mc.replay();
 
    // Leave with default XmlBeanFactoryLoader
 
    // Basically the test is what needed to be implemented here!
View Full Code Here

    }
  }
 
  public void testSlsb() throws Exception {
    MockControl mc = MockControl.createControl(SessionContext.class);
    SessionContext sc = (SessionContext) mc.getMock();
    mc.replay();
   
    final BeanFactory bf = new StaticListableBeanFactory();
    BeanFactoryLocator bfl = new BeanFactoryLocator() {
      public BeanFactoryReference useBeanFactory(String factoryKey) throws FatalBeanException {
View Full Code Here

    mdb.ejbCreate();
  }
 
  public void testCannotLoadBeanFactory() throws Exception {
    MockControl mc = MockControl.createControl(SessionContext.class);
    SessionContext sc = (SessionContext) mc.getMock();
    mc.replay();
 
    BeanFactoryLocator bfl = new BeanFactoryLocator() {
      public BeanFactoryReference useBeanFactory(String factoryKey) throws FatalBeanException {
        throw new BootstrapException("", null);
View Full Code Here

            try {
                final InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                final SessionContext sctx = (SessionContext) ctx.lookup("java:comp/env/sessioncontext");
                Assert.assertNotNull("The SessionContext got from java:comp/env/sessioncontext is null", sctx);

                // lookup using global name
                final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The SessionContext got from java:comp/EJBContext is null ", ejbCtx);
View Full Code Here

            try {
                final InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                final SessionContext sctx = (SessionContext) ctx.lookup("java:comp/env/sessioncontext");
                Assert.assertNotNull("The SessionContext got from java:comp/env/sessioncontext is null", sctx);

                // lookup using global name
                final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The SessionContext got from java:comp/EJBContext is null ", ejbCtx);
View Full Code Here

    /**
     * Set the associated session context. The container calls this method
     * after the instance creation.
     */
    public SessionContext getSessionContext() throws EJBException, RemoteException {
        SessionContext ejbContext = null;
        try {
            ejbContext = (SessionContext) new InitialContext().lookup("java:comp/EJBContext");
        } catch (final NamingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

            try {
                final InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                final SessionContext sctx = (SessionContext) ctx.lookup("java:comp/env/sessioncontext");
                Assert.assertNotNull("The SessionContext got from java:comp/env/sessioncontext is null", sctx);

                // lookup using global name
                final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The SessionContext got from java:comp/EJBContext is null ", ejbCtx);
View Full Code Here

            try {
                final InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                final SessionContext sctx = (SessionContext) ctx.lookup("java:comp/env/sessioncontext");
                Assert.assertNotNull("The SessionContext got from java:comp/env/sessioncontext is null", sctx);

                // lookup using global name
                final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The SessionContext got from java:comp/EJBContext is null ", ejbCtx);
View Full Code Here

            try {
                final InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                final SessionContext sctx = (SessionContext) ctx.lookup("java:comp/env/sessioncontext");
                Assert.assertNotNull("The SessionContext got from java:comp/env/sessioncontext is null", sctx);

                // lookup using global name
                final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The SessionContext got from java:comp/EJBContext is null ", ejbCtx);
View Full Code Here

TOP

Related Classes of javax.ejb.SessionContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.