JAMES-2334 better name for default rate limiter
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/bc6eb256 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/bc6eb256 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/bc6eb256 Branch: refs/heads/master Commit: bc6eb2562129c622e13f2afc46a9a3327e142481 Parents: 614ebad Author: duc <dt...@linagora.com> Authored: Fri Oct 19 17:34:03 2018 +0700 Committer: Benoit Tellier <btell...@linagora.com> Committed: Wed Oct 24 08:48:20 2018 +0700 ---------------------------------------------------------------------- .../java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java | 2 +- .../test/java/org/apache/james/mailbox/tika/TikaContainer.java | 2 +- .../apache/james/blob/objectstorage/DockerSwiftContainer.java | 4 ++-- .../src/test/java/org/apache/james/metric/es/ESReporterTest.java | 2 +- .../java/org/apache/james/user/ldap/LdapGenericContainer.java | 2 +- .../james/transport/mailets/AmqpForwardAttachmentTest.java | 2 +- .../org/apache/james/transport/mailets/ContactExtractorTest.java | 2 +- .../james/transport/mailets/ICSAttachmentWorkflowTest.java | 2 +- .../org/apache/james/transport/mailets/SpamAssassinTest.java | 2 +- .../src/test/java/org/apache/james/jmap/ContainerTest.java | 2 +- .../src/main/java/org/apache/james/util/docker/RateLimiters.java | 2 +- .../testing/src/main/java/org/apache/james/utils/FakeSmtp.java | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/backends-common/rabbitmq/src/test/java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java ---------------------------------------------------------------------- diff --git a/backends-common/rabbitmq/src/test/java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java b/backends-common/rabbitmq/src/test/java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java index 9153f81..1b53492 100644 --- a/backends-common/rabbitmq/src/test/java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java +++ b/backends-common/rabbitmq/src/test/java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java @@ -84,7 +84,7 @@ public class DockerRabbitMQ { private WaitStrategy waitStrategy() { return new WaitAllStrategy() .withStrategy(Wait.forHttp("").forPort(DEFAULT_RABBITMQ_ADMIN_PORT) - .withRateLimiter(RateLimiters.DEFAULT) + .withRateLimiter(RateLimiters.TWENTIES_PER_SECOND) .withStartupTimeout(TEN_MINUTE_TIMEOUT)) .withStrategy(new RabbitMQWaitStrategy(this, TEN_MINUTE_TIMEOUT)) .withStartupTimeout(TEN_MINUTE_TIMEOUT); http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/TikaContainer.java ---------------------------------------------------------------------- diff --git a/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/TikaContainer.java b/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/TikaContainer.java index ae015e0..aa2c0fe 100644 --- a/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/TikaContainer.java +++ b/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/TikaContainer.java @@ -39,7 +39,7 @@ public class TikaContainer extends ExternalResource { public TikaContainer() { tika = new SwarmGenericContainer(Images.TIKA) .withExposedPorts(DEFAULT_TIKA_PORT) - .waitingFor(Wait.forHttp("/tika").withRateLimiter(RateLimiters.DEFAULT)) + .waitingFor(Wait.forHttp("/tika").withRateLimiter(RateLimiters.TWENTIES_PER_SECOND)) .withStartupTimeout(Duration.ofSeconds(30)); } http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/DockerSwiftContainer.java ---------------------------------------------------------------------- diff --git a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/DockerSwiftContainer.java b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/DockerSwiftContainer.java index 6822fee..6837621 100644 --- a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/DockerSwiftContainer.java +++ b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/DockerSwiftContainer.java @@ -54,12 +54,12 @@ public class DockerSwiftContainer { forHttp("/v3") .forPort(KEYSTONE_ADMIN_PORT) .forStatusCode(200) - .withRateLimiter(RateLimiters.DEFAULT) + .withRateLimiter(RateLimiters.TWENTIES_PER_SECOND) ).withStrategy( forHttp("/info") .forPort(SWIFT_PORT) .forStatusCode(200) - .withRateLimiter(RateLimiters.DEFAULT) + .withRateLimiter(RateLimiters.TWENTIES_PER_SECOND) ) ); http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/server/container/metrics/metrics-es-reporter/src/test/java/org/apache/james/metric/es/ESReporterTest.java ---------------------------------------------------------------------- diff --git a/server/container/metrics/metrics-es-reporter/src/test/java/org/apache/james/metric/es/ESReporterTest.java b/server/container/metrics/metrics-es-reporter/src/test/java/org/apache/james/metric/es/ESReporterTest.java index 3cc32fb..d602f8b 100644 --- a/server/container/metrics/metrics-es-reporter/src/test/java/org/apache/james/metric/es/ESReporterTest.java +++ b/server/container/metrics/metrics-es-reporter/src/test/java/org/apache/james/metric/es/ESReporterTest.java @@ -58,7 +58,7 @@ public class ESReporterTest { public SwarmGenericContainer esContainer = new SwarmGenericContainer(Images.ELASTICSEARCH) .withAffinityToContainer() .withExposedPorts(ES_HTTP_PORT, ES_APPLICATIVE_PORT) - .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.DEFAULT)); + .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.TWENTIES_PER_SECOND)); private ClientProvider clientProvider; private ESMetricReporter esMetricReporter; http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/LdapGenericContainer.java ---------------------------------------------------------------------- diff --git a/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/LdapGenericContainer.java b/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/LdapGenericContainer.java index 6f53a13..40ee62d 100644 --- a/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/LdapGenericContainer.java +++ b/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/LdapGenericContainer.java @@ -69,7 +69,7 @@ public class LdapGenericContainer extends ExternalResource { .withEnv("SLAPD_PASSWORD", password) .withEnv("SLAPD_CONFIG_PASSWORD", password) .withExposedPorts(LdapGenericContainer.DEFAULT_LDAP_PORT) - .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.DEFAULT)); + .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.TWENTIES_PER_SECOND)); } } http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttachmentTest.java ---------------------------------------------------------------------- diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttachmentTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttachmentTest.java index d23d8c1..0b46621 100644 --- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttachmentTest.java +++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttachmentTest.java @@ -67,7 +67,7 @@ public class AmqpForwardAttachmentTest { public SwarmGenericContainer rabbitMqContainer = new SwarmGenericContainer(Images.RABBITMQ) .withAffinityToContainer() .waitingFor(new HostPortWaitStrategy() - .withRateLimiter(RateLimiters.DEFAULT)); + .withRateLimiter(RateLimiters.TWENTIES_PER_SECOND)); public TemporaryFolder temporaryFolder = new TemporaryFolder(); public AmqpRule amqpRule = new AmqpRule(rabbitMqContainer, EXCHANGE_NAME, ROUTING_KEY); http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java ---------------------------------------------------------------------- diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java index 1674987..e61cc96 100644 --- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java +++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java @@ -66,7 +66,7 @@ public class ContactExtractorTest { public static final String ROUTING_KEY = ""; public SwarmGenericContainer rabbit = new SwarmGenericContainer(Images.RABBITMQ) - .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.DEFAULT)); + .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.TWENTIES_PER_SECOND)); public AmqpRule amqpRule = new AmqpRule(rabbit, EXCHANGE, ROUTING_KEY); public TemporaryFolder folder = new TemporaryFolder(); http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ICSAttachmentWorkflowTest.java ---------------------------------------------------------------------- diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ICSAttachmentWorkflowTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ICSAttachmentWorkflowTest.java index 4337d06..b91f664 100644 --- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ICSAttachmentWorkflowTest.java +++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/ICSAttachmentWorkflowTest.java @@ -431,7 +431,7 @@ public class ICSAttachmentWorkflowTest { @ClassRule public static SwarmGenericContainer rabbitMqContainer = new SwarmGenericContainer(Images.RABBITMQ) .withAffinityToContainer() - .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.DEFAULT)); + .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.TWENTIES_PER_SECOND)); @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); @Rule http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/SpamAssassinTest.java ---------------------------------------------------------------------- diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/SpamAssassinTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/SpamAssassinTest.java index 94b6c7c..aa0cf64 100644 --- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/SpamAssassinTest.java +++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/SpamAssassinTest.java @@ -62,7 +62,7 @@ public class SpamAssassinTest { public static SwarmGenericContainer spamAssassinContainer = new SwarmGenericContainer(Images.SPAMASSASSIN) .withExposedPorts(783) .withAffinityToContainer() - .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.DEFAULT)); + .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.TWENTIES_PER_SECOND)); @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); @Rule http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/ContainerTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/ContainerTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/ContainerTest.java index bd7057a..d95a891 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/ContainerTest.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/ContainerTest.java @@ -41,7 +41,7 @@ public class ContainerTest { .withExposedPorts(80) .waitingFor(new HttpWaitStrategy() .forStatusCode(200) - .withRateLimiter(RateLimiters.DEFAULT)); + .withRateLimiter(RateLimiters.TWENTIES_PER_SECOND)); @Test public void containerShouldBeReachableOnExposedPort() throws IOException, URISyntaxException { http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/server/testing/src/main/java/org/apache/james/util/docker/RateLimiters.java ---------------------------------------------------------------------- diff --git a/server/testing/src/main/java/org/apache/james/util/docker/RateLimiters.java b/server/testing/src/main/java/org/apache/james/util/docker/RateLimiters.java index d75730e..2c1e387 100644 --- a/server/testing/src/main/java/org/apache/james/util/docker/RateLimiters.java +++ b/server/testing/src/main/java/org/apache/james/util/docker/RateLimiters.java @@ -25,7 +25,7 @@ import org.rnorth.ducttape.ratelimits.RateLimiter; import org.rnorth.ducttape.ratelimits.RateLimiterBuilder; public interface RateLimiters { - RateLimiter DEFAULT = RateLimiterBuilder.newBuilder() + RateLimiter TWENTIES_PER_SECOND = RateLimiterBuilder.newBuilder() .withRate(20, TimeUnit.SECONDS) .withConstantThroughput() .build(); http://git-wip-us.apache.org/repos/asf/james-project/blob/bc6eb256/server/testing/src/main/java/org/apache/james/utils/FakeSmtp.java ---------------------------------------------------------------------- diff --git a/server/testing/src/main/java/org/apache/james/utils/FakeSmtp.java b/server/testing/src/main/java/org/apache/james/utils/FakeSmtp.java index 0ae1ccc..8aa4571 100644 --- a/server/testing/src/main/java/org/apache/james/utils/FakeSmtp.java +++ b/server/testing/src/main/java/org/apache/james/utils/FakeSmtp.java @@ -55,7 +55,7 @@ public class FakeSmtp implements TestRule { return new SwarmGenericContainer(Images.FAKE_SMTP) .withAffinityToContainer() .waitingFor(new HostPortWaitStrategy() - .withRateLimiter(RateLimiters.DEFAULT)); + .withRateLimiter(RateLimiters.TWENTIES_PER_SECOND)); } private static final int SMTP_PORT = 25; --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org