Upgraded to work with the Eventuate client framework version 0.12

See http://eventuate.io/docs/java/spring-configuration.html for details on new configuration properties.
Upgraded to Spring Boot 1.2.8
Misc changes to build scripts
This commit is contained in:
Chris Richardson
2015-12-21 15:02:04 -08:00
parent 2135f3f136
commit bbea6d9d2f
41 changed files with 165 additions and 137 deletions

View File

@@ -66,13 +66,16 @@ See this [wiki page](../../wiki/AboutTheEventStoreServer) for more details.
# Building the application (and running the tests)
Both projects use Gradle.
To build a project, execute this command:
Both versions of the application use Gradle.
To build an application, execute this command in the application's top-level directory:
```
./gradlew assemble
```
Note: you do not need to install Gradle.
It will be automatically downloaded by `./gradlew`.
This will build a Spring Boot jar in each of the `*-service` directories.
You can also run the tests using `gradle build`.

41
_build-and-test-all.sh Executable file
View File

@@ -0,0 +1,41 @@
#! /bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DOCKER_COMPOSE="docker-compose -p event-sourcing-examples"
if [ "$1" = "--use-existing" ] ; then
shift;
else
${DOCKER_COMPOSE?} stop
${DOCKER_COMPOSE?} rm -v --force
fi
${DOCKER_COMPOSE?} up -d mongodb
if [ -z "$DOCKER_HOST_IP" ] ; then
export DOCKER_HOST_IP=$(docker-machine ip default)
echo set DOCKER_HOST_IP $DOCKER_HOST_IP
fi
if [ -z "$SPRING_DATA_MONGODB_URI" ] ; then
export SPRING_DATA_MONGODB_URI=mongodb://${DOCKER_HOST_IP}/mydb
echo Set SPRING_DATA_MONGODB_URI $SPRING_DATA_MONGODB_URI
fi
export SERVICE_HOST=$DOCKER_HOST_IP
./gradlew $* build
${DOCKER_COMPOSE?} up -d
$DIR/wait-for-services.sh $DOCKER_HOST_IP
set -e
./gradlew $* :e2e-test:cleanTest :e2e-test:test
${DOCKER_COMPOSE?} stop
${DOCKER_COMPOSE?} rm -v --force

View File

@@ -1,5 +0,0 @@
mongodb:
image: dockerfile/mongodb
ports:
- "27017:27017"

View File

@@ -1,4 +0,0 @@
#! /bin/bash
docker run --link esexamplesdocker_mongodb_1:mongodb -i -t dockerfile/mongodb:latest /usr/bin/mongo --host mongodb

View File

@@ -3,16 +3,12 @@ apply plugin: 'java'
dependencies {
compile project(":common-backend")
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.3'
compile 'com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.3'
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
testCompile project(":testutil")
testCompile "junit:junit:4.11"
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
}

View File

@@ -9,7 +9,7 @@ dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
testCompile "org.springframework.boot:spring-boot-starter-test"

View File

