From 2bab2e6bd7275bf762f9deb2f06080a59f11a71f Mon Sep 17 00:00:00 2001 From: Guido Steinacker Date: Sat, 26 May 2018 12:08:40 +0200 Subject: [PATCH] Fixes a refactoring where 'empty' was accidentally renamed to 'unknown' in too many places. --- synapse-aws/settings.gradle | 17 ----------------- .../KinesisMessageLogReceiverEndpointTest.java | 2 +- .../aws/CompactionAcceptanceTest.java | 2 +- .../synapse/testsupport/TestStreamSource.java | 2 +- synapse-core/settings.gradle | 17 ----------------- .../MessageInterceptorRegistration.java | 8 ++++---- .../InMemoryRingBufferMessageStore.java | 2 +- synapse-edison/settings.gradle | 17 ----------------- .../example-consumer/settings.gradle | 17 ----------------- .../example-producer/settings.gradle | 17 ----------------- 10 files changed, 8 insertions(+), 93 deletions(-) diff --git a/synapse-aws/settings.gradle b/synapse-aws/settings.gradle index 20c475ef..d01f4676 100644 --- a/synapse-aws/settings.gradle +++ b/synapse-aws/settings.gradle @@ -1,18 +1 @@ -/* - * This settings file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * In a single project build this file can be unknown or even removed. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user guide at https://docs.gradle.org/4.0/userguide/multi_project_builds.html - */ - -/* -// To declare projects as part of a multi-project build use the 'include' method -include 'shared' -include 'api' -include 'services:webservice' -*/ - rootProject.name = 'synapse' diff --git a/synapse-aws/src/test/java/de/otto/synapse/channel/aws/KinesisMessageLogReceiverEndpointTest.java b/synapse-aws/src/test/java/de/otto/synapse/channel/aws/KinesisMessageLogReceiverEndpointTest.java index b20ce6af..ed85e7e3 100644 --- a/synapse-aws/src/test/java/de/otto/synapse/channel/aws/KinesisMessageLogReceiverEndpointTest.java +++ b/synapse-aws/src/test/java/de/otto/synapse/channel/aws/KinesisMessageLogReceiverEndpointTest.java @@ -421,7 +421,7 @@ private Record createEmptyRecord() { .partitionKey(String.valueOf(nextKey++)) .approximateArrivalTimestamp(clock.instant()) .data(ByteBuffer.allocateDirect(0)) - .sequenceNumber("sequence-" + "unknown") + .sequenceNumber("sequence-empty") .build(); } diff --git a/synapse-aws/src/test/java/de/otto/synapse/compaction/aws/CompactionAcceptanceTest.java b/synapse-aws/src/test/java/de/otto/synapse/compaction/aws/CompactionAcceptanceTest.java index 7531dd4b..6c9b3349 100644 --- a/synapse-aws/src/test/java/de/otto/synapse/compaction/aws/CompactionAcceptanceTest.java +++ b/synapse-aws/src/test/java/de/otto/synapse/compaction/aws/CompactionAcceptanceTest.java @@ -104,7 +104,7 @@ public void shouldCompactData() throws Exception { //when write additional data with partially existing ids writeToStream(INTEGRATION_TEST_STREAM, "integrationtest-stream.txt"); - //Write an unknown object for key 100000 - should be removed during compaction + //Write an empty object for key 100000 - should be removed during compaction kinesisClient.putRecord(PutRecordRequest.builder().streamName(INTEGRATION_TEST_STREAM).partitionKey("100000").data(EMPTY_BYTE_BUFFER).build()); diff --git a/synapse-aws/src/test/java/de/otto/synapse/testsupport/TestStreamSource.java b/synapse-aws/src/test/java/de/otto/synapse/testsupport/TestStreamSource.java index 61a8da0c..7dd4c8a1 100644 --- a/synapse-aws/src/test/java/de/otto/synapse/testsupport/TestStreamSource.java +++ b/synapse-aws/src/test/java/de/otto/synapse/testsupport/TestStreamSource.java @@ -135,7 +135,7 @@ private List createFakeRecords() { public void putRecords(String channelName, List records) { if (records.isEmpty()) { - throw new IllegalArgumentException("records must not be unknown"); + throw new IllegalArgumentException("records must not be empty"); } PutRecordsRequest putRecordsRequest = PutRecordsRequest.builder() diff --git a/synapse-core/settings.gradle b/synapse-core/settings.gradle index 20c475ef..d01f4676 100644 --- a/synapse-core/settings.gradle +++ b/synapse-core/settings.gradle @@ -1,18 +1 @@ -/* - * This settings file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * In a single project build this file can be unknown or even removed. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user guide at https://docs.gradle.org/4.0/userguide/multi_project_builds.html - */ - -/* -// To declare projects as part of a multi-project build use the 'include' method -include 'shared' -include 'api' -include 'services:webservice' -*/ - rootProject.name = 'synapse' diff --git a/synapse-core/src/main/java/de/otto/synapse/endpoint/MessageInterceptorRegistration.java b/synapse-core/src/main/java/de/otto/synapse/endpoint/MessageInterceptorRegistration.java index b8fb829f..bcd9699a 100644 --- a/synapse-core/src/main/java/de/otto/synapse/endpoint/MessageInterceptorRegistration.java +++ b/synapse-core/src/main/java/de/otto/synapse/endpoint/MessageInterceptorRegistration.java @@ -104,7 +104,7 @@ private MessageInterceptorRegistration(final Pattern channelNamePattern, this.interceptor = requireNonNull(interceptor); this.enabledEndpointTypes = requireNonNull(enabledEndpointTypes); if (enabledEndpointTypes.isEmpty()) { - throw new IllegalArgumentException("The set of enabled endpoint types must not be unknown"); + throw new IllegalArgumentException("The set of enabled endpoint types must not be empty"); } } @@ -121,13 +121,13 @@ public MessageInterceptor getInterceptor() { * Returns {@code true} if the registration is matching the given {@code channelName} and {@code EndpointType}, * false otherwise. * - * @param channelName the name of the channel + * @param channelNamePattern the regexp used to match channel names * @param endpointType the {@link EndpointType} of the channel * @return boolean */ - public boolean isEnabledFor(final String channelName, + public boolean isEnabledFor(final String channelNamePattern, final EndpointType endpointType) { - return enabledEndpointTypes.contains(endpointType) && channelNamePattern.matcher(channelName).matches(); + return enabledEndpointTypes.contains(endpointType) && this.channelNamePattern.matcher(channelNamePattern).matches(); } @Override diff --git a/synapse-core/src/main/java/de/otto/synapse/messagestore/InMemoryRingBufferMessageStore.java b/synapse-core/src/main/java/de/otto/synapse/messagestore/InMemoryRingBufferMessageStore.java index 8dfd36f2..2b411017 100644 --- a/synapse-core/src/main/java/de/otto/synapse/messagestore/InMemoryRingBufferMessageStore.java +++ b/synapse-core/src/main/java/de/otto/synapse/messagestore/InMemoryRingBufferMessageStore.java @@ -17,7 +17,7 @@ /** * Thread-safe in-memory implementation of a circular MessageStore that is storing all messages in insertion order - * with a configurable unknown capacity. + * with a configurable capacity. * *

Each time an element is added to a full message store, the message store automatically removes its head element. */ diff --git a/synapse-edison/settings.gradle b/synapse-edison/settings.gradle index 20c475ef..d01f4676 100644 --- a/synapse-edison/settings.gradle +++ b/synapse-edison/settings.gradle @@ -1,18 +1 @@ -/* - * This settings file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * In a single project build this file can be unknown or even removed. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user guide at https://docs.gradle.org/4.0/userguide/multi_project_builds.html - */ - -/* -// To declare projects as part of a multi-project build use the 'include' method -include 'shared' -include 'api' -include 'services:webservice' -*/ - rootProject.name = 'synapse' diff --git a/synapse-examples/example-consumer/settings.gradle b/synapse-examples/example-consumer/settings.gradle index 7c6f542f..a3c589fc 100644 --- a/synapse-examples/example-consumer/settings.gradle +++ b/synapse-examples/example-consumer/settings.gradle @@ -1,18 +1 @@ -/* - * This settings file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * In a single project build this file can be unknown or even removed. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user guide at https://docs.gradle.org/4.0/userguide/multi_project_builds.html - */ - -/* -// To declare projects as part of a multi-project build use the 'include' method -include 'shared' -include 'api' -include 'services:webservice' -*/ - rootProject.name = 'synapse-examples' diff --git a/synapse-examples/example-producer/settings.gradle b/synapse-examples/example-producer/settings.gradle index 7c6f542f..a3c589fc 100644 --- a/synapse-examples/example-producer/settings.gradle +++ b/synapse-examples/example-producer/settings.gradle @@ -1,18 +1 @@ -/* - * This settings file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * In a single project build this file can be unknown or even removed. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user guide at https://docs.gradle.org/4.0/userguide/multi_project_builds.html - */ - -/* -// To declare projects as part of a multi-project build use the 'include' method -include 'shared' -include 'api' -include 'services:webservice' -*/ - rootProject.name = 'synapse-examples'