You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2019/09/02 15:27:23 UTC

[camel] branch CAMEL-13826 updated (b5bb21d -> aca3a18)

This is an automated email from the ASF dual-hosted git repository.

aldettinger pushed a change to branch CAMEL-13826
in repository https://gitbox.apache.org/repos/asf/camel.git.


 discard b5bb21d  CAMEL-13826: Added a comment in the doc about the possibility to migrate per camel test
 discard 2e46ef0  CAMEL-13826: Migrated half of the camel-xstream tests to JUnit 5 (testing coexistence of JUnit 4 and JUnit 5)
 discard a8abbf0  CAMEL-13826: Merged CamelTestSupport.isCreateCamelContextPerClass() into JUnit 5 Lifecycle.PER_CLASS
     add 0a79ae3  CAMEL-13917: Configuring endpoints with consumer. prefix for consumer options is no longer supported as they should be regular options instead. This also avoid reflection setting properties.
     add eee4e0e  CAMEL-13925: camel-seda - SedaConsumer should extend DefaultConsumer
     add 0315fba  CAMEL-13917: Configuring endpoints with consumer. prefix for consumer options is no longer supported as they should be regular options instead. This also avoid reflection setting properties.
     add aa19fb2  CAMEL-13917: Configuring endpoints with consumer. prefix for consumer options is no longer supported as they should be regular options instead. This also avoid reflection setting properties.
     add a3539d9  CAMEL-13917: Configuring endpoints with consumer. prefix for consumer options is no longer supported as they should be regular options instead. This also avoid reflection setting properties.
     add 7900b29  CAMEL-13917: Configuring endpoints with consumer. prefix for consumer options is no longer supported as they should be regular options instead. This also avoid reflection setting properties.
     add fdaa12d  CAMEL-13917: Configuring endpoints with consumer. prefix for consumer options is no longer supported as they should be regular options instead. This also avoid reflection setting properties.
     add 944f7db  CAMEL-13917: Configuring endpoints with consumer. prefix for consumer options is no longer supported as they should be regular options instead. This also avoid reflection setting properties.
     add 8fb880d  CAMEL-13929: camel3 - ApiEndpoint should extend ScheduledPollEndpoint
     add efca3b1  CAMEL-13917: Configuring endpoints with consumer. prefix for consumer options is no longer supported as they should be regular options instead. This also avoid reflection setting properties.
     add 4c5fcc0  Regen
     add 7afcd5d  CAMEL-13475: camel-olingo4 - Should close http client when shutting down. Thanks to Remco Schoen for reporting.
     new d494ad1  CAMEL-13826: Merged CamelTestSupport.isCreateCamelContextPerClass() into JUnit 5 Lifecycle.PER_CLASS
     new 336efdf  CAMEL-13826: Migrated half of the camel-xstream tests to JUnit 5 (testing coexistence of JUnit 4 and JUnit 5)
     new aca3a18  CAMEL-13826: Added a comment in the doc about the possibility to migrate per camel test

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (b5bb21d)
            \
             N -- N -- N   refs/heads/CAMEL-13826 (aca3a18)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 MIGRATION.md                                       |   4 +
 .../atom/AtomEntryPollingConsumerTest.java         |   6 +-
 .../AtomEntryPollingConsumerWithBasicAuthTest.java |   6 +-
 .../camel/component/atom/AtomEntrySortTest.java    |   4 +-
 .../camel/component/atom/AtomGoodBlogsTest.java    |   2 +-
 .../atom/AtomPollingConsumerIdleMessageTest.java   |   2 +-
 .../component/atom/AtomPollingLowDelayTest.java    |   2 +-
 .../component/atom/AtomPollingUnthrottledTest.java |   2 +-
 .../apache/camel/component/atom/AtomRouteTest.java |   2 +-
 .../camel/component/aws/sqs/SqsComponent.java      |   2 +-
 .../beanstalk/ConsumerCompletionTest.java          |   2 +-
 .../component/beanstalk/ImmediateConsumerTest.java |   2 +-
 .../bindy/csv/BindyCsvUnmarshallTest-context.xml   |   4 +-
 .../blueprint/handler/CamelNamespaceHandler.java   |   3 -
 .../camel-csv/src/main/docs/csv-dataformat.adoc    |   2 +-
 .../elsql/ElSqlConsumerDynamicParameterTest.java   |   2 +-
 .../src/main/docs/facebook-component.adoc          |   2 +-
 .../facebook/FacebookComponentConsumerTest.java    |   6 +-
 .../camel-file/src/main/docs/file-component.adoc   |  12 +-
 ...LWithClientAuthAndSSLContextParametersTest.java |   2 +-
 .../FileToFtpsExplicitSSLWithClientAuthTest.java   |   2 +-
 ...lientAuthAndGlobalSSLContextParametersTest.java |   2 +-
 ...thoutClientAuthAndSSLContextParametersTest.java |   2 +-
 ...FileToFtpsExplicitSSLWithoutClientAuthTest.java |   2 +-
 ...SWithClientAuthAndSSLContextParametersTest.java |   2 +-
 .../FileToFtpsExplicitTLSWithClientAuthTest.java   |   2 +-
 ...thoutClientAuthAndSSLContextParametersTest.java |   2 +-
 ...FileToFtpsExplicitTLSWithoutClientAuthTest.java |   2 +-
 ...LWithClientAuthAndSSLContextParametersTest.java |   2 +-
 .../FileToFtpsImplicitSSLWithClientAuthTest.java   |   2 +-
 ...thoutClientAuthAndSSLContextParametersTest.java |   2 +-
 ...FileToFtpsImplicitSSLWithoutClientAuthTest.java |   2 +-
 ...SWithClientAuthAndSSLContextParametersTest.java |   2 +-
 .../FileToFtpsImplicitTLSWithClientAuthTest.java   |   2 +-
 ...thoutClientAuthAndSSLContextParametersTest.java |   2 +-
 ...FileToFtpsImplicitTLSWithoutClientAuthTest.java |   2 +-
 ...psWithCustomKeyAndTrustStorePropertiesTest.java |   2 +-
 ...leToFtpsWithCustomTrustStorePropertiesTest.java |   2 +-
 .../FileToFtpsWithDefaultSettingsIPV6Test.java     |   2 +-
 .../remote/FileToFtpsWithDefaultSettingsTest.java  |   2 +-
 .../FileToFtpsWithFtpClientConfigRefTest.java      |   2 +-
 .../remote/FromFilePercentSignInPasswordTest.java  |   4 +-
 ...lePercentSignInPasswordUserInfoEncodedTest.java |   2 +-
 .../FromFilePercentSignInPasswordUserInfoTest.java |   2 +-
 .../file/remote/FromFileToFtpNotStepwiseTest.java  |   2 +-
 .../component/file/remote/FromFileToFtpTest.java   |   4 +-
 .../file/remote/FromFileToFtpWithChmodTest.java    |   4 +-
 .../FromFtpExclusiveReadNoneStrategyTest.java      |   2 +-
 .../remote/FromFtpMoveFileNotStepwiseTest.java     |   2 +-
 .../FromFtpMoveFilePostfixNotStepwiseTest.java     |   2 +-
 .../file/remote/FromFtpMoveFilePostfixTest.java    |   2 +-
 .../FromFtpMoveFilePrefixNotStepwiseTest.java      |   2 +-
 .../file/remote/FromFtpMoveFilePrefixTest.java     |   2 +-
 .../component/file/remote/FromFtpMoveFileTest.java |   2 +-
 .../component/file/remote/FromFtpNoFilesTest.java  |   2 +-
 .../remote/FromFtpPreMoveFileExpressionTest.java   |   2 +-
 .../FromFtpPreMoveFilePrefixNotStepwiseTest.java   |   2 +-
 .../file/remote/FromFtpPreMoveFilePrefixTest.java  |   2 +-
 .../FromFtpRemoteFileSortByExpressionTest.java     |   2 +-
 ...tpRemoteFileSortByIgnoreCaseExpressionTest.java |   2 +-
 ...romFtpRemoteFileSortByNestedExpressionTest.java |   2 +-
 .../file/remote/FromFtpToBinaryFileTest.java       |   2 +-
 .../file/remote/FromFtpToBinaryFilesTest.java      |   6 +-
 .../file/remote/FromFtpToBinarySampleTest.java     |   2 +-
 .../file/remote/FtpConsumerBodyAsStringTest.java   |   2 +-
 .../FtpConsumerDeleteNoWritePermissionTest.java    |   2 +-
 .../remote/FtpConsumerIPV6BodyAsStringTest.java    |   2 +-
 .../file/remote/FtpConsumerMoveExpressionTest.java |   2 +-
 .../remote/FtpConsumerMultipleDirectoriesTest.java |   2 +-
 .../remote/FtpConsumerWithNoFileOptionTest.java    |   2 +-
 .../FtpPollEnrichBridgeErrorHandlerTest.java       |   2 +-
 .../remote/FtpProducerConnectErrorsHeaderTest.java |   2 +-
 .../src/main/docs/hipchat-component.adoc           |   2 +-
 .../camel/component/hipchat/HipchatEndpoint.java   |  22 +-
 .../camel-http/src/main/docs/http-component.adoc   |   2 +-
 .../camel/component/ironmq/IronMQComponent.java    |   4 +-
 .../camel-jetty/src/main/docs/jetty-component.adoc |  44 +--
 .../apache/camel/component/jpa/JpaComponent.java   |   1 +
 .../apache/camel/component/jpa/JpaEndpoint.java    |  20 +-
 .../camel/component/jpa/JpaComponentTest.java      |   2 +-
 .../jpa/JpaWithNamedQueryAndParametersTest.java    |   5 +-
 .../camel/component/jpa/JpaWithNamedQueryTest.java |   4 +-
 .../component/jpa/JpaWithNativeQueryTest.java      |   2 +-
 .../jpa/JpaWithNativeQueryWithResultClassTest.java |   2 +-
 .../camel/component/jpa/JpaWithQueryTest.java      |   2 +-
 .../camel/processor/jpa/JpaNonTXRollbackTest.java  |   2 +-
 .../jpa/JpaRouteSkipLockedEntityTest.java          |   4 +-
 .../camel/processor/jpa/JpaTXRollbackTest.java     |   2 +-
 .../src/main/docs/linkedin-component.adoc          |   2 +-
 .../camel-mail/src/main/docs/mail-component.adoc   |   6 +-
 .../apache/camel/component/mail/MailEndpoint.java  |   4 +-
 .../mail/AdditionalMailPropertiesTest.java         |   4 +-
 .../camel/component/mail/FromFileSendMailTest.java |   4 +-
 .../mail/MailAttachmentDuplicateNamesTest.java     |   2 +-
 .../mail/MailAttachmentRedeliveryTest.java         |   2 +-
 .../camel/component/mail/MailAttachmentTest.java   |   2 +-
 .../mail/MailAttachmentsUmlautIssueTest.java       |   2 +-
 .../component/mail/MailBatchConsumerTest.java      |   2 +-
 .../component/mail/MailCollectionHeaderTest.java   |   2 +-
 .../component/mail/MailCommitOnCompletionTest.java |   2 +-
 .../mail/MailConsumerIdleMessageTest.java          |   2 +-
 .../mail/MailConsumerUnsupportedCharsetTest.java   |   2 +-
 .../mail/MailContentTypeResolverTest.java          |   2 +-
 .../camel/component/mail/MailConvertersTest.java   |   2 +-
 .../camel/component/mail/MailCopyToTest.java       |   2 +-
 .../camel/component/mail/MailDisconnectTest.java   |   2 +-
 .../mail/MailDoNotDeleteIfProcessFailsTest.java    |   2 +-
 .../camel/component/mail/MailFetchSizeTest.java    |   2 +-
 .../component/mail/MailFetchSizeZeroTest.java      |   2 +-
 ...aderOverrulePreConfigurationRecipientsTest.java |   2 +-
 .../component/mail/MailHtmlAttachmentTest.java     |   2 +-
 ...IdempotentRepositoryDuplicateNotRemoveTest.java |   2 +-
 .../MailIdempotentRepositoryDuplicateTest.java     |   2 +-
 .../mail/MailIdempotentRepositoryTest.java         |   2 +-
 .../component/mail/MailMaxMessagesPerPollTest.java |   2 +-
 .../component/mail/MailMimeDecodeHeadersTest.java  |   4 +-
 .../component/mail/MailMultipleRecipientsTest.java |   8 +-
 .../mail/MailNameAndEmailInRecipientTest.java      |   4 +-
 .../component/mail/MailPollEnrichNoMailTest.java   |   2 +-
 .../camel/component/mail/MailPollEnrichTest.java   |   2 +-
 .../component/mail/MailPostProcessActionTest.java  |   2 +-
 .../mail/MailProcessOnlyUnseenMessagesTest.java    |   2 +-
 .../mail/MailProducerUnsupportedCharsetTest.java   |   4 +-
 .../camel/component/mail/MailReplyToTest.java      |   2 +-
 .../apache/camel/component/mail/MailRouteTest.java |   4 +-
 .../camel/component/mail/MailSearchTermTest.java   |   2 +-
 .../MailSearchTermUriConfigLast24HoursTest.java    |   2 +-
 .../mail/MailSearchTermUriConfigTest.java          |   2 +-
 .../mail/MailShutdownCompleteAllTasksTest.java     |   2 +-
 .../MailShutdownCompleteCurrentTaskOnlyTest.java   |   2 +-
 .../camel/component/mail/MailSortTermTest.java     |   2 +-
 .../component/mail/MailSortTermThreeTest.java      |   2 +-
 .../camel/component/mail/MailSortTermTwoTest.java  |   2 +-
 .../component/mail/MailSplitAttachmentsTest.java   |   2 +-
 .../camel/component/mail/MailSubjectTest.java      |   2 +-
 .../component/mail/MailUsernameWithAtSignTest.java |   2 +-
 .../component/mail/MailUsingCustomSessionTest.java |   2 +-
 .../component/mail/MimeMessageConsumeTest.java     |   4 +-
 .../mail/MimeMultipartAlternativeTest.java         |   2 +-
 ...imeMultipartAlternativeWithContentTypeTest.java |   2 +-
 ...MultipartAlternativeWithLongerFilenameTest.java |   2 +-
 .../mail/MultipleDestinationConsumeTest.java       |   2 +-
 .../mail/NestedMimeMessageConsumeTest.java         |   4 +-
 .../camel/component/mail/RawMailMessageTest.java   |   8 +-
 .../SslContextParametersMailRouteTest.java         |   2 +-
 .../mail/SpringMailSplitAttachmentsTest.xml        |   2 +-
 .../camel/component/mybatis/MyBatisEndpoint.java   |   6 +-
 .../camel/component/mybatis/MyBatisQueueTest.java  |   2 +-
 .../mybatis/MyBatisRouteEmptyResultSetTest.java    |   2 +-
 .../src/main/docs/olingo2-component.adoc           |  29 +-
 .../camel/component/olingo2/Olingo2Component.java  |   6 -
 .../component/olingo2/Olingo2Configuration.java    |  14 +
 .../camel/component/olingo2/Olingo2Endpoint.java   |   7 +-
 .../olingo2/Olingo2ComponentConsumerTest.java      |  22 +-
 .../component/olingo2/Olingo2SampleServer.java     |   2 +-
 .../component/olingo4/api/impl/Olingo4AppImpl.java |   4 +-
 .../src/main/docs/olingo4-component.adoc           |  27 +-
 .../component/olingo4/Olingo4Configuration.java    |  14 +
 .../camel/component/olingo4/Olingo4Endpoint.java   |   7 +-
 .../olingo4/Olingo4ComponentConsumerTest.java      |  30 +-
 .../camel-rss/src/main/docs/rss-component.adoc     |   8 +-
 .../camel-rss/src/main/docs/rss-dataformat.adoc    |   2 +-
 .../camel/component/rss/RssEndpointTest.java       |   8 +-
 .../component/rss/RssEntryPollingConsumerTest.java |   2 +-
 .../RssEntryPollingConsumerWithBasicAuthTest.java  |   2 +-
 .../rss/RssEntryPollingConsumerWithFilterTest.java |   2 +-
 .../component/rss/RssEntrySortDefaultsTest.java    |   4 +-
 .../camel/component/rss/RssEntrySortTest.java      |   4 +-
 .../apache/camel/component/rss/RssFilterTest.java  |   2 +-
 .../rss/RssMultipleEndpointsIssueTest.java         |   4 +-
 ...sPollingConsumerWithFeedHeaderDisabledTest.java |   2 +-
 .../camel/dataformat/rss/RssConverterTest.java     |   4 +-
 .../camel/dataformat/rss/RssDataFormatTest.java    |   4 +-
 .../dataformat/rss/RssFilterWithXPathTest.java     |   2 +-
 .../apache/camel/component/seda/SedaConsumer.java  |  85 ++---
 .../sql/SqlConsumerDeleteBatchCompleteTest.java    |   2 +-
 .../component/sql/SqlConsumerDeleteFailedTest.java |   2 +-
 .../camel/component/sql/SqlConsumerDeleteTest.java |   2 +-
 .../sql/SqlConsumerDeleteTransformTest.java        |   2 +-
 .../sql/SqlConsumerDynamicParameterTest.java       |   2 +-
 .../sql/SqlConsumerMaxMessagesPerPollTest.java     |   2 +-
 .../sql/SqlConsumerOutputTypeSelectListTest.java   |   2 +-
 ...lConsumerOutputTypeSelectListWithClassTest.java |   2 +-
 .../sql/SqlConsumerOutputTypeSelectOneTest.java    |   8 +-
 .../sql/SqlConsumerOutputTypeStreamListTest.java   |   6 +-
 .../camel/component/sql/SqlConsumerTest.java       |   2 +-
 ...qlProducerAlwaysPopulateStatementFalseTest.java |   2 +-
 .../SqlProducerAlwaysPopulateStatementTest.java    |   2 +-
 .../src/main/docs/tarfile-dataformat.adoc          |   4 +-
 .../tarfile/TarFileMultipleFilesSplitterTest.java  |   2 +-
 .../dataformat/tarfile/TarSplitterRouteTest.java   |   2 +-
 .../AggregationStrategyWithPreservationTest.java   |   2 +-
 .../tarfile/TarAggregationStrategyTest.java        |   2 +-
 .../tarfile/SpringTarSplitterRouteTest.xml         |   2 +-
 .../src/main/docs/twilio-component.adoc            |  17 +-
 .../component/twitter/AbstractTwitterEndpoint.java |   2 +-
 .../src/main/docs/zendesk-component.adoc           |  17 +-
 .../src/main/docs/zipfile-dataformat.adoc          |   4 +-
 .../zipfile/ZipFileMultipleFilesSplitterTest.java  |   2 +-
 .../dataformat/zipfile/ZipSplitterRouteTest.java   |   2 +-
 .../AggregationStrategyWithPreservationTest.java   |   2 +-
 .../zipfile/ZipAggregationStrategyTest.java        |   2 +-
 .../zipfile/SpringZipSplitterRouteTest.xml         |   2 +-
 components/readme.adoc                             |   4 +-
 .../camel/component/file/FileConfigureTest.java    |   6 +-
 ...ileConsumerBridgeRouteExceptionHandlerTest.java |   2 +-
 .../FileConsumerCustomExceptionHandlerTest.java    |   2 +-
 .../file/FileConsumerPollStrategyNotBeginTest.java |   2 +-
 ...FileConsumerPollStrategyPolledMessagesTest.java |   2 +-
 .../file/FileConsumerPollStrategyTest.java         |   2 +-
 .../scheduler/SchedulerNoPolledMessagesTest.java   |   2 +-
 .../impl/DefaultComponentValidateURITest.java      |  20 +-
 ...edPollEndpointConfigureConsumerRestartTest.java | 146 -------
 .../CustomConsumerExceptionHandlerTest.java        |   2 +-
 .../DeadLetterChannelAlwaysHandledTest.java        |   2 +-
 ...tConsumerBridgeErrorHandlerOnExceptionTest.java |   2 +-
 ...ltConsumerBridgeErrorHandlerRedeliveryTest.java |   2 +-
 .../DefaultConsumerBridgeErrorHandlerTest.java     |   2 +-
 ...cheduledPollConsumerBridgeErrorHandlerTest.java |   2 +-
 .../enricher/PollEnrichBridgeErrorHandlerTest.java |   2 +-
 .../impl/RuntimeCamelCatalogTest.java              |   8 -
 .../dsl/HipchatEndpointBuilderFactory.java         |   8 +-
 .../dsl/Olingo2EndpointBuilderFactory.java         | 421 +++++++++++++++++++++
 .../dsl/Olingo4EndpointBuilderFactory.java         | 421 +++++++++++++++++++++
 .../endpoint/dsl/TwilioEndpointBuilderFactory.java | 395 +++++++++++++++++++
 .../dsl/ZendeskEndpointBuilderFactory.java         | 396 +++++++++++++++++++
 .../BridgeExceptionHandlerToErrorHandler.java      |   2 +-
 .../org/apache/camel/support/DefaultEndpoint.java  |  75 +---
 .../camel/support/ScheduledPollConsumer.java       |  10 +-
 .../camel/support/ScheduledPollEndpoint.java       | 133 +++----
 .../support/component/AbstractApiEndpoint.java     |   4 +-
 .../modules/ROOT/pages/csv-dataformat.adoc         |   2 +-
 .../modules/ROOT/pages/facebook-component.adoc     |   2 +-
 .../modules/ROOT/pages/file-component.adoc         |  12 +-
 .../modules/ROOT/pages/hipchat-component.adoc      |   2 +-
 .../modules/ROOT/pages/http-component.adoc         |   2 +-
 .../modules/ROOT/pages/jetty-component.adoc        |  44 +--
 .../modules/ROOT/pages/linkedin-component.adoc     |   2 +-
 .../modules/ROOT/pages/mail-component.adoc         |   6 +-
 .../modules/ROOT/pages/olingo2-component.adoc      |  29 +-
 .../modules/ROOT/pages/olingo4-component.adoc      |  27 +-
 .../modules/ROOT/pages/rss-component.adoc          |   8 +-
 .../modules/ROOT/pages/rss-dataformat.adoc         |   2 +-
 .../modules/ROOT/pages/tarfile-dataformat.adoc     |   4 +-
 .../modules/ROOT/pages/twilio-component.adoc       |  17 +-
 .../modules/ROOT/pages/zendesk-component.adoc      |  17 +-
 .../modules/ROOT/pages/zipfile-dataformat.adoc     |   4 +-
 examples/camel-example-jooq/README.adoc            |   2 +-
 .../resources/META-INF/spring/camel-context.xml    |   2 +-
 .../example/spring/boot/rest/jpa/Application.java  |   4 +-
 .../springboot/HttpComponentConfiguration.java     |  32 +-
 .../JettyHttpComponentConfiguration9.java          | 386 +++++++++----------
 .../springboot/Olingo2ComponentConfiguration.java  |  14 +
 .../springboot/Olingo4ComponentConfiguration.java  |  14 +
 254 files changed, 2546 insertions(+), 1023 deletions(-)
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/impl/ScheduledPollEndpointConfigureConsumerRestartTest.java


