From 3380595c6eb44d914e9a25958bc09c4e292e1c32 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 21 Oct 2022 16:21:51 +0100 Subject: [PATCH] JAL-2349 JAL-3855 fix failing tests --- src/jalview/gui/AnnotationPanel.java | 5 ++--- src/mc_view/PDBChain.java | 2 +- test/mc_view/PDBfileTest.java | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 615fbdd..e12cc3f 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -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) diff --git a/src/mc_view/PDBChain.java b/src/mc_view/PDBChain.java index 035e608..5413a3c 100755 --- a/src/mc_view/PDBChain.java +++ b/src/mc_view/PDBChain.java @@ -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) diff --git a/test/mc_view/PDBfileTest.java b/test/mc_view/PDBfileTest.java index b636669..cae183a 100644 --- a/test/mc_view/PDBfileTest.java +++ b/test/mc_view/PDBfileTest.java @@ -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); } } -- 1.7.10.2