JAL-2349 JAL-3855 fix failing tests
authorJim Procter <j.procter@dundee.ac.uk>
Fri, 21 Oct 2022 15:21:51 +0000 (16:21 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Fri, 21 Oct 2022 15:21:51 +0000 (16:21 +0100)
src/jalview/gui/AnnotationPanel.java
src/mc_view/PDBChain.java
test/mc_view/PDBfileTest.java

index 615fbdd..e12cc3f 100755 (executable)
@@ -1019,15 +1019,14 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
   static int[] getRowIndexAndOffset(int yPos, AlignmentAnnotation[] aa)
   {
     int[] res = new int[2];
+    res[0] = -1;
+    res[1] = 0;
     if (aa == null)
     {
-      res[0] = -1;
-      res[1] = 0;
       return res;
     }
     int row = -1;
     int height = 0, lheight = 0;
-
     for (int i = 0; i < aa.length; i++)
     {
       if (aa[i].visible)
index 035e608..5413a3c 100755 (executable)
@@ -82,7 +82,7 @@ public class PDBChain
   public String pdbid = "";
 
   AnnotationRowBuilder tfacTemplate = new AnnotationRowBuilder(
-          "TemperatureFactor");
+          "Temperature Factor");
 
   public PDBChain(String thePdbid, String theId,
           AnnotationRowBuilder template)
index b636669..cae183a 100644 (file)
@@ -26,6 +26,13 @@ import static org.testng.AssertJUnit.assertNull;
 import static org.testng.AssertJUnit.assertSame;
 import static org.testng.AssertJUnit.assertTrue;
 
+import java.io.IOException;
+import java.util.List;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
 import jalview.bin.Cache;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
@@ -37,13 +44,6 @@ import jalview.gui.JvOptionPane;
 import jalview.io.DataSourceType;
 import jalview.structure.StructureImportSettings;
 
-import java.io.IOException;
-import java.util.List;
-
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
 public class PDBfileTest
 {
 
@@ -286,10 +286,10 @@ public class PDBfileTest
     for (int i = 0; i < 20; i++)
     {
       assertNull(anns[0].annotations[i]);
-      assertEquals("E", anns[0].annotations[20].displayCharacter);
+      assertNull(anns[0].annotations[20].displayCharacter);
       assertEquals('E', anns[0].annotations[20].secondaryStructure);
-      assertEquals("E", anns[2].annotations[18].displayCharacter);
-      assertEquals("H", anns[2].annotations[23].displayCharacter);
+      assertEquals('E', anns[2].annotations[18].secondaryStructure);
+      assertEquals('H', anns[2].annotations[23].secondaryStructure);
     }
   }