Package org.apache.jackrabbit.oak.spi.security

Examples of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters$Milliseconds


        Map<String,Object> m = new HashMap<String, Object>();
        m.put("TEST", testObject);
        m.put("String", "1000");
        m.put("Int2", new Integer(1000));
        m.put("Int3", 1000);
        ConfigurationParameters options = new ConfigurationParameters(m);

        assertEquals(testObject, options.getConfigValue("TEST", testObject));
        assertEquals("t", options.getConfigValue("TEST", "defaultString"));

        assertEquals(int1000, options.getConfigValue("String", new Integer(10)));
        assertEquals(new Long(1000), options.getConfigValue("String", new Long(10)));
        assertEquals("1000", options.getConfigValue("String", "10"));

        assertEquals(int1000, options.getConfigValue("Int2", new Integer(10)));
        assertEquals("1000", options.getConfigValue("Int2", "1000"));

        assertEquals(int1000, options.getConfigValue("Int3", new Integer(10)));
        assertEquals("1000", options.getConfigValue("Int3", "1000"));
    }
View Full Code Here


        Map<String,Object> m = new HashMap<String, Object>();
        m.put("TEST", testObject);
        m.put("String", "1000");
        m.put("Int2", new Integer(1000));
        m.put("Int3", 1000);
        ConfigurationParameters options = new ConfigurationParameters(m);

        assertNotNull(options.getNullableConfigValue("TEST", null));
        assertEquals(testObject, options.getNullableConfigValue("TEST", null));

        assertEquals(testObject, options.getNullableConfigValue("TEST", testObject));
        assertEquals("t", options.getNullableConfigValue("TEST", "defaultString"));

        assertEquals("1000", options.getNullableConfigValue("String", null));
        assertEquals(int1000, options.getNullableConfigValue("String", new Integer(10)));
        assertEquals(new Long(1000), options.getNullableConfigValue("String", new Long(10)));
        assertEquals("1000", options.getNullableConfigValue("String", "10"));

        assertEquals(int1000, options.getNullableConfigValue("Int2", null));
        assertEquals(int1000, options.getNullableConfigValue("Int2", new Integer(10)));
        assertEquals("1000", options.getNullableConfigValue("Int2", "1000"));

        assertEquals(1000, options.getNullableConfigValue("Int3", null));
        assertEquals(int1000, options.getNullableConfigValue("Int3", new Integer(10)));
        assertEquals("1000", options.getNullableConfigValue("Int3", "1000"));
    }
View Full Code Here

        assertEquals("1000", options.getNullableConfigValue("Int3", "1000"));
    }

    @Test
    public void testNullValue() {
        ConfigurationParameters options = new ConfigurationParameters(Collections.singletonMap("test", null));

        assertNull(options.getConfigValue("test", null));
        assertEquals("value", options.getConfigValue("test", "value"));
        TestObject to = new TestObject("t");
        assertEquals(to, options.getConfigValue("test", to));
        assertFalse(options.getConfigValue("test", false));
    }
View Full Code Here

        assertFalse(options.getConfigValue("test", false));
    }

    @Test
    public void testNullValue2() {
        ConfigurationParameters options = new ConfigurationParameters(Collections.singletonMap("test", null));

        assertNull(options.getNullableConfigValue("test", null));
        assertNull(options.getNullableConfigValue("test", "value"));
        assertNull(options.getNullableConfigValue("test", "value"));
        assertNull(options.getNullableConfigValue("test", new TestObject("t")));
        assertNull(options.getNullableConfigValue("test", false));
    }
View Full Code Here

            assertEquals("test", authInfo.getUserID());

            cs.close();
            cs = null;

            ConfigurationParameters config = securityProvider.getConfiguration(UserConfiguration.class).getParameters();
            String adminId = UserUtility.getAdminId(config);
            sc = new SimpleCredentials(adminId, new char[0]);
            ImpersonationCredentials ic = new ImpersonationCredentials(sc, authInfo);

            try {
View Full Code Here

    public void testAdminConfiguration() throws Exception {
        Map<String,String> userParams = new HashMap();
        userParams.put(UserConstants.PARAM_ADMIN_ID, "admin");
        userParams.put(UserConstants.PARAM_ADMIN_PW, null);

        ConfigurationParameters params = new ConfigurationParameters(ImmutableMap.of(UserConfiguration.PARAM_USER_OPTIONS, new ConfigurationParameters(userParams)));
        SecurityProvider sp = new SecurityProviderImpl(params);
        final ContentRepository repo = new Oak().with(new InitialContent())
                .with(new PropertyIndexEditorProvider())
                .with(new PropertyIndexProvider())
                .with(new RegistrationEditorProvider())
View Full Code Here

    @Override
    @Before
    public void before() throws Exception {
        super.before();

        ConfigurationParameters options = getConfig(AccessControlConfiguration.class).getParameters();
        readPaths = options.getConfigValue(AccessControlConstants.PARAM_READ_PATHS, AccessControlConstants.DEFAULT_READ_PATHS);
    }
View Full Code Here

    }

    @Override
    protected ConfigurationParameters getSecurityConfigParameters() {
        Map<String, String> map = Collections.singletonMap(AccessControlConstants.PARAM_PERMISSIONS_JR2, AccessControlConstants.VALUE_PERMISSIONS_JR2);
        ConfigurationParameters acConfig = new ConfigurationParameters(map);

        return new ConfigurationParameters(ImmutableMap.of(AccessControlConfiguration.PARAM_ACCESS_CONTROL_OPTIONS, acConfig));
    }
View Full Code Here

        String importBehavior = getImportBehavior();
        if (importBehavior != null) {
            Map<String,String> userParams = new HashMap();
            userParams.put(ProtectedItemImporter.PARAM_IMPORT_BEHAVIOR, getImportBehavior());
            ConfigurationParameters config = new ConfigurationParameters(ImmutableMap.of(UserConfiguration.PARAM_USER_OPTIONS, new ConfigurationParameters(userParams)));

            SecurityProvider securityProvider = new SecurityProviderImpl(config);
            String dir = "target/mk-tck-" + System.currentTimeMillis();
            Jcr jcr = new Jcr(new MicroKernelImpl(dir));
            jcr.with(Executors.newScheduledThreadPool(1))
View Full Code Here

    protected ConfigurationParameters getSecurityConfigParameters() {
        Map<String, String> map = new HashMap<String, String>();
        map.put(AccessControlAction.GROUP_PRIVILEGE_NAMES, PrivilegeConstants.JCR_READ);
        map.put(AccessControlAction.USER_PRIVILEGE_NAMES, PrivilegeConstants.JCR_ALL);

        ConfigurationParameters userConfig = new ConfigurationParameters(map);
        return new ConfigurationParameters(ImmutableMap.of(UserConfiguration.PARAM_USER_OPTIONS, userConfig));
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.security.ConfigurationParameters$Milliseconds

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.