package ru.matevosyan;

import org.junit.Test;

import java.io.File;
import java.io.IOException;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.*;

/**
 * Created SortFile for testing sort big file and write it to a new file.
 * Created on 19.02.2017.
 * @since 1.0
 * @author Matevosyan Vardan
 * @version 1.0
 */
public class SortFileTest {
    @Test
    public void whenAddFileThanSortToAnotherFile() {
        String pathSource = "\\\\Server2008\\общие докумены\\Производственный отдел\\Abbat.txt";
        String pathDist = "\\\\Server2008\\общие докумены\\Производственный отдел\\AbbatResult.txt";

        File sourceFile = new File(pathSource);
        File distFile = new File(pathDist);

        SortFile sortFile = new SortFile();

        try {
            sortFile.sort(sourceFile, distFile);
        } catch (IOException ioe) {
            System.out.println(ioe.getMessage());
        }

        long l = sourceFile.length();

        assertThat(distFile.length(), is(l));
    }


}
@@ -456,157 +456,99 @@
  = %22
-%5C%5C%5C%5CServer2008%5C%5C%D0%BE%D0%B1%D1%89%D0%B8%D0%B5 %D0%B4%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%8B%5C%5C%D0%9F%D1%80%D0%BE%D0%B8%D0%B7%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%B5%D0%BD%D0%BD%D1%8B%D0%B9 %D0%BE%D1%82%D0%B4%D0%B5%D0%BB%5C%5CAbbat.txt%22;%0A        String pathDist = %22%5C%5C%5C%5CServer2008%5C%5C%D0%BE%D0%B1%D1%89%D0%B8%D0%B5 %D0%B4%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%8B%5C%5C%D0%9F%D1%80%D0%BE%D0%B8%D0%B7%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%B5%D0%BD%D0%BD%D1%8B%D0%B9 %D0%BE%D1%82%D0%B4%D0%B5%D0%BB
+C:%5C%5CUsers%5C%5CAdmin%5C%5CDesktop%5C%5CAbbat.txt%22;%0A        String pathDist = %22C:%5C%5CUsers%5C%5CAdmin%5C%5CDesktop
 %5C%5CAb
@@ -556,16 +556,17 @@
 atResult
+s
 .txt%22;%0A%0A

change sortArray method