From a8c9bb134b3146ff69f70dc34cf8951f3a8b139c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 21 Jun 2013 11:58:47 +0100 Subject: [PATCH] JAL-1294 JAL-1325 test annotation threshold line equivalence --- src/jalview/datamodel/GraphLine.java | 15 +++++++++++++++ test/jalview/io/StockholmFileTest.java | 1 + 2 files changed, 16 insertions(+) diff --git a/src/jalview/datamodel/GraphLine.java b/src/jalview/datamodel/GraphLine.java index 494ffae..619dbd2 100755 --- a/src/jalview/datamodel/GraphLine.java +++ b/src/jalview/datamodel/GraphLine.java @@ -51,4 +51,19 @@ public class GraphLine displayed = from.displayed; } } + @Override + public boolean equals(Object obj) + { + if (obj!=null && obj instanceof GraphLine) + { + GraphLine other = (GraphLine) obj; + return displayed == other.displayed + && value != other.value + && (colour != null ? (other.colour != null && other.colour + .equals(label)) : other.colour == null) + && (label != null ? (other.label != null && other.label + .equals(label)) : other.label == null); + } + return false; + } } diff --git a/test/jalview/io/StockholmFileTest.java b/test/jalview/io/StockholmFileTest.java index a0c9336..1338514 100644 --- a/test/jalview/io/StockholmFileTest.java +++ b/test/jalview/io/StockholmFileTest.java @@ -147,6 +147,7 @@ public class StockholmFileTest // compare graphGroup or graph properties - needed to verify JAL-1299 assertTrue("Graph type not identical.",aa_original[i].graph==aa_new[i].graph); assertTrue("Visibility not identical.", aa_original[i].visible==aa_new[i].visible); + assertTrue("Threshold line not identical.", aa_original[i].threshold==null ? aa_new[i].threshold==null : aa_original[i].threshold.equals(aa_new[i].threshold)); // graphGroup may differ, but pattern should be the same Integer o_ggrp=new Integer(aa_original[i].graphGroup+2),n_ggrp=new Integer(aa_new[i].graphGroup+2); BitSet orig_g=orig_groups.get(o_ggrp),new_g=new_groups.get(n_ggrp); -- 1.7.10.2