X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fanalysis%2FAnnotationSorterTest.java;h=9dd297256eab89b662058fe4aaf17f3d9916af42;hb=8f118c154e74caaef6bec19acd0466904ac424d4;hp=47271e58b1cda7a3e854a2851cd3242ca6f815f4;hpb=6b106f39c410cbb2b1714b905948d68b91a341dd;p=jalview.git diff --git a/test/jalview/analysis/AnnotationSorterTest.java b/test/jalview/analysis/AnnotationSorterTest.java index 47271e5..9dd2972 100644 --- a/test/jalview/analysis/AnnotationSorterTest.java +++ b/test/jalview/analysis/AnnotationSorterTest.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.analysis; import static org.testng.AssertJUnit.assertEquals; @@ -30,7 +50,7 @@ public class AnnotationSorterTest /* * Set up 6 sequences and 7 annotations. */ - @BeforeMethod(alwaysRun = true) + @BeforeMethod(alwaysRun = true) public void setUp() { al = buildAlignment(NUM_SEQS); @@ -84,7 +104,7 @@ public class AnnotationSorterTest * sequence ref * */ - @Test(groups ={ "Functional" }) + @Test(groups = { "Functional" }) public void testSortBySequenceAndType_autocalcLast() { // @formatter:off @@ -111,7 +131,7 @@ public class AnnotationSorterTest /** * Variant with autocalculated annotations sorting to front */ - @Test(groups ={ "Functional" }) + @Test(groups = { "Functional" }) public void testSortBySequenceAndType_autocalcFirst() { // @formatter:off @@ -147,7 +167,7 @@ public class AnnotationSorterTest * sequence ref * */ - @Test(groups ={ "Functional" }) + @Test(groups = { "Functional" }) public void testSortByTypeAndSequence_autocalcLast() { // @formatter:off @@ -174,7 +194,7 @@ public class AnnotationSorterTest /** * Variant of test with autocalculated annotations sorted to front */ - @Test(groups ={ "Functional" }) + @Test(groups = { "Functional" }) public void testSortByTypeAndSequence_autocalcFirst() { // @formatter:off @@ -202,7 +222,7 @@ public class AnnotationSorterTest * Variant of test with autocalculated annotations sorted to front but * otherwise no change. */ - @Test(groups ={ "Functional" }) + @Test(groups = { "Functional" }) public void testNoSort_autocalcFirst() { // @formatter:off @@ -226,7 +246,7 @@ public class AnnotationSorterTest assertEquals("Structure", anns[6].label); } - @Test(groups ={ "Functional" }) + @Test(groups = { "Functional" }) public void testSort_timingPresorted() { testTiming_presorted(50, 100); @@ -262,14 +282,14 @@ public class AnnotationSorterTest long endTime = System.currentTimeMillis(); final long elapsed = endTime - startTime; System.out.println("Timing test for presorted " + numSeqs - + " sequences and " - + numAnns + " annotations took " + elapsed + "ms"); + + " sequences and " + numAnns + " annotations took " + elapsed + + "ms"); } /** * Timing tests for sorting randomly sorted annotations for various sizes. */ - @Test(groups ={ "Functional" }) + @Test(groups = { "Functional" }) public void testSort_timingUnsorted() { testTiming_unsorted(50, 100); @@ -306,14 +326,14 @@ public class AnnotationSorterTest long endTime = System.currentTimeMillis(); final long elapsed = endTime - startTime; System.out.println("Timing test for unsorted " + numSeqs - + " sequences and " - + numAnns + " annotations took " + elapsed + "ms"); + + " sequences and " + numAnns + " annotations took " + elapsed + + "ms"); } /** * Timing test for sorting annotations with a limited range of types (labels). */ - @Test(groups ={ "Functional" }) + @Test(groups = { "Functional" }) public void testSort_timingSemisorted() { testTiming_semiSorted(50, 100); @@ -339,8 +359,8 @@ public class AnnotationSorterTest Alignment alignment = buildAlignment(numSeqs); AlignmentAnnotation[] annotations = buildAnnotations(numAnns); - String[] labels = new String[] - { "label1", "label2", "label3", "label4", "label5", "label6" }; + String[] labels = new String[] { "label1", "label2", "label3", + "label4", "label5", "label6" }; /* * Set the annotations in sequence order with randomly assigned labels. @@ -359,8 +379,8 @@ public class AnnotationSorterTest long endTime = System.currentTimeMillis(); long elapsed = endTime - startTime; System.out.println("Sort by label for semisorted " + numSeqs - + " sequences and " - + numAnns + " annotations took " + elapsed + "ms"); + + " sequences and " + numAnns + " annotations took " + elapsed + + "ms"); // now resort by sequence startTime = System.currentTimeMillis();