git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-4195 add exception handling for all other CommandsTest tests and remove errant...
[jalview.git]
/
test
/
jalview
/
analysis
/
AnnotationSorterTest.java
diff --git
a/test/jalview/analysis/AnnotationSorterTest.java
b/test/jalview/analysis/AnnotationSorterTest.java
index
d6b31a0
..
11c42ed
100644
(file)
--- a/
test/jalview/analysis/AnnotationSorterTest.java
+++ b/
test/jalview/analysis/AnnotationSorterTest.java
@@
-1,6
+1,6
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*
* This file is part of Jalview.
*
@@
-27,16
+27,26
@@
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
+import jalview.gui.JvOptionPane;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class AnnotationSorterTest
{
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class AnnotationSorterTest
{
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
private static final int NUM_SEQS = 6;
private static final int NUM_ANNS = 7;
private static final int NUM_SEQS = 6;
private static final int NUM_ANNS = 7;
@@
-281,9
+291,9
@@
public class AnnotationSorterTest
testee.sort(annotations, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
long endTime = System.currentTimeMillis();
final long elapsed = endTime - startTime;
testee.sort(annotations, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
long endTime = System.currentTimeMillis();
final long elapsed = endTime - startTime;
- System.out.println("Timing test for presorted " + numSeqs
- + " sequences and " + numAnns + " annotations took " + elapsed
- + "ms");
+ System.out.println(
+ "Timing test for presorted " + numSeqs + " sequences and "
+ + numAnns + " annotations took " + elapsed + "ms");
}
/**
}
/**
@@
-325,9
+335,9
@@
public class AnnotationSorterTest
testee.sort(annotations, SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
long endTime = System.currentTimeMillis();
final long elapsed = endTime - startTime;
testee.sort(annotations, SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
long endTime = System.currentTimeMillis();
final long elapsed = endTime - startTime;
- System.out.println("Timing test for unsorted " + numSeqs
- + " sequences and " + numAnns + " annotations took " + elapsed
- + "ms");
+ System.out.println(
+ "Timing test for unsorted " + numSeqs + " sequences and "
+ + numAnns + " annotations took " + elapsed + "ms");
}
/**
}
/**
@@
-359,8
+369,8
@@
public class AnnotationSorterTest
Alignment alignment = buildAlignment(numSeqs);
AlignmentAnnotation[] annotations = buildAnnotations(numAnns);
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.
/*
* Set the annotations in sequence order with randomly assigned labels.
@@
-378,9
+388,9
@@
public class AnnotationSorterTest
testee.sort(annotations, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
long endTime = System.currentTimeMillis();
long elapsed = endTime - startTime;
testee.sort(annotations, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
long endTime = System.currentTimeMillis();
long elapsed = endTime - startTime;
- System.out.println("Sort by label for semisorted " + numSeqs
- + " sequences and " + numAnns + " annotations took " + elapsed
- + "ms");
+ System.out.println(
+ "Sort by label for semisorted " + numSeqs + " sequences and "
+ + numAnns + " annotations took " + elapsed + "ms");
// now resort by sequence
startTime = System.currentTimeMillis();
// now resort by sequence
startTime = System.currentTimeMillis();
@@
-396,8
+406,8
@@
public class AnnotationSorterTest
testee.sort(annotations, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
endTime = System.currentTimeMillis();
elapsed = endTime - startTime;
testee.sort(annotations, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
endTime = System.currentTimeMillis();
elapsed = endTime - startTime;
- System.out.println("Resort by label for semisorted " + numSeqs
- + " sequences and " + numAnns + " annotations took " + elapsed
- + "ms");
+ System.out.println(
+ "Resort by label for semisorted " + numSeqs + " sequences and "
+ + numAnns + " annotations took " + elapsed + "ms");
}
}
}
}