Package org.apache.cxf.fediz.core.config.jaxb

Examples of org.apache.cxf.fediz.core.config.jaxb.FedizConfig


    }
   
    @org.junit.Test
    public void testTokenReplayCache() throws JAXBException, IOException {
        FedizConfig config = createConfiguration();
       
        // Test the default TokenReplayCache
        TokenReplayCache<String> defaultReplayCache = parseConfigAndReturnTokenReplayCache(config);
        Assert.assertNotNull(defaultReplayCache);
        Assert.assertTrue(defaultReplayCache instanceof EHCacheTokenReplayCache);
       
        // Now test setting another TokenReplayCache
        ContextConfig contextConfig = config.getContextConfig().get(0);
        contextConfig.setTokenReplayCache("org.apache.cxf.fediz.core.InMemoryTokenReplayCache");
       
        TokenReplayCache<String> newReplayCache = parseConfigAndReturnTokenReplayCache(config);
        Assert.assertNotNull(newReplayCache);
        Assert.assertTrue(newReplayCache instanceof InMemoryTokenReplayCache);
View Full Code Here


        SecurityTestUtil.cleanup();
    }
   
    private FedizConfig createConfiguration() throws JAXBException {

        FedizConfig rootConfig = new FedizConfig();
        ContextConfig config = new ContextConfig();
        rootConfig.getContextConfig().add(config);

        config.setName(CONFIG_NAME);
        config.setMaximumClockSkew(new BigInteger(CLOCK_SKEW));

        CertificateStores certStores = new CertificateStores();
View Full Code Here

        return rootConfig;
    }
   
    private FedizConfig createConfigWithoutCB() throws JAXBException {
       
        FedizConfig config = createConfiguration();
        FederationProtocolType protocol = (FederationProtocolType)config.getContextConfig().get(0).getProtocol();
       
        CallbackType homeRealm = new CallbackType();
        homeRealm.setType(ArgumentType.STRING);
        homeRealm.setValue(TestCallbackHandler.TEST_HOME_REALM);
        protocol.setHomeRealm(homeRealm);
View Full Code Here

        return config;
    }
   
    private FedizConfig createConfigCB() throws JAXBException {
       
        FedizConfig config = createConfiguration();
        FederationProtocolType protocol = (FederationProtocolType)config.getContextConfig().get(0).getProtocol();
       
        CallbackType homeRealm = new CallbackType();
        homeRealm.setType(ArgumentType.CLASS);
        homeRealm.setValue(CALLBACKHANDLER_CLASS);
        protocol.setHomeRealm(homeRealm);
View Full Code Here

   
    @org.junit.Test
    public void testParamsWithCallbackHandler() throws Exception {
       
        final JAXBContext jaxbContext = JAXBContext.newInstance(FedizConfig.class);
        FedizConfig configOut = createConfigCB();
        StringWriter writer = new StringWriter();
        jaxbContext.createMarshaller().marshal(configOut, writer);
        StringReader reader = new StringReader(writer.toString());
       
        FederationConfigurator configurator = new FederationConfigurator();
View Full Code Here

   
    @org.junit.Test
    public void testParamsWithoutCallbackHandler() throws Exception {
       
        final JAXBContext jaxbContext = JAXBContext.newInstance(FedizConfig.class);
        FedizConfig configOut = createConfigWithoutCB();
        StringWriter writer = new StringWriter();
        jaxbContext.createMarshaller().marshal(configOut, writer);
        StringReader reader = new StringReader(writer.toString());
       
        FederationConfigurator configurator = new FederationConfigurator();
View Full Code Here

    }

    //CHECKSTYLE:OFF
    private FedizConfig createConfiguration() throws JAXBException {

        FedizConfig rootConfig = new FedizConfig();
        ContextConfig config = new ContextConfig();
        rootConfig.getContextConfig().add(config);

        config.setName(CONFIG_NAME);
        config.setMaximumClockSkew(new BigInteger(CLOCK_SKEW));

        FederationProtocolType protocol = new FederationProtocolType();
View Full Code Here

    @org.junit.Test
    public void readWriteConfig() throws JAXBException {

        final JAXBContext jaxbContext = JAXBContext
                .newInstance(FedizConfig.class);
        FedizConfig configOut = createConfiguration();

        StringWriter writer = new StringWriter();
        jaxbContext.createMarshaller().marshal(configOut, writer);

        StringReader reader = new StringReader(writer.toString());
View Full Code Here

    public void testSaveConfig() throws JAXBException, IOException {
        final JAXBContext jaxbContext = JAXBContext
                .newInstance(FedizConfig.class);

        FederationConfigurator configurator = new FederationConfigurator();
        FedizConfig configOut = createConfiguration();
        StringWriter writer = new StringWriter();
        jaxbContext.createMarshaller().marshal(configOut, writer);
        StringReader reader = new StringReader(writer.toString());
        configurator.loadConfig(reader);
View Full Code Here

        /**
         * Test JAXB part
         */

        FederationConfigurator configurator = new FederationConfigurator();
        FedizConfig configOut = createConfiguration();
        StringWriter writer = new StringWriter();
        jaxbContext.createMarshaller().marshal(configOut, writer);
        StringReader reader = new StringReader(writer.toString());
        configurator.loadConfig(reader);

View Full Code Here

TOP

Related Classes of org.apache.cxf.fediz.core.config.jaxb.FedizConfig

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.