Package org.jgroups.auth

Examples of org.jgroups.auth.SimpleToken


        try{
            properties.clear();

            properties.put("auth_value", "chris");

            SimpleToken token1 = new SimpleToken();
            token1.setValue(properties);

            properties.put("auth_value", "chris");

            SimpleToken token2 = new SimpleToken();
            token2.setValue(properties);

            assertTrue(token1.authenticate(token2, null));
        }catch(Exception failException){
            fail(failException.getMessage());
        }
View Full Code Here


        try{
            properties.clear();

            properties.put("auth_value", "chris");

            SimpleToken token1 = new SimpleToken();
            token1.setValue(properties);

            properties.put("auth_value", "chrismills");

            SimpleToken token2 = new SimpleToken();
            token2.setValue(properties);

            assertTrue(!token1.authenticate(token2, null));
        }catch(Exception failException){
            fail(failException.getMessage());
        }
View Full Code Here

        try{
            properties.clear();

            properties.put("auth_value", "chris");

            SimpleToken token1 = new SimpleToken();
            token1.setValue(properties);

            AuthHeader header = new AuthHeader();
            header.setToken(token1);

            assertTrue(token1 == header.getToken());
View Full Code Here

        try{
            properties.clear();

            properties.put("auth_value", "chris");

            SimpleToken token1 = new SimpleToken();
            token1.setValue(properties);

            properties.put("auth_value", "chris");

            SimpleToken token2 = new SimpleToken();
            token2.setValue(properties);

            AuthHeader header = new AuthHeader();
            header.setToken(token1);

            assertTrue(!(token2 == header.getToken()));
View Full Code Here

    /**
     * Creates two SimpleToken objects with identical auth_values and authenticates one against the other
     * Test fails if an exception is thrown or authentication fails
     */
    public static void testSimpleToken() {
        SimpleToken token1=new SimpleToken();
        token1.setAuthValue("chris");
        SimpleToken token2=new SimpleToken();
        token2.setAuthValue("chris");
        assert token1.authenticate(token2, null);
    }
View Full Code Here

     * Creates two SimpleToken objects with different auth_values and authenticates one against the other
     * <p/>
     * Test fails if an exception is thrown or authentication passes
     */
    public static void testSimpleTokenMismatch() {
        SimpleToken token1=new SimpleToken();
        token1.setAuthValue("chris");
        SimpleToken token2=new SimpleToken();
        token2.setAuthValue("chrismills");
        assert !token1.authenticate(token2, null);
    }
View Full Code Here

     * Test to create an AuthHeader object and set and get the Token object
     * <p/>
     * Fails if an exception is thrown or the set and get don't equal the same object
     */
    public static void testAuthHeader() {
        SimpleToken token1=new SimpleToken();
        token1.setAuthValue("chris");

        AuthHeader header=new AuthHeader();
        header.setToken(token1);

        assert token1 == header.getToken();
View Full Code Here

     * Test to create an AuthHeader object and set and get the Token object
     * <p/>
     * Fails if an exception is thrown or the set and get equal the same object
     */
    public static void testAuthHeaderDifferent() {
        SimpleToken token1=new SimpleToken();
        token1.setAuthValue("chris");

        SimpleToken token2=new SimpleToken();
        token2.setAuthValue("chris");

        AuthHeader header=new AuthHeader();
        header.setToken(token1);

        assert !(token2 == header.getToken());
View Full Code Here

TOP

Related Classes of org.jgroups.auth.SimpleToken

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.