Skip to content
This repository was archived by the owner on Jul 9, 2022. It is now read-only.

Commit 098c09c

Browse files
committed
polished code to comply with upgrade to SI 2.2
1 parent 8431494 commit 098c09c

File tree

7 files changed

+69
-19
lines changed

7 files changed

+69
-19
lines changed

build.gradle

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ apply plugin: 'base'
55
allprojects {
66
group = 'org.springframework.integration'
77

8+
logging.captureStandardOutput LogLevel.DEBUG
9+
810
repositories {
911
mavenCentral()
1012
maven { url 'https://repo.springsource.org/libs-staging-local'}
@@ -27,7 +29,7 @@ subprojects { subproject ->
2729
junitVersion = '4.8.2'
2830
log4jVersion = '1.2.12'
2931
mockitoVersion = '1.9.0'
30-
springintegrationVersion = '2.2.0.M1'
32+
springintegrationVersion = '2.2.0.BUILD-SNAPSHOT'
3133
springGemfireVersion = '1.1.0.RELEASE'
3234

3335
install {
@@ -74,7 +76,7 @@ project('spring-integration-scala-jms') {
7476
description = 'Spring Integration Scala JMS'
7577
dependencies {
7678
compile project(":spring-integration-scala-core")
77-
compile ('org.springframework.integration:spring-integration-jms:$springintegrationVersion')
79+
compile "org.springframework.integration:spring-integration-jms:$springintegrationVersion"
7880
compile ("org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1")
7981

8082
// libraries only needed for test
@@ -92,15 +94,15 @@ project('spring-integration-scala-gemfire') {
9294
}
9395
dependencies {
9496
compile project(":spring-integration-scala-core")
95-
compile ('org.springframework.integration:spring-integration-gemfire:$springintegrationVersion')
97+
compile "org.springframework.integration:spring-integration-gemfire:$springintegrationVersion"
9698
}
9799
}
98100

99101
project('spring-integration-scala-http') {
100102
description = 'Spring Integration Scala HTTP'
101103
dependencies {
102104
compile project(":spring-integration-scala-core")
103-
compile ('org.springframework.integration:spring-integration-http:$springintegrationVersion')
105+
compile "org.springframework.integration:spring-integration-http:$springintegrationVersion"
104106
}
105107
}
106108

spring-integration-scala-gemfire/src/test/scala/demo/DslUsageDemoTests.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ class DSLUsageDemoTests {
7878
val cacheFactoryBean = new CacheFactoryBean
7979
cacheFactoryBean.afterPropertiesSet
8080
val cache = cacheFactoryBean.getObject.asInstanceOf[Cache]
81-
val region = cache.createRegionFactory[String, String]().create("$")
81+
val region = if (cache.getRegion("$") == null)
82+
cache.createRegionFactory[String, String]().create("$") else cache.getRegion("$")
8283
new GemfireRegion(region, cache)
8384
}
8485
}

spring-integration-scala-gemfire/vf.gf.dmn-events.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,45 @@
274274
2012-05-17T10:26:30,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-17T10:26:30|state=on
275275
2012-05-17T10:26:30,INFO,UpdatedLicenseStateEvent,enforcement=soft|licenseType=local|expirationDate=2012-07-16T10:26:30|used=1|available=60|addons=vf.gf.evaluation
276276
2012-05-17T10:26:36,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-17T10:26:36|state=off
277+
2012-05-17T10:45:06,INFO,EventManagerStartedEvent,
278+
2012-05-17T10:45:07,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
279+
2012-05-17T10:45:07,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
280+
2012-05-17T10:45:07,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-17T10:45:07|state=on
281+
2012-05-17T10:45:07,INFO,UpdatedLicenseStateEvent,enforcement=soft|licenseType=local|expirationDate=2012-07-16T10:45:07|used=1|available=60|addons=vf.gf.evaluation
282+
2012-05-17T10:45:26,INFO,EventManagerStartedEvent,
283+
2012-05-17T10:45:27,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
284+
2012-05-17T10:45:27,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
285+
2012-05-17T10:45:27,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-17T10:45:27|state=on
286+
2012-05-17T10:45:27,INFO,UpdatedLicenseStateEvent,enforcement=soft|licenseType=local|expirationDate=2012-07-16T10:45:27|used=1|available=60|addons=vf.gf.evaluation
287+
2012-05-17T10:46:22,INFO,EventManagerStartedEvent,
288+
2012-05-17T10:46:22,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
289+
2012-05-17T10:46:22,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
290+
2012-05-17T10:46:22,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-17T10:46:22|state=on
291+
2012-05-17T10:46:22,INFO,UpdatedLicenseStateEvent,enforcement=soft|licenseType=local|expirationDate=2012-07-16T10:46:22|used=1|available=60|addons=vf.gf.evaluation
292+
2012-05-17T10:46:28,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-17T10:46:28|state=off
293+
2012-05-17T10:49:28,INFO,EventManagerStartedEvent,
294+
2012-05-17T10:49:28,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
295+
2012-05-17T10:49:28,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
296+
2012-05-17T10:49:28,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-17T10:49:28|state=on
297+
2012-05-17T10:49:28,INFO,UpdatedLicenseStateEvent,enforcement=soft|licenseType=local|expirationDate=2012-07-16T10:49:28|used=1|available=60|addons=vf.gf.evaluation
298+
2012-05-17T10:49:34,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-17T10:49:34|state=off
299+
2012-05-17T10:50:00,INFO,EventManagerStartedEvent,
300+
2012-05-17T10:50:00,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
301+
2012-05-17T10:50:00,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
302+
2012-05-17T10:50:00,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-17T10:50:00|state=on
303+
2012-05-17T10:50:00,INFO,UpdatedLicenseStateEvent,enforcement=soft|licenseType=local|expirationDate=2012-07-16T10:50:00|used=1|available=60|addons=vf.gf.evaluation
304+
2012-05-22T10:12:24,INFO,EventManagerStartedEvent,
305+
2012-05-22T10:12:24,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
306+
2012-05-22T10:12:24,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
307+
2012-05-22T10:12:24,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-22T10:12:24|state=on
308+
2012-05-22T10:12:24,INFO,UpdatedLicenseStateEvent,enforcement=soft|licenseType=local|expirationDate=2012-07-21T10:12:24|used=1|available=60|addons=vf.gf.evaluation
309+
2012-05-22T10:14:35,INFO,EventManagerStartedEvent,
310+
2012-05-22T10:14:35,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
311+
2012-05-22T10:14:35,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
312+
2012-05-22T10:14:35,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-22T10:14:35|state=on
313+
2012-05-22T10:14:35,INFO,UpdatedLicenseStateEvent,enforcement=soft|licenseType=local|expirationDate=2012-07-21T10:14:35|used=1|available=60|addons=vf.gf.evaluation
314+
2012-05-22T10:19:17,INFO,EventManagerStartedEvent,
315+
2012-05-22T10:19:18,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
316+
2012-05-22T10:19:18,INFO,LicenseActivatedEvent,expirationDate=unset|expirationType=floating-eval|serialNumber=G04E0-MFK43-M8E1H-0ZARK-AV25A|allowedVersions=vf.gf.dmn-6|available=60
317+
2012-05-22T10:19:18,INFO,ComponentStateChangeEvent,instanceIdType=self|instanceId=self|timestamp=2012-05-22T10:19:18|state=on
318+
2012-05-22T10:19:18,INFO,UpdatedLicenseStateEvent,enforcement=soft|licenseType=local|expirationDate=2012-07-21T10:19:18|used=1|available=60|addons=vf.gf.evaluation
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# vf.gf.dmn written May 17, 2012 10:26:36 AM EDT
2-
instance.self=self,off,1337264796085
1+
# vf.gf.dmn written May 22, 2012 10:19:18 AM EDT
2+
instance.self=self,on,1337696358151

spring-integration-scala-http/src/main/scala/org/springframework/integration/dsl/HttpOutboundGatewayDsl.scala

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ private[dsl] class HttpOutboundGateway(name: String = "$http_out_" + UUID.random
145145
beansElement.setAttribute("xsi:schemaLocation", schemaLocation +
146146
" http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http.xsd")
147147

148+
148149
val element = document.createElement("int-http:outbound-gateway")
149150
element.setAttribute("id", this.name)
150151

@@ -153,17 +154,19 @@ private[dsl] class HttpOutboundGateway(name: String = "$http_out_" + UUID.random
153154

154155
this.target match {
155156
case fn: Function[_, _] => {
157+
val targetDefinition = targetDefinitionFunction.apply(this.target)
158+
156159
element.setAttribute("url", "{url}")
157-
val targetDefinnition = targetDefinitionFunction.apply(this.target)
160+
158161
val uriVarElement = document.createElement("int-http:uri-variable")
159162
uriVarElement.setAttribute("name", "url")
160163
val expressionParam =
161-
if (targetDefinnition._2.startsWith("sendMessage")) "#this"
162-
else if (targetDefinnition._2.startsWith("sendPayloadAndHeaders")) "payload, headers"
163-
else if (targetDefinnition._2.startsWith("sendPayload")) "payload"
164+
if (targetDefinition._2.startsWith("sendMessage")) "#this"
165+
else if (targetDefinition._2.startsWith("sendPayloadAndHeaders")) "payload, headers"
166+
else if (targetDefinition._2.startsWith("sendPayload")) "payload"
164167

165-
uriVarElement.setAttribute("expression", "@" + targetDefinnition._1 + "." +
166-
targetDefinnition._2 + "(" + expressionParam + ")")
168+
uriVarElement.setAttribute("expression", "@" + targetDefinition._1 + "." +
169+
targetDefinition._2 + "(" + expressionParam + ")")
167170
element.appendChild(uriVarElement)
168171
}
169172
case url: String => {

spring-integration-scala-http/src/test/scala/demo/DslUsageDemoTests.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ package demo
1818
import org.junit.Test
1919
import org.springframework.integration.dsl._
2020
import org.springframework.integration.Message
21+
import org.junit.Ignore
2122

2223
/**
2324
* @author Oleg Zhurakousky
2425
*/
2526
class DSLUsageDemoTests {
2627

2728
@Test
29+
@Ignore
2830
def httpOutboundWithFunctionUrl = {
2931

3032
val tickerService =
@@ -39,8 +41,8 @@ class DSLUsageDemoTests {
3941
val httpFlow =
4042
enrich.header("company" -> { name: String => tickerService.sendAndReceive[String](name) }) -->
4143
http.GET[String] { ticker: String => "http://www.google.com/finance/info?q=" + ticker } -->
42-
handle { (payload: String, headers: Map[String, _]) =>
43-
println("QUOTES for " + headers.get("company") + " : " + payload)
44+
handle { (payload: String, headers: Map[String, _]) =>
45+
println("QUOTES for " + headers.get("company") + " : " + payload)
4446
}
4547

4648
httpFlow.send("vmw")
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory
1515
object jms {
1616

1717
def listen(requestDestinationName: String, connectionFactory: ConnectionFactory) =
18-
new ListeningIntegrationComposition(null, new JmsInboundAdapter(target = requestDestinationName, connectionFactory = connectionFactory))
18+
new ListeningIntegrationComposition(null, new JmsInboundGateway(target = requestDestinationName, connectionFactory = connectionFactory))
1919

2020
}
2121

22-
private[dsl] class JmsInboundAdapter(name: String = "$jms_in_" + UUID.randomUUID().toString.substring(0, 8),
22+
private[dsl] class JmsInboundGateway(name: String = "$jms_in_" + UUID.randomUUID().toString.substring(0, 8),
2323
target: String,
2424
val connectionFactory: ConnectionFactory) extends InboundMessageSource(name, target) {
2525

@@ -28,8 +28,8 @@ private[dsl] class JmsInboundAdapter(name: String = "$jms_in_" + UUID.randomUUID
2828
beansElement.setAttribute("xmlns:int-jms", "http://www.springframework.org/schema/integration/jms")
2929
val schemaLocation = beansElement.getAttribute("xsi:schemaLocation")
3030
beansElement.setAttribute("xsi:schemaLocation", "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd " +
31-
"http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd " +
32-
"http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms-2.1.xsd")
31+
"http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd " +
32+
"http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd")
3333

3434
val element = document.createElement("int-jms:inbound-gateway")
3535
element.setAttribute("id", this.name)

0 commit comments

Comments
 (0)