Repository: james-project Updated Branches: refs/heads/master 70f69255d -> f89a2abd2
JAMES-1693 MemoryUsersRepository is supposed to support virtualHosting Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/3413ec51 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/3413ec51 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/3413ec51 Branch: refs/heads/master Commit: 3413ec5125e177a24b8849c1eff866ee4ac351ef Parents: 940a0ec Author: Benoit Tellier <btell...@linagora.com> Authored: Mon Feb 29 15:55:58 2016 +0700 Committer: Matthieu Baechler <matthieu.baech...@linagora.com> Committed: Wed Mar 23 17:03:55 2016 +0100 ---------------------------------------------------------------------- .../mpt/managesieve/file/host/FileHostSystem.java | 2 +- .../james/user/memory/MemoryUsersRepository.java | 17 ++++++++++++++++- .../user/memory/MemoryUsersRepositoryTest.java | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/3413ec51/mpt/impl/managesieve/file/src/test/java/org/apache/james/mpt/managesieve/file/host/FileHostSystem.java ---------------------------------------------------------------------- diff --git a/mpt/impl/managesieve/file/src/test/java/org/apache/james/mpt/managesieve/file/host/FileHostSystem.java b/mpt/impl/managesieve/file/src/test/java/org/apache/james/mpt/managesieve/file/host/FileHostSystem.java index 51a4641..2ed61f3 100644 --- a/mpt/impl/managesieve/file/src/test/java/org/apache/james/mpt/managesieve/file/host/FileHostSystem.java +++ b/mpt/impl/managesieve/file/src/test/java/org/apache/james/mpt/managesieve/file/host/FileHostSystem.java @@ -39,7 +39,7 @@ public class FileHostSystem extends JamesManageSieveHostSystem { } public FileHostSystem() throws Exception { - super(new MemoryUsersRepository(), createSieveRepository()); + super(MemoryUsersRepository.withoutVirtualHosting(), createSieveRepository()); } @Override http://git-wip-us.apache.org/repos/asf/james-project/blob/3413ec51/server/data/data-memory/src/main/java/org/apache/james/user/memory/MemoryUsersRepository.java ---------------------------------------------------------------------- diff --git a/server/data/data-memory/src/main/java/org/apache/james/user/memory/MemoryUsersRepository.java b/server/data/data-memory/src/main/java/org/apache/james/user/memory/MemoryUsersRepository.java index 229c563..02d48b8 100644 --- a/server/data/data-memory/src/main/java/org/apache/james/user/memory/MemoryUsersRepository.java +++ b/server/data/data-memory/src/main/java/org/apache/james/user/memory/MemoryUsersRepository.java @@ -34,12 +34,27 @@ import java.util.Map; public class MemoryUsersRepository extends AbstractUsersRepository { + public static MemoryUsersRepository withVirtualHosting() { + return new MemoryUsersRepository(true); + } + + public static MemoryUsersRepository withoutVirtualHosting() { + return new MemoryUsersRepository(false); + } + private final Map<String, User> userByName; + private final boolean supportVirtualHosting; private String algo; - public MemoryUsersRepository() { + private MemoryUsersRepository(boolean supportVirtualHosting) { this.userByName = new HashMap<String, User>(); this.algo = "MD5"; + this.supportVirtualHosting = supportVirtualHosting; + } + + @Override + public boolean supportVirtualHosting() { + return supportVirtualHosting; } @Override http://git-wip-us.apache.org/repos/asf/james-project/blob/3413ec51/server/data/data-memory/src/test/java/org/apache/james/user/memory/MemoryUsersRepositoryTest.java ---------------------------------------------------------------------- diff --git a/server/data/data-memory/src/test/java/org/apache/james/user/memory/MemoryUsersRepositoryTest.java b/server/data/data-memory/src/test/java/org/apache/james/user/memory/MemoryUsersRepositoryTest.java index 8427736..4057eb7 100644 --- a/server/data/data-memory/src/test/java/org/apache/james/user/memory/MemoryUsersRepositoryTest.java +++ b/server/data/data-memory/src/test/java/org/apache/james/user/memory/MemoryUsersRepositoryTest.java @@ -26,6 +26,6 @@ public class MemoryUsersRepositoryTest extends AbstractUsersRepositoryTest { @Override protected AbstractUsersRepository getUsersRepository() throws Exception { - return new MemoryUsersRepository(); + return MemoryUsersRepository.withVirtualHosting(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org