use of com.enonic.xp.branch.Branches in project xp by enonic.
the class GetActiveContentVersionsParamsTest method testEquals.
@Test
public void testEquals() {
Branch branch = Branch.create().value("branchName").build();
Branches branches = Branches.from(branch);
GetActiveContentVersionsParams params = GetActiveContentVersionsParams.create().contentId(contentId).branches(branches).build();
assertEquals(params, params);
assertEquals(params.getContentId(), contentId);
assertEquals(params.getBranches().getSet(), branches.getSet());
}
use of com.enonic.xp.branch.Branches in project xp by enonic.
the class FileDumpReaderTest method ignore_file_in_branch_folder.
@Test
public void ignore_file_in_branch_folder() throws Exception {
final Path meta = createFolder(this.dumpFolder, "meta");
final Path repo1 = createFolder(meta, "repo1");
createFolder(repo1, "master");
createFolder(repo1, "draft");
createFile(meta, "fisk");
final Branches branches = fileDumpReader.getBranches(RepositoryId.from("repo1"));
assertEquals(2, branches.getSize());
}
use of com.enonic.xp.branch.Branches in project xp by enonic.
the class FileDumpReaderTest method hidden_folder.
@Test
public void hidden_folder() throws Exception {
final Path meta = createFolder(this.dumpFolder, "meta");
final Path repo1 = createFolder(meta, "repo1");
final Path hiddenFolder = createFolder(repo1, ".myBranch");
if (isWindows()) {
hideTheFileWindowsWay(hiddenFolder);
}
createFolder(repo1, "myBranch");
final Branches branches = fileDumpReader.getBranches(RepositoryId.from("repo1"));
assertEquals(1, branches.getSize());
}
use of com.enonic.xp.branch.Branches in project xp by enonic.
the class FileDumpReaderTest method branches.
@Test
public void branches() throws Exception {
final Path meta = createFolder(this.dumpFolder, "meta");
final Path repo1 = createFolder(meta, "repo1");
createFolder(repo1, "master");
createFolder(repo1, "draft");
final Branches branches = fileDumpReader.getBranches(RepositoryId.from("repo1"));
assertEquals(2, branches.getSize());
}