X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Fjalview%2Fgui%2FPopupMenuTest.java;h=ba1b2757f4f726a596662a9b29656f245f61fa70;hb=9c5872525e4587979d60c2a7ca93d1e527fae5c1;hp=f7b148264545df889667a849473918777674d7d3;hpb=4935082f08648ab92743e14e5e2dfefa3e0dcd4d;p=jalview.git diff --git a/test/jalview/gui/PopupMenuTest.java b/test/jalview/gui/PopupMenuTest.java index f7b1482..ba1b275 100644 --- a/test/jalview/gui/PopupMenuTest.java +++ b/test/jalview/gui/PopupMenuTest.java @@ -1,14 +1,15 @@ package jalview.gui; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertFalse; +import static org.testng.AssertJUnit.assertTrue; + import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; +import jalview.datamodel.Annotation; import jalview.datamodel.SequenceI; import jalview.io.AppletFormatAdapter; import jalview.io.FormatAdapter; -import jalview.util.MessageManager; import java.awt.Component; import java.io.IOException; @@ -20,8 +21,8 @@ import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.JSeparator; -import org.junit.Before; -import org.junit.Test; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; public class PopupMenuTest { @@ -40,7 +41,7 @@ public class PopupMenuTest PopupMenu testee = null; - @Before + @BeforeMethod public void setUp() throws IOException { alignment = new FormatAdapter().readFile(TEST_DATA, @@ -66,12 +67,9 @@ public class PopupMenuTest List seqs = new ArrayList(); testee.configureReferenceAnnotationsMenu(menu, seqs); assertFalse(menu.isEnabled()); - assertEquals( - MessageManager.getString("label.add_reference_annotations"), - menu.getText()); // now try null list menu.setEnabled(true); - testee.configureReferenceAnnotationsMenu(menu, seqs); + testee.configureReferenceAnnotationsMenu(menu, null); assertFalse(menu.isEnabled()); } @@ -132,7 +130,7 @@ public class PopupMenuTest testee.configureReferenceAnnotationsMenu(menu, seqs); assertTrue(menu.isEnabled()); - String expected = "
Add annotations for
JMOL/secondary structure
PBD/Temp
"; + String expected = "
Add annotations for
JMOL/secondary structure
PBD/Temp
"; assertEquals(expected, menu.getToolTipText()); } @@ -153,7 +151,7 @@ public class PopupMenuTest testee.configureReferenceAnnotationsMenu(menu, seqs); assertTrue(menu.isEnabled()); - String expected = "
Add annotations for
JMOL/secondary structure
PBD/Temp
"; + String expected = "
Add annotations for
JMOL/secondary structure
PBD/Temp
"; assertEquals(expected, menu.getToolTipText()); } @@ -241,28 +239,32 @@ public class PopupMenuTest // PDB.secondary structure on Sequence0 AlignmentAnnotation annotation = new AlignmentAnnotation( - "secondary structure", "", 0); + "secondary structure", "", new Annotation[] + {}); annotation.setCalcId("PDB"); annotation.visible = true; seqs.get(0).addAlignmentAnnotation(annotation); parentPanel.getAlignment().addAnnotation(annotation); // JMOL.secondary structure on Sequence0 - hidden - annotation = new AlignmentAnnotation("secondary structure", "", 0); + annotation = new AlignmentAnnotation("secondary structure", "", new Annotation[] + {}); annotation.setCalcId("JMOL"); annotation.visible = false; seqs.get(0).addAlignmentAnnotation(annotation); parentPanel.getAlignment().addAnnotation(annotation); // Jpred.SSP on Sequence0 - hidden - annotation = new AlignmentAnnotation("SSP", "", 0); + annotation = new AlignmentAnnotation("SSP", "", new Annotation[] + {}); annotation.setCalcId("JPred"); annotation.visible = false; seqs.get(0).addAlignmentAnnotation(annotation); parentPanel.getAlignment().addAnnotation(annotation); // PDB.Temp on Sequence1 - annotation = new AlignmentAnnotation("Temp", "", 0); + annotation = new AlignmentAnnotation("Temp", "", new Annotation[] + {}); annotation.setCalcId("PDB"); annotation.visible = true; seqs.get(1).addAlignmentAnnotation(annotation); @@ -319,14 +321,16 @@ public class PopupMenuTest // PDB.secondary structure on Sequence0 AlignmentAnnotation annotation = new AlignmentAnnotation( - "secondary structure", "", 0); + "secondary structure", "", new Annotation[] + {}); annotation.setCalcId("PDB"); annotation.visible = true; seqs.get(0).addAlignmentAnnotation(annotation); parentPanel.getAlignment().addAnnotation(annotation); // PDB.Temp on Sequence1 - annotation = new AlignmentAnnotation("Temp", "", 0); + annotation = new AlignmentAnnotation("Temp", "", new Annotation[] + {}); annotation.setCalcId("PDB"); annotation.visible = true; seqs.get(1).addAlignmentAnnotation(annotation); @@ -376,14 +380,16 @@ public class PopupMenuTest // PDB.secondary structure on Sequence0 AlignmentAnnotation annotation = new AlignmentAnnotation( - "secondary structure", "", 0); + "secondary structure", "", new Annotation[] + {}); annotation.setCalcId("PDB"); annotation.visible = false; seqs.get(0).addAlignmentAnnotation(annotation); parentPanel.getAlignment().addAnnotation(annotation); // PDB.Temp on Sequence1 - annotation = new AlignmentAnnotation("Temp", "", 0); + annotation = new AlignmentAnnotation("Temp", "", new Annotation[] + {}); annotation.setCalcId("PDB2"); annotation.visible = false; seqs.get(1).addAlignmentAnnotation(annotation);