Skip to content

Commit

Permalink
Start version 5.4
Browse files Browse the repository at this point in the history
* Fix compatibility after upgrading to some latest dependencies
  • Loading branch information
artembilan committed May 19, 2020
1 parent 42845f0 commit 8f92bb2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 48 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Expand Up @@ -59,9 +59,9 @@ ext {
derbyVersion = '10.14.2.0'
ftpServerVersion = '1.1.1'
googleJsr305Version = '3.0.2'
groovyVersion = '2.5.11'
groovyVersion = '3.0.3'
hamcrestVersion = '2.2'
hazelcastVersion = '3.12.6'
hazelcastVersion = '4.0.1'
hibernateVersion = '5.4.14.Final'
hsqldbVersion = '2.5.0'
h2Version = '1.4.200'
Expand Down Expand Up @@ -92,11 +92,11 @@ ext {
rsocketVersion = '1.0.0'
servletApiVersion = '4.0.1'
smackVersion = '4.3.4'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.2.6.RELEASE'
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : 'Neumann-RELEASE'
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.3.2.RELEASE'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.3.0.BUILD-SNAPSHOT'
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : 'Neumann-BUILD-SNAPSHOT'
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.4.0.BUILD-SNAPSHOT'
springRetryVersion = '1.2.5.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.2.6.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.3.0-SNAPSHOT'
springWsVersion = '3.0.9.RELEASE'
tomcatVersion = "9.0.35"
xstreamVersion = '1.4.12'
Expand All @@ -112,7 +112,7 @@ allprojects {
if (project.hasProperty('mavenLocal')) {
mavenLocal()
}
if (version.endsWith('BUILD-SNAPSHOT')) {
if (version.endsWith('SNAPSHOT')) {
maven { url 'https://repo.spring.io/libs-snapshot' }
}
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
@@ -1,4 +1,4 @@
version=5.3.1.BUILD-SNAPSHOT
version=5.4.0-SNAPSHOT
org.gradle.jvmargs=-Xmx1536m -Dfile.encoding=UTF-8
org.gradle.caching=true
org.gradle.parallel=true
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@
package org.springframework.integration.groovy.config;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
Expand All @@ -26,8 +26,7 @@
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
Expand All @@ -43,8 +42,7 @@
import org.springframework.messaging.support.ErrorMessage;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.scripting.groovy.GroovyObjectCustomizer;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

import groovy.lang.GroovyObject;
import groovy.lang.MissingPropertyException;
Expand All @@ -54,10 +52,10 @@
* @author Oleg Zhurakousky
* @author Artem Bilan
* @author Gunnar Hillert
*
* @since 2.0
*/
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@SpringJUnitConfig
public class GroovyServiceActivatorTests {

@Autowired
Expand Down Expand Up @@ -86,7 +84,7 @@ public class GroovyServiceActivatorTests {


@Test
public void referencedScriptAndCustomiser() throws Exception {
public void referencedScriptAndCustomizer() throws Exception {
groovyCustomizer.executed = false;
QueueChannel replyChannel = new QueueChannel();
replyChannel.setBeanName("returnAddress");
Expand Down Expand Up @@ -134,7 +132,7 @@ public void withScriptVariableGenerator() throws Exception {
}

@Test
public void inlineScript() throws Exception {
public void inlineScript() {
groovyCustomizer.executed = false;
QueueChannel replyChannel = new QueueChannel();
replyChannel.setBeanName("returnAddress");
Expand All @@ -156,7 +154,7 @@ public void inlineScript() throws Exception {
}

@Test
public void testScriptWithoutVariables() throws Exception {
public void testScriptWithoutVariables() {
PollableChannel replyChannel = new QueueChannel();
for (int i = 1; i <= 3; i++) {
Message<?> message = MessageBuilder.withPayload("test-" + i).setReplyChannel(replyChannel).build();
Expand All @@ -174,41 +172,36 @@ public void testScriptWithoutVariables() throws Exception {
assertThat(replyChannel.receive(0)).isNull();
}

//INT-2399
@Test(expected = MessageHandlingException.class)
public void invalidInlineScript() throws Exception {
Message<?> message =
new ErrorMessage(new ReplyRequiredException(new GenericMessage<String>("test"), "reply required!"));
try {
this.invalidInlineScript.send(message);
fail("MessageHandlingException expected!");
}
catch (Exception e) {
Throwable cause = e.getCause();
assertThat(cause.getClass()).isEqualTo(MissingPropertyException.class);
assertThat(cause.getMessage()).contains("No such property: ReplyRequiredException for class: script");
throw e;
}

@Test
public void invalidInlineScript() {
assertThatExceptionOfType(MessageHandlingException.class)
.isThrownBy(() ->
this.invalidInlineScript.send(
new ErrorMessage(
new ReplyRequiredException(new GenericMessage<>("test"), "reply required!"))))
.withStackTraceContaining("No such property: ReplyRequiredException for class: Script_")
.withCauseInstanceOf(MissingPropertyException.class);
}

@Test(expected = BeanDefinitionParsingException.class)
public void variablesAndScriptVariableGenerator() throws Exception {
new ClassPathXmlApplicationContext("GroovyServiceActivatorTests-fail-withgenerator-context.xml",
this.getClass()).close();
@Test
public void variablesAndScriptVariableGenerator() {
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() ->
new ClassPathXmlApplicationContext("GroovyServiceActivatorTests-fail-withgenerator-context.xml",
this.getClass()));
}

@Test
public void testGroovyScriptForOutboundChannelAdapter() {
this.outboundChannelAdapterWithGroovy.send(new GenericMessage<String>("foo"));
this.outboundChannelAdapterWithGroovy.send(new GenericMessage<>("foo"));
assertThat(this.invoked.get()).isTrue();
}


public static class SampleScriptVariSource implements ScriptVariableGenerator {

public Map<String, Object> generateScriptVariables(Message<?> message) {
Map<String, Object> variables = new HashMap<String, Object>();
Map<String, Object> variables = new HashMap<>();
variables.put("foo", "foo");
variables.put("bar", "bar");
variables.put("date", new Date());
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,8 +27,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
Expand Down Expand Up @@ -80,7 +79,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.util.MultiValueMap;
import org.springframework.web.socket.client.WebSocketClient;
import org.springframework.web.socket.client.standard.StandardWebSocketClient;
Expand All @@ -104,7 +103,7 @@
* @since 4.1
*/
@ContextConfiguration(classes = StompIntegrationTests.ClientConfig.class)
@RunWith(SpringRunner.class)
@SpringJUnitConfig
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
public class StompIntegrationTests {

Expand Down Expand Up @@ -382,7 +381,6 @@ public PollableChannel webSocketEvents() {
}

@Bean
@SuppressWarnings("unchecked")
public ApplicationListener<ApplicationEvent> webSocketEventListener() {
ApplicationEventListeningMessageProducer producer = new ApplicationEventListeningMessageProducer();
producer.setEventTypes(AbstractSubProtocolEvent.class);
Expand Down Expand Up @@ -446,7 +444,7 @@ public int number() {

@MessagingGateway
@Controller
interface WebSocketGateway {
public interface WebSocketGateway {

@MessageMapping("/greeting")
@SendToUser("/queue/answer")
Expand Down

0 comments on commit 8f92bb2

Please sign in to comment.