Package org.jboss.seam.security

Examples of org.jboss.seam.security.Identity.login()


         identity.getCredentials().setPassword("bar");
        
         assert("foo".equals(identity.getCredentials().getUsername()));
         assert("bar".equals(identity.getCredentials().getPassword()));
        
         assert("loggedIn".equals(identity.login()));
         assert(identity.isLoggedIn());
        
         // Pre-authenticated roles are cleared before authenticating,
         // so this should still return false
         assert(!identity.hasRole("admin"));
View Full Code Here


    @Test
    public void testSave() throws Exception {
        Identity identity = Identity.instance();
        identity.getCredentials().setUsername("admin");
        identity.getCredentials().setPassword("admin");
        identity.login();

        HLocale locale = entityManager.find(HLocale.class, new Long(1));
        HAccount account = entityManager.find(HAccount.class, new Long(1));

        assertThat(locale, notNullValue());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.