// Path: commons/src/main/java/pl/edu/icm/coansys/commons/java/Pair.java
// public class Pair<K,V> {
// 	public Pair(K x, V y) {
// 		this.x = x;
// 		this.y = y;
// 	}
// 	
// 	private K x;
// 	private V y;
// 	
// 	public K getX() {
// 		return x;
// 	}
// 	public void setX(K x) {
// 		this.x = x;
// 	}
// 	public V getY() {
// 		return y;
// 	}
// 	public void setY(V y) {
// 		this.y = y;
// 	}
// 
//     @Override
//     public int hashCode() {
//         int hash = 5;
//         hash = 23 * hash + Objects.hashCode(this.x);
//         hash = 23 * hash + Objects.hashCode(this.y);
//         return hash;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (this == obj) {
//             return true;
//         }
//         if (obj == null) {
//             return false;
//         }
//         if (!( obj instanceof Pair )) {
//             return false;
//         }
//         final Pair<?, ?> other = (Pair<?, ?>) obj;
//         if (!Objects.equals(this.x, other.x)) {
//             return false;
//         }
//         if (!Objects.equals(this.y, other.y)) {
//             return false;
//         }
//         return true;
//     }
//     
//     
//     
//     
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.FalseFileFilter;
import org.apache.commons.io.filefilter.RegexFileFilter;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.ToolRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import pl.edu.icm.coansys.commons.hadoop.SequenceFileUtils;
import pl.edu.icm.coansys.commons.java.Pair;
import pl.edu.icm.coansys.deduplication.document.tool.DuplicateGenerator;
/*
 * This file is part of CoAnSys project.
 * Copyright (c) 2012-2015 ICM-UW
 * 
 * CoAnSys is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * CoAnSys is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with CoAnSys. If not, see <http://www.gnu.org/licenses/>.
 */

package pl.edu.icm.coansys.deduplication.document;




public class DuplicatesDetectorBigTest {
    
    private static Logger log = LoggerFactory.getLogger(DuplicatesDetectorBigTest.class);
    
    private URL baseOutputUrl = this.getClass().getResource("/");
    private String outputDir = baseOutputUrl.getPath() + "/bigTestOut";
    
    
    @BeforeTest
    public void before() throws Exception{
        URL inputSeqFileUrl = this.getClass().getResource("/test_input_yadda_2000.seq");
        ToolRunner.run(new Configuration(), new DuplicateGenerator(), new String[]{inputSeqFileUrl.getFile(), this.getClass().getResource("/").getFile()});
        FileUtils.deleteDirectory(new File(outputDir));
        URL inputFileUrl = this.getClass().getResource("/generated/ambiguous-publications.seq");
        ToolRunner.run(new Configuration(), new DuplicateWorkDetector(), new String[]{inputFileUrl.getPath(), outputDir});
    }
    
    @AfterTest
    public void after() throws Exception{
        FileUtils.deleteDirectory(new File(outputDir));
    }
    
    
// Path: commons/src/main/java/pl/edu/icm/coansys/commons/java/Pair.java
// public class Pair<K,V> {
// 	public Pair(K x, V y) {
// 		this.x = x;
// 		this.y = y;
// 	}
// 	
// 	private K x;
// 	private V y;
// 	
// 	public K getX() {
// 		return x;
// 	}
// 	public void setX(K x) {
// 		this.x = x;
// 	}
// 	public V getY() {
// 		return y;
// 	}
// 	public void setY(V y) {
// 		this.y = y;
// 	}
// 
//     @Override
//     public int hashCode() {
//         int hash = 5;
//         hash = 23 * hash + Objects.hashCode(this.x);
//         hash = 23 * hash + Objects.hashCode(this.y);
//         return hash;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (this == obj) {
//             return true;
//         }
//         if (obj == null) {
//             return false;
//         }
//         if (!( obj instanceof Pair )) {
//             return false;
//         }
//         final Pair<?, ?> other = (Pair<?, ?>) obj;
//         if (!Objects.equals(this.x, other.x)) {
//             return false;
//         }
//         if (!Objects.equals(this.y, other.y)) {
//             return false;
//         }
//         return true;
//     }
//     
//     
//     
//     
// }


// Path: deduplication-document/deduplication-document-impl/src/test/java/pl/edu/icm/coansys/deduplication/document/DuplicatesDetectorBigTest.java
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.FalseFileFilter;
import org.apache.commons.io.filefilter.RegexFileFilter;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.ToolRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import pl.edu.icm.coansys.commons.hadoop.SequenceFileUtils;
import pl.edu.icm.coansys.commons.java.Pair;
import pl.edu.icm.coansys.deduplication.document.tool.DuplicateGenerator;

/*
 * This file is part of CoAnSys project.
 * Copyright (c) 2012-2015 ICM-UW
 * 
 * CoAnSys is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * CoAnSys is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with CoAnSys. If not, see <http://www.gnu.org/licenses/>.
 */

package pl.edu.icm.coansys.deduplication.document;




public class DuplicatesDetectorBigTest {
    
    private static Logger log = LoggerFactory.getLogger(DuplicatesDetectorBigTest.class);
    
    private URL baseOutputUrl = this.getClass().getResource("/");
    private String outputDir = baseOutputUrl.getPath() + "/bigTestOut";
    
    
    @BeforeTest
    public void before() throws Exception{
        URL inputSeqFileUrl = this.getClass().getResource("/test_input_yadda_2000.seq");
        ToolRunner.run(new Configuration(), new DuplicateGenerator(), new String[]{inputSeqFileUrl.getFile(), this.getClass().getResource("/").getFile()});
        FileUtils.deleteDirectory(new File(outputDir));
        URL inputFileUrl = this.getClass().getResource("/generated/ambiguous-publications.seq");
        ToolRunner.run(new Configuration(), new DuplicateWorkDetector(), new String[]{inputFileUrl.getPath(), outputDir});
    }
    
    @AfterTest
    public void after() throws Exception{
        FileUtils.deleteDirectory(new File(outputDir));
    }
    
    
    public void addPairToHashMap(HashMap<String,Set<String>> map, Pair<String,String> p) {