Package org.jboss.weld.security

Examples of org.jboss.weld.security.GetDeclaredMethodAction


        try {
            Class<?> unsafe = Class.forName(REFLECTION_CLASS_NAME);
            Field accessor = AccessController.doPrivileged(new GetDeclaredFieldAction(unsafe, "theUnsafe"));
            AccessController.doPrivileged(SetAccessibleAction.of(accessor));
            unsafeInstance = accessor.get(null);
            allocateInstanceMethod = AccessController.doPrivileged(new GetDeclaredMethodAction(unsafe, "allocateInstance", Class.class));
        } catch (Exception e) {
            // OK to fail
        }
    }
View Full Code Here


        }
    }

    @Test
    public void testGetDeclaredMethod() throws PrivilegedActionException {
        Assert.assertNotNull(AccessController.doPrivileged(new GetDeclaredMethodAction(TestObject.class, "publicTest", new Class<?>[]{String.class})));
    }
View Full Code Here

    }

    @Test(expected = NoSuchMethodException.class)
    public void testGetDeclaredMethodNotFound() throws Throwable {
        try {
            AccessController.doPrivileged(new GetDeclaredMethodAction(TestObject.class, "xpublicTest", new Class<?>[]{String.class}));
        } catch (PrivilegedActionException e) {
            throw e.getCause();
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.weld.security.GetDeclaredMethodAction

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.