INTEXT-229: Update to SI 5.0; Spring IO Cairo
JIRA: https://jira.spring.io/browse/INTEXT-229 * Move `sourceSets` before applying `spring-io` plugin to let the custom set to be applied for IO tasks as well
This commit is contained in:
committed by
Artem Bilan
parent
53e7c3a61d
commit
e0ad10032e
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@ target
|
|||||||
/.gradle
|
/.gradle
|
||||||
/build
|
/build
|
||||||
/*.iml
|
/*.iml
|
||||||
|
/bin/
|
||||||
|
|||||||
11
.travis.yml
Normal file
11
.travis.yml
Normal file
@@ -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
|
||||||
81
build.gradle
81
build.gradle
@@ -1,18 +1,32 @@
|
|||||||
description = 'Spring Integration Flow'
|
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'http://repo.spring.io/plugins-release' }
|
maven { url 'https://repo.spring.io/plugins-release' }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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'
|
plugins {
|
||||||
apply from: "${rootProject.projectDir}/publish-maven.gradle"
|
id 'java'
|
||||||
apply plugin: 'eclipse'
|
id 'eclipse'
|
||||||
apply plugin: 'idea'
|
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')) {
|
if (project.hasProperty('platformVersion')) {
|
||||||
apply plugin: 'spring-io'
|
apply plugin: 'spring-io'
|
||||||
@@ -33,17 +47,19 @@ if (project.hasProperty('platformVersion')) {
|
|||||||
group = 'org.springframework.integration'
|
group = 'org.springframework.integration'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'http://repo.spring.io/libs-milestone' }
|
maven { url 'http://repo.spring.io/libs-snapshot' }
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = 1.6
|
compileJava {
|
||||||
targetCompatibility = 1.6
|
sourceCompatibility = 1.8
|
||||||
|
targetCompatibility = 1.8
|
||||||
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
|
|
||||||
commonsLangVersion = '2.6'
|
commonsLangVersion = '2.6'
|
||||||
jacocoVersion = '0.7.1.201405082137'
|
log4jVersion = '2.7'
|
||||||
springIntegrationVersion = '4.0.5.RELEASE'
|
springIntegrationVersion = '5.0.0.BUILD-SNAPSHOT'
|
||||||
|
|
||||||
linkHomepage = 'https://github.com/spring-projects/spring-integration-extensions'
|
linkHomepage = 'https://github.com/spring-projects/spring-integration-extensions'
|
||||||
linkCi = 'https://build.spring.io/browse/INTEXT'
|
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-test:$springIntegrationVersion"
|
||||||
testCompile "org.springframework.integration:spring-integration-groovy:$springIntegrationVersion"
|
testCompile "org.springframework.integration:spring-integration-groovy:$springIntegrationVersion"
|
||||||
testCompile "org.springframework.integration:spring-integration-jmx:$springIntegrationVersion"
|
testCompile "org.springframework.integration:spring-integration-jmx:$springIntegrationVersion"
|
||||||
|
testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
|
||||||
jacoco "org.jacoco:org.jacoco.agent:$jacocoVersion:runtime"
|
testRuntime "org.apache.logging.log4j:log4j-jcl:$log4jVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -79,12 +95,8 @@ eclipse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
jacoco {
|
||||||
test {
|
toolVersion = "0.7.8"
|
||||||
resources {
|
|
||||||
srcDirs = ['src/test/resources', 'src/test/java']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// enable all compiler warnings; individual projects may customize further
|
// enable all compiler warnings; individual projects may customize further
|
||||||
@@ -93,9 +105,22 @@ sourceSets {
|
|||||||
test {
|
test {
|
||||||
// suppress all console output during testing unless running `gradle -i`
|
// suppress all console output during testing unless running `gradle -i`
|
||||||
logging.captureStandardOutput(LogLevel.INFO)
|
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) {
|
task sourcesJar(type: Jar) {
|
||||||
classifier = 'sources'
|
classifier = 'sources'
|
||||||
from sourceSets.main.allJava
|
from sourceSets.main.allJava
|
||||||
@@ -111,10 +136,8 @@ artifacts {
|
|||||||
archives javadocJar
|
archives javadocJar
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'sonar-runner'
|
sonarqube {
|
||||||
|
properties {
|
||||||
sonarRunner {
|
|
||||||
sonarProperties {
|
|
||||||
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
|
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
|
||||||
property "sonar.links.homepage", linkHomepage
|
property "sonar.links.homepage", linkHomepage
|
||||||
property "sonar.links.ci", linkCi
|
property "sonar.links.ci", linkCi
|
||||||
@@ -234,10 +257,4 @@ task dist(dependsOn: assemble) {
|
|||||||
description = 'Builds -dist, -docs and -schema distribution archives.'
|
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'
|
defaultTasks 'build'
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
version=1.0.1.BUILD-SNAPSHOT
|
version=2.0.0.BUILD-SNAPSHOT
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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
|
||||||
|
|||||||
74
gradlew
vendored
74
gradlew
vendored
@@ -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.
|
# Attempt to set APP_HOME
|
||||||
DEFAULT_JVM_OPTS=""
|
# 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_NAME="Gradle"
|
||||||
APP_BASE_NAME=`basename "$0"`
|
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.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD="maximum"
|
||||||
|
|
||||||
@@ -30,6 +48,7 @@ die ( ) {
|
|||||||
cygwin=false
|
cygwin=false
|
||||||
msys=false
|
msys=false
|
||||||
darwin=false
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
case "`uname`" in
|
case "`uname`" in
|
||||||
CYGWIN* )
|
CYGWIN* )
|
||||||
cygwin=true
|
cygwin=true
|
||||||
@@ -40,31 +59,11 @@ case "`uname`" in
|
|||||||
MINGW* )
|
MINGW* )
|
||||||
msys=true
|
msys=true
|
||||||
;;
|
;;
|
||||||
|
NONSTOP* )
|
||||||
|
nonstop=true
|
||||||
|
;;
|
||||||
esac
|
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
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -90,7 +89,7 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# 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`
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
@@ -114,6 +113,7 @@ fi
|
|||||||
if $cygwin ; then
|
if $cygwin ; then
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
@@ -154,11 +154,19 @@ if $cygwin ; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
# Escape application args
|
||||||
function splitJvmOpts() {
|
save ( ) {
|
||||||
JVM_OPTS=("$@")
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
|
echo " "
|
||||||
}
|
}
|
||||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
APP_ARGS=$(save "$@")
|
||||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
|
||||||
|
|
||||||
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" "$@"
|
||||||
|
|||||||
174
gradlew.bat
vendored
174
gradlew.bat
vendored
@@ -1,90 +1,84 @@
|
|||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%" == "" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables with windows NT shell
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
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 DIRNAME=%~dp0
|
||||||
set DEFAULT_JVM_OPTS=
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
set DIRNAME=%~dp0
|
set APP_HOME=%DIRNAME%
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
|
||||||
set APP_BASE_NAME=%~n0
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set APP_HOME=%DIRNAME%
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
echo.
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation.
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
:findJavaFromJavaHome
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
echo.
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation.
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:init
|
:init
|
||||||
@rem Get command-line arguments, handling Windowz variants
|
@rem Get command-line arguments, handling Windows variants
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
|
||||||
|
:win9xME_args
|
||||||
:win9xME_args
|
@rem Slurp the command line arguments.
|
||||||
@rem Slurp the command line arguments.
|
set CMD_LINE_ARGS=
|
||||||
set CMD_LINE_ARGS=
|
set _SKIP=2
|
||||||
set _SKIP=2
|
|
||||||
|
:win9xME_args_slurp
|
||||||
:win9xME_args_slurp
|
if "x%~1" == "x" goto execute
|
||||||
if "x%~1" == "x" goto execute
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
set CMD_LINE_ARGS=%*
|
|
||||||
goto execute
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
:4NT_args
|
|
||||||
@rem Get arguments from the 4NT Shell from JP Software
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
set CMD_LINE_ARGS=%$
|
|
||||||
|
@rem Execute Gradle
|
||||||
:execute
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
@rem Setup the command line
|
|
||||||
|
:end
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
@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%
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
:end
|
rem the _cmd.exe /c_ return code!
|
||||||
@rem End local scope for the variables with windows NT shell
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
exit /b 1
|
||||||
|
|
||||||
:fail
|
:mainEnd
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
:omega
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
||||||
|
|||||||
183
pom.xml
183
pom.xml
@@ -1,183 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>org.springframework.integration</groupId>
|
|
||||||
<artifactId>spring-integration-flow</artifactId>
|
|
||||||
<version>4.0.0.BUILD-SNAPSHOT</version>
|
|
||||||
<name>Spring Integration Flow Support</name>
|
|
||||||
<properties>
|
|
||||||
<spring.version>4.0.7.RELEASE</spring.version>
|
|
||||||
<spring.integration.version>4.0.4.RELEASE</spring.integration.version>
|
|
||||||
<project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<licenses>
|
|
||||||
<license>
|
|
||||||
<name>The Apache Software License, Version 2.0</name>
|
|
||||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
|
||||||
<distribution>repo</distribution>
|
|
||||||
</license>
|
|
||||||
</licenses>
|
|
||||||
<build>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/java</directory>
|
|
||||||
<includes>
|
|
||||||
<include>**/*</include>
|
|
||||||
</includes>
|
|
||||||
<excludes>
|
|
||||||
<exclude>**/*.java</exclude>
|
|
||||||
</excludes>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
<includes>
|
|
||||||
<include>**/*</include>
|
|
||||||
</includes>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
<testResources>
|
|
||||||
<testResource>
|
|
||||||
<directory>src/test/java</directory>
|
|
||||||
<includes>
|
|
||||||
<include>**/*</include>
|
|
||||||
</includes>
|
|
||||||
<excludes>
|
|
||||||
<exclude>**/*.java</exclude>
|
|
||||||
</excludes>
|
|
||||||
</testResource>
|
|
||||||
<testResource>
|
|
||||||
<directory>src/test/resources</directory>
|
|
||||||
<includes>
|
|
||||||
<include>**/*</include>
|
|
||||||
</includes>
|
|
||||||
</testResource>
|
|
||||||
</testResources>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>1.6</source>
|
|
||||||
<target>1.6</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<includes>
|
|
||||||
<include>**/*Tests.java</include>
|
|
||||||
</includes>
|
|
||||||
<excludes>
|
|
||||||
<exclude>**/*Abstract*.java</exclude>
|
|
||||||
</excludes>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>SpringSource Plugin Repository</id>
|
|
||||||
<url>http://repo.springsource.org/plugins-release</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>SpringSource Milestone Repository</id>
|
|
||||||
<url>http://repo.springsource.org/libs-milestone</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>SpringSource Snapshot Repository</id>
|
|
||||||
<url>http://repo.springsource.org/libs-snapshot</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-test</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-tx</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.integration</groupId>
|
|
||||||
<artifactId>spring-integration-test</artifactId>
|
|
||||||
<version>${spring.integration.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cglib</groupId>
|
|
||||||
<artifactId>cglib-nodep</artifactId>
|
|
||||||
<version>2.2</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>log4j</groupId>
|
|
||||||
<artifactId>log4j</artifactId>
|
|
||||||
<version>1.2.12</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.integration</groupId>
|
|
||||||
<artifactId>spring-integration-core</artifactId>
|
|
||||||
<version>${spring.integration.version}</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.easymock</groupId>
|
|
||||||
<artifactId>easymock</artifactId>
|
|
||||||
<version>2.3</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.easymock</groupId>
|
|
||||||
<artifactId>easymockclassextension</artifactId>
|
|
||||||
<version>2.3</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.integration</groupId>
|
|
||||||
<artifactId>spring-integration-groovy</artifactId>
|
|
||||||
<version>${spring.integration.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-context</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.hamcrest</groupId>
|
|
||||||
<artifactId>hamcrest-all</artifactId>
|
|
||||||
<version>1.1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mockito</groupId>
|
|
||||||
<artifactId>mockito-all</artifactId>
|
|
||||||
<version>1.8.4</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-lang</groupId>
|
|
||||||
<artifactId>commons-lang</artifactId>
|
|
||||||
<version>2.6</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.integration</groupId>
|
|
||||||
<artifactId>spring-integration-jmx</artifactId>
|
|
||||||
<version>${spring.integration.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit-dep</artifactId>
|
|
||||||
<version>4.8.2</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Manifest-Version: 1.0
|
|
||||||
Class-Path:
|
|
||||||
|
|
||||||
@@ -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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* 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
|
* 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
|
* 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.
|
* specific language governing permissions and limitations under the License.
|
||||||
@@ -13,33 +13,35 @@
|
|||||||
package org.springframework.integration.flow.config.xml;
|
package org.springframework.integration.flow.config.xml;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.BeanCreationException;
|
import org.springframework.beans.factory.BeanCreationException;
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author David Turanski
|
* @author David Turanski
|
||||||
|
* @author Gary Russell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class FlowContextTests {
|
public class FlowContextTests {
|
||||||
@Test(expected=BeanCreationException.class)
|
@Test(expected=BeanCreationException.class)
|
||||||
public void testChannelConflictShouldThrowException() {
|
public void testChannelConflictShouldThrowException() {
|
||||||
try {
|
try {
|
||||||
new ClassPathXmlApplicationContext(
|
new ClassPathXmlApplicationContext(
|
||||||
"/org/springframework/integration/flow/config/xml/FlowContextTests-context.xml");
|
"/org/springframework/integration/flow/config/xml/FlowContextTests-context.xml").close();
|
||||||
} catch (BeanCreationException e) {
|
} catch (BeanCreationException e) {
|
||||||
System.out.println(e.getCause().getMessage());
|
System.out.println(e.getCause().getMessage());
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFlowWithJMX() {
|
public void testFlowWithJMX() {
|
||||||
|
|
||||||
new ClassPathXmlApplicationContext(
|
new ClassPathXmlApplicationContext(
|
||||||
"/org/springframework/integration/flow/config/xml/FlowContextTests-jmx-context.xml");
|
"/org/springframework/integration/flow/config/xml/FlowContextTests-jmx-context.xml").close();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
* 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
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
* the License at
|
* the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
* 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 static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
import org.springframework.messaging.Message;
|
import org.springframework.messaging.Message;
|
||||||
import org.springframework.messaging.MessageChannel;
|
import org.springframework.messaging.MessageChannel;
|
||||||
import org.springframework.messaging.MessagingException;
|
|
||||||
import org.springframework.messaging.MessageHandler;
|
import org.springframework.messaging.MessageHandler;
|
||||||
|
import org.springframework.messaging.MessagingException;
|
||||||
import org.springframework.messaging.PollableChannel;
|
import org.springframework.messaging.PollableChannel;
|
||||||
import org.springframework.messaging.SubscribableChannel;
|
import org.springframework.messaging.SubscribableChannel;
|
||||||
import org.springframework.messaging.support.GenericMessage;
|
import org.springframework.messaging.support.GenericMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author David Turanski
|
* @author David Turanski
|
||||||
*
|
* @author Gary Russell
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class FlowWithErrorTests {
|
public class FlowWithErrorTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFlowThrowsExceptionWithGatewayErrorChannel() {
|
public void testFlowThrowsExceptionWithGatewayErrorChannel() {
|
||||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||||
"/org/springframework/integration/flow/config/xml/FlowWithErrorTests-context.xml");
|
"/org/springframework/integration/flow/config/xml/FlowWithErrorTests-context.xml");
|
||||||
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
|
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
|
||||||
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel", SubscribableChannel.class);
|
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel", SubscribableChannel.class);
|
||||||
@@ -48,18 +50,19 @@ public class FlowWithErrorTests {
|
|||||||
errorChannel.subscribe(handler);
|
errorChannel.subscribe(handler);
|
||||||
inputChannel.send(msg);
|
inputChannel.send(msg);
|
||||||
assertTrue(handler.gotResponse);
|
assertTrue(handler.gotResponse);
|
||||||
|
applicationContext.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDirectCallWithErrorChannel() {
|
public void testDirectCallWithErrorChannel() {
|
||||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||||
"classpath:/META-INF/spring/integration/flows/subflow5/subflow5-context.xml");
|
"classpath:/META-INF/spring/integration/flows/subflow5/subflow5-context.xml");
|
||||||
MessageChannel inputChannel = applicationContext.getBean("subflow-input", MessageChannel.class);
|
MessageChannel inputChannel = applicationContext.getBean("subflow-input", MessageChannel.class);
|
||||||
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel", SubscribableChannel.class);
|
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel", SubscribableChannel.class);
|
||||||
|
|
||||||
errorChannel.subscribe(new MessageHandler() {
|
errorChannel.subscribe(new MessageHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void handleMessage(Message<?> message) throws MessagingException {
|
public void handleMessage(Message<?> message) throws MessagingException {
|
||||||
assertTrue(message.getPayload() instanceof MessagingException);
|
assertTrue(message.getPayload() instanceof MessagingException);
|
||||||
}
|
}
|
||||||
@@ -67,11 +70,12 @@ public class FlowWithErrorTests {
|
|||||||
|
|
||||||
Message<String> msg = new GenericMessage<String>("hello");
|
Message<String> msg = new GenericMessage<String>("hello");
|
||||||
assertTrue(inputChannel.send(msg));
|
assertTrue(inputChannel.send(msg));
|
||||||
|
applicationContext.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWithErrorChannel() {
|
public void testWithErrorChannel() {
|
||||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||||
"/org/springframework/integration/flow/config/xml/FlowWithErrorTests-context.xml");
|
"/org/springframework/integration/flow/config/xml/FlowWithErrorTests-context.xml");
|
||||||
MessageChannel inputChannel = applicationContext.getBean("inputC1", MessageChannel.class);
|
MessageChannel inputChannel = applicationContext.getBean("inputC1", MessageChannel.class);
|
||||||
PollableChannel output = applicationContext.getBean("outputC1", PollableChannel.class);
|
PollableChannel output = applicationContext.getBean("outputC1", PollableChannel.class);
|
||||||
@@ -81,6 +85,7 @@ public class FlowWithErrorTests {
|
|||||||
Message<?> reply = output.receive(100);
|
Message<?> reply = output.receive(100);
|
||||||
assertNotNull(reply);
|
assertNotNull(reply);
|
||||||
assertTrue(reply.getPayload() instanceof MessagingException);
|
assertTrue(reply.getPayload() instanceof MessagingException);
|
||||||
|
applicationContext.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler implements MessageHandler {
|
private static class Handler implements MessageHandler {
|
||||||
@@ -91,11 +96,12 @@ public class FlowWithErrorTests {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see
|
* @see
|
||||||
* org.springframework.messaging.MessageHandler#handleMessage
|
* org.springframework.messaging.MessageHandler#handleMessage
|
||||||
* (org.springframework.messaging.Message)
|
* (org.springframework.messaging.Message)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void handleMessage(Message<?> message) throws MessagingException {
|
public void handleMessage(Message<?> message) throws MessagingException {
|
||||||
this.gotResponse = true;
|
this.gotResponse = true;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
|
|||||||
@@ -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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* 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
|
* 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
|
* 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.
|
* 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 static org.junit.Assert.fail;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
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.FlowConstants;
|
||||||
import org.springframework.integration.flow.Transaction.StubTransactionManager;
|
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.ErrorMessage;
|
||||||
import org.springframework.messaging.support.GenericMessage;
|
import org.springframework.messaging.support.GenericMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author David Turanski
|
* @author David Turanski
|
||||||
*
|
* @author Gary Russell
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public class TransactionalFlowTests {
|
public class TransactionalFlowTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFlowDirectCommit() {
|
public void testFlowDirectCommit() {
|
||||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||||
"/META-INF/spring/integration/flows/transactional-flow/flow-context.xml",
|
"/META-INF/spring/integration/flows/transactional-flow/flow-context.xml",
|
||||||
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
|
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
|
||||||
MessageChannel inputChannel = applicationContext.getBean("inputChannel", MessageChannel.class);
|
MessageChannel inputChannel = applicationContext.getBean("inputChannel", MessageChannel.class);
|
||||||
SubscribableChannel outputChannel = applicationContext.getBean("outputChannel", SubscribableChannel.class);
|
SubscribableChannel outputChannel = applicationContext.getBean("outputChannel", SubscribableChannel.class);
|
||||||
@@ -49,12 +52,13 @@ public class TransactionalFlowTests {
|
|||||||
assertTrue(handler.messageReceived);
|
assertTrue(handler.messageReceived);
|
||||||
assertTrue(transactionManager.committed);
|
assertTrue(transactionManager.committed);
|
||||||
assertFalse(transactionManager.rolledback);
|
assertFalse(transactionManager.rolledback);
|
||||||
|
applicationContext.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFlowDirectRollback() {
|
public void testFlowDirectRollback() {
|
||||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||||
"/META-INF/spring/integration/flows/transactional-flow/flow-context.xml",
|
"/META-INF/spring/integration/flows/transactional-flow/flow-context.xml",
|
||||||
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
|
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
|
||||||
MessageChannel inputChannel = applicationContext.getBean("inputChannel", MessageChannel.class);
|
MessageChannel inputChannel = applicationContext.getBean("inputChannel", MessageChannel.class);
|
||||||
SubscribableChannel outputChannel = applicationContext.getBean("outputChannel", SubscribableChannel.class);
|
SubscribableChannel outputChannel = applicationContext.getBean("outputChannel", SubscribableChannel.class);
|
||||||
@@ -70,12 +74,13 @@ public class TransactionalFlowTests {
|
|||||||
assertTrue(transactionManager.rolledback);
|
assertTrue(transactionManager.rolledback);
|
||||||
assertFalse(transactionManager.committed);
|
assertFalse(transactionManager.committed);
|
||||||
}
|
}
|
||||||
|
applicationContext.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFlowCommit() {
|
public void testFlowCommit() {
|
||||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||||
"/org/springframework/integration/flow/config/xml/TransactionalFlowTests-context.xml",
|
"/org/springframework/integration/flow/config/xml/TransactionalFlowTests-context.xml",
|
||||||
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
|
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
|
||||||
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
|
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
|
||||||
SubscribableChannel outputChannel = applicationContext.getBean("outputC", SubscribableChannel.class);
|
SubscribableChannel outputChannel = applicationContext.getBean("outputC", SubscribableChannel.class);
|
||||||
@@ -86,12 +91,13 @@ public class TransactionalFlowTests {
|
|||||||
assertTrue(handler.messageReceived);
|
assertTrue(handler.messageReceived);
|
||||||
assertTrue(transactionManager.committed);
|
assertTrue(transactionManager.committed);
|
||||||
assertFalse(transactionManager.rolledback);
|
assertFalse(transactionManager.rolledback);
|
||||||
|
applicationContext.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFlowRollbackWithGatewayErrorChannel() {
|
public void testFlowRollbackWithGatewayErrorChannel() {
|
||||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||||
"/org/springframework/integration/flow/config/xml/TransactionalFlowTests-context.xml",
|
"/org/springframework/integration/flow/config/xml/TransactionalFlowTests-context.xml",
|
||||||
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
|
"/org/springframework/integration/flow/config/xml/txmanager-config.xml");
|
||||||
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
|
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
|
||||||
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel", SubscribableChannel.class);
|
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel", SubscribableChannel.class);
|
||||||
@@ -107,7 +113,7 @@ public class TransactionalFlowTests {
|
|||||||
handler.message.getHeaders().get(FlowConstants.FLOW_OUTPUT_PORT_HEADER));
|
handler.message.getHeaders().get(FlowConstants.FLOW_OUTPUT_PORT_HEADER));
|
||||||
assertTrue(transactionManager.rolledback);
|
assertTrue(transactionManager.rolledback);
|
||||||
assertFalse(transactionManager.committed);
|
assertFalse(transactionManager.committed);
|
||||||
|
applicationContext.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler implements MessageHandler {
|
private static class Handler implements MessageHandler {
|
||||||
@@ -117,12 +123,13 @@ public class TransactionalFlowTests {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see
|
* @see
|
||||||
* org.springframework.messaging.MessageHandler#handleMessage
|
* org.springframework.messaging.MessageHandler#handleMessage
|
||||||
* (org.springframework.messaging.Message)
|
* (org.springframework.messaging.Message)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
public void handleMessage(Message<?> message) throws MessagingException {
|
public void handleMessage(Message<?> message) throws MessagingException {
|
||||||
this.messageReceived = true;
|
this.messageReceived = true;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
|
||||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
|
||||||
|
|
||||||
<!-- Appenders -->
|
|
||||||
<appender name="console" class="org.apache.log4j.ConsoleAppender">
|
|
||||||
<param name="Target" value="System.out" />
|
|
||||||
<layout class="org.apache.log4j.PatternLayout">
|
|
||||||
<param name="ConversionPattern" value="[%t] %-5p: %c - %m%n" />
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Loggers -->
|
|
||||||
<logger name="org.springframework">
|
|
||||||
<level value="warn" />
|
|
||||||
</logger>
|
|
||||||
|
|
||||||
<logger name="org.springframework.integration">
|
|
||||||
<level value="info" />
|
|
||||||
</logger>
|
|
||||||
|
|
||||||
<logger name="org.springframework.integration.flow">
|
|
||||||
<level value="info" />
|
|
||||||
</logger>
|
|
||||||
|
|
||||||
<!-- Root Logger -->
|
|
||||||
<root>
|
|
||||||
<priority value="info" />
|
|
||||||
<appender-ref ref="console" />
|
|
||||||
</root>
|
|
||||||
|
|
||||||
</log4j:configuration>
|
|
||||||
15
src/test/resources/log4j2-test.xml
Normal file
15
src/test/resources/log4j2-test.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Configuration> <!-- status="trace"> -->
|
||||||
|
<Appenders>
|
||||||
|
<Console name="STDOUT" target="SYSTEM_OUT">
|
||||||
|
<PatternLayout pattern="%d %5p %c [%t] : %m%n" />
|
||||||
|
</Console>
|
||||||
|
</Appenders>
|
||||||
|
<Loggers>
|
||||||
|
<Logger name="org.springframework" level="warn"/>
|
||||||
|
<Logger name="org.springframework.integration" level="warn"/>
|
||||||
|
<Root level="info">
|
||||||
|
<AppenderRef ref="STDOUT" />
|
||||||
|
</Root>
|
||||||
|
</Loggers>
|
||||||
|
</Configuration>
|
||||||
Reference in New Issue
Block a user