You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 22, 2020. It is now read-only.
A simple Proof of Concept on how to run **Database Integration Tests with real dockerized PostgreSQL or MySQL Databases during Atlassian JIRA Plugin development**.
4
-
This PoC is based on **[UnitTests for Active Objects](https://developer.atlassian.com/server/framework/atlassian-sdk/testing/)**.
4
+
This PoC is based on **[UnitTests for Active Objects](https://developer.atlassian.com/server/framework/atlassian-sdk/testing/)**.
5
5
6
6
7
7
@@ -37,7 +37,8 @@ docker run --name postgres95 \
37
37
-e POSTGRES_PASSWORD=jira \
38
38
-e POSTGRES_USER=jira \
39
39
-e POSTGRES_DB=jira \
40
-
postgres:9.5
40
+
postgres:9.5 \
41
+
postgres -c 'log_statement=all'
41
42
```
42
43
43
44
(2) Run tests against it
@@ -56,8 +57,13 @@ We can see the **tables and indexes**:
*[**`OwnerEntity`**](https://github.com/comsysto/poc-dockerized-database-integration-tests-atlassian-plugin/blob/master/src/main/java/com/comsysto/poc/ao/model/OwnerEntity.java) = Active Objects Entity
110
116
*[**`PetEntity`**](https://github.com/comsysto/poc-dockerized-database-integration-tests-atlassian-plugin/blob/master/src/main/java/com/comsysto/poc/ao/model/PetEntity.java) = Active Objects Entity
111
-
*[**`PetAndOwnerDataAccessServiceImpl`**](https://github.com/comsysto/poc-dockerized-database-integration-tests-atlassian-plugin/blob/master/src/main/java/com/comsysto/poc/ao/service/PetAndOwnerDataAccessServiceImpl.java) = Data Access API works with ActiveObjects
117
+
*[**`PetAndOwnerDataAccessServiceImpl`**](https://github.com/comsysto/poc-dockerized-database-integration-tests-atlassian-plugin/blob/master/src/main/java/com/comsysto/poc/ao/service/PetAndOwnerDataAccessServiceImpl.java) = Data Access API works with ActiveObjects
112
118
* Test
113
119
*[**`PetAndOwnerDataAccessServiceTest`**](https://github.com/comsysto/poc-dockerized-database-integration-tests-atlassian-plugin/blob/master/src/test/java/ut/com/comsysto/poc/ao/service/PetAndOwnerDataAccessServiceTest.java) = Base test whose test methods are run against different database engines
114
120
115
121
116
122
117
123
### Distinctions
118
124
119
-
* Why not `atlas-integration-test`?
125
+
* Why not `atlas-integration-test`?
120
126
* Because even though it is named 'integration-test' it starts a full JIRA instance
121
127
and runs tests against it. We only want to instantiate Active Objects with a real database and not the whole JIRA context.
122
128
That is why we use the `atlas-unit-test` command.
123
129
* Why not use `@ManyToOne` Annotations?
124
130
* You can do that if you want a **Left Join**
125
-
* The PoC wants to show how to perform an **Inner Join**
131
+
* The PoC wants to show how to perform an **Inner Join**
0 commit comments