mark security context as deprecated and use shiro apis instead

This commit is contained in:
Sebastian Sdorra
2012-08-30 13:20:26 +02:00
parent 7d0980605e
commit 4a9d14b708
24 changed files with 277 additions and 298 deletions

View File

@@ -35,6 +35,9 @@ package sonia.scm.user;
//~--- non-JDK imports --------------------------------------------------------
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.junit.Test;
import sonia.scm.Manager;
@@ -56,7 +59,7 @@ import java.util.UUID;
* @author Sebastian Sdorra
*/
public abstract class UserManagerTestBase
extends ManagerTestBase<User, UserException>
extends ManagerTestBase<User, UserException>
{
/** Field description */
@@ -265,7 +268,7 @@ public abstract class UserManagerTestBase
*/
@Test
public void testMultiThreaded()
throws UserException, IOException, InterruptedException
throws UserException, IOException, InterruptedException
{
int initialSize = manager.getAll().size();
List<MultiThreadTester> testers = new ArrayList<MultiThreadTester>();
@@ -275,8 +278,11 @@ public abstract class UserManagerTestBase
testers.add(new MultiThreadTester(manager));
}
Subject subject = SecurityUtils.getSubject();
for (MultiThreadTester tester : testers)
{
subject.associateWith(tester);
new Thread(tester).start();
}
@@ -393,7 +399,7 @@ public abstract class UserManagerTestBase
{
String id = UUID.randomUUID().toString();
User user = new User(id, id.concat(" displayName"),
id.concat("@mail.com"));
id.concat("@mail.com"));
manager.create(user);
@@ -410,7 +416,7 @@ public abstract class UserManagerTestBase
* @throws UserException
*/
private void modifyAndDeleteUser(User user)
throws UserException, IOException
throws UserException, IOException
{
String name = user.getName();
String nd = name.concat(" new displayname");