Package org.sonatype.security

Examples of org.sonatype.security.SecuritySystem.start()


  public void testGetUserFromUserManager()
      throws Exception
  {

    SecuritySystem securitySystem = this.getSecuritySystem();
    securitySystem.start();
    User user = securitySystem.getUser("cstamas");
    Assert.assertNotNull(user);
    Assert.assertEquals("cstamas", user.getUserId());
    Assert.assertEquals("cstamas@sonatype.com", user.getEmailAddress());
    Assert.assertEquals("Tamas Cservenak", user.getName());
View Full Code Here


  {
    IOUtils.copy(getClass().getResourceAsStream("/test-conf/etc/security-users-in-both-realms.xml"),
        new FileOutputStream(getNexusSecurityConfiguration()));

    SecuritySystem securitySystem = this.getSecuritySystem();
    securitySystem.start();

    List<String> realms = new ArrayList<String>();
    realms.add("XmlAuthenticatingRealm");
    realms.add(LdapPlugin.REALM_NAME);
View Full Code Here

  @Test
  public void testInjectionIsSetupCorrectly() {
    SecuritySystem securitySystem = injector.getInstance(SecuritySystem.class);
    // See DefaultSecuritySystem, that applies cache
    // TODO: this should be done with Guice binding?
    securitySystem.start();

    SecurityManager securityManager = injector.getInstance(SecurityManager.class);

    RealmSecurityManager realmSecurityManager = injector.getInstance(RealmSecurityManager.class);
View Full Code Here

  public void testGetSubjectFromThread()
      throws Exception
  {
    SecuritySystem securitySystem = this.lookup(SecuritySystem.class);
    securitySystem.start();

    // need to bind to a request
    // this.setupLoginContext( "testGetSubjectFromThread" );

    Assert.assertNotNull(securitySystem.login(new UsernamePasswordToken("jcoder", "jcoder")));
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.