package jalview.io.gff;
import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertSame;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceDummy;
+import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
+import jalview.gui.JvOptionPane;
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 InterProScanHelperTest
{
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
/**
* Test processing one InterProScan GFF line
*
assertEquals(1, newseqs.size());
assertTrue(newseqs.get(0) instanceof SequenceDummy);
assertEquals("match$17_5_30", newseqs.get(0).getName());
+
+ assertNotNull(newseqs.get(0).getSequenceFeatures());
+ assertEquals(1, newseqs.get(0).getSequenceFeatures().size());
+ SequenceFeature sf = newseqs.get(0).getSequenceFeatures().get(0);
+ assertEquals(1, sf.getBegin());
+ assertEquals(26, sf.getEnd());
+ assertEquals("Pfam", sf.getType());
+ assertEquals("4Fe-4S dicluster domain", sf.getDescription());
+ assertEquals("InterProScan", sf.getFeatureGroup());
+
assertEquals(1, align.getCodonFrames().size());
AlignedCodonFrame mapping = align.getCodonFrames().iterator().next();
assertSame(newseqs.get(0), mapping.getAaSeqs()[0]);
assertEquals(1, mapping.getdnaToProt().length);
assertEquals(1, mapping.getdnaToProt()[0].getFromRanges().size());
- assertArrayEquals(new int[] { 5, 30 }, mapping.getdnaToProt()[0]
- .getFromRanges().get(0));
+ assertArrayEquals(new int[] { 5, 30 },
+ mapping.getdnaToProt()[0].getFromRanges().get(0));
assertEquals(1, mapping.getdnaToProt()[0].getToRanges().size());
- assertArrayEquals(new int[] { 1, 26 }, mapping.getdnaToProt()[0]
- .getToRanges().get(0));
+ assertArrayEquals(new int[] { 1, 26 },
+ mapping.getdnaToProt()[0].getToRanges().get(0));
}
}