package ru.matevosyan;

import org.junit.BeforeClass;
import org.junit.Test;

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

/**
 * 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 ZipWithStructureTest {

    private static String java;
    private static String classFormat;
    String[] s = new String[]{java, classFormat};
    private final static String folder_path_name = "D:\\dir";
    private static String outZip;

    /**
     * execute all common variable before start testing class methods, that use anywhere in the class.
     * @throws IOException when path to a file is invalid.
     */

    @BeforeClass
    public static void executeSameVariable() throws IOException {

        outZip = "D:\\dir.zip";
        java = "java";
        classFormat = "class";

    }

    /**
     * testing files size.
     */

    @Test
    public void whenAddFileAndSortToAnotherFileThanCheckFileSize() {
        ZipWithStructure zip = new ZipWithStructure(folder_path_name);

        try {
            zip.genListOfFiles(new File(folder_path_name), s);
            zip.zipping(outZip);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


}
@@ -479,22 +479,19 @@
  String 
-folder
+zip
 _path_na
@@ -500,19 +500,115 @@
  = %22D:%5C%5C
-dir
+Tracker-1.0-shaded.jar%22;%0A    private final static String FOLDER_PATH_NAME = %22D:%5C%5CTracker-1.0-shaded
 %22;%0A    p
@@ -925,16 +925,19 @@
 %22D:%5C%5Cdir
+Jar
 .zip%22;%0A 
@@ -1172,22 +1172,19 @@
 ructure(
-folder
+zip
 _path_na
@@ -1203,16 +1203,76 @@
   try %7B%0A
+            zip.unzipping(zip_path_name, FOLDER_PATH_NAME);%0A
         
@@ -1307,14 +1307,11 @@
 ile(
-folder
+zip
 _pat

add call unzipping