@@ -0,0 +1,2944 @@
+package org.rmatil.sync.test.syncer.sharing;%0A%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport org.rmatil.sync.core.syncer.sharing.SharingSyncer;%0Aimport org.rmatil.sync.persistence.exceptions.InputOutputException;%0Aimport org.rmatil.sync.test.messaging.base.BaseNetworkHandlerTest;%0Aimport org.rmatil.sync.version.api.AccessType;%0A%0Aimport java.io.IOException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Apublic class SharingSyncerTest extends BaseNetworkHandlerTest %7B%0A%0A    protected static SharingSyncer SHARING_SYNCER;%0A    protected static Path TEST_DIR  = Paths.get(%22myDir%22);%0A    protected static Path TEST_FILE = TEST_DIR.resolve(%22myFile.txt%22);%0A%0A    @BeforeClass%0A    public static void setUpChild()%0A            throws IOException, InputOutputException %7B%0A        SHARING_SYNCER = new SharingSyncer(%0A                CLIENT_1,%0A                CLIENT_MANAGER_1,%0A                STORAGE_ADAPTER_1,%0A                OBJECT_STORE_1%0A        );%0A%0A        Files.createDirectory(ROOT_TEST_DIR1.resolve(TEST_DIR));%0A        Files.createFile(ROOT_TEST_DIR1.resolve(TEST_FILE));%0A%0A        OBJECT_STORE_1.sync(ROOT_TEST_DIR1.toFile());%0A%0A        OBJECT_STORE_1.getSharerManager().addSharer(%0A                USER_2.getUserName(),%0A                AccessType.WRITE,%0A                TEST_DIR.toString()%0A        );%0A%0A        OBJECT_STORE_1.getSharerManager().addSharer(%0A                USER_2.getUserName(),%0A                AccessType.WRITE,%0A                TEST_FILE.toString()%0A        );%0A    %7D%0A%0A    @Test%0A    public void testGetRelativePathToSharedFolder()%0A            throws InputOutputException %7B%0A%0A        String relativePath = SHARING_SYNCER.getRelativePathToSharedFolder(TEST_DIR.toString(), USER_2.getUserName(), AccessType.WRITE);%0A        assertEquals(%22RelativePathToSharedFolder should be equal%22, TEST_DIR.toString(), relativePath);%0A%0A        String relativePath2 = SHARING_SYNCER.getRelativePathToSharedFolder(TEST_FILE.toString(), USER_2.getUserName(), AccessType.WRITE);%0A        assertEquals(%22RelativePathToSharedFile should be equal%22, TEST_FILE.toString(), relativePath2);%0A%0A        OBJECT_STORE_1.getSharerManager().removeSharer(USER_2.getUserName(), TEST_FILE.toString());%0A%0A        // add only read permissions to test file%0A        OBJECT_STORE_1.getSharerManager().addSharer(USER_2.getUserName(), AccessType.READ, TEST_FILE.toString());%0A        String relativePath3 = SHARING_SYNCER.getRelativePathToSharedFolder(TEST_DIR.toString(), USER_2.getUserName(), AccessType.WRITE);%0A        assertEquals(%22RelativePathToSharedFolder should be equal%22, TEST_DIR.toString(), relativePath3);%0A%0A        String relativePath4 = SHARING_SYNCER.getRelativePathToSharedFolder(TEST_FILE.getFileName().toString(), USER_2.getUserName(), AccessType.READ);%0A        assertEquals(%22RelativePathToSharedFile should be equal%22, TEST_FILE.getFileName().toString(), relativePath4);%0A%0A    %7D%0A%7D%0A%0A

Add sharing syncer test