X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Fjalview%2Fdatamodel%2FAlignmentAnnotationTests.java;h=2f46ecab0eda38bc336103e60dd62371e08884c9;hb=57738a1f3c19b1c3a00bd3ac5108f8cd0af32f99;hp=19a725ecfb1fd3ddc09edc3e627b085dea18ad0a;hpb=e7338a61f3ce96dadf44ac80b2b32cc5ba4b94c8;p=jalview.git diff --git a/test/jalview/datamodel/AlignmentAnnotationTests.java b/test/jalview/datamodel/AlignmentAnnotationTests.java index 19a725e..2f46eca 100644 --- a/test/jalview/datamodel/AlignmentAnnotationTests.java +++ b/test/jalview/datamodel/AlignmentAnnotationTests.java @@ -69,8 +69,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"); @@ -93,9 +93,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)); } } @@ -130,10 +132,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); @@ -156,9 +157,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++) { @@ -181,12 +181,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); } } @@ -317,21 +317,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."); }