diff --git a/.gitignore b/.gitignore
index 1c91afb..9cff86f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ target
/.gradle
/build
/*.iml
+/bin/
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..e858760
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,11 @@
+language: java
+jdk: oraclejdk8
+install: true
+before_cache:
+ - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
+cache:
+ directories:
+ - $HOME/.gradle/caches/
+ - $HOME/.gradle/wrapper/
+script:
+ - ./gradlew check --refresh-dependencies --no-daemon
diff --git a/build.gradle b/build.gradle
index d6a0cca..2224aa8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,18 +1,32 @@
-description = 'Spring Integration Flow'
-
buildscript {
repositories {
- maven { url 'http://repo.spring.io/plugins-release' }
+ maven { url 'https://repo.spring.io/plugins-release' }
}
+
dependencies {
- classpath 'io.spring.gradle:spring-io-plugin:0.0.4.RELEASE'
+ classpath 'io.spring.gradle:dependency-management-plugin:1.0.0.RC2'
+ classpath 'io.spring.gradle:spring-io-plugin:0.0.6.RELEASE'
}
}
-apply plugin: 'java'
-apply from: "${rootProject.projectDir}/publish-maven.gradle"
-apply plugin: 'eclipse'
-apply plugin: 'idea'
+plugins {
+ id 'java'
+ id 'eclipse'
+ id 'idea'
+ id 'jacoco'
+ id 'org.sonarqube' version '2.1'
+}
+
+description = 'Spring Integration Flow'
+
+
+sourceSets {
+ test {
+ resources {
+ srcDirs = ['src/test/resources', 'src/test/java']
+ }
+ }
+}
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
@@ -33,17 +47,19 @@ if (project.hasProperty('platformVersion')) {
group = 'org.springframework.integration'
repositories {
- maven { url 'http://repo.spring.io/libs-milestone' }
+ maven { url 'http://repo.spring.io/libs-snapshot' }
}
-sourceCompatibility = 1.6
-targetCompatibility = 1.6
+compileJava {
+ sourceCompatibility = 1.8
+ targetCompatibility = 1.8
+}
ext {
commonsLangVersion = '2.6'
- jacocoVersion = '0.7.1.201405082137'
- springIntegrationVersion = '4.0.5.RELEASE'
+ log4jVersion = '2.7'
+ springIntegrationVersion = '5.0.0.BUILD-SNAPSHOT'
linkHomepage = 'https://github.com/spring-projects/spring-integration-extensions'
linkCi = 'https://build.spring.io/browse/INTEXT'
@@ -68,8 +84,8 @@ dependencies {
testCompile "org.springframework.integration:spring-integration-test:$springIntegrationVersion"
testCompile "org.springframework.integration:spring-integration-groovy:$springIntegrationVersion"
testCompile "org.springframework.integration:spring-integration-jmx:$springIntegrationVersion"
-
- jacoco "org.jacoco:org.jacoco.agent:$jacocoVersion:runtime"
+ testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
+ testRuntime "org.apache.logging.log4j:log4j-jcl:$log4jVersion"
}
@@ -79,12 +95,8 @@ eclipse {
}
}
-sourceSets {
- test {
- resources {
- srcDirs = ['src/test/resources', 'src/test/java']
- }
- }
+jacoco {
+ toolVersion = "0.7.8"
}
// enable all compiler warnings; individual projects may customize further
@@ -93,9 +105,22 @@ sourceSets {
test {
// suppress all console output during testing unless running `gradle -i`
logging.captureStandardOutput(LogLevel.INFO)
- jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=*"
+ jacoco {
+ append = false
+ destinationFile = file("$buildDir/jacoco.exec")
+ }
}
+jacocoTestReport {
+ reports {
+ xml.enabled false
+ csv.enabled false
+ html.destination "${buildDir}/reports/jacoco/html"
+ }
+}
+
+build.dependsOn jacocoTestReport
+
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
@@ -111,10 +136,8 @@ artifacts {
archives javadocJar
}
-apply plugin: 'sonar-runner'
-
-sonarRunner {
- sonarProperties {
+sonarqube {
+ properties {
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
property "sonar.links.homepage", linkHomepage
property "sonar.links.ci", linkCi
@@ -234,10 +257,4 @@ task dist(dependsOn: assemble) {
description = 'Builds -dist, -docs and -schema distribution archives.'
}
-task wrapper(type: Wrapper) {
- description = 'Generates gradlew[.bat] scripts'
- gradleVersion = '1.12'
- distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
-}
-
defaultTasks 'build'
diff --git a/gradle.properties b/gradle.properties
index 1c7ff0f..dfe1192 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1 +1 @@
-version=1.0.1.BUILD-SNAPSHOT
+version=2.0.0.BUILD-SNAPSHOT
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 0087cd3..a2e2314 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 98ee075..e314cca 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-3.3-bin.zip
diff --git a/gradlew b/gradlew
index 91a7e26..4453cce 100755
--- a/gradlew
+++ b/gradlew
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
##############################################################################
##
@@ -6,12 +6,30 @@
##
##############################################################################
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
+nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
@@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
+ NONSTOP* )
+ nonstop=true
+ ;;
esac
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -90,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
+# Escape application args
+save ( ) {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=$(save "$@")
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 8a0b282..e95643d 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,90 +1,84 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 97011bb..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,183 +0,0 @@
-
-
- 4.0.0
- org.springframework.integration
- spring-integration-flow
- 4.0.0.BUILD-SNAPSHOT
- Spring Integration Flow Support
-
- 4.0.7.RELEASE
- 4.0.4.RELEASE
- UTF8
-
-
-
- The Apache Software License, Version 2.0
- http://www.apache.org/licenses/LICENSE-2.0.txt
- repo
-
-
-
-
-
- src/main/java
-
- **/*
-
-
- **/*.java
-
-
-
- src/main/resources
-
- **/*
-
-
-
-
-
- src/test/java
-
- **/*
-
-
- **/*.java
-
-
-
- src/test/resources
-
- **/*
-
-
-
-
-
- maven-compiler-plugin
-
- 1.6
- 1.6
-
-
-
- maven-surefire-plugin
-
-
- **/*Tests.java
-
-
- **/*Abstract*.java
-
-
-
-
-
-
-
- SpringSource Plugin Repository
- http://repo.springsource.org/plugins-release
-
-
- SpringSource Milestone Repository
- http://repo.springsource.org/libs-milestone
-
-
- SpringSource Snapshot Repository
- http://repo.springsource.org/libs-snapshot
-
-
-
-
- org.springframework
- spring-test
- ${spring.version}
- test
-
-
- org.springframework
- spring-tx
- ${spring.version}
- test
-
-
- org.springframework.integration
- spring-integration-test
- ${spring.integration.version}
- test
-
-
- cglib
- cglib-nodep
- 2.2
- test
-
-
- log4j
- log4j
- 1.2.12
- test
-
-
- org.springframework.integration
- spring-integration-core
- ${spring.integration.version}
- compile
-
-
- org.easymock
- easymock
- 2.3
- test
-
-
- org.easymock
- easymockclassextension
- 2.3
- test
-
-
- org.springframework.integration
- spring-integration-groovy
- ${spring.integration.version}
- test
-
-
- org.springframework
- spring-context
- ${spring.version}
- compile
-
-
- org.hamcrest
- hamcrest-all
- 1.1
- test
-
-
- org.mockito
- mockito-all
- 1.8.4
- test
-
-
- commons-lang
- commons-lang
- 2.6
- compile
-
-
- org.springframework.integration
- spring-integration-jmx
- ${spring.integration.version}
- test
-
-
- junit
- junit-dep
- 4.8.2
- test
-
-
-
diff --git a/src/main/java/META-INF/MANIFEST.MF b/src/main/java/META-INF/MANIFEST.MF
deleted file mode 100644
index 5e94951..0000000
--- a/src/main/java/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
diff --git a/src/test/java/org/springframework/integration/flow/config/xml/FlowContextTests.java b/src/test/java/org/springframework/integration/flow/config/xml/FlowContextTests.java
index f1581e8..e5fad86 100644
--- a/src/test/java/org/springframework/integration/flow/config/xml/FlowContextTests.java
+++ b/src/test/java/org/springframework/integration/flow/config/xml/FlowContextTests.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2002-2011 the original author or authors.
- *
+ * Copyright 2002-2017 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. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
@@ -13,33 +13,35 @@
package org.springframework.integration.flow.config.xml;
import org.junit.Test;
+
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* @author David Turanski
+ * @author Gary Russell
*
*/
-
+
public class FlowContextTests {
@Test(expected=BeanCreationException.class)
public void testChannelConflictShouldThrowException() {
try {
new ClassPathXmlApplicationContext(
- "/org/springframework/integration/flow/config/xml/FlowContextTests-context.xml");
+ "/org/springframework/integration/flow/config/xml/FlowContextTests-context.xml").close();
} catch (BeanCreationException e) {
System.out.println(e.getCause().getMessage());
throw e;
}
}
-
- @Test
+
+ @Test
public void testFlowWithJMX() {
-
+
new ClassPathXmlApplicationContext(
- "/org/springframework/integration/flow/config/xml/FlowContextTests-jmx-context.xml");
-
+ "/org/springframework/integration/flow/config/xml/FlowContextTests-jmx-context.xml").close();
+
}
-
+
}
diff --git a/src/test/java/org/springframework/integration/flow/config/xml/FlowWithErrorTests.java b/src/test/java/org/springframework/integration/flow/config/xml/FlowWithErrorTests.java
index 16faa1e..89b4af3 100644
--- a/src/test/java/org/springframework/integration/flow/config/xml/FlowWithErrorTests.java
+++ b/src/test/java/org/springframework/integration/flow/config/xml/FlowWithErrorTests.java
@@ -1,12 +1,12 @@
/*
- * Copyright 2002-2011 the original author or authors.
- *
+ * Copyright 2002-2017 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. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -19,27 +19,29 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
-import org.springframework.context.ApplicationContext;
+
+import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
-import org.springframework.messaging.MessagingException;
import org.springframework.messaging.MessageHandler;
+import org.springframework.messaging.MessagingException;
import org.springframework.messaging.PollableChannel;
import org.springframework.messaging.SubscribableChannel;
import org.springframework.messaging.support.GenericMessage;
/**
- *
+ *
* @author David Turanski
- *
+ * @author Gary Russell
+ *
*/
public class FlowWithErrorTests {
@Test
public void testFlowThrowsExceptionWithGatewayErrorChannel() {
- ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
+ ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"/org/springframework/integration/flow/config/xml/FlowWithErrorTests-context.xml");
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel", SubscribableChannel.class);
@@ -48,18 +50,19 @@ public class FlowWithErrorTests {
errorChannel.subscribe(handler);
inputChannel.send(msg);
assertTrue(handler.gotResponse);
-
+ applicationContext.close();
}
@Test
public void testDirectCallWithErrorChannel() {
- ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
+ ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"classpath:/META-INF/spring/integration/flows/subflow5/subflow5-context.xml");
MessageChannel inputChannel = applicationContext.getBean("subflow-input", MessageChannel.class);
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel", SubscribableChannel.class);
errorChannel.subscribe(new MessageHandler() {
+ @Override
public void handleMessage(Message> message) throws MessagingException {
assertTrue(message.getPayload() instanceof MessagingException);
}
@@ -67,11 +70,12 @@ public class FlowWithErrorTests {
Message msg = new GenericMessage("hello");
assertTrue(inputChannel.send(msg));
+ applicationContext.close();
}
@Test
public void testWithErrorChannel() {
- ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
+ ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"/org/springframework/integration/flow/config/xml/FlowWithErrorTests-context.xml");
MessageChannel inputChannel = applicationContext.getBean("inputC1", MessageChannel.class);
PollableChannel output = applicationContext.getBean("outputC1", PollableChannel.class);
@@ -81,6 +85,7 @@ public class FlowWithErrorTests {
Message> reply = output.receive(100);
assertNotNull(reply);
assertTrue(reply.getPayload() instanceof MessagingException);
+ applicationContext.close();
}
private static class Handler implements MessageHandler {
@@ -91,11 +96,12 @@ public class FlowWithErrorTests {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.messaging.MessageHandler#handleMessage
* (org.springframework.messaging.Message)
*/
+ @Override
public void handleMessage(Message> message) throws MessagingException {
this.gotResponse = true;
this.message = message;
diff --git a/src/test/java/org/springframework/integration/flow/config/xml/TransactionalFlowTests.java b/src/test/java/org/springframework/integration/flow/config/xml/TransactionalFlowTests.java
index e50d12f..d1382c7 100644
--- a/src/test/java/org/springframework/integration/flow/config/xml/TransactionalFlowTests.java
+++ b/src/test/java/org/springframework/integration/flow/config/xml/TransactionalFlowTests.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2002-2011 the original author or authors.
- *
+ * Copyright 2002-2017 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. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
@@ -18,27 +18,30 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Test;
-import org.springframework.context.ApplicationContext;
+
+import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.MessageChannel;
-import org.springframework.messaging.MessagingException;
-import org.springframework.messaging.MessageHandler;
-import org.springframework.messaging.SubscribableChannel;
import org.springframework.integration.flow.FlowConstants;
import org.springframework.integration.flow.Transaction.StubTransactionManager;
+import org.springframework.messaging.Message;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.messaging.MessageHandler;
+import org.springframework.messaging.MessagingException;
+import org.springframework.messaging.SubscribableChannel;
import org.springframework.messaging.support.ErrorMessage;
import org.springframework.messaging.support.GenericMessage;
/**
* @author David Turanski
- *
+ * @author Gary Russell
+ *
*/
public class TransactionalFlowTests {
+
@Test
public void testFlowDirectCommit() {
- ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
- "/META-INF/spring/integration/flows/transactional-flow/flow-context.xml",
+ ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
+ "/META-INF/spring/integration/flows/transactional-flow/flow-context.xml",
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
MessageChannel inputChannel = applicationContext.getBean("inputChannel", MessageChannel.class);
SubscribableChannel outputChannel = applicationContext.getBean("outputChannel", SubscribableChannel.class);
@@ -49,12 +52,13 @@ public class TransactionalFlowTests {
assertTrue(handler.messageReceived);
assertTrue(transactionManager.committed);
assertFalse(transactionManager.rolledback);
+ applicationContext.close();
}
@Test
public void testFlowDirectRollback() {
- ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
- "/META-INF/spring/integration/flows/transactional-flow/flow-context.xml",
+ ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
+ "/META-INF/spring/integration/flows/transactional-flow/flow-context.xml",
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
MessageChannel inputChannel = applicationContext.getBean("inputChannel", MessageChannel.class);
SubscribableChannel outputChannel = applicationContext.getBean("outputChannel", SubscribableChannel.class);
@@ -70,12 +74,13 @@ public class TransactionalFlowTests {
assertTrue(transactionManager.rolledback);
assertFalse(transactionManager.committed);
}
+ applicationContext.close();
}
@Test
public void testFlowCommit() {
- ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
- "/org/springframework/integration/flow/config/xml/TransactionalFlowTests-context.xml",
+ ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
+ "/org/springframework/integration/flow/config/xml/TransactionalFlowTests-context.xml",
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
SubscribableChannel outputChannel = applicationContext.getBean("outputC", SubscribableChannel.class);
@@ -86,12 +91,13 @@ public class TransactionalFlowTests {
assertTrue(handler.messageReceived);
assertTrue(transactionManager.committed);
assertFalse(transactionManager.rolledback);
+ applicationContext.close();
}
@Test
public void testFlowRollbackWithGatewayErrorChannel() {
- ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
- "/org/springframework/integration/flow/config/xml/TransactionalFlowTests-context.xml",
+ ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
+ "/org/springframework/integration/flow/config/xml/TransactionalFlowTests-context.xml",
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel", SubscribableChannel.class);
@@ -107,7 +113,7 @@ public class TransactionalFlowTests {
handler.message.getHeaders().get(FlowConstants.FLOW_OUTPUT_PORT_HEADER));
assertTrue(transactionManager.rolledback);
assertFalse(transactionManager.committed);
-
+ applicationContext.close();
}
private static class Handler implements MessageHandler {
@@ -117,12 +123,13 @@ public class TransactionalFlowTests {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.messaging.MessageHandler#handleMessage
* (org.springframework.messaging.Message)
*/
+ @Override
public void handleMessage(Message> message) throws MessagingException {
this.messageReceived = true;
this.message = message;
diff --git a/src/test/resources/log4j.xml b/src/test/resources/log4j.xml
deleted file mode 100644
index 377dfd4..0000000
--- a/src/test/resources/log4j.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/test/resources/log4j2-test.xml b/src/test/resources/log4j2-test.xml
new file mode 100644
index 0000000..a65bf51
--- /dev/null
+++ b/src/test/resources/log4j2-test.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+