Package tifauv.jplop.core.auth

Examples of tifauv.jplop.core.auth.User


    }
  }


  public void testCheckPassword() {
    User user = new User();
    assertTrue(user.checkPassword(null));
    assertFalse(user.checkPassword(""));
    assertFalse(user.checkPassword(" "));
    assertFalse(user.checkPassword("  "));
    assertFalse(user.checkPassword("sdfgdsfgsd"));

    try {
      user.setPassword("pikaron");
      assertFalse(user.checkPassword(null));
      assertFalse(user.checkPassword(""));
      assertTrue(user.checkPassword("pikaron"));
      assertFalse(user.checkPassword("pikaron1"));
      assertFalse(user.checkPassword("1pikaron"));
    } catch (PasswordException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here


    }
  }


  public void testAddRole() {
    User user = new User();
    assertEquals("", user.getRoles());
 
    user.addRole(null);
    assertEquals("", user.getRoles());
 
    user.addRole("");
    assertEquals("", user.getRoles());

    user.addRole("toto");
    assertEquals("toto", user.getRoles());

    user.addRole("plop ");
    assertEquals("plop,toto", user.getRoles());

    user.addRole(" pika");
    assertEquals("pika,plop,toto", user.getRoles());

    user.addRole("pika");
    assertEquals("pika,plop,toto", user.getRoles());

    user.addRole(" pikaron , ronron ");
    assertEquals("pika,plop,toto", user.getRoles());

    user.addRole("ronron ,");
    assertEquals("pika,plop,toto", user.getRoles());

    user.addRole(",ronron,");
    assertEquals("pika,plop,toto", user.getRoles());
  }
View Full Code Here

    assertEquals("pika,plop,toto", user.getRoles());
  }


  public void testAddRoles() {
    User user = new User();
    assertEquals("", user.getRoles());

    user.addRoles(null);
    assertEquals("", user.getRoles());

    user.addRoles("");
    assertEquals("", user.getRoles());

    user.addRoles("toto");
    assertEquals("toto", user.getRoles());

    user.addRoles("toto,plop");
    assertEquals("plop,toto", user.getRoles());

    user.addRoles("pika , ron,zorro");
    assertEquals("pika,plop,ron,toto,zorro", user.getRoles());
  }
View Full Code Here

    assertEquals("pika,plop,ron,toto,zorro", user.getRoles());
  }


  public void testClearRoles() {
    User user = new User();
    assertEquals("", user.getRoles());

    user.addRole("toto");
    assertEquals("toto", user.getRoles());
    user.clearRoles();
    assertEquals("", user.getRoles());

    user.addRoles("toto,plop");
    assertEquals("plop,toto", user.getRoles());
    user.clearRoles();
    assertEquals("", user.getRoles());
  }
View Full Code Here

    assertEquals("", user.getRoles());
  }


  public void testSetRoles() {
    User user = new User();
    assertEquals("", user.getRoles());

    user.setRoles(null);
    assertEquals("", user.getRoles());

    user.setRoles("");
    assertEquals("", user.getRoles());

    user.setRoles("toto");
    assertEquals("toto", user.getRoles());

    user.setRoles("plop");
    assertEquals("plop", user.getRoles());

    user.setRoles("plop, toto ,pika");
    assertEquals("pika,plop,toto", user.getRoles());

    user.setRoles("ron,coin");
    assertEquals("coin,ron", user.getRoles());

    user.setRoles(null);
    assertEquals("", user.getRoles());
  }
View Full Code Here

TOP

Related Classes of tifauv.jplop.core.auth.User

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.