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

add itests for camel-cxfrs-kafka-connector #996 #1099

Merged
merged 5 commits into from
Mar 18, 2021

Conversation

ffang
Copy link
Contributor

@ffang ffang commented Mar 12, 2021

No description provided.

Copy link
Contributor

@orpiske orpiske left a comment

Choose a reason for hiding this comment

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

Looks in the right track, but I'd advise applying a few changes to ensure it's runs reliably on GH actions.

}


public abstract static class AbstractTestProcessor implements Processor {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably look into moving these processing code to a separate Camel-based test service (in a similar way to the one we have in the syslog tests, for example). That way, we can potentially reuse more test code when adding new scenarios to this.

* A simple test case that checks whether the CXF RS Consumer Endpoint produces the expected number of
* messages
*/
public class CamelSourceCXFRSITCase extends AbstractKafkaTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd try using the CamelSourceTestSupport class as the base class for the tests, as it abstracts away some of the setup, test logic and tear down complexity.


protected static final int PORT = NetworkUtils.getFreePort("localhost");
protected static final String CXT = PORT + "/CxfRsConsumerTest";
protected static final String CXF_RS_ENDPOINT_ADDRESS = "http://localhost:" + CXT + "/rest";
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd use the NetworkUtils.getLocalHostname() method to avoid problems when running these on misconfigured hosts (we did saw some problems with false positives on Github actions due to this).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @orpiske for the feedbacks! I will revise accordingly.

Copy link
Contributor

@orpiske orpiske left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

Copy link
Contributor

@oscerd oscerd left a comment

Choose a reason for hiding this comment

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

Thanks, I think this needs to be backported on camel-master too.

@ffang ffang merged commit c046727 into apache:master Mar 18, 2021
@ffang ffang deleted the cxfrs-itests-merge branch March 18, 2021 14:23
oscerd pushed a commit that referenced this pull request Mar 23, 2021
* add itests for camel-cxfrs-kafka-connector #996

* NetworkUtils should be able to hold a free port for later usage #1109

* address feedback

* #1109 address PR review feedback

(cherry picked from commit 94929f3)
oscerd pushed a commit that referenced this pull request Mar 23, 2021
* add itests for camel-cxfrs-kafka-connector #996

* NetworkUtils should be able to hold a free port for later usage #1109

* address feedback

* #1109 address PR review feedback

(cherry picked from commit 94929f3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants