JAL-4392 Fixed failed test cases
authorRenia Correya <rcorreya001@dundee.ac.uk>
Wed, 12 Jun 2024 15:01:12 +0000 (16:01 +0100)
committerRenia Correya <rcorreya001@dundee.ac.uk>
Wed, 12 Jun 2024 15:01:12 +0000 (16:01 +0100)
src/jalview/viewmodel/styles/ViewStyle.java
test/jalview/viewmodel/styles/ViewStyleTest.java

index cba0923..e856262 100644 (file)
@@ -225,6 +225,7 @@ public class ViewStyle implements ViewStyleI
     setUpperCasebold(vs.isUpperCasebold());
     setWrapAlignment(vs.getWrapAlignment());
     setWrappedWidth(vs.getWrappedWidth());
+    setSecondaryStructureSources(vs.getSecondaryStructureSources());
     // ViewStyle.configureFrom(this, viewStyle);
   }
 
@@ -287,7 +288,8 @@ public class ViewStyle implements ViewStyleI
             && getThresholdTextColour() == vs.getThresholdTextColour()
             && isUpperCasebold() == vs.isUpperCasebold()
             && getWrapAlignment() == vs.getWrapAlignment()
-            && getWrappedWidth() == vs.getWrappedWidth());
+            && getWrappedWidth() == vs.getWrappedWidth()
+            && getSecondaryStructureSources() == vs.getSecondaryStructureSources());
     /*
      * and compare non-primitive types; syntax below will match null with null
      * values
index 3019afa..ba8aa99 100644 (file)
@@ -27,7 +27,10 @@ import static org.testng.AssertJUnit.assertTrue;
 import jalview.gui.JvOptionPane;
 
 import java.awt.Color;
+import java.awt.Container;
 import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Random;
 
 import org.testng.AssertJUnit;
@@ -177,6 +180,13 @@ public class ViewStyleTest
       field.set(vs,
               Color.RED.equals(field.get(vs)) ? Color.BLACK : Color.RED);
     }
+    else if (type.equals(java.util.List.class))
+    {
+      List<?> list = (List<?>) field.get(vs);
+      List<Object> mutableList = new ArrayList<>(list);
+      mutableList.add("All");
+      field.set(vs, mutableList);
+    }
     else
     {
       AssertJUnit.fail("Unhandled field type (add to test): "