Search in sources :

Example 1 with Branches

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());
}
Also used : Branch(com.enonic.xp.branch.Branch) Branches(com.enonic.xp.branch.Branches) Test(org.junit.jupiter.api.Test)

Example 2 with Branches

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());
}
Also used : Path(java.nio.file.Path) Branches(com.enonic.xp.branch.Branches) Test(org.junit.jupiter.api.Test)

Example 3 with Branches

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());
}
Also used : Path(java.nio.file.Path) Branches(com.enonic.xp.branch.Branches) Test(org.junit.jupiter.api.Test)

Example 4 with Branches

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());
}
Also used : Path(java.nio.file.Path) Branches(com.enonic.xp.branch.Branches) Test(org.junit.jupiter.api.Test)

Aggregations

Branches (com.enonic.xp.branch.Branches)4 Test (org.junit.jupiter.api.Test)4 Path (java.nio.file.Path)3 Branch (com.enonic.xp.branch.Branch)1