X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fdatamodel%2FAlignmentAnnotationTests.java;h=f9e99d0733e22fb2f53ae54c0d733deb7cc76230;hb=c0501eaa85c0594f9275766f64de8ea44a59c368;hp=ade91504cfaffda66239d46082c9a53648f63157;hpb=304e64fb34b32659be1bbfd39fb4e15b2f79586e;p=jalview.git diff --git a/test/jalview/datamodel/AlignmentAnnotationTests.java b/test/jalview/datamodel/AlignmentAnnotationTests.java index ade9150..f9e99d0 100644 --- a/test/jalview/datamodel/AlignmentAnnotationTests.java +++ b/test/jalview/datamodel/AlignmentAnnotationTests.java @@ -74,8 +74,8 @@ public class AlignmentAnnotationTests al[i] = new Annotation(new Annotation("" + sq.getCharAt(i), "", (char) 0, sq.findPosition(i))); } - AlignmentAnnotation alan = new AlignmentAnnotation("For " - + sq.getName(), "Fake alignment annot", al); + AlignmentAnnotation alan = new AlignmentAnnotation( + "For " + sq.getName(), "Fake alignment annot", al); // create a sequence mapping for the annotation vector in its current state alan.createSequenceMapping(sq, sq.getStart(), false); alan.setProperty("CreatedBy", "createAnnotation"); @@ -98,9 +98,11 @@ public class AlignmentAnnotationTests { if (ala.annotations[p] != null) { - assertEquals("Mismatch at position " + p - + " between annotation position value and sequence" - + ala.annotations[p], (int) ala.annotations[p].value, + assertEquals( + "Mismatch at position " + p + + " between annotation position value and sequence" + + ala.annotations[p], + (int) ala.annotations[p].value, ala.sequenceRef.findPosition(p)); } } @@ -135,10 +137,9 @@ public class AlignmentAnnotationTests alSeq2.setStart(sqTo.getStart() + align.getSeq2Start() - 1); alSeq2.setEnd(sqTo.getStart() + align.getSeq2End() - 1); alSeq2.setDatasetSequence(sqTo); - System.out.println(new AppletFormatAdapter() -.formatSequences( - FileFormat.Stockholm, new Alignment(new SequenceI[] { sqFrom, - alSeq1, sqTo, alSeq2 }), true)); + System.out.println(new AppletFormatAdapter().formatSequences( + FileFormat.Stockholm, new Alignment(new SequenceI[] + { sqFrom, alSeq1, sqTo, alSeq2 }), true)); Mapping mp = align.getMappingFromS1(false); @@ -161,9 +162,8 @@ public class AlignmentAnnotationTests AlignmentI all = new Alignment(new SequenceI[] { alSeq1, alSeq2 }); all.addAnnotation(almap1); all.addAnnotation(almap2); - System.out.println(new AppletFormatAdapter().formatSequences( - FileFormat.Stockholm, - all, true)); + System.out.println(new AppletFormatAdapter() + .formatSequences(FileFormat.Stockholm, all, true)); for (int p = 0; p < alSeq1.getLength(); p++) { @@ -186,12 +186,12 @@ public class AlignmentAnnotationTests "Mismatch on Original To and transferred annotation on 1", (orig1 != null) ? orig1.toString() : null, (trans1 != null) ? trans1.toString() : null); - String alm1 = "" - + (almap1.annotations.length > p ? almap1.annotations[p].displayCharacter - : "Out of range"); - String alm2 = "" - + (almap2.annotations.length > p ? almap2.annotations[p].displayCharacter - : "Out of range"); + String alm1 = "" + (almap1.annotations.length > p + ? almap1.annotations[p].displayCharacter + : "Out of range"); + String alm2 = "" + (almap2.annotations.length > p + ? almap2.annotations[p].displayCharacter + : "Out of range"); assertEquals("Position " + p + " " + alm1 + " " + alm2, alm1, alm2); } } @@ -322,21 +322,24 @@ public class AlignmentAnnotationTests Assert.assertFalse(ann.isQuantitative(), "Empty annotation set should not be quantitative."); - ann = new AlignmentAnnotation("an", "some an", new Annotation[] { - newAnnotation("4"), newAnnotation("1"), newAnnotation("1"), - newAnnotation("0.1"), newAnnotation("0.3") }); + ann = new AlignmentAnnotation("an", "some an", + new Annotation[] + { newAnnotation("4"), newAnnotation("1"), newAnnotation("1"), + newAnnotation("0.1"), newAnnotation("0.3") }); Assert.assertTrue(ann.isQuantitative(), "All numbers annotation set should be quantitative."); - ann = new AlignmentAnnotation("an", "some an", new Annotation[] { - newAnnotation("E"), newAnnotation("E"), newAnnotation("E"), - newAnnotation("E"), newAnnotation("E") }); + ann = new AlignmentAnnotation("an", "some an", + new Annotation[] + { newAnnotation("E"), newAnnotation("E"), newAnnotation("E"), + newAnnotation("E"), newAnnotation("E") }); Assert.assertFalse(ann.isQuantitative(), "All 'E' annotation set should not be quantitative."); - ann = new AlignmentAnnotation("an", "some an", new Annotation[] { - newAnnotation("E"), newAnnotation("1"), newAnnotation("2"), - newAnnotation("3"), newAnnotation("E") }); + ann = new AlignmentAnnotation("an", "some an", + new Annotation[] + { newAnnotation("E"), newAnnotation("1"), newAnnotation("2"), + newAnnotation("3"), newAnnotation("E") }); Assert.assertTrue(ann.isQuantitative(), "Mixed 'E' annotation set should be quantitative."); }