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

Commit acd3642

Browse files
committed
Added assertion for tde collection
1 parent 50cfd8d commit acd3642

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

src/test/java/com/marklogic/appdeployer/command/schemas/LoadSchemasTest.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,53 +11,53 @@
1111
import com.marklogic.appdeployer.command.restapis.DeployRestApiServersCommand;
1212
import com.marklogic.client.DatabaseClient;
1313
import com.marklogic.client.document.GenericDocumentManager;
14+
import com.marklogic.client.io.DocumentMetadataHandle;
1415

15-
public class LoadSchemasTest extends AbstractAppDeployerTest {
16+
public class LoadSchemasTest extends AbstractAppDeployerTest {
1617

17-
@Test
18-
public void testSchemaLoading() {
19-
initializeAppDeployer(new DeploySchemasDatabaseCommand(),
20-
new DeployTriggersDatabaseCommand(),
21-
new DeployContentDatabasesCommand(1),
22-
new DeployRestApiServersCommand(),
23-
newCommand());
18+
@Test
19+
public void testSchemaLoading() {
20+
initializeAppDeployer(new DeploySchemasDatabaseCommand(), new DeployTriggersDatabaseCommand(),
21+
new DeployContentDatabasesCommand(1), new DeployRestApiServersCommand(), newCommand());
2422
appDeployer.deploy(appConfig);
25-
23+
2624
DatabaseClient client = appConfig.newSchemasDatabaseClient();
27-
25+
2826
GenericDocumentManager docMgr = client.newDocumentManager();
29-
27+
3028
assertNull("Rules document loaded", docMgr.exists("notExists"));
3129
assertNotNull("Rules document loaded", docMgr.exists("my.rules").getUri());
3230
assertNotNull("XSD document loaded", docMgr.exists("x.xsd").getUri());
33-
}
34-
35-
@Test
36-
public void testSchemaCustomSchemasPath() {
37-
initializeAppDeployer(new DeploySchemasDatabaseCommand(),
38-
new DeployTriggersDatabaseCommand(),
39-
new DeployContentDatabasesCommand(1),
40-
new DeployRestApiServersCommand(),
41-
newCommand());
31+
}
32+
33+
@Test
34+
public void testSchemaCustomSchemasPath() {
35+
initializeAppDeployer(new DeploySchemasDatabaseCommand(), new DeployTriggersDatabaseCommand(),
36+
new DeployContentDatabasesCommand(1), new DeployRestApiServersCommand(), newCommand());
4237
appConfig.setSchemasPath("src/test/resources/schemas-marklogic9");
4338
appDeployer.deploy(appConfig);
44-
45-
39+
4640
DatabaseClient client = appConfig.newSchemasDatabaseClient();
47-
41+
4842
GenericDocumentManager docMgr = client.newDocumentManager();
49-
43+
5044
assertNotNull("TDEXML document loaded", docMgr.exists("x.tdex").getUri());
5145
assertNotNull("TDEJSON document loaded", docMgr.exists("x.tdej").getUri());
52-
}
53-
54-
@After
55-
public void cleanup() {
46+
47+
for (String uri : new String[] { "x.tdex", "x.tdej" }) {
48+
DocumentMetadataHandle h = docMgr.readMetadata(uri, new DocumentMetadataHandle());
49+
assertEquals("Files ending in tdex and tdej go into a special collection", "http://marklogic.com/xdmp/tde",
50+
h.getCollections().iterator().next());
51+
}
52+
}
53+
54+
@After
55+
public void cleanup() {
5656
undeploySampleApp();
5757
}
5858

59-
private Command newCommand() {
60-
return new LoadSchemasCommand();
61-
}
62-
59+
private Command newCommand() {
60+
return new LoadSchemasCommand();
61+
}
62+
6363
}

0 commit comments

Comments
 (0)