[camel] 03/03: CAMEL-13826: Added a comment in the doc about the possibility to migrate per camel test

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aldettinger pushed a commit to branch CAMEL-13826
in repository https://gitbox.apache.org/repos/asf/camel.git

commit aca3a1852af0c0bd4da3416a05fd534a34c8160e
Author: aldettinger <al...@gmail.com>
AuthorDate: Thu Aug 22 17:39:28 2019 +0200

    CAMEL-13826: Added a comment in the doc about the possibility to migrate per camel test
---
 components/camel-test-junit5/src/main/docs/test-junit5.adoc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/components/camel-test-junit5/src/main/docs/test-junit5.adoc b/components/camel-test-junit5/src/main/docs/test-junit5.adoc
index f31ff75..858e3b7 100644
--- a/components/camel-test-junit5/src/main/docs/test-junit5.adoc
+++ b/components/camel-test-junit5/src/main/docs/test-junit5.adoc
@@ -57,6 +57,8 @@ Projects using `camel-test` would need to use `camel-test-junit5`. For instance,
 </dependency>
 ----
 
+Tips: Note that it's possible to reference both `camel-test` and `camel-test-junit5` thus allowing to migrate camel tests once at a time.
+
 === Typical migration steps linked to JUnit 5 support in Camel Test
 * Imports of `org.apache.camel.test.junit4.\*` should be replaced with `org.apache.camel.test.junit5.*`
 * `TestSupport` static methods should be imported where needed, for instance `import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf`


