Skip to content

Instantly share code, notes, and snippets.

@mdoering
Created July 2, 2021 10:44
Show Gist options
  • Select an option

  • Save mdoering/e27361c089d9aeff2f85c88bed9ce576 to your computer and use it in GitHub Desktop.

Select an option

Save mdoering/e27361c089d9aeff2f85c88bed9ce576 to your computer and use it in GitHub Desktop.
package life.catalogue.db.tree;
import life.catalogue.common.io.Resources;
import life.catalogue.dao.FileMetricsDatasetDao;
import java.io.File;
import org.apache.commons.lang3.time.StopWatch;
import org.junit.Test;
public class DatasetDiffServiceTest extends BaseDiffServiceTest<Integer> {
static int attemptCnt;
public DatasetDiffServiceTest() {
diff = new DatasetDiffService(factory(), new FileMetricsDatasetDao(factory(), treeRepoRule.getRepo()));
}
@Override
Integer provideTestKey() {
return 1;
}
@Test
public void diffItisNames() throws Exception {
final File f1 = Resources.toFile("trees/itis/36-names.txt.gz");
final File f2 = Resources.toFile("trees/itis/37-names.txt.gz");
StopWatch watch = StopWatch.createStarted();
var delta = diff.udiff(provideTestKey(), new int[]{1,2}, 0, i -> {
switch (i) {
case 1: return f1;
case 2: return f2;
}
return null;
});
watch.stop();
System.out.println(watch);
System.out.println(delta);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment