use of com.enonic.xp.dump.SystemDumpResult in project xp by enonic.
the class DumpServiceImplTest method zip_unzip.
@Test
public void zip_unzip() throws Exception {
final Node node = createNode(NodePath.ROOT, "myNode");
updateNode(node);
updateNode(node);
updateNode(node);
refresh();
final SystemDumpResult systemDumpResult = NodeHelper.runAsAdmin(() -> this.dumpService.dump(SystemDumpParams.create().archive(true).includeVersions(true).dumpName("testDump").build()));
// 4 of node, 1 of root
assertEquals(5, systemDumpResult.get(TEST_REPO_ID).getVersions());
final BranchDumpResult branchDumpResult = systemDumpResult.get(TEST_REPO_ID).get(WS_DEFAULT);
assertEquals(2, branchDumpResult.getSuccessful());
NodeHelper.runAsAdmin(() -> this.dumpService.load(SystemLoadParams.create().archive(true).includeVersions(true).dumpName("testDump").build()));
final Repositories newRepos = NodeHelper.runAsAdmin(this::doListRepositories);
assertEquals(RepositoryIds.from(RepositoryId.from("com.enonic.cms.test"), RepositoryId.from("system-repo"), RepositoryId.from("system.auditlog"), RepositoryId.from("system.scheduler")), newRepos.getIds());
}
use of com.enonic.xp.dump.SystemDumpResult in project xp by enonic.
the class DumpServiceImplTest method verify_result.
@Test
public void verify_result() throws Exception {
final Node node = createNode(NodePath.ROOT, "myNode");
updateNode(node);
updateNode(node);
updateNode(node);
refresh();
final SystemDumpResult systemDumpResult = NodeHelper.runAsAdmin(() -> this.dumpService.dump(SystemDumpParams.create().dumpName("testDump").build()));
// 4 of node, 1 of root
assertEquals(5, systemDumpResult.get(TEST_REPO_ID).getVersions());
final BranchDumpResult branchDumpResult = systemDumpResult.get(TEST_REPO_ID).get(WS_DEFAULT);
assertEquals(2, branchDumpResult.getSuccessful());
}
use of com.enonic.xp.dump.SystemDumpResult in project xp by enonic.
the class DumpServiceImplTest method dump_long_filename.
@Test
public void dump_long_filename() throws Exception {
final String nodeName = "this-is-my-node-with-very-long-filename-more-than-100-characters-yes-it-has-to-be-very-long-indeed-sir";
final Node node = createNode(NodePath.ROOT, nodeName);
final SystemDumpResult systemDumpResult = NodeHelper.runAsAdmin(() -> this.dumpService.dump(SystemDumpParams.create().dumpName("testDump").build()));
final BranchDumpResult result = systemDumpResult.get(TEST_REPO_ID).get(WS_DEFAULT);
assertNotNull(result);
assertEquals(2, result.getSuccessful());
NodeHelper.runAsAdmin(() -> dumpDeleteAndLoad(true));
final Node storedNode = this.nodeService.getById(node.id());
assertNotNull(storedNode);
assertEquals(nodeName, storedNode.name().toString());
}
Aggregations