Java 8 SerializablePermission - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SerializablePermission class.

This code example shows how to use the following methods:
 
    @Test
    public void testCommitThrowsNullPointerException2() throws Throwable {
        LogEvent evt = new LogEvent();
        try { 
            transactionManager.commit(1, 100L, new SerializablePermission("testTransactionManagerParam1"), null, true, evt, null);
            fail("Expected NullPointerException to be thrown"); 
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
        } 
    } 
 
    @Test
    public void testConstructor() throws Throwable {
        assertNull("transactionManager.retryTask", transactionManager.retryTask);
        assertEquals("transactionManager.getLog().getRealm()", "org.jpos.transaction.TransactionManager", transactionManager
                .getLog().getRealm()); 
        assertEquals("transactionManager.getState()", -1, transactionManager.getState());
        assertTrue("transactionManager.isModified()", transactionManager.isModified());
        assertEquals("transactionManager.pauseTimeout", 0L, transactionManager.pauseTimeout);
5
CodeRank
This code example shows how to use the following methods:
public class Support_IOTestSecurityManager extends SecurityManager {
    private ArrayList<Permission> permissions;
 
    public Support_IOTestSecurityManager() { 
        permissions = new ArrayList<Permission>(2);
        permissions.add(new SerializablePermission("enableSubclassImplementation"));
        permissions.add(new SerializablePermission("enableSubstitution"));
    } 
 
    public void checkPermission(Permission p) {
        for (Iterator<Permission> i = permissions.iterator(); i.hasNext(); ) {
            if (i.next().equals(p)) {
                throw new SecurityException();
            } 
        } 
    } 
} 
 
 
5
CodeRank
This code example shows how to use the following methods:
public class Support_IOTestSecurityManager extends SecurityManager {
    private ArrayList<Permission> permissions;
     
    public Support_IOTestSecurityManager() { 
        permissions = new ArrayList<Permission>(2);
        permissions.add(new SerializablePermission("enableSubclassImplementation"));
        permissions.add(new SerializablePermission("enableSubstitution"));
    } 
     
    public void checkPermission(Permission p) {
        for (Iterator<Permission> i = permissions.iterator(); i.hasNext(); ) {
            if (i.next().equals(p)) {
                throw new SecurityException();
            } 
        } 
    }         
} 
 
 
4
CodeRank
This code example shows how to use the following methods:
         
        //these are required for server-side scripts to be able to  
        //invoke remote EJBs. 
        add(new SerializablePermission("creator"));
        add(new SerializablePermission("allowSerializationReflection"));
        add(new SerializablePermission("enableSubclassImplementation"));
        add(new RuntimePermission("reflectionFactoryAccess"));
 
        //by default allow the scripts access to any credentials of any user 
        //we don't consider the scripts malevolent. 
        add(new PrivateCredentialPermission("* * \"*\"", "read"));
 
        //adding this so that new classes with loggers can be initialized. 
        add(new LoggingPermission("control", null));
    } 
     
    public void add(Permission permission) {
        perms.add(permission);
    } 
 
4
CodeRank
This code example shows how to use the following methods:
	 */ 
	public void test_ConstructorLjava_lang_String() { 
		// Test for method java.io.SerializablePermission(java.lang.String) 
		assertEquals("permission ill-formed", 
				"enableSubclassImplementation", new SerializablePermission(
				"enableSubclassImplementation").getName());
	} 
 
	/** 
	 * @tests java.io.SerializablePermission#SerializablePermission(java.lang.String, 
	 *        java.lang.String) 
	 */ 
	public void test_ConstructorLjava_lang_StringLjava_lang_String() { 
		// Test for method java.io.SerializablePermission(java.lang.String, 
		// java.lang.String) 
		assertEquals("permission ill-formed", 
				"enableSubclassImplementation", new SerializablePermission(
				"enableSubclassImplementation", "").getName());
	} 
 
4
CodeRank
This code example shows how to use the following methods:
        add(new ReflectPermission("suppressAccessChecks"));
         
        //these are required for server-side scripts to be able to  
        //invoke remote EJBs. 
        add(new SerializablePermission("creator"));
        add(new SerializablePermission("allowSerializationReflection"));
        add(new SerializablePermission("enableSubclassImplementation"));
        add(new RuntimePermission("reflectionFactoryAccess"));
 
        //by default allow the scripts access to any credentials of any user 
        //we don't consider the scripts malevolent. 
        add(new PrivateCredentialPermission("* * \"*\"", "read"));
 
        //adding this so that new classes with loggers can be initialized. 
        add(new LoggingPermission("control", null));
    } 
     
    public void add(Permission permission) {
        perms.add(permission);
    } 
3
CodeRank
See Code Examples for Java 8 SerializablePermission Methods: