Repository: syncope Updated Branches: refs/heads/1_2_X c6640c99c -> 28783291d refs/heads/master 350b3bd24 -> 246457cd5
Reduing the thread number to avoid OutOfMemory errors on some platforms Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/c6640c99 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/c6640c99 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/c6640c99 Branch: refs/heads/master Commit: c6640c99c2cc7d242ba5b7f279de2c967c8cce40 Parents: 312897e Author: Francesco Chicchiriccò <[email protected]> Authored: Wed Mar 4 08:31:05 2015 +0100 Committer: Francesco Chicchiriccò <[email protected]> Committed: Wed Mar 4 08:31:05 2015 +0100 ---------------------------------------------------------------------- .../test/java/org/apache/syncope/client/ConcurrencyTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/c6640c99/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java ---------------------------------------------------------------------- diff --git a/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java b/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java index c7228c3..8c599db 100644 --- a/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java +++ b/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java @@ -30,6 +30,8 @@ public class ConcurrencyTest { private static final Logger LOG = LoggerFactory.getLogger(ConcurrencyTest.class); + private static final int THREAD_NUMBER = 1000; + private static final SyncopeClient client = new SyncopeClientFactoryBean().setAddress("http://url").create("username", "password"); @@ -37,7 +39,7 @@ public class ConcurrencyTest { public void multiThreadTest() throws InterruptedException { - for (int i = 0; i < 10000; i++) { + for (int i = 0; i < THREAD_NUMBER; i++) { Thread execution = new Thread("Th-" + StringUtils.leftPad(String.valueOf(i), 5, '0')) { @Override @@ -55,13 +57,13 @@ public class ConcurrencyTest { execution.start(); } - Thread.sleep(10000); + Thread.sleep(THREAD_NUMBER); } @Test public void multiCallTest() { try { - for (int i = 0; i < 10000; i++) { + for (int i = 0; i < THREAD_NUMBER; i++) { client.getService(ResourceService.class); } } catch (Exception e) {
