Package org.apache.openejb.test.object

Examples of org.apache.openejb.test.object.OperationsPolicy.allow()


        }

        /*[2] Test isCallerInRole /////////////*/
        try {
            ejbContext.isCallerInRole("TheMan");
            policy.allow(OperationsPolicy.Context_isCallerInRole);
        } catch (final IllegalStateException ise) {
        }

        /*[3] Test getRollbackOnly ////////////*/
        try {
View Full Code Here


        }

        /*[3] Test getRollbackOnly ////////////*/
        try {
            ejbContext.getRollbackOnly();
            policy.allow(OperationsPolicy.Context_getRollbackOnly);
        } catch (final IllegalStateException ise) {
        }

        /*[4] Test setRollbackOnly ////////////*/
//        try {
View Full Code Here

//        }

        /*[5] Test getUserTransaction /////////*/
        try {
            ejbContext.getUserTransaction();
            policy.allow(OperationsPolicy.Context_getUserTransaction);
        } catch (final IllegalStateException ise) {
        }

        /*[6] Test getEJBObject ///////////////*/
        try {
View Full Code Here

        }

        /*[6] Test getEJBObject ///////////////*/
        try {
            ejbContext.getEJBObject();
            policy.allow(OperationsPolicy.Context_getEJBObject);
        } catch (final IllegalStateException ise) {
        }

        /*[7] Test Context_getPrimaryKey ///////////////
         *
 
View Full Code Here

         *
         * TODO: Write this test.
         */
        try {
            ejbContext.getPrimaryKey();
            policy.allow(OperationsPolicy.Context_getPrimaryKey);
        } catch (final IllegalStateException ise) {
        }

        /*[8] Test JNDI_access_to_java_comp_env ///////////////*/
        try {
View Full Code Here

        try {
            final InitialContext jndiContext = new InitialContext();

            jndiContext.lookup("java:comp/env/stateless/references/JNDI_access_to_java_comp_env");

            policy.allow(OperationsPolicy.JNDI_access_to_java_comp_env);
        } catch (final IllegalStateException ise) {
        } catch (final NamingException ne) {
        }

        allowedOperationsTable.put(methodName, policy);
View Full Code Here

     */
    public void test01_setEntityContext(){
        try{

        final OperationsPolicy policy = new OperationsPolicy();
        policy.allow( OperationsPolicy.Context_getEJBHome );
        policy.allow( OperationsPolicy.JNDI_access_to_java_comp_env );

        final Object expected = policy;
        final Object actual = ejbObject.getAllowedOperationsReport("setEntityContext");

View Full Code Here

    public void test01_setEntityContext(){
        try{

        final OperationsPolicy policy = new OperationsPolicy();
        policy.allow( OperationsPolicy.Context_getEJBHome );
        policy.allow( OperationsPolicy.JNDI_access_to_java_comp_env );

        final Object expected = policy;
        final Object actual = ejbObject.getAllowedOperationsReport("setEntityContext");

        assertNotNull("The OpperationsPolicy is null", actual );
View Full Code Here

    public void TODO_test02_unsetEntityContext(){
        try{

        /* TO DO:  This test needs unique functionality to work */
        final OperationsPolicy policy = new OperationsPolicy();
        policy.allow( OperationsPolicy.Context_getEJBHome );
        policy.allow( OperationsPolicy.JNDI_access_to_java_comp_env );

        final Object expected = policy;
        final Object actual = ejbObject.getAllowedOperationsReport("unsetEntityContext");

View Full Code Here

        try{

        /* TO DO:  This test needs unique functionality to work */
        final OperationsPolicy policy = new OperationsPolicy();
        policy.allow( OperationsPolicy.Context_getEJBHome );
        policy.allow( OperationsPolicy.JNDI_access_to_java_comp_env );

        final Object expected = policy;
        final Object actual = ejbObject.getAllowedOperationsReport("unsetEntityContext");

        assertNotNull("The OpperationsPolicy is null", actual );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.