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

Use test resources, fix GraalVM metadata and add GraalVM tests #355

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ plugins {
repositories {
gradlePluginPortal()
mavenCentral()
// need to pull in micronaut-gradle-plugin:4.0.0-SNAPSHOT
// to prevent leaking codehaus groovy from micronaut-test 3.x
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions buildSrc/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rootProject.name = 'jms-parent'
dependencyResolutionManagement {
versionCatalogs {
libs {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
plugins {
id 'io.micronaut.build.internal.jms-base'
id 'io.micronaut.application'
}
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module('io.micronaut.jms:micronaut-jms-core') using project(':micronaut-jms-core')
substitute module('io.micronaut.jms:micronaut-jms-activemq-classic') using project(':micronaut-jms-activemq-classic')
substitute module('io.micronaut.jms:micronaut-jms-activemq-artemis') using project(':micronaut-jms-activemq-artemis')
substitute module('io.micronaut.jms:micronaut-jms-sqs') using project(':micronaut-jms-sqs')
}
}
micronaut {
version libs.versions.micronaut.platform.get()
runtime "netty"
}

application {
mainClass = 'example.Application'
}

dependencies {
runtimeOnly(mn.snakeyaml)
testImplementation(mn.logback.classic)
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
plugins {
id 'io.micronaut.build.internal.jms-base'
id 'io.micronaut.minimal.application'
}

micronaut {
version libs.versions.micronaut
runtime 'netty'
id 'io.micronaut.build.internal.jms-application'
}

dependencies {
testCompileOnly libs.jsr305 // for "warning: unknown enum constant When.MAYBE"
testImplementation projects.micronautJmsActivemqClassic
testImplementation libs.activemq.broker
testImplementation(mn.logback.classic)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
id 'io.micronaut.build.internal.jms-application'
}

tasks.named("check") { task ->
def graal = ["jvmci.Compiler", "java.vendor.version", "java.vendor"].any {
System.getProperty(it)?.toLowerCase(Locale.ENGLISH)?.contains("graal")
}
if (graal) {
task.dependsOn("nativeTest")
}
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
plugins {
id 'groovy'
id 'io.micronaut.build.internal.jms-base'
id 'io.micronaut.application'
}

application {
mainClass = 'example.Application'
id 'io.micronaut.build.internal.jms-application'
id 'io.micronaut.test-resources'
}

micronaut {
version '4.0.0-SNAPSHOT'
runtime 'netty'
testRuntime 'spock'
testResources {
clientTimeout = 300
}
}


dependencies {

testImplementation mnTest.micronaut.test.core
testImplementation mn.micronaut.http.client
testImplementation libs.testcontainers.spock

// without this :tests:tasks-activemq-artemis TasksSpec fails with ClassNotFoundException for javax.json.JsonValue
runtimeOnly(libs.javax.json.api)
Expand Down
1 change: 0 additions & 1 deletion docs-examples/example-groovy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
}

micronaut {
version = '4.0.0-SNAPSHOT'
testRuntime 'spock'
}

Expand Down
4 changes: 1 addition & 3 deletions docs-examples/example-java/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
plugins {
id 'io.micronaut.build.internal.jms-examples'
id 'io.micronaut.application'
id 'java'
id 'io.micronaut.build.internal.jms-native-tests'
}

dependencies {
testImplementation libs.awaitility
}

micronaut {
version = '4.0.0-SNAPSHOT'
testRuntime 'junit5'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MapConsumer {
List<Map<String, Object>> messageHeaders = Collections.synchronizedList(new ArrayList<>());
List<javax.jms.Message> messages = Collections.synchronizedList(new ArrayList<>());

@Queue(value = "queue_map", concurrency = "1-5")
@Queue(value = "queue_map")
public void receive(@MessageBody Map<String, Serializable> body,
@Message javax.jms.Message message,
@MessageHeader(JMS_CORRELATION_ID) @Nullable String correlationId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public class SelectorConsumer {

List<String> messageBodiesTopic = Collections.synchronizedList(new ArrayList<>());

@Queue(value = "selector_queue", concurrency = "1-5", messageSelector = "CustomBooleanHeader=true")
@Queue(value = "selector_queue", messageSelector = "CustomBooleanHeader=true")
public void receive(@MessageBody String body) {
messageBodiesTrue.add(body);
}

@Queue(value = "selector_queue", concurrency = "1-5", messageSelector = "CustomBooleanHeader=false")
@Queue(value = "selector_queue", messageSelector = "CustomBooleanHeader=false")
public void receive2(@MessageBody String body) {
messageBodiesFalse.add(body);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ErrorThrowingConsumer {

Collection<String> messages = Collections.synchronizedSet(new HashSet<>());

@Queue(value = "error-queue", concurrency = "1-1", errorHandlers = {CountingErrorHandler.class}) // <2>
@Queue(value = "error-queue", errorHandlers = {CountingErrorHandler.class}) // <2>
void receive(@MessageBody String message) {
if ("throw an error".equalsIgnoreCase(message)) {
throw new RuntimeException("this is an error"); // <3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class TextConsumer {

List<String> messages = Collections.synchronizedList(new ArrayList<>());

@Queue(value = "queue_text", concurrency = "1-5") // <2>
@Queue(value = "queue_text") // <2>
public void receive(@MessageBody String body) { // <3>
messages.add(body);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SuccessHandlingConsumer {

Collection<String> messages = Collections.synchronizedSet(new HashSet<>());

@Queue(value = "success-queue", concurrency = "1-1", successHandlers = {CountingSuccessHandler.class}) // <2>
@Queue(value = "success-queue", successHandlers = {CountingSuccessHandler.class}) // <2>
void receive(@MessageBody String message) throws JMSException {
messages.add(message);
}
Expand Down
1 change: 0 additions & 1 deletion docs-examples/example-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies {
}

micronaut {
version = '4.0.0-SNAPSHOT'
testRuntime 'kotest5'
}

Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[versions]
micronaut-docs = "2.0.0"
micronaut = "4.0.0-M1"
micronaut-test = "4.0.0-SNAPSHOT"

micronaut = "4.0.0-M2"
micronaut-test = "4.0.0-M1"
micronaut-platform = "4.0.0-M1"
activemq = '5.17.3'
amazon-sqs-messaging = '2.0.3'
artemis-client = '2.28.0'
Expand All @@ -18,12 +18,12 @@ jsr305 = "3.0.2"
kotlin = '1.8.10'
spock = "2.3-groovy-4.0"
spotbugs = "4.7.1"
testcontainers = '1.17.6'
testcontainers = '1.18.0'
lombok = '1.18.26'

micronaut-aws-v2 = '3.13.1'
micronaut-validation = "4.0.0-M2"
micronaut-gradle-plugin = "4.0.0-SNAPSHOT"
micronaut-gradle-plugin = "4.0.0-M1"

[libraries]
micronaut-validation = { module = "io.micronaut.validation:micronaut-validation-bom", version.ref = "micronaut-validation" }
Expand Down
Loading