@@ -3,7 +3,7 @@ apply plugin: 'java'
dependencies {
compile project(":common-backend")
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion"
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
@@ -13,7 +13,7 @@ dependencies {
testCompile project(":testutil")
testCompile "junit:junit:4.11"
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
}

View File

@@ -12,6 +12,8 @@ import net.chrisrichardson.eventstore.subscriptions.DispatchedEvent;
import net.chrisrichardson.eventstore.subscriptions.EventHandlerMethod;
import net.chrisrichardson.eventstore.subscriptions.EventSubscriber;
import rx.Observable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
@@ -20,6 +22,8 @@ import static net.chrisrichardson.eventstore.javaexamples.banking.backend.querys
@EventSubscriber(id="querySideEventHandlers")
public class AccountQueryWorkflow implements CompoundEventHandler {
private Logger logger = LoggerFactory.getLogger(getClass());
private AccountInfoUpdateService accountInfoUpdateService;
public AccountQueryWorkflow(AccountInfoUpdateService accountInfoUpdateService) {
@@ -31,7 +35,7 @@ public class AccountQueryWorkflow implements CompoundEventHandler {
AccountOpenedEvent event = de.event();
String id = de.getEntityIdentifier().getId();
String eventId = de.eventId().asString();
System.out.println("**************** account version=" + id + ", " + eventId);
logger.info("**************** account version=" + id + ", " + eventId);
BigDecimal initialBalance = event.getInitialBalance();
accountInfoUpdateService.create(id, initialBalance, eventId);
return Observable.just(null);
@@ -43,8 +47,8 @@ public class AccountQueryWorkflow implements CompoundEventHandler {
String moneyTransferId = de.getEntityIdentifier().getId();
String fromAccountId = de.event().getDetails().getFromAccountId().getId();
String toAccountId = de.event().getDetails().getToAccountId().getId();
System.out.println("**************** account version=" + fromAccountId + ", " + de.eventId().asString());
System.out.println("**************** account version=" + toAccountId + ", " + de.eventId().asString());
logger.info("**************** account version=" + fromAccountId + ", " + de.eventId().asString());
logger.info("**************** account version=" + toAccountId + ", " + de.eventId().asString());
AccountTransactionInfo ti = new AccountTransactionInfo(moneyTransferId, fromAccountId, toAccountId, toIntegerRepr(de.event().getDetails().getAmount()));
@@ -74,7 +78,7 @@ public class AccountQueryWorkflow implements CompoundEventHandler {
long balanceDelta = amount * delta;
AccountChangeInfo ci = new AccountChangeInfo(changeId, transactionId, de.event().getClass().getSimpleName(), amount, balanceDelta);
String accountId = de.getEntityIdentifier().getId();
System.out.println("**************** account version=" + accountId + ", " + de.eventId().asString());
logger.info("**************** account version=" + accountId + ", " + de.eventId().asString());
accountInfoUpdateService.updateBalance(accountId, changeId, balanceDelta, ci);

View File

@@ -9,7 +9,7 @@ dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
testCompile project(":testutil")
testCompile "org.springframework.boot:spring-boot-starter-test"

View File

@@ -8,6 +8,6 @@ dependencies {
testCompile project(":testutil")
testCompile "junit:junit:4.11"
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
}

View File

@@ -0,0 +1,3 @@
#! /bin/bash
../_build-and-test-all.sh $*

View File

@@ -22,13 +22,7 @@ subprojects {
targetCompatibility = 1.7
repositories {
if (project.hasProperty("localMavenRepoUrl")) {
project.localMavenRepoUrl.split(',').each { theUrl ->
maven { url theUrl }
}
}
mavenCentral()
maven { url "https://06c59145-4e83-4f22-93ef-6a7eee7aebaa.repos.chrisrichardson.net.s3.amazonaws.com" }
eventuateMavenRepoUrl.split(',').each { repoUrl -> maven { url repoUrl } }
}
}

View File

@@ -6,11 +6,10 @@ class VerifyEventStoreEnvironmentPlugin implements Plugin<Project> {
project.test {
beforeSuite { x ->
if (x.parent == null) {
if (System.getenv("EVENT_STORE_URL") == null)
logger.warn("\nPLEASE make sure that Event Store-related environment variables including EVENT_STORE_URL are set, see sample-set-remote-env.sh !!!!\n")
if (System.getenv("EVENTUATE_API_KEY_ID") == null && System.getenv("EVENTUATE_API_KEY_SECRET") == null)
logger.warn("\nPLEASE make sure that Eventuate-related environment variables EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET are set, see sample-set-remote-env.sh !!!!\n")
}
}
}
}
}

View File

@@ -1,14 +1,11 @@
apply plugin: 'java'
dependencies {
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.3'
compile 'com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.3'
testCompile "junit:junit:4.11"
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
}

View File

@@ -8,10 +8,15 @@
<Pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</Pattern>
</layout>
</appender>
<root level="error">
<appender-ref ref="STDOUT" />
</root>
<logger name="org.springframework" level='debug'>
</logger>
</configuration>
<logger name="org.springframework" level='info'>
</logger>
<logger name="net.chrisrichardson.eventstore.client" level='info'>
</logger>
</configuration>

View File

@@ -1,7 +1,7 @@
apply plugin: 'java'
dependencies {
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion"
testCompile "junit:junit:4.11"

View File

@@ -7,11 +7,8 @@ accountscommandside:
ports:
- "8080:8080"
environment:
EVENT_STORE_USER_ID:
EVENT_STORE_PASSWORD:
EVENT_STORE_URL:
EVENT_STORE_STOMP_SERVER_HOST:
EVENT_STORE_STOMP_SERVER_PORT:
EVENTUATE_API_KEY_ID:
EVENTUATE_API_KEY_SECRET:
transactionscommandside:
image: java:8
@@ -22,11 +19,8 @@ transactionscommandside:
ports:
- "8082:8080"
environment:
EVENT_STORE_USER_ID:
EVENT_STORE_PASSWORD:
EVENT_STORE_URL:
EVENT_STORE_STOMP_SERVER_HOST:
EVENT_STORE_STOMP_SERVER_PORT:
EVENTUATE_API_KEY_ID:
EVENTUATE_API_KEY_SECRET:
accountsqueryside:
@@ -34,17 +28,14 @@ accountsqueryside:
working_dir: /app
volumes:
- ./accounts-query-side-service/build/libs:/app
command: java -jar /app/accounts-query-side-service.jar --spring.data.mongodb_uri=mongodb://database/CQRS
command: java -jar /app/accounts-query-side-service.jar
ports:
- "8081:8080"
links:
- mongodb
environment:
EVENT_STORE_USER_ID:
EVENT_STORE_PASSWORD:
EVENT_STORE_URL:
EVENT_STORE_STOMP_SERVER_HOST:
EVENT_STORE_STOMP_SERVER_PORT:
EVENTUATE_API_KEY_ID:
EVENTUATE_API_KEY_SECRET:
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
mongodb:

View File

@@ -1,9 +1,10 @@
org.gradle.jvmargs=-XX:MaxPermSize=512m
eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release
scalaTestDependency=org.scalatest:scalatest_2.10:2.0
springBootVersion=1.2.5.RELEASE
springBootVersion=1.2.8.RELEASE
eventStoreClientVersion=0.7
eventStoreCommonVersion=0.7
eventStoreClientVersion=0.12

View File

@@ -10,7 +10,7 @@ dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
testCompile project(":testutil")
testCompile "org.springframework.boot:spring-boot-starter-test"

View File

@@ -1,7 +1,7 @@
apply plugin: 'java'
dependencies {
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.3'
@@ -9,7 +9,7 @@ dependencies {
compile "junit:junit:4.11"
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
}

View File

@@ -3,16 +3,12 @@ apply plugin: 'java'
dependencies {
compile project(":common-backend")
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.3'
compile 'com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.3'
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
testCompile project(":testutil")
testCompile "junit:junit:4.11"
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
}

View File

@@ -8,7 +8,7 @@ dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
testCompile "org.springframework.boot:spring-boot-starter-test"

View File

@@ -3,6 +3,8 @@
# Execute this script in the java-spring or scala-spring directory
# Runs all of the services
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ -f account-cs.pid ]]; then
echo pid file exists
exit 1
@@ -19,13 +21,4 @@ echo $! > transfers-cs.pid
echo -n waiting for services....
while [[ true ]]; do
nc -z -w 4 localhost 8080 && nc -z -w 4 localhost 8081 && nc -z -w 4 localhost 8082
if [[ "$?" -eq "0" ]]; then
echo connected
break
fi
echo -n .
sleep 1
done
$DIR/wait-for-services.sh localhost

View File

@@ -1,9 +1,6 @@
#! /bin/bash -e
export EVENT_STORE_USER_ID=Aladdin
export EVENT_STORE_PASSWORD="open sesame"
export EVENT_STORE_URL=serverUrl
export EVENT_STORE_STOMP_SERVER_HOST=serverhost
export EVENT_STORE_STOMP_SERVER_PORT=serverPort
export EVENTUATE_API_KEY_ID=Aladdin
export EVENTUATE_API_KEY_SECRET="open sesame"
export SPRING_DATA_MONGODB_URI=mongodb://192.168.59.103/mydb

View File

@@ -1,5 +1,5 @@
dependencies {
compile "org.scala-lang:scala-library:2.10.2"
compile project(":common-backend")
compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling_2.10:$eventStoreClientVersion"
}

View File

@@ -9,7 +9,7 @@ dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile scalaTestDependency

View File

@@ -7,13 +7,10 @@ dependencies {
compile "org.scala-lang:scala-library:2.10.2"
compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion"
compile "net.chrisrichardson.eventstore.common:eventstore-common:$eventStoreCommonVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
testCompile scalaTestDependency
testCompile "junit:junit:4.11"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
}

View File

@@ -10,7 +10,7 @@ dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile scalaTestDependency

View File

@@ -12,7 +12,7 @@ dependencies {
testCompile scalaTestDependency
testCompile "junit:junit:4.11"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
}

View File

@@ -0,0 +1,3 @@
#! /bin/bash
../_build-and-test-all.sh $*

View File

@@ -23,13 +23,7 @@ subprojects {
targetCompatibility = 1.7
repositories {
if (project.hasProperty("localMavenRepoUrl")) {
project.localMavenRepoUrl.split(',').each { theUrl ->
maven { url theUrl }
}
}
mavenCentral()
maven { url "https://06c59145-4e83-4f22-93ef-6a7eee7aebaa.repos.chrisrichardson.net.s3.amazonaws.com" }
eventuateMavenRepoUrl.split(',').each { repoUrl -> maven { url repoUrl } }
}
}

View File

@@ -6,11 +6,10 @@ class VerifyEventStoreEnvironmentPlugin implements Plugin<Project> {
project.test {
beforeSuite { x ->
if (x.parent == null) {
if (System.getenv("EVENT_STORE_URL") == null)
logger.warn("\nPLEASE make sure that Event Store-related environment variables including EVENT_STORE_URL are set, see sample-set-remote-env.sh !!!!\n")
if (System.getenv("EVENTUATE_API_KEY_ID") == null && System.getenv("EVENTUATE_API_KEY_SECRET") == null)
logger.warn("\nPLEASE make sure that Eventuate-related environment variables EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET are set, see sample-set-remote-env.sh !!!!\n")
}
}
}
}
}

View File

@@ -2,11 +2,9 @@ apply plugin: 'scala'
dependencies {
compile "org.scala-lang:scala-library:2.10.2"
compile "net.chrisrichardson.eventstore.common:eventstore-common:$eventStoreCommonVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
testCompile scalaTestDependency
testCompile "junit:junit:4.11"
}

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- [%thread] -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</Pattern>
</layout>
</appender>
<root level="error">
<appender-ref ref="STDOUT" />
</root>
<logger name="org.springframework" level='info'>
</logger>
<logger name="net.chrisrichardson.eventstore.client" level='info'>
</logger>
</configuration>

View File

@@ -7,11 +7,8 @@ accountscommandside:
ports:
- "8080:8080"
environment:
EVENT_STORE_USER_ID:
EVENT_STORE_PASSWORD:
EVENT_STORE_URL:
EVENT_STORE_STOMP_SERVER_HOST:
EVENT_STORE_STOMP_SERVER_PORT:
EVENTUATE_API_KEY_ID:
EVENTUATE_API_KEY_SECRET:
transactionscommandside:
image: java:8
@@ -22,11 +19,8 @@ transactionscommandside:
ports:
- "8082:8080"
environment:
EVENT_STORE_USER_ID:
EVENT_STORE_PASSWORD:
EVENT_STORE_URL:
EVENT_STORE_STOMP_SERVER_HOST:
EVENT_STORE_STOMP_SERVER_PORT:
EVENTUATE_API_KEY_ID:
EVENTUATE_API_KEY_SECRET:
accountsqueryside:
@@ -34,17 +28,14 @@ accountsqueryside:
working_dir: /app
volumes:
- ./accounts-query-side-service/build/libs:/app
command: java -jar /app/accounts-query-side-service.jar --spring.data.mongodb_uri=mongodb://database/CQRS
command: java -jar /app/accounts-query-side-service.jar
ports:
- "8081:8080"
links:
- mongodb
environment:
EVENT_STORE_USER_ID:
EVENT_STORE_PASSWORD:
EVENT_STORE_URL:
EVENT_STORE_STOMP_SERVER_HOST:
EVENT_STORE_STOMP_SERVER_PORT:
EVENTUATE_API_KEY_ID:
EVENTUATE_API_KEY_SECRET:
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
mongodb:

View File

@@ -18,9 +18,10 @@ import scala.collection.JavaConversions._
@RunWith(classOf[JUnitRunner])
class EndToEndTest extends FlatSpec {
val accountsCommandSideBaseUrl = s"http://localhost:8080/"
val accountsQuerySideBaseUrl = s"http://localhost:8081/"
val transactionsCommandSideBaseUrl = s"http://localhost:8082/"
val serviceHost = Option(System.getenv("SERVICE_HOST")) getOrElse "localhost"
val accountsCommandSideBaseUrl = s"http://$serviceHost:8080/"
val accountsQuerySideBaseUrl = s"http://$serviceHost:8081/"
val transactionsCommandSideBaseUrl = s"http://$serviceHost:8082/"
val restTemplate = new RestTemplate()
restTemplate.getMessageConverters foreach {

View File

@@ -1,9 +1,10 @@
org.gradle.jvmargs=-XX:MaxPermSize=512m
eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release
scalaTestDependency=org.scalatest:scalatest_2.10:2.0
springBootVersion=1.2.5.RELEASE
springBootVersion=1.2.8.RELEASE
eventStoreClientVersion=0.7
eventStoreCommonVersion=0.7
eventStoreClientVersion=0.12

View File

@@ -11,7 +11,7 @@ dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile scalaTestDependency

View File

@@ -1,5 +1,5 @@
dependencies {
compile "org.scala-lang:scala-library:2.10.2"
compile project(":common-backend")
compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling_2.10:$eventStoreClientVersion"
}

View File

@@ -9,7 +9,7 @@ dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile scalaTestDependency

11
wait-for-services.sh Executable file
View File

@@ -0,0 +1,11 @@
#! /bin/bash
while [[ true ]]; do
nc -z -w 4 ${1?} 8080 && nc -z -w 4 ${1?} 8081 && nc -z -w 4 ${1?} 8082
if [[ "$?" -eq "0" ]]; then
echo connected
break
fi
echo -n .
sleep 1
done