Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 4e72497

Browse files
authored
Merge pull request #190 from derms/feature/issue-189-uni-temporal-configuration-example
added uni-temporal examples
2 parents b15b751 + c899330 commit 4e72497

File tree

5 files changed

+87
-0
lines changed

5 files changed

+87
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package com.marklogic.appdeployer.command.temporal;
2+
3+
import com.marklogic.appdeployer.AbstractAppDeployerTest;
4+
import com.marklogic.appdeployer.command.databases.DeployContentDatabasesCommand;
5+
import com.marklogic.appdeployer.command.databases.DeployOtherDatabasesCommand;
6+
import com.marklogic.appdeployer.command.databases.DeploySchemasDatabaseCommand;
7+
import com.marklogic.mgmt.resource.temporal.TemporalAxesManager;
8+
import com.marklogic.mgmt.resource.temporal.TemporalCollectionManager;
9+
import com.marklogic.rest.util.ResourcesFragment;
10+
import org.junit.Test;
11+
12+
import java.io.File;
13+
14+
public class DeployUniTemporalTest extends AbstractAppDeployerTest {
15+
16+
@Test
17+
public void test() {
18+
appConfig.getConfigDir().setBaseDir(new File("src/test/resources/sample-app/uni-temporal-config"));
19+
20+
initializeAppDeployer(new DeployContentDatabasesCommand(1),
21+
new DeploySchemasDatabaseCommand(), new DeployTemporalAxesCommand(),
22+
new DeployTemporalCollectionsCommand(), new DeployTemporalCollectionsLSQTCommand(),
23+
new DeployOtherDatabasesCommand());
24+
25+
try {
26+
appDeployer.deploy(appConfig);
27+
28+
verifyTemporalDocsExist(appConfig.getContentDatabaseName());
29+
} finally {
30+
undeploySampleApp();
31+
}
32+
}
33+
34+
private void verifyTemporalDocsExist(String databaseName) {
35+
ResourcesFragment axes = new TemporalAxesManager(manageClient, databaseName).getAsXml();
36+
assertEquals(1, axes.getResourceCount());
37+
38+
ResourcesFragment collections = new TemporalCollectionManager(manageClient, databaseName).getAsXml();
39+
assertEquals(1, collections.getResourceCount());
40+
}
41+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"database-name": "%%DATABASE%%",
3+
"schema-database": "%%SCHEMAS_DATABASE%%",
4+
"range-element-index": [
5+
{
6+
"collation": "",
7+
"invalid-values": "reject",
8+
"localname": "systemStart",
9+
"namespace-uri": "",
10+
"range-value-positions": false,
11+
"scalar-type": "dateTime"
12+
}
13+
,
14+
{
15+
"collation": "",
16+
"invalid-values": "reject",
17+
"localname": "systemEnd",
18+
"namespace-uri": "",
19+
"range-value-positions": false,
20+
"scalar-type": "dateTime"
21+
}
22+
]
23+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"database-name": "%%SCHEMAS_DATABASE%%"
3+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"axis-name": "system",
3+
"axis-start": {
4+
"element-reference": {
5+
"namespace-uri": "",
6+
"localname": "systemStart"
7+
}
8+
},
9+
"axis-end": {
10+
"element-reference": {
11+
"namespace-uri": "",
12+
"localname": "systemEnd"
13+
}
14+
}
15+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"collection-name": "uni-temporal-collection",
3+
"system-axis": "system",
4+
"option": ["updates-safe"]
5+
}

0 commit comments

Comments
 (0)