Clover coverage report -
Coverage timestamp: Thu Jun 22 2006 14:24:50 CEST
file stats: LOC: 123   Methods: 8
NCLOC: 47   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
SFSBBeanManagedSessionCtxMethods.java - 75% 75% 75%
coverage coverage
 1    /**
 2    * EasyBeans
 3    * Copyright (C) 2006 Bull S.A.S.
 4    * Contact: easybeans@objectweb.org
 5    *
 6    * This library is free software; you can redistribute it and/or
 7    * modify it under the terms of the GNU Lesser General Public
 8    * License as published by the Free Software Foundation; either
 9    * version 2.1 of the License, or any later version.
 10    *
 11    * This library is distributed in the hope that it will be useful,
 12    * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 14    * Lesser General Public License for more details.
 15    *
 16    * You should have received a copy of the GNU Lesser General Public
 17    * License along with this library; if not, write to the Free Software
 18    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 19    * USA
 20    *
 21    * --------------------------------------------------------------------------
 22    * $Id: SFSBBeanManagedSessionCtxMethods.java 627 2006-06-12 09:16:55Z studzine $
 23    * --------------------------------------------------------------------------
 24    */
 25    package org.objectweb.easybeans.tests.common.ejbs.stateful.beanmanaged.sessioncontext;
 26   
 27    import static org.testng.Assert.assertEquals;
 28   
 29    import javax.annotation.Resource;
 30    import javax.ejb.Remote;
 31    import javax.ejb.SessionContext;
 32    import javax.ejb.Stateful;
 33    import javax.ejb.TransactionManagement;
 34    import javax.ejb.TransactionManagementType;
 35   
 36    import org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextBMT;
 37    import org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextCMT;
 38    import org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextEJB3;
 39    import org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextSecurity;
 40    import org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextTimer;
 41   
 42    /**
 43    * This class is used to test SessionContext methods.
 44    * @author Eduardo Studzinski Estima de Castro
 45    * @author Gisele Pinheiro Souza
 46    *
 47    */
 48    @Stateful(name="SFSBBeanManagedSessionCtxMethods")
 49    @Remote({ItfSessionContextBMT.class, ItfSessionContextCMT.class, ItfSessionContextEJB3.class, ItfSessionContextSecurity.class,
 50    ItfSessionContextTimer.class})
 51    @TransactionManagement(value = TransactionManagementType.BEAN)
 52    public class SFSBBeanManagedSessionCtxMethods implements ItfSessionContextBMT, ItfSessionContextCMT, ItfSessionContextEJB3,
 53    ItfSessionContextSecurity, ItfSessionContextTimer{
 54   
 55    /**
 56    * SessionContext.
 57    */
 58    @Resource
 59    private SessionContext ctx;
 60   
 61    /**
 62    * @see org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextCMT
 63    */
 64  1 public void verifySetRollbackOnly() {
 65    //Must throw an IllegalStateException
 66  1 ctx.setRollbackOnly();
 67    }
 68   
 69    /**
 70    * @see org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextCMT
 71    */
 72  1 public void verifyGetRollbackOnly() {
 73    //Must throw an IllegalStateException
 74  1 ctx.getRollbackOnly();
 75    }
 76   
 77    /**
 78    * @see org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextEJB3
 79    */
 80  1 public void verifyGetBusinessObject() {
 81  1 ItfSessionContextCMT bean = ctx.getBusinessObject(ItfSessionContextCMT.class);
 82  0 bean.verifyGetRollbackOnly();
 83    }
 84   
 85    /**
 86    * @see org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextEJB3
 87    */
 88  1 public void verifyGetInvokedBusinessInterface() {
 89  1 Class cl = ctx.getInvokedBusinessInterface();
 90  0 assertEquals(cl, ItfSessionContextEJB3.class, "This method should return the "
 91    + "interface ItfSessionContextEJB3, but returned " + cl.getName());
 92    }
 93   
 94    /**
 95    * @see org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextTimer
 96    */
 97  1 public void verifyGetTimerService() {
 98    //Must throw an IllegalStateException
 99  1 ctx.getTimerService();
 100    }
 101   
 102    /**
 103    * @see org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextBMT
 104    */
 105  1 public void verifyGetUserTransaction() {
 106  1 ctx.getUserTransaction();
 107    }
 108   
 109    /**
 110    * @see org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextSecurity
 111    */
 112  0 public void verifyGetCallerPrincipal() {
 113    // TODO: Code
 114    }
 115   
 116    /**
 117    * @see org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextSecurity
 118    */
 119  0 public void verifyIsCallerInRole() {
 120    // TODO: Code
 121    }
 122   
 123    }