package ie.tcd.slscs.kfclone;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Created by Abair on 20/07/2016.
 */
public class ImpExpTest {
    @Test
    public void load() throws Exception {

    }

}
@@ -35,181 +35,1696 @@
 ort 
-org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A * Created by Abair on 20/07/2016.%0A */%0Apublic class ImpExpTest %7B%0A    @Test%0A    public void load() throws Exception %7B%0A
+ie.tcd.slscs.ngramtool.NGram;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0Aimport org.junit.rules.TemporaryFolder;%0A%0Aimport java.io.*;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class ImpExpTest %7B%0A    private TemporaryFolder tempFolder;%0A    private File tempFile;%0A    private OutputStream fos;%0A    private OutputStreamWriter osw;%0A    private BufferedWriter bw;%0A    private List%3CNGram%3E expList;%0A    private FileInputStream readBackIn;%0A%0A    public ImpExpTest() %7B%0A        expList = new ArrayList%3CNGram%3E();%0A        expList.add(new NGram(%22this is a%22, 6));%0A        expList.add(new NGram(%22is a small%22, 6));%0A        expList.add(new NGram(%22a small test%22, 6));%0A%0A        try %7B%0A            tempFolder = new TemporaryFolder();%0A            tempFolder.create();%0A            tempFile = tempFolder.newFile(%22test.txt%22);%0A            fos = new FileOutputStream(tempFile);%0A            osw = new OutputStreamWriter(fos);%0A            bw = new BufferedWriter(osw);%0A%0A            readBackIn = new FileInputStream(tempFile);%0A%0A            bw.write(%22this is a%5Ct6%22);%0A            bw.newLine();%0A            bw.write(%22is a small%5Ct6%22);%0A            bw.newLine();%0A            bw.write(%22a small test%5Ct6%22);%0A            bw.newLine();%0A%0A            bw.close();%0A            osw.close();%0A            fos.close();%0A%0A        %7D catch (Exception e) %7B%0A            System.out.print(e);%0A        %7D%0A%0A    %7D%0A%0A    // FIXME: why does this fail?%0A    @Test%0A    public void load() throws Exception %7B%0A        List%3CNGram%3E out = ImpExp.load(readBackIn);%0A        for (NGram n : out) %7B%0A            System.out.println(n.getText() + %22 : %22 + n.getCount());%0A        %7D%0A        //assert(out.equals(expList));
 %0A   

add (failing, for no apparent reason) test