Skip to content

Commit

Permalink
Merge 7668048 into 49e7ebc
Browse files Browse the repository at this point in the history
  • Loading branch information
allanmckenzie committed Jun 14, 2019
2 parents 49e7ebc + 7668048 commit 10afd56
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 199 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ before_script:
- psql -c 'create database frameworkeventstore;' -U postgres
- psql -c 'create database frameworkviewstore;' -U postgres
- psql -c 'create database frameworkfilestore;' -U postgres
- psql -c 'create database frameworksystem;' -U postgres
- psql -c "CREATE USER framework WITH PASSWORD 'framework';" -U postgres
addons:
postgresql: '9.5'
Expand Down
12 changes: 7 additions & 5 deletions example-context/example-service/example-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -290,30 +290,32 @@
<goal>update</goal>
</goals>
</execution>

<execution>
<id>subscriptions-liquibase</id>
<id>subscription-repository-liquibase</id>
<configuration>
<changeLogFile>liquibase/subscription-repository-changelog.xml
</changeLogFile>
<changeLogFile>liquibase/subscription-repository-changelog.xml</changeLogFile>
<url>jdbc:postgresql://localhost:5432/frameworkviewstore</url>
</configuration>
<phase>pre-integration-test</phase>
<goals>
<goal>update</goal>
</goals>
</execution>

<execution>
<id>framework-system-liquibase</id>
<configuration>
<changeLogFile>liquibase/framework-system-changelog.xml
</changeLogFile>
<url>jdbc:postgresql://localhost:5432/frameworkviewstore</url>
<url>jdbc:postgresql://localhost:5432/frameworksystem</url>
</configuration>
<phase>pre-integration-test</phase>
<goals>
<goal>update</goal>
</goals>
</execution>

<execution>
<id>file-service-liquibase</id>
<configuration>
Expand Down Expand Up @@ -463,7 +465,7 @@
<timeout>120</timeout>
<java-opts>
<javaOpt>-DDEFAULT_PORT=${random-http-port}</javaOpt>
<!--<java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8888</java-opt>-->
<!-- <java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8888</java-opt>-->
</java-opts>
<port>${random-management-port}</port>
<version>${wildfly.version}</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ private void cleanViewstoreTables() {
"recipe",
"cake",
"cake_order",
"processed_event",
"shuttered_command_store"
"processed_event"
);

databaseCleaner.cleanStreamBufferTable(contextName);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ private void cleanViewstoreTables() {
"recipe",
"cake",
"cake_order",
"processed_event",
"shuttered_command_store"
"processed_event"
);

databaseCleaner.cleanStreamBufferTable(contextName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import uk.gov.justice.services.jmx.system.command.client.SystemCommanderClientFactory;
import uk.gov.justice.services.management.shuttering.command.ShutterSystemCommand;
import uk.gov.justice.services.management.shuttering.command.UnshutterSystemCommand;
import uk.gov.justice.services.test.utils.persistence.DatabaseCleaner;

import java.util.Optional;

Expand Down Expand Up @@ -53,12 +54,15 @@ public class ShutteringIT {
private static final int PORT = valueOf(getProperty("random.management.port"));

private final SystemCommanderClientFactory systemCommanderClientFactory = new SystemCommanderClientFactory();
private final DatabaseCleaner databaseCleaner = new DatabaseCleaner();

@Before
public void before() {
client = new RestEasyClientFactory().createResteasyClient();
querier = new Querier(client);
commandSender = new CommandSender(client, eventFactory);

databaseCleaner.cleanSystemTables("framework");
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ private void cleanViewstoreTables() {
"recipe",
"cake",
"cake_order",
"processed_event",
"shuttered_command_store"
"processed_event"
);

databaseCleaner.cleanStreamBufferTable(contextName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ public DataSource initEventStoreDb() {
"db.eventstore.password");
}

public DataSource initFileServiceDb() {
return initDatabase("db.fileservice.url", "db.fileservice.userName",
"db.fileservice.password");
}

public DataSource initViewStoreDb() {
return initDatabase("db.example.url", "db.example.userName",
"db.example.password");
}

public DataSource initSystemDb() {
return initDatabase("db.system.url", "db.system.userName",
"db.system.password");
}

public DataSource initFileServiceDb() {
return initDatabase("db.fileservice.url", "db.fileservice.userName",
"db.fileservice.password");
}

private static DataSource initDatabase(final String dbUrlPropertyName,
final String dbUserNamePropertyName,
final String dbPasswordPropertyName) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# eventstore database
db.eventstore.url=jdbc:postgresql://localhost:5432/frameworkeventstore
db.eventstore.userName=framework
db.eventstore.password=framework

# viewstore database
db.example.url=jdbc:postgresql://localhost:5432/frameworkviewstore
db.example.userName=framework
db.example.password=framework

# system database
db.system.url=jdbc:postgresql://localhost:5432/frameworksystem
db.system.userName=framework
db.system.password=framework

# file store database
db.fileservice.url=jdbc:postgresql://localhost:5432/frameworkfilestore
db.fileservice.userName=framework
db.fileservice.password=framework
db.fileservice.password=framework
Loading

0 comments on commit 10afd56

Please sign in to comment.