import jalview.datamodel.SequenceDummy;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
+import jalview.gui.JvOptionPane;
+import jalview.io.DataSourceType;
import jalview.io.FileLoader;
-import jalview.io.FormatAdapter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class ExonerateHelperTest
{
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
@Test(groups = "Functional")
public void testGetMappingType()
{
// protein-to-dna:
- assertSame(MappingType.PeptideToNucleotide,
- ExonerateHelper
- .getMappingType("exonerate:protein2genome:local"));
+ assertSame(MappingType.PeptideToNucleotide, ExonerateHelper
+ .getMappingType("exonerate:protein2genome:local"));
assertSame(MappingType.PeptideToNucleotide,
ExonerateHelper.getMappingType("exonerate:protein2dna:local"));
assertSame(newseqs.get(0), mapping.getdnaSeqs()[0]);
assertEquals(1, mapping.getdnaToProt().length);
assertEquals(1, mapping.getdnaToProt()[0].getFromRanges().size());
- assertArrayEquals(new int[] { 400, 423 }, mapping.getdnaToProt()[0]
- .getFromRanges().get(0));
+ assertArrayEquals(new int[] { 400, 423 },
+ mapping.getdnaToProt()[0].getFromRanges().get(0));
assertEquals(1, mapping.getdnaToProt()[0].getToRanges().size());
- assertArrayEquals(new int[] { 3, 10 }, mapping.getdnaToProt()[0]
- .getToRanges().get(0));
+ assertArrayEquals(new int[] { 3, 10 },
+ mapping.getdnaToProt()[0].getToRanges().get(0));
}
/**
assertSame(newseqs.get(0), mapping.getdnaSeqs()[0]);
assertEquals(1, mapping.getdnaToProt().length);
assertEquals(1, mapping.getdnaToProt()[0].getFromRanges().size());
- assertArrayEquals(new int[] { 400, 377 }, mapping.getdnaToProt()[0]
- .getFromRanges().get(0));
+ assertArrayEquals(new int[] { 400, 377 },
+ mapping.getdnaToProt()[0].getFromRanges().get(0));
assertEquals(1, mapping.getdnaToProt()[0].getToRanges().size());
- assertArrayEquals(new int[] { 3, 10 }, mapping.getdnaToProt()[0]
- .getToRanges().get(0));
+ assertArrayEquals(new int[] { 3, 10 },
+ mapping.getdnaToProt()[0].getToRanges().get(0));
}
/**
assertEquals(1, mapping.getdnaSeqs().length);
assertEquals(1, mapping.getdnaToProt().length);
assertEquals(1, mapping.getdnaToProt()[0].getFromRanges().size());
- assertArrayEquals(new int[] { 400, 423 }, mapping.getdnaToProt()[0]
- .getFromRanges().get(0));
+ assertArrayEquals(new int[] { 400, 423 },
+ mapping.getdnaToProt()[0].getFromRanges().get(0));
assertEquals(1, mapping.getdnaToProt()[0].getToRanges().size());
- assertArrayEquals(new int[] { 3, 10 }, mapping.getdnaToProt()[0]
- .getToRanges().get(0));
+ assertArrayEquals(new int[] { 3, 10 },
+ mapping.getdnaToProt()[0].getToRanges().get(0));
}
/**
assertEquals(1, mapping.getdnaSeqs().length);
assertEquals(1, mapping.getdnaToProt().length);
assertEquals(1, mapping.getdnaToProt()[0].getFromRanges().size());
- assertArrayEquals(new int[] { 400, 377 }, mapping.getdnaToProt()[0]
- .getFromRanges().get(0));
+ assertArrayEquals(new int[] { 400, 377 },
+ mapping.getdnaToProt()[0].getFromRanges().get(0));
assertEquals(1, mapping.getdnaToProt()[0].getToRanges().size());
- assertArrayEquals(new int[] { 3, 10 }, mapping.getdnaToProt()[0]
- .getToRanges().get(0));
+ assertArrayEquals(new int[] { 3, 10 },
+ mapping.getdnaToProt()[0].getToRanges().get(0));
}
/**
{
FileLoader loader = new FileLoader(false);
AlignFrame af = loader.LoadFileWaitTillLoaded(
- "examples/testdata/exonerateseqs.fa", FormatAdapter.FILE);
+ "examples/testdata/exonerateseqs.fa", DataSourceType.FILE);
af.loadJalviewDataFile("examples/testdata/exonerateoutput.gff",
- FormatAdapter.FILE, null, null);
+ DataSourceType.FILE, null, null);
/*
* verify one mapping to a dummy sequence, one to a real one