-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extended Integaration Tests to include View Store
- Loading branch information
Des Marshall
authored and
Des Marshall
committed
Dec 22, 2017
1 parent
decdca9
commit d30228a
Showing
11 changed files
with
288 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
...amework-event-listener/src/main/java/uk/gov/justice/framework/tools/entity/TestEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package uk.gov.justice.framework.tools.entity; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
import java.util.UUID; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
|
||
@Entity | ||
@Table(name = "test") | ||
public class TestEvent implements Serializable { | ||
|
||
@Id | ||
@Column(name = "stream_id") | ||
private UUID streamId; | ||
|
||
@Column(name = "version_id") | ||
private Integer versionId; | ||
|
||
@Column(name = "data") | ||
private String data; | ||
|
||
|
||
|
||
public TestEvent(UUID streamId, Integer versionId, String data) { | ||
this.streamId = streamId; | ||
this.versionId = versionId; | ||
this.data = data; | ||
} | ||
|
||
public UUID getStreamId() { | ||
return streamId; | ||
} | ||
|
||
public void setStreamId(UUID streamId) { | ||
this.streamId = streamId; | ||
} | ||
|
||
public Integer getVersionId() { | ||
return versionId; | ||
} | ||
|
||
public void setVersionId(int versionId) { | ||
this.versionId = versionId; | ||
} | ||
|
||
public String getData() { | ||
return data; | ||
} | ||
|
||
public void setData(String data) { | ||
this.data = data; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TestEvent{" + | ||
"streamId=" + streamId + | ||
", versionId=" + versionId + | ||
", data='" + data + '\'' + | ||
'}'; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
TestEvent testEvent = (TestEvent) o; | ||
return versionId == testEvent.versionId && | ||
Objects.equals(streamId, testEvent.streamId) && | ||
Objects.equals(data, testEvent.data); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
|
||
return Objects.hash(streamId, versionId, data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ener/src/main/java/uk/gov/justice/framework/tools/repository/TestViewstoreRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package uk.gov.justice.framework.tools.repository; | ||
|
||
import uk.gov.justice.framework.tools.entity.TestEvent; | ||
|
||
import java.util.UUID; | ||
|
||
import org.apache.deltaspike.data.api.EntityRepository; | ||
import org.apache.deltaspike.data.api.Repository; | ||
|
||
@Repository | ||
public interface TestViewstoreRepository extends EntityRepository<TestEvent, UUID> { | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
framework-tools-test/framework-event-listener/src/main/resources/META-INF/persistence.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<persistence xmlns="http://java.sun.com/xml/ns/persistence" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence | ||
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> | ||
|
||
<persistence-unit name="replay-test"> | ||
<provider>org.hibernate.ejb.HibernatePersistence</provider> | ||
<jta-data-source>java:/DS.replay</jta-data-source> | ||
<class>uk.gov.justice.framework.tools.entity.TestEvent</class> | ||
</persistence-unit> | ||
|
||
</persistence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
framework-tools-test/framework-tools-it/src/test/resources/liquibase/liquibase.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
changeLogFile=liquibase/viewstore-db-changelog.xml |
9 changes: 9 additions & 0 deletions
9
...ork-tools-test/framework-tools-it/src/test/resources/liquibase/viewstore-db-changelog.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd"> | ||
|
||
<includeAll relativeToChangelogFile="true" path="viewstore-db-changesets"/> | ||
|
||
</databaseChangeLog> |
Oops, something went wrong.