Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: migrate to [email protected] #163

Closed
wants to merge 1 commit into from

Conversation

bbortt
Copy link
Collaborator

@bbortt bbortt commented May 14, 2023

upgrade citrus core from com.consol.citrus to org.citrusframework dependency. that includes some transitive dependency updates/migrations, also in order to support a jdk17 build minimum:

  • javax to jakarta
  • org.springframework
  • org.springframework.boot

BREAKING CHANGE: contains breaking dependency updates!

closes #162.

@bbortt bbortt added Type: Enhancement IN PROGRESS Prio: High dependencies Pull requests that update a dependency file java Pull requests that update Java code labels May 14, 2023
@bbortt bbortt self-assigned this May 14, 2023
@bbortt bbortt force-pushed the feature/#162-citrusframework-4-milestone-1 branch from 1ca2ea1 to 0c309d6 Compare May 14, 2023 15:17
pom.xml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@bbortt bbortt force-pushed the feature/#162-citrusframework-4-milestone-1 branch from 0c309d6 to ec1464d Compare July 29, 2023 15:45
@bbortt
Copy link
Collaborator Author

bbortt commented Jul 29, 2023

@christophd there seems to be an issue with the org.citrusframework.org:citrus-mail package.. see the build:

Error:  Tests run: 4, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 8.044 s <<< FAILURE! - in org.citrusframework.simulator.SimulatorMailIT
Error:  testDefaultRequest(org.citrusframework.simulator.SimulatorMailIT)  Time elapsed: 0.215 s  <<< FAILURE!
java.lang.NoClassDefFoundError: javax/activation/DataContentHandler
Caused by: java.lang.ClassNotFoundException: javax.activation.DataContentHandler

I am not exactly sure if this comes from the com.sun.mail:jakarta.mail package? that one hasn't been updated in a long time.

@bbortt
Copy link
Collaborator Author

bbortt commented Jul 30, 2023

Update: found the bug --> jakartaee/mail-api#665. will update citrusframework/citrus code of citrus-mail and then follow up in this PR.

bbortt added a commit to citrusframework/citrus that referenced this pull request Jul 30, 2023
The implemented workaround allows jakarta-mail to find the corresponding classes when opening a new session.
The reported without the workaround error is:

```shell
java.lang.IllegalStateException: Not provider of jakarta.mail.util.StreamProvider was found
    at org.citrusframework.mail.server.MailServerTest.testMultipartMessageSplitting(MailServerTest.java:378)
```

Report in PR: citrusframework/citrus-simulator#163 (comment).
@bbortt
Copy link
Collaborator Author

bbortt commented Aug 4, 2023

@christophd I tried implementing that mentioned fix in 7339378, but without success. now I am stuck. any ideas?

(btw sorry if I mentioned you too much. I thought I've already written this comment, but cannot find it now)

@boskoop
Copy link
Contributor

boskoop commented Aug 5, 2023

@bbortt I didn't look at it in detail, but maybe you need to add the Eclipse Angus reference implementation for Jakarta Mail to work: https://eclipse-ee4j.github.io/angus-mail/

@bbortt
Copy link
Collaborator Author

bbortt commented Aug 7, 2023

@bbortt I didn't look at it in detail, but maybe you need to add the Eclipse Angus reference implementation for Jakarta Mail to work: https://eclipse-ee4j.github.io/angus-mail/

I've tried that too, I think. but let me double check.

bbortt added a commit to citrusframework/citrus that referenced this pull request Aug 7, 2023
The implemented workaround allows jakarta-mail to find the corresponding classes when opening a new session.
The reported without the workaround error is:

```shell
java.lang.IllegalStateException: Not provider of jakarta.mail.util.StreamProvider was found
    at org.citrusframework.mail.server.MailServerTest.testMultipartMessageSplitting(MailServerTest.java:378)
```

Report in PR: citrusframework/citrus-simulator#163 (comment).
@bbortt
Copy link
Collaborator Author

bbortt commented Aug 7, 2023

@boskoop I've tried that too.. and pushed another commit (referenced above this comment) with my latest changes. ended up with the com.sun.* implementation again, in the end. no clue why its still looking for a javax.* class:

java.lang.NoClassDefFoundError: javax/activation/DataContentHandler

and even if this is present on the class path, some cast does then (obviously) not work:

java.lang.ClassCastException: class com.sun.mail.handlers.text_plain cannot be cast to class jakarta.activation.DataContentHandler (com.sun.mail.handlers.text_plain and jakarta.activation.DataContentHandler are in unnamed module of loader 'app')

edit: I will try and take a look at the maven dependency tree.. maybe I can find something. must come from somewhere, tho!

bbortt added a commit to citrusframework/citrus that referenced this pull request Aug 7, 2023
Compatibility fixes for
the [citrusframework/citrus-simulator](https://github.com/citrusframework/citrus-simulator)
project. These changes - mostly in `citrus-jms` and `citrus-mail` - will allow it to
build on jdk17 and with the latest Spring- and Boot framework as well.

Progress originally reported in PR: citrusframework/citrus-simulator#163 (comment).
@bbortt
Copy link
Collaborator Author

bbortt commented Aug 7, 2023

never mind.. I got it. don't know how exactly, but I got it 🤣 see the linked PR.

@bbortt bbortt force-pushed the feature/#162-citrusframework-4-milestone-1 branch from ec1464d to 04ac686 Compare August 7, 2023 19:46
bbortt added a commit to citrusframework/citrus that referenced this pull request Aug 14, 2023
Compatibility fixes for
the [citrusframework/citrus-simulator](https://github.com/citrusframework/citrus-simulator)
project. These changes - mostly in `citrus-jms` and `citrus-mail` - will allow it to
build on jdk17 and with the latest Spring- and Boot framework as well.

Progress originally reported in PR: citrusframework/citrus-simulator#163 (comment).
@bbortt bbortt force-pushed the feature/#162-citrusframework-4-milestone-1 branch from 04ac686 to 428a0b9 Compare August 14, 2023 19:44
christophd pushed a commit to citrusframework/citrus that referenced this pull request Aug 16, 2023
Compatibility fixes for
the [citrusframework/citrus-simulator](https://github.com/citrusframework/citrus-simulator)
project. These changes - mostly in `citrus-jms` and `citrus-mail` - will allow it to
build on jdk17 and with the latest Spring- and Boot framework as well.

Progress originally reported in PR: citrusframework/citrus-simulator#163 (comment).
@bbortt
Copy link
Collaborator Author

bbortt commented Aug 21, 2023

by the way, if someone wants to continue this: feel free to add commits on top of it. we can squash it later. 'cause I'll have no time this week (probably until next monday).

@bbortt
Copy link
Collaborator Author

bbortt commented Aug 29, 2023

by the way, if someone wants to continue this: feel free to add commits on top of it. we can squash it later. 'cause I'll have no time this week (probably until next monday).

I've fixed it, btw. will push it this evening 🚀

@bbortt bbortt force-pushed the feature/#162-citrusframework-4-milestone-1 branch 2 times, most recently from 586b7a3 to 4492511 Compare August 31, 2023 16:27
@bbortt
Copy link
Collaborator Author

bbortt commented Aug 31, 2023

@buergich fyi I've now migrated the samples to ActiveMQ Artemis as well (like we did with the citrus core). ActiveMQ classic is not ready yet, but will be probably in the next month. See:

}

requestBuilder
.messageType(MessageType.JSON)
// TODO: .messageType(MessageType.JSON)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I saw in the legacy code, this did select the extractor or serializer based on the type. how will this be handled in the future?

@@ -44,6 +54,10 @@ public class ScenarioDesigner extends DefaultTestDesigner {
/** Bean reference resolver */
private final ReferenceResolver referenceResolver;

// TODO: Is this still relevant?
/** Optional stack of containers cached for execution */
protected Stack<TestActionContainerBuilder<? extends TestActionContainer, ?>> containers = new Stack<>();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still relevant? if not, I think this part can be removed as well.

@@ -67,18 +81,22 @@ public CorrelationManager correlation() {
return () -> {
CorrelationHandlerBuilder builder = new CorrelationHandlerBuilder(scenarioEndpoint, applicationContext);
action(builder);
// TODO: Not sure if this works? Where does this action get called?
// See: https://github.com/citrusframework/citrus/pull/946/files#diff-f5bc91f18a5e506ee478ab30a349ef1aee9eecf68efbb8954c5978a7eb14029eL749
doFinally().actions(builder.stop());
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this works? These builded actions, they're not added to any list nor similar. Where or how are these bein executed?

doFinally().actions(builder.stop());
return builder;
};
}


Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to myself:

Suggested change

@@ -60,9 +70,11 @@ public ScenarioRunner(ScenarioEndpoint scenarioEndpoint, ApplicationContext appl
*
* @return
*/
public CorrelationHandlerBuilder correlation(CorrelationBuilderSupport configurer) {
public StartCorrelationHandlerAction correlation(CorrelationBuilderSupport configurer) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will now return an action, not a builder. but if the last line calls run, no builder will be returned (as expected).

@@ -105,60 +103,51 @@ public final Long run(SimulatorScenario scenario, String name, List<ScenarioPara
private Future<?> startScenarioAsync(Long executionId, String name, SimulatorScenario scenario, List<ScenarioParameter> scenarioParameters) {
return executorService.submit(() -> {
try {
if (scenario instanceof Executable) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that concept of an Executable does no longer exist, right? I've removed that condition.


/**
* @author Christoph Deppisch
*/
public class ScenarioDesigner extends DefaultTestDesigner {
public class ScenarioDesigner extends DefaultTestCaseRunner {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the whole concept around "Designers" has been removed from the core, I think. this class would be removed and the ScenarioRunner would be the only remaining option, right? it does not differ much from the designer, tho.

@bbortt bbortt force-pushed the feature/#162-citrusframework-4-milestone-1 branch 2 times, most recently from 41f6cd8 to 231aa18 Compare September 4, 2023 19:32
upgrade citrus core from `com.consol.citrus` to `org.citrusframework` dependency.
that includes some transitive dependency updates/migrations, also in order to
support a jdk17 build minimum:
* `javax` to `jakarta`
* `org.springframework`
* `org.springframework.boot`

BREAKING CHANGE: contains breaking dependency updates!
@bbortt bbortt force-pushed the feature/#162-citrusframework-4-milestone-1 branch from 231aa18 to 034acf9 Compare September 5, 2023 16:13
@bbortt
Copy link
Collaborator Author

bbortt commented Sep 5, 2023

@christophd with 034acf9 the sample-bank-service works on my local machine. would be cool to know if the way I've refactored it is good to continue. because refactoring all samples is a bit of repetitive work which I'd like to not do too often.

@bbortt bbortt mentioned this pull request Sep 9, 2023
@christophd
Copy link
Member

@bbortt I had a look and managed to fix all issues to complete the migration to Citrus 4.x 😃

My changes build on top of this draft PR.
In this PR you can see my changes #168
This is the combined PR towards main branch so we can see all tests green before merge 😅 #169

@bbortt
Copy link
Collaborator Author

bbortt commented Sep 12, 2023

superseded by #169.

@bbortt bbortt closed this Sep 12, 2023
@bbortt bbortt deleted the feature/#162-citrusframework-4-milestone-1 branch September 12, 2023 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file IN PROGRESS java Pull requests that update Java code Prio: High Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

org.citrusframework v4.0.0-M1 support
3 participants