Package org.picketlink.identity.federation.core.wstrust

Examples of org.picketlink.identity.federation.core.wstrust.WSTrustServiceFactory


        InputStream configStream = cl.getResourceAsStream("sts/picketlink-sts.xml");
        STSConfigParser configParser = new STSConfigParser();
        STSType stsType = (STSType) configParser.parse(configStream);

        STSConfiguration config = new PicketLinkSTSConfiguration(stsType);
        WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();

        // tests the creation of the request handler.
        WSTrustRequestHandler handler = factory.createRequestHandler(
                "org.picketlink.identity.federation.core.wstrust.StandardRequestHandler", config);
        assertNotNull("Unexpected null request handler", handler);
        assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);

        InputStream is = getClass().getClassLoader().getResourceAsStream("wstrust/wstrust-rst-usekey.xml");
View Full Code Here


     *
     * @throws Exception if an error occurs while running the test.
     */
    public void testCreateRequestHandler() throws Exception {
        STSConfiguration config = new PicketLinkSTSConfiguration();
        WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();

        // tests the creation of the request handler.
        WSTrustRequestHandler handler = factory.createRequestHandler(
                "org.picketlink.identity.federation.core.wstrust.StandardRequestHandler", config);
        assertNotNull("Unexpected null request handler", handler);
        assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);

        // try to create an invalid instance of request handler.
        try {
            factory.createRequestHandler("InvalidHandler", config);
            fail("An exception should have been raised");
        } catch (RuntimeException re) {
            String msg = re.getCause().getMessage();
            assertTrue(msg.contains("Class Not Loaded"));
        }
View Full Code Here

     * </p>
     *
     * @throws Exception if an error occurs while running the test.
     */
    public void testCreateTokenProvider() throws Exception {
        WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();
        SecurityTokenProvider provider = factory.createTokenProvider(
                "org.picketlink.test.identity.federation.core.wstrust.SpecialTokenProvider", null);
        assertNotNull("Unexpected null token provider", provider);
        assertTrue("Unexpected token provider type", provider instanceof SpecialTokenProvider);
        provider = factory.createTokenProvider(
                "org.picketlink.identity.federation.core.wstrust.plugins.saml.SAML20TokenProvider",
                new HashMap<String, String>());
        assertNotNull("Unexpected null token provider", provider);
        assertTrue("Unexpected token provider type", provider instanceof SAML20TokenProvider);

        // try to create an invalid token provider.
        try {
            factory.createTokenProvider("InvalidTokenProvider", null);
            fail("An exception should have been raised");
        } catch (RuntimeException re) {
            String msg = re.getCause().getMessage();
            assertTrue(msg.contains("Cannot create instance"));
        }
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.wstrust.WSTrustServiceFactory

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.