import static org.testng.Assert.assertEquals;
-import jalview.bin.Jalview;
import jalview.datamodel.Alignment;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
-import org.testng.annotations.AfterMethod;
+import java.awt.Dimension;
+
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
{
JvOptionPane.setInteractiveMode(false);
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
-
- Jalview.main(new String[] { "-nonews", "-props",
- "test/jalview/testProps.jvprops" });
- }
-
- @AfterMethod(alwaysRun = true)
- public void tearDown()
- {
- Desktop.instance.closeAll_actionPerformed(null);
}
/**
seq16, seq17, seq18, seq19, seq20, seq21, seq22, seq23 };
Alignment al = new Alignment(seqs);
al.setDataset(null);
- AlignViewport av = new AlignViewport(al);
- AlignFrame alignFrame = new AlignFrame(al, 700, 500);
- AlignmentPanel ap = new AlignmentPanel(alignFrame, av);
+ AlignFrame alignFrame = new AlignFrame(al, 500, 700);
+
+ alignFrame.alignPanel.getSeqPanel().seqCanvas
+ .setPreferredSize(new Dimension(300, 300));
- int oldres = av.getEndRes();
- ap.setScrollValues(-1, 5);
+ int oldres = alignFrame.getViewport().getEndRes();
+ alignFrame.alignPanel.setScrollValues(-1, 5);
// setting -ve x value does not change residue
- assertEquals(av.getEndRes(), oldres);
+ assertEquals(alignFrame.getViewport().getEndRes(), oldres);
- ap.setScrollValues(0, 5);
+ alignFrame.alignPanel.setScrollValues(0, 5);
// setting 0 as x value does not change residue
- assertEquals(av.getEndRes(), oldres);
+ assertEquals(alignFrame.getViewport().getEndRes(), oldres);
- ap.setScrollValues(5, 5);
+ alignFrame.alignPanel.setScrollValues(5, 5);
// setting x value to 20 extends endRes by 20px converted to residues
- assertEquals(av.getEndRes(), oldres + 5);
+ assertEquals(alignFrame.getViewport().getEndRes(), oldres + 5);
}