Skip to content

Commit

Permalink
fixed test-framework/junit5 + generated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriOndrusek committed May 27, 2024
1 parent 21e3f98 commit eaac76a
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ quarkus.native.resources.includes=contract.json
----



[id="extensions-rest-openapi-additional-camel-quarkus-configuration"]
== Additional Camel Quarkus configuration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#
---
name: "Camel ActiveMQ"
description: "Send messages to (or consume from) Apache ActiveMQ. This component extends the Camel JMS component"
description: "Send messages to (or consume from) Apache ActiveMQ 5.x. This component extends the Camel JMS component"
metadata:
icon-url: "https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg"
guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/activemq.html"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ metadata:
- "integration"
status:
- "stable"
- "deprecated"
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.apache.camel.util.StopWatch;
import org.jboss.logging.Logger;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public abstract class AbstractCallbacksTest extends CamelQuarkusTestSupport {
Expand All @@ -48,7 +47,6 @@ public abstract class AbstractCallbacksTest extends CamelQuarkusTestSupport {

public enum Callback {
postTearDown,
doSetup,
preSetup,
postSetup,
contextCreation,
Expand All @@ -69,12 +67,6 @@ public AbstractCallbacksTest(String testName, String afterClassTestName) {
this.afterClassTestName = afterClassTestName;
}

@BeforeEach
protected void createTmpFiles() throws Exception {
createTmpFile(testName, Callback.doSetup);
createTmpFile(afterClassTestName, Callback.doSetup);
}

@Override
protected CamelContext createCamelContext() throws Exception {
createTmpFile(testName, Callback.contextCreation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public static void shouldTearDown() {
protected static BiConsumer<Callback, Long> createAssertionConsumer() {
return (callback, count) -> {
switch (callback) {
case doSetup:
assertCount(3, count, callback, CallbacksPerTestFalse01Test.class.getSimpleName());
break;
case contextCreation:
assertCount(3, count, callback, CallbacksPerTestFalse01Test.class.getSimpleName());
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public static void shouldTearDown() {
protected static BiConsumer<Callback, Long> createAssertionConsumer() {
return (callback, count) -> {
switch (callback) {
case doSetup:
assertCount(1, count, callback, CallbacksPerTestTrue01Test.class.getSimpleName());
break;
case contextCreation:
assertCount(1, count, callback, CallbacksPerTestTrue01Test.class.getSimpleName());
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.quarkus.test.CamelQuarkusTestSupport;
import org.apache.camel.test.junit5.DebugBreakpoint;
import org.jboss.logging.Logger;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
Expand Down Expand Up @@ -92,4 +93,9 @@ public void configure() {
};
}
// END SNIPPET: e2

@Override
protected DebugBreakpoint createBreakpoint() {
return new TestDebugBreakpoint();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.quarkus.test.CamelQuarkusTestSupport;
import org.apache.camel.test.junit5.DebugBreakpoint;
import org.jboss.logging.Logger;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -88,4 +89,9 @@ public void configure() {
};
}
// END SNIPPET: e2

@Override
protected DebugBreakpoint createBreakpoint() {
return new TestDebugBreakpoint();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.quarkus.test.CamelQuarkusTestSupport;
import org.apache.camel.test.junit5.DebugBreakpoint;
import org.jboss.logging.Logger;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -95,4 +96,9 @@ public void configure() {
};
}
// END SNIPPET: e2

@Override
protected DebugBreakpoint createBreakpoint() {
return new TestDebugBreakpoint();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.apache.camel.quarkus.test.junit5.patterns;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.test.junit5.DebugBreakpoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestDebugBreakpoint extends DebugBreakpoint {
private static final Logger LOG = LoggerFactory.getLogger(TestDebugBreakpoint.class);

@Override
protected void debugBefore(
Exchange exchange, Processor processor, ProcessorDefinition<?> definition, String id, String label) {
// this method is invoked before we are about to enter the given
// processor
// from your Java editor you can add a breakpoint in the code line
// below
LOG.info("Before {} with body {}", definition, exchange.getIn().getBody());
}

@Override
protected void debugAfter(
Exchange exchange, Processor processor, ProcessorDefinition<?> definition, String id, String label,
long timeTaken) {

}
}

0 comments on commit eaac76a

Please sign in to comment.