[camel] 02/03: CAMEL-13826: Migrated half of the camel-xstream tests to JUnit 5 (testing coexistence of JUnit 4 and JUnit 5)

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aldettinger pushed a commit to branch CAMEL-13826
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 336efdf326ab5f2119eae2ac31520a8399c33684
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Aug 21 17:31:13 2019 +0200

    CAMEL-13826: Migrated half of the camel-xstream tests to JUnit 5 (testing coexistence of JUnit 4 and JUnit 5)
---
 components/camel-test/pom.xml                             |  4 ++++
 components/camel-xstream/pom.xml                          |  5 +++++
 .../dataformat/xstream/MarshalDomainObjectJSONTest.java   |  4 +++-
 .../camel/dataformat/xstream/MarshalDomainObjectTest.java |  8 +++++---
 .../xstream/XStreamDataFormatOmitFieldsTest.java          | 15 +++++++++------
 .../XStreamDataFormatPermissionsSystemPropertyTest.java   | 13 ++++++++-----
 .../xstream/XStreamDataFormatPermissionsTest.java         |  7 +++++--
 parent/pom.xml                                            |  4 ++--
 .../camel-spring-boot-dependencies-generator/pom.xml      |  1 +
 9 files changed, 42 insertions(+), 19 deletions(-)

diff --git a/components/camel-test/pom.xml b/components/camel-test/pom.xml
index 2e70437..aa6acfa 100644
--- a/components/camel-test/pom.xml
+++ b/components/camel-test/pom.xml
@@ -54,6 +54,10 @@
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.junit.vintage</groupId>
+            <artifactId>junit-vintage-engine</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
diff --git a/components/camel-xstream/pom.xml b/components/camel-xstream/pom.xml
index d3fa5d7..99dad32 100644
--- a/components/camel-xstream/pom.xml
+++ b/components/camel-xstream/pom.xml
@@ -77,6 +77,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-junit5</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
             <artifactId>camel-spring</artifactId>
             <scope>test</scope>
         </dependency>
diff --git a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalDomainObjectJSONTest.java b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalDomainObjectJSONTest.java
index 6f6ad86..2e6fe37 100644
--- a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalDomainObjectJSONTest.java
+++ b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalDomainObjectJSONTest.java
@@ -19,7 +19,9 @@ package org.apache.camel.dataformat.xstream;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.model.dataformat.JsonLibrary;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class MarshalDomainObjectJSONTest extends MarshalDomainObjectTest {
     
diff --git a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalDomainObjectTest.java b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalDomainObjectTest.java
index 8e429d5..2096c85 100644
--- a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalDomainObjectTest.java
+++ b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalDomainObjectTest.java
@@ -18,8 +18,10 @@ package org.apache.camel.dataformat.xstream;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * Marshal tests with domain objects.
@@ -58,7 +60,7 @@ public class MarshalDomainObjectTest extends CamelTestSupport {
 
         String body1 = mock.getExchanges().get(0).getIn().getBody(String.class);
         String body2 = mock.getExchanges().get(1).getIn().getBody(String.class);
-        assertEquals("The body should marshalled to the same", body1, body2);
+        assertEquals(body1, body2, "The body should marshalled to the same");
     }
 
     @Test
diff --git a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatOmitFieldsTest.java b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatOmitFieldsTest.java
index b6d34e2..b9df598 100644
--- a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatOmitFieldsTest.java
+++ b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatOmitFieldsTest.java
@@ -21,8 +21,11 @@ import java.util.Map;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class XStreamDataFormatOmitFieldsTest extends CamelTestSupport {
 
@@ -40,10 +43,10 @@ public class XStreamDataFormatOmitFieldsTest extends CamelTestSupport {
 
         assertMockEndpointsSatisfied();
 
-        String body = mock.getReceivedExchanges().get(0).getIn().getBody(String.class);        
-        assertTrue("Should contain name field", body.contains("<name>"));
-        assertFalse("Should not contain price field", body.contains("price"));
-        assertTrue("Should contain amount field", body.contains("<amount>"));
+        String body = mock.getReceivedExchanges().get(0).getIn().getBody(String.class);
+        assertTrue(body.contains("<name>"), "Should contain name field");
+        assertFalse(body.contains("price"), "Should not contain price field");
+        assertTrue(body.contains("<amount>"), "Should contain amount field");
     }
     
 
diff --git a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatPermissionsSystemPropertyTest.java b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatPermissionsSystemPropertyTest.java
index 99f83d6..acf39a4 100644
--- a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatPermissionsSystemPropertyTest.java
+++ b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatPermissionsSystemPropertyTest.java
@@ -16,20 +16,23 @@
  */
 package org.apache.camel.dataformat.xstream;
 import com.thoughtworks.xstream.XStream;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 public class XStreamDataFormatPermissionsSystemPropertyTest extends XStreamDataFormatPermissionsTest {
 
-    @BeforeClass
+    @BeforeAll
     public static void setup() {
         // clear the default permissions system property
         // see AbstractXStreamWrapper.PERMISSIONS_PROPERTY_DEFAULT
         XStreamTestUtils.setPermissionSystemProperty("*");
     }
 
-    @AfterClass
+    @AfterAll
     public static void cleanup() {
         XStreamTestUtils.revertPermissionSystemProperty();
     }
diff --git a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatPermissionsTest.java b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatPermissionsTest.java
index 425be60..ee8a274 100644
--- a/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatPermissionsTest.java
+++ b/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamDataFormatPermissionsTest.java
@@ -18,8 +18,11 @@ package org.apache.camel.dataformat.xstream;
 
 import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.security.ForbiddenClassException;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
 
 public class XStreamDataFormatPermissionsTest extends CamelTestSupport {
     protected static final String XML_PURCHASE_ORDER = 
diff --git a/parent/pom.xml b/parent/pom.xml
index 9f08c37..771d979 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -4793,8 +4793,8 @@
                 <version>${junit-jupiter-version}</version>
             </dependency>
             <dependency>
-                <groupId>org.junit.jupiter</groupId>
-                <artifactId>junit-jupiter-vintage</artifactId>
+                <groupId>org.junit.vintage</groupId>
+                <artifactId>junit-vintage-engine</artifactId>
                 <version>${junit-jupiter-version}</version>
             </dependency>
             <dependency>
diff --git a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies-generator/pom.xml b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies-generator/pom.xml
index 38b5af6..9e5cc33 100644
--- a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies-generator/pom.xml
+++ b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies-generator/pom.xml
@@ -160,6 +160,7 @@
                             <exclude>javax.servlet:javax.servlet-api</exclude>
                             <exclude>junit:*</exclude>
                             <exclude>org.junit.jupiter:*</exclude>
+                            <exclude>org.junit.vintage:*</exclude>
                             <exclude>net.sf.ehcache:ehcache</exclude>
 
                             <exclude>xml-apis:*</exclude>


[camel] 01/03: CAMEL-13826: Merged CamelTestSupport.isCreateCamelContextPerClass() into JUnit 5 Lifecycle.PER_CLASS

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aldettinger pushed a commit to branch CAMEL-13826
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d494ad1ac77af8e6bc5aa4d57cab1f7fb00e7c85
Author: aldettinger <al...@gmail.com>
AuthorDate: Tue Aug 20 17:33:30 2019 +0200

    CAMEL-13826: Merged CamelTestSupport.isCreateCamelContextPerClass() into JUnit 5 Lifecycle.PER_CLASS
---
 .../src/main/docs/test-junit5.adoc                 |  3 +++
 .../apache/camel/test/junit5/CamelTestSupport.java | 25 ++++++++++++++--------
 .../CreateCamelContextPerTestFalseTest.java        |  7 ++----
 .../CreateCamelContextPerTestTrueTest.java         |  5 -----
 .../FilterCreateCamelContextPerClassTest.java      | 10 ++-------
 5 files changed, 23 insertions(+), 27 deletions(-)

diff --git a/components/camel-test-junit5/src/main/docs/test-junit5.adoc b/components/camel-test-junit5/src/main/docs/test-junit5.adoc
index 0ae295f..f31ff75 100644
--- a/components/camel-test-junit5/src/main/docs/test-junit5.adoc
+++ b/components/camel-test-junit5/src/main/docs/test-junit5.adoc
@@ -62,6 +62,9 @@ Projects using `camel-test` would need to use `camel-test-junit5`. For instance,
 * `TestSupport` static methods should be imported where needed, for instance `import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf`
 * Usage of the field `CamelTestSupport.log` should be replaced by another logger, for instance `org.slf4j.LoggerFactory.getLogger(MyCamelTest.class);`
 * Usage of the method `CamelTestSupport.createRegistry` should be replaced by `CamelTestSupport.createCamelRegistry()`
+* Overrides of `isCreateCamelContextPerClass()` returning `false` should be removed
+* Overrides of `isCreateCamelContextPerClass()` returning `true` should be replaced by `@TestInstance(Lifecycle.PER_CLASS)`
+
 
 === Typical migration steps linked to JUnit 5 itself
 Once Camel related steps have been performed, there are still typical JUnit 5 migration steps to remember:
diff --git a/components/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java b/components/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
index 1818a98..083f3fc 100644
--- a/components/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
+++ b/components/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java
@@ -66,8 +66,10 @@ import org.apache.camel.util.TimeUtils;
 import org.apache.camel.util.URISupport;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.TestInstance.Lifecycle;
 import org.junit.jupiter.api.extension.AfterAllCallback;
 import org.junit.jupiter.api.extension.AfterTestExecutionCallback;
+import org.junit.jupiter.api.extension.BeforeAllCallback;
 import org.junit.jupiter.api.extension.BeforeEachCallback;
 import org.junit.jupiter.api.extension.BeforeTestExecutionCallback;
 import org.junit.jupiter.api.extension.ExtensionContext;
@@ -82,7 +84,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
  * with some routes along with a {@link org.apache.camel.ProducerTemplate} for
  * use in the test case Do <tt>not</tt> use this class for Spring Boot testing.
  */
-public abstract class CamelTestSupport implements BeforeEachCallback, AfterAllCallback, BeforeTestExecutionCallback, AfterTestExecutionCallback {
+public abstract class CamelTestSupport implements BeforeEachCallback, AfterAllCallback, BeforeAllCallback, BeforeTestExecutionCallback, AfterTestExecutionCallback {
 
     /**
      * JVM system property which can be set to true to turn on dumping route
@@ -112,6 +114,7 @@ public abstract class CamelTestSupport implements BeforeEachCallback, AfterAllCa
     private static final ThreadLocal<AtomicInteger> TESTS = new ThreadLocal<>();
     private static final ThreadLocal<CamelTestSupport> INSTANCE = new ThreadLocal<>();
     private String currentTestName;
+    private boolean isCreateCamelContextPerClass = false;
     private CamelRouteCoverageDumper routeCoverageDumper = new CamelRouteCoverageDumper();
     // CHECKSTYLE:ON
 
@@ -135,6 +138,11 @@ public abstract class CamelTestSupport implements BeforeEachCallback, AfterAllCa
     }
 
     @Override
+    public void beforeAll(ExtensionContext context) {
+        isCreateCamelContextPerClass = context.getTestInstanceLifecycle().filter(lc -> lc.equals(Lifecycle.PER_CLASS)).isPresent();
+    }
+
+    @Override
     public void afterAll(ExtensionContext context) {
         CamelTestSupport support = INSTANCE.get();
         if (support != null && support.isCreateCamelContextPerClass()) {
@@ -197,12 +205,11 @@ public abstract class CamelTestSupport implements BeforeEachCallback, AfterAllCa
     }
 
     /**
-     * Override to control whether {@link CamelContext} should be setup per test
-     * or per class.
+     * Tells whether {@link CamelContext} should be setup per test or per class.
      * <p/>
-     * By default it will be setup/teardown per test (per test method). If you
-     * want to re-use {@link CamelContext} between test methods you can override
-     * this method and return <tt>true</tt>
+     * By default it will be setup/teardown per test method. This method returns
+     * <code>true</code> when the camel test class is annotated
+     * with @TestInstance(TestInstance.Lifecycle.PER_CLASS).
      * <p/>
      * <b>Important:</b> Use this with care as the {@link CamelContext} will
      * carry over state from previous tests, such as endpoints, components etc.
@@ -214,8 +221,8 @@ public abstract class CamelTestSupport implements BeforeEachCallback, AfterAllCa
      *
      * @return <tt>true</tt> per class, <tt>false</tt> per test.
      */
-    public boolean isCreateCamelContextPerClass() {
-        return false;
+    public final boolean isCreateCamelContextPerClass() {
+        return isCreateCamelContextPerClass;
     }
 
     /**
@@ -539,7 +546,7 @@ public abstract class CamelTestSupport implements BeforeEachCallback, AfterAllCa
         LOG.info("********************************************************************************");
 
         if (isCreateCamelContextPerClass()) {
-            // will tear down test specially in CamelTearDownRule
+            // will tear down test specially in afterAll callback
         } else {
             LOG.debug("tearDown()");
             doStopTemplates(consumer, template, fluentTemplate);
diff --git a/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/CreateCamelContextPerTestFalseTest.java b/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/CreateCamelContextPerTestFalseTest.java
index 34c8591..149edb9 100644
--- a/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/CreateCamelContextPerTestFalseTest.java
+++ b/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/CreateCamelContextPerTestFalseTest.java
@@ -27,12 +27,14 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInstance;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
+@TestInstance(TestInstance.Lifecycle.PER_METHOD)
 public class CreateCamelContextPerTestFalseTest extends CamelTestSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(CreateCamelContextPerTestFalseTest.class);
@@ -47,11 +49,6 @@ public class CreateCamelContextPerTestFalseTest extends CamelTestSupport {
     protected ProducerTemplate template;
 
     @Override
-    public boolean isCreateCamelContextPerClass() {
-        return false;
-    }
-
-    @Override
     protected CamelContext createCamelContext() throws Exception {
         LOG.info("createCamelContext()");
         CREATED_CONTEXTS.incrementAndGet();
diff --git a/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/CreateCamelContextPerTestTrueTest.java b/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/CreateCamelContextPerTestTrueTest.java
index a234455..222fe62 100644
--- a/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/CreateCamelContextPerTestTrueTest.java
+++ b/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/CreateCamelContextPerTestTrueTest.java
@@ -52,11 +52,6 @@ public class CreateCamelContextPerTestTrueTest extends CamelTestSupport {
     protected ProducerTemplate template;
 
     @Override
-    public boolean isCreateCamelContextPerClass() {
-        return true;
-    }
-
-    @Override
     protected CamelContext createCamelContext() throws Exception {
         LOG.info("createCamelContext()");
         CREATED_CONTEXTS.incrementAndGet();
diff --git a/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/FilterCreateCamelContextPerClassTest.java b/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/FilterCreateCamelContextPerClassTest.java
index 0f5be29..be38b86 100644
--- a/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/FilterCreateCamelContextPerClassTest.java
+++ b/components/camel-test-junit5/src/test/java/org/apache/camel/test/junit5/patterns/FilterCreateCamelContextPerClassTest.java
@@ -19,21 +19,15 @@ package org.apache.camel.test.junit5.patterns;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInstance;
 
 /**
  * Tests filtering using Camel Test
  */
 // START SNIPPET: example
+@TestInstance(TestInstance.Lifecycle.PER_CLASS)
 public class FilterCreateCamelContextPerClassTest extends CamelTestSupport {
 
-    @Override
-    public boolean isCreateCamelContextPerClass() {
-        // we override this method and return true, to tell Camel test-kit that
-        // it should only create CamelContext once (per class), so we will
-        // re-use the CamelContext between each test method in this class
-        return true;
-    }
-
     @Test
     public void testSendMatchingMessage() throws Exception {
         String expectedBody = "<matched/>";