Skip to content

Commit

Permalink
INTSAMPLES-127 Polishing
Browse files Browse the repository at this point in the history
- PR Comments
- Switch to Jackson2
- Fix oxm config

Polishing

INTSAMPLES-127 Update to SI 4.0.0.RC1

INTSAMPLES-127 Remove Servlet Dependency

travel sample; see INT-3350.

INTSAMPLES-127 Update Samples to SI 4.0.0

JIRA: https://jira.spring.io/browse/INTSAMPLES-127

Created `maint` branch for ongoing SI 3.0.x samples.
  • Loading branch information
garyrussell authored and Artem Bilan committed Apr 16, 2014
1 parent c5b1ace commit cc57922
Show file tree
Hide file tree
Showing 93 changed files with 262 additions and 292 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Spring Integration Samples
==========================

# Note

This (master) branch requires Spring Integration 4.0 or above. For samples running against earlier versions of Spring Integration, use the __maint__ branch.

# Introduction

Welcome to the **Spring Integration Samples** repository which provides **50+ samples** to help you learn [Spring Integration][]. To simplify your experience, the *Spring Integration* samples are split into 4 distinct categories:
Expand Down
4 changes: 2 additions & 2 deletions advanced/advanced-testing-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>3.0.2.RELEASE</spring.integration.version>
<spring.version>3.2.8.RELEASE</spring.version>
<spring.integration.version>4.0.0.RC1</spring.integration.version>
<spring.version>4.0.3.RELEASE</spring.version>
<log4j.version>1.2.17</log4j.version>
<junit.version>4.11</junit.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.MessagingException;
import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.core.SubscribableChannel;
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.jms.core.JmsTemplate;
import org.springframework.jms.support.converter.SimpleMessageConverter;
Expand Down
11 changes: 8 additions & 3 deletions advanced/dynamic-ftp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>3.0.2.RELEASE</spring.integration.version>
<spring.version>3.2.8.RELEASE</spring.version>
<spring.integration.version>4.0.0.RC1</spring.integration.version>
<spring.version>4.0.3.RELEASE</spring.version>
<log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version>
<junit.version>4.11</junit.version>
</properties>
<dependencies>
<dependency>
Expand All @@ -34,6 +34,11 @@
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
<build>
<testResources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.env.PropertiesPropertySource;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.integration.MessageChannel;
import org.springframework.messaging.MessageChannel;

/**
* Demonstrates how a dynamic Spring Integration flow snippet can be used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static org.junit.Assert.*;

import org.junit.Test;
import org.springframework.integration.MessageChannel;
import org.springframework.messaging.MessageChannel;

/**
* @author Gary Russell
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 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 @@ -15,19 +15,22 @@
*/
package org.springframework.integration.samples.ftp;

import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.net.UnknownHostException;

import org.junit.Test;

import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.MessagingException;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessagingException;

/**
* @author Gary Russell
Expand All @@ -47,25 +50,28 @@ public void runDemo() throws Exception{
.build();
try {
channel.send(message);
} catch (MessagingException e) {
assertTrue(e.getCause().getCause() instanceof UnknownHostException);
assertTrue(e.getCause().getCause().getMessage().startsWith("host.for.cust1"));
}
catch (MessagingException e) {
assertThat(e.getCause().getCause().getCause(), instanceOf(UnknownHostException.class));
assertTrue(e.getCause().getCause().getCause().getMessage().startsWith("host.for.cust1"));
}
// send another so we can see in the log we don't create the ac again.
try {
channel.send(message);
} catch (MessagingException e) {
assertTrue(e.getCause().getCause() instanceof UnknownHostException);
assertTrue(e.getCause().getCause().getMessage().startsWith("host.for.cust1"));
}
catch (MessagingException e) {
assertThat(e.getCause().getCause().getCause(), instanceOf(UnknownHostException.class));
assertTrue(e.getCause().getCause().getCause().getMessage().startsWith("host.for.cust1"));
}
// send to a different customer; again, check the log to see a new ac is built
message = MessageBuilder.withPayload(file)
.setHeader("customer", "cust2").build();
try {
channel.send(message);
} catch (MessagingException e) {
assertTrue(e.getCause().getCause() instanceof UnknownHostException);
assertTrue(e.getCause().getCause().getMessage().startsWith("host.for.cust2"));
}
catch (MessagingException e) {
assertThat(e.getCause().getCause().getCause(), instanceOf(UnknownHostException.class));
assertTrue(e.getCause().getCause().getCause().getMessage().startsWith("host.for.cust2"));
}

// send to a different customer; again, check the log to see a new ac is built
Expand All @@ -74,9 +80,10 @@ public void runDemo() throws Exception{
.setHeader("customer", "cust3").build();
try {
channel.send(message);
} catch (MessagingException e) {
assertTrue(e.getCause().getCause() instanceof UnknownHostException);
assertTrue(e.getCause().getCause().getMessage().startsWith("host.for.cust3"));
}
catch (MessagingException e) {
assertThat(e.getCause().getCause().getCause(), instanceOf(UnknownHostException.class));
assertTrue(e.getCause().getCause().getCause().getMessage().startsWith("host.for.cust3"));
}

//send to cust1 again, since this one has been invalidated before, we should
Expand All @@ -85,9 +92,10 @@ public void runDemo() throws Exception{
.setHeader("customer", "cust1").build();
try {
channel.send(message);
} catch (MessagingException e) {
assertTrue(e.getCause().getCause() instanceof UnknownHostException);
assertEquals("host.for.cust1", e.getCause().getCause().getMessage());
}
catch (MessagingException e) {
assertThat(e.getCause().getCause().getCause(), instanceOf(UnknownHostException.class));
assertEquals("host.for.cust1", e.getCause().getCause().getCause().getMessage());
}

ctx.close();
Expand Down
4 changes: 2 additions & 2 deletions applications/cafe-scripted/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<name>Samples (Applications) - Cafe Sample (Scripted Implementation)</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>3.0.2.RELEASE</spring.integration.version>
<spring.version>3.2.8.RELEASE</spring.version>
<spring.integration.version>4.0.0.RC1</spring.integration.version>
<spring.version>4.0.3.RELEASE</spring.version>
<log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- Obtain a connection to the RabbitMQ via cloudfoundry-runtime: -->
<beans profile="cloud">
<cloud:rabbit-connection-factory id="rabbitConnectionFactory" />
<!-- <cloud:rabbit-connection-factory id="rabbitConnectionFactory" /> -->
</beans>

<!-- connect to the local broker using the default user name and password -->
Expand Down
10 changes: 5 additions & 5 deletions applications/cafe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>3.0.2.RELEASE</spring.integration.version>
<spring.version>3.2.8.RELEASE</spring.version>
<spring.integration.version>4.0.0.RC1</spring.integration.version>
<spring.version>4.0.3.RELEASE</spring.version>
<log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version>
</properties>
Expand All @@ -49,9 +49,9 @@
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.2</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
Expand Down
2 changes: 1 addition & 1 deletion applications/loan-broker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<name>Samples (Applications) - Loan Broker</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>3.0.2.RELEASE</spring.integration.version>
<spring.integration.version>4.0.0.RC1</spring.integration.version>
<commons-logging.version>1.1.1</commons-logging.version>
<log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version>
Expand Down
76 changes: 2 additions & 74 deletions applications/loanshark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>3.0.2.RELEASE</spring.integration.version>
<spring.version>3.2.8.RELEASE</spring.version>
<aspectj.version>1.6.10</aspectj.version>
<spring.integration.version>4.0.0.RC1</spring.integration.version>
<spring.version>4.0.3.RELEASE</spring.version>
<slf4j.version>1.6.1</slf4j.version>
</properties>
<repositories>
Expand Down Expand Up @@ -49,11 +48,6 @@
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
Expand Down Expand Up @@ -99,11 +93,6 @@
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
Expand Down Expand Up @@ -345,43 +334,6 @@
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.0</version>
<dependencies>
<!-- NB: You must use Maven 2.0.9 or above or these are ignored (see MNG-2972) -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<outxml>true</outxml>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down Expand Up @@ -416,30 +368,6 @@
<version>2.5</version>
</plugin>
<!-- IDE -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.7</version> <!-- Note 2.8 does not work with AspectJ aspect path -->
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<wtpversion>2.0</wtpversion>
<additionalBuildcommands>
<buildCommand>
<name>org.eclipse.ajdt.core.ajbuilder</name>
<arguments>
<aspectPath>org.springframework.aspects</aspectPath>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
</buildCommand>
</additionalBuildcommands>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-idea-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion basic/amqp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>3.0.2.RELEASE</spring.integration.version>
<spring.integration.version>4.0.0.RC1</spring.integration.version>
<log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion basic/control-bus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>3.0.2.RELEASE</spring.integration.version>
<spring.integration.version>4.0.0.RC1</spring.integration.version>
<log4j.version>1.2.17</log4j.version>
<junit.version>4.10</junit.version>
</properties>
Expand Down
Loading

0 comments on commit cc57922

Please sign in to comment.