From: Renia Correya Date: Wed, 12 Jun 2024 15:01:12 +0000 (+0100) Subject: JAL-4392 Fixed failed test cases X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=23a2d467f1b20c0f7663326e348c2b719c24b75d;p=jalview.git JAL-4392 Fixed failed test cases --- diff --git a/src/jalview/viewmodel/styles/ViewStyle.java b/src/jalview/viewmodel/styles/ViewStyle.java index cba0923..e856262 100644 --- a/src/jalview/viewmodel/styles/ViewStyle.java +++ b/src/jalview/viewmodel/styles/ViewStyle.java @@ -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 diff --git a/test/jalview/viewmodel/styles/ViewStyleTest.java b/test/jalview/viewmodel/styles/ViewStyleTest.java index 3019afa..ba8aa99 100644 --- a/test/jalview/viewmodel/styles/ViewStyleTest.java +++ b/test/jalview/viewmodel/styles/ViewStyleTest.java @@ -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 mutableList = new ArrayList<>(list); + mutableList.add("All"); + field.set(vs, mutableList); + } else { AssertJUnit.fail("Unhandled field type (add to test): "