public AnnotationPanel(AlignmentPanel ap)
{
- MAC = new jalview.util.Platform().isAMac();
+ MAC = jalview.util.Platform.isAMac();
ToolTipManager.sharedInstance().registerComponent(this);
ToolTipManager.sharedInstance().setInitialDelay(0);
*/
package jalview.jbgui;
+import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
+import jalview.api.SplitContainerI;
+import jalview.bin.Cache;
+import jalview.gui.JvSwingUtils;
+import jalview.gui.Preferences;
+import jalview.schemes.ColourSchemeProperty;
+import jalview.util.MessageManager;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
-import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
-import jalview.api.SplitContainerI;
-import jalview.bin.Cache;
-import jalview.gui.JvSwingUtils;
-import jalview.gui.Preferences;
-import jalview.schemes.ColourSchemeProperty;
-import jalview.util.MessageManager;
-
public class GAlignFrame extends JInternalFrame
{
protected JMenuBar alignFrameMenuBar = new JMenuBar();
System.err.println(e.toString());
}
- if (!new jalview.util.Platform().isAMac())
+ if (!jalview.util.Platform.isAMac())
{
closeMenuItem.setMnemonic('C');
outputTextboxMenu.setMnemonic('T');
private FontMetrics fm;
- private final boolean MAC = new jalview.util.Platform().isAMac();
+ private final boolean MAC = jalview.util.Platform.isAMac();
boolean av_renderHistogram = true, av_renderProfile = true,
av_normaliseProfile = false;
* Test the constructor that parses a PDB file format ATOM line. Fields are in
* fixed column positions
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testStringConstructor()
{
Atom a = new Atom(
* Test the case where occupancy and temp factor are blank - should default to
* 1
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testStringConstructor_blankOccupancyTempFactor()
{
Atom a = new Atom(
/**
* Parsing non-numeric data as Atom throws an exception
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testStringConstructor_malformed()
{
try
public class BondTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testTranslate()
{
Atom a1 = new Atom(1f, 2f, 3f);
c = new PDBChain("1GAQ", "A");
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetNewlineString()
{
assertEquals(System.lineSeparator(), c.getNewlineString());
assertEquals("gaga", c.getNewlineString());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testPrint()
{
c.offset = 7;
* Test the method that constructs a Bond between two atoms and adds it to the
* chain's list of bonds
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMakeBond()
{
/*
assertEquals(3f, b2.end[2], 0.0001f);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testSetChainColours_colour()
{
c.makeBond(a1, a2);
* Test setting bond start/end colours based on a colour scheme i.e. colour by
* residue
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSetChainColours_colourScheme()
{
Color alaColour = new Color(204, 255, 0);
assertEquals(Color.gray, b.endCol);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetChargeColour()
{
assertEquals(Color.red, PDBChain.getChargeColour("ASP"));
/**
* Test the method that sets bond start/end colours by residue charge property
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSetChargeColours()
{
a1.resName = "ASP"; // red
/**
* Test the method that converts the raw list of atoms to a list of residues
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMakeResidueList_noAnnotation()
{
Vector<Atom> atoms = new Vector<Atom>();
* Test the method that converts the raw list of atoms to a list of residues,
* including parsing of tempFactor to an alignment annotation
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMakeResidueList_withTempFactor()
{
Vector<Atom> atoms = new Vector<Atom>();
* Test the method that constructs bonds between successive residues' CA or P
* atoms
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMakeCaBondList()
{
c.isNa = true;
assertTrue(c.isNa);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testMakeCaBondList_nucleotide()
{
c.isNa = false;
/**
* Test the method that updates atoms with their alignment positions
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMakeExactMapping()
{
Vector<Atom> atoms = new Vector<Atom>();
public class PDBfileTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testIsRna()
{
SequenceI seq = new Sequence("Seq1", "CGAU");
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testParse() throws IOException
{
/*
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testParse_withAnnotations_noSS() throws IOException
{
PDBfile pf = new PDBfile(true, false, false, "examples/3W5V.pdb",
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testParse_withJmol_noAnnotations() throws IOException
{
PDBfile pf = new PDBfile(false, true, false, "examples/3W5V.pdb",
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testParse_withJmolAddAlignmentAnnotations()
throws IOException
{
* @throws IOException
*/
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void testParse_withAnnotate3D() throws IOException
{
// TODO requires a mock for Annotate3D processing
private AlignmentAnnotation[] getAlignmentAnnotations(PDBfile pf)
{
AlignmentI al = new Alignment(pf.getSeqsAsArray());
- pf.addAnnotations((Alignment) al);
+ pf.addAnnotations(al);
return al.getAlignmentAnnotation();
}
}
public class ResidueTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testFindAtom()
{
Atom a1 = new Atom(1f, 2f, 3f);
import java.io.IOException;
import java.io.StringWriter;
+import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
/**
* an input string
* @throws Exception
*/
+
+ @Test(groups =
+ { "Functional" }, dataProvider = "testWriteParam")
void test(String re, String inp) throws IOException
{
StringWriter sw = new StringWriter();
}
}
- @Test
- public void testWrite() throws IOException
+ // @Test(groups ={ "Functional" })
+ // public void testWrite() throws IOException
+ // {
+ // for (int n = 1; n <= 1; n++)
+ // {
+ // test("s/x/y/", "-----x123456789");
+ // test("s/x/y/", "x123456789");
+ // test("s/x/y/", "-----x");
+ // test("s/x.*?x/y/", ".xx..x..x...x...x....x....x");
+ // test("s/x.*x/[$&]/", "--x........x--xx");
+ // test("s/x.*x/[$&]/", "--x........x------");
+ // test("s/.$/a/m", "bb\nbbb\nbbbb\nbbbbb\nbbbbbb\nbbbbbbbbbbbb");
+ // test("s/.$/a/", "123");
+ // test("s/.$/a/", "bb\nbbb\nbbbb\nbbbbb\nbbbbbb\nbb");
+ // test("s/^./a/", "bb\nbbb\nbbbb\nbbbbb\nbbbbbb\nbb");
+ // test("s/$/a/", "bbb");
+ // test("s/^/a/", "bbb");
+ // test("s/^/a/", "");
+ // test("s{.*}{N}", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
+ // test("s/.{0,7}/y/", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
+ // test("s/x/$&/", "xxx");
+ // }
+ // }
+
+ @DataProvider(name = "testWriteParam")
+ public Object[][] regexTestParams()
{
- for (int n = 1; n <= 1; n++)
+ return new Object[][]
{
- test("s/x/y/", "-----x123456789");
- test("s/x/y/", "x123456789");
- test("s/x/y/", "-----x");
- test("s/x.*?x/y/", ".xx..x..x...x...x....x....x");
- test("s/x.*x/[$&]/", "--x........x--xx");
- test("s/x.*x/[$&]/", "--x........x------");
- test("s/.$/a/m", "bb\nbbb\nbbbb\nbbbbb\nbbbbbb\nbbbbbbbbbbbb");
- test("s/.$/a/", "123");
- test("s/.$/a/", "bb\nbbb\nbbbb\nbbbbb\nbbbbbb\nbb");
- test("s/^./a/", "bb\nbbb\nbbbb\nbbbbb\nbbbbbb\nbb");
- test("s/$/a/", "bbb");
- test("s/^/a/", "bbb");
- test("s/^/a/", "");
- test("s{.*}{N}", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
- test("s/.{0,7}/y/", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
- test("s/x/$&/", "xxx");
- }
+ { "s/x/y/", "-----x123456789" },
+ { "s/x/y/", "x123456789" },
+ { "s/x/y/", "-----x" },
+ { "s/x.*?x/y/", ".xx..x..x...x...x....x....x" },
+ { "s/x.*x/[$&]/", "--x........x--xx" },
+ { "s/x.*x/[$&]/", "--x........x------" },
+ { "s/.$/a/m", "bb\nbbb\nbbbb\nbbbbb\nbbbbbb\nbbbbbbbbbbbb" },
+ { "s/.$/a/", "123" },
+ { "s/.$/a/", "bb\nbbb\nbbbb\nbbbbb\nbbbbbb\nbb" },
+ { "s/^./a/", "bb\nbbb\nbbbb\nbbbbb\nbbbbbb\nbb" },
+ { "s/$/a/", "bbb" },
+ { "s/^/a/", "bbb" },
+ { "s/^/a/", "" },
+ { "s{.*}{N}", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" },
+ { "s/.{0,7}/y/", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" },
+ { "s/x/$&/", "xxx" } };
}
}
private static final String P = AAFrequency.PROFILE;
- @Test
+ @Test(groups ={ "Functional" })
public void testCalculate_noProfile()
{
SequenceI seq1 = new Sequence("Seq1", "CAGT");
assertEquals("T", col.get(R));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testCalculate_withProfile()
{
SequenceI seq1 = new Sequence("Seq1", "CAGT");
assertEquals(4, profile[1][1]);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testCalculate_withProfileTiming()
{
SequenceI seq1 = new Sequence("Seq1", "CAGT");
System.out.println(System.currentTimeMillis() - start);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetPercentageFormat()
{
assertNull(AAFrequency.getPercentageFormat(0));
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import org.junit.Test;
+import org.testng.annotations.Test;
public class AlignSeqTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testExtractGaps()
{
assertNull(AlignSeq.extractGaps(null, null));
/**
* Test method that converts a (possibly null) array to a list.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAsList()
{
// null array
/**
* Test a mixture of show/hidden annotations in/outside selection group.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetShownHiddenTypes_forSelectionGroup()
{
Map<String, List<List<String>>> shownTypes = new HashMap<String, List<List<String>>>();
* Test case where there are 'grouped' annotations, visible and hidden, within
* and without the selection group.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetShownHiddenTypes_withGraphGroups()
{
final int GROUP_3 = 3;
/**
* Test method that determines visible graph groups.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetVisibleGraphGroups()
{
AlignmentAnnotation[] anns = alignment.getAlignmentAnnotation();
* Test for case where no sequence is selected. Shouldn't normally arise but
* check it handles it gracefully.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetShownHiddenTypes_noSequenceSelected()
{
Map<String, List<List<String>>> shownTypes = new HashMap<String, List<List<String>>>();
public static Sequence ts = new Sequence("short",
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm");
- @Test
+ @Test(groups ={ "Functional" })
public void testExpandContext()
{
AlignmentI al = new Alignment(new Sequence[] {});
/**
* Test that annotations are correctly adjusted by expandContext
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testExpandContext_annotation()
{
AlignmentI al = new Alignment(new Sequence[]
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetSequencesByName() throws IOException
{
final String data = ">Seq1Name\nKQYL\n" + ">Seq2Name\nRFPW\n"
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMapProteinToCdna_noXrefs() throws IOException
{
List<SequenceI> protseqs = new ArrayList<SequenceI>();
/**
* Test for the alignSequenceAs method that takes two sequences and a mapping.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAlignSequenceAs_withMapping_noIntrons()
{
MapList map = new MapList(new int[]
/**
* Test for the alignSequenceAs method that takes two sequences and a mapping.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAlignSequenceAs_withMapping_withIntrons()
{
/*
/**
* Test for the case where not all of the protein sequence is mapped to cDNA.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAlignSequenceAs_withMapping_withUnmappedProtein()
{
/**
* Test for the alignSequenceAs method where we preserve gaps in introns only.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAlignSequenceAs_keepIntronGapsOnly()
{
* Test for the method that generates an aligned translated sequence from one
* mapping.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetAlignedTranslation_dnaLikeProtein()
{
// dna alignment will be replaced
/**
* Test the method that realigns protein to match mapped codon alignment.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAlignProteinAsDna()
{
// seq1 codons are [1,2,3] [4,5,6] [7,8,9] [10,11,12]
* Test the method that tests whether a CDNA sequence translates to a protein
* sequence
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testTranslatesAs()
{
assertTrue(AlignmentUtils.translatesAs("tttcccaaaggg".toCharArray(), 0,
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMapProteinToCdna_withStartAndStopCodons()
throws IOException
{
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMapProteinToCdna_withXrefs() throws IOException
{
List<SequenceI> protseqs = new ArrayList<SequenceI>();
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMapProteinToCdna_prioritiseXrefs() throws IOException
{
List<SequenceI> protseqs = new ArrayList<SequenceI>();
* Test the method that shows or hides sequence annotations by type(s) and
* selection group.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testShowOrHideSequenceAnnotations()
{
SequenceI seq1 = new Sequence("Seq1", "AAA");
/**
* Tests for the method that checks if one sequence cross-references another
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testHasCrossRef()
{
assertFalse(AlignmentUtils.hasCrossRef(null, null));
* Tests for the method that checks if either sequence cross-references the
* other
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testHaveCrossRef()
{
assertFalse(AlignmentUtils.hasCrossRef(null, null));
/**
* Test the method that extracts the exon-only part of a dna alignment.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMakeExonAlignment()
{
SequenceI dna1 = new Sequence("dna1", "aaaGGGcccTTTaaa");
* already has a protein product (Uniprot translation) which in turn has an
* x-ref to the EMBLCDS record.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMakeExonSequences()
{
SequenceI dna1 = new Sequence("dna1", "aaaGGGcccTTTaaa");
* its product mappings, for the case where there are multiple exon mappings
* to different protein products.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMakeExonAlignment_multipleProteins()
{
SequenceI dna1 = new Sequence("dna1", "aaaGGGcccTTTaaa");
* sequence ref</li>
* </ul>
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSortBySequenceAndType_autocalcLast()
{
// @formatter:off
/**
* Variant with autocalculated annotations sorting to front
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSortBySequenceAndType_autocalcFirst()
{
// @formatter:off
* sequence ref</li>
* </ul>
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSortByTypeAndSequence_autocalcLast()
{
// @formatter:off
/**
* Variant of test with autocalculated annotations sorted to front
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSortByTypeAndSequence_autocalcFirst()
{
// @formatter:off
* Variant of test with autocalculated annotations sorted to front but
* otherwise no change.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testNoSort_autocalcFirst()
{
// @formatter:off
assertEquals("Structure", anns[6].label);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testSort_timingPresorted()
{
testTiming_presorted(50, 100);
/**
* Timing tests for sorting randomly sorted annotations for various sizes.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSort_timingUnsorted()
{
testTiming_unsorted(50, 100);
/**
* Timing test for sorting annotations with a limited range of types (labels).
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSort_timingSemisorted()
{
testTiming_semiSorted(50, 100);
public class CodingUtilsTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testDecodeCodon()
{
assertTrue(Arrays.equals(new char[]
{ 'T', 'T', 'T' }, CodingUtils.decodeCodon(63)));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testDecodeNucleotide()
{
assertEquals('A', CodingUtils.decodeNucleotide(0));
assertEquals('0', CodingUtils.decodeNucleotide(4));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testEncodeCodon()
{
assertTrue(CodingUtils.encodeCodon('Z') < 0);
public class CrossRefTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testFindXDbRefs()
{
DBRefEntry ref1 = new DBRefEntry("UNIPROT", "1", "A123");
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testTranslateCdna_withUntranslatableCodons()
throws IOException
{
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testTranslateCdna_withUntranslatableCodonsAndHiddenColumns()
throws IOException
{
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testTranslateCdna_simple() throws IOException
{
AlignmentI alf = new FormatAdapter().readFile(fasta,
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testTranslateCdna_hiddenColumns() throws IOException
{
AlignmentI alf = new FormatAdapter().readFile(fasta,
/**
* Use this test to help debug into any cases of interest.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testCompareCodonPos_oneOnly()
{
assertFollows("-AA--A", "G--GG"); // 2 shifted seq2, 3 shifted seq1
/**
* Tests for method that compares 'alignment' of two codon position triplets.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testCompareCodonPos()
{
/*
* reorders the cDNA and retranslates, and verifies that the translations are
* the same (apart from ordering).
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testTranslateCdna_sequenceOrderIndependent()
{
/*
* Test that all the cases in testCompareCodonPos have a 'symmetric'
* comparison (without checking the actual comparison result).
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testCompareCodonPos_isSymmetric()
{
assertSymmetric("AAA", "GGG");
/**
* Weirdly, maybe worth a test to prove the helper method of this test class.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testConvertCodon()
{
assertEquals("[0, 1, 2]", convertCodon("AAA").toString());
int[] positions = new int[]
{ 1, 7, 9 };
- @Test
+ @Test(groups ={ "Functional" })
public void testMakeGroupsWithBoth()
{
ArrayList<String> str = new ArrayList<String>();
* more 'number characters' (0-9+.), i.e. greedily matches any trailing
* numeric part of the string
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetScoresFromDescription()
{
String regex = ".*([-0-9.+]+)";
* character, followed by at least one 'number character', then any trailing
* characters.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetScoresFromDescription_twoScores()
{
String regex = ".*([-0-9.+]+).+([-0-9.+]+).*";
*
* @see AlignFrame.extractScores_actionPerformed
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetScoresFromDescription_wordBoundaries()
{
String regex = "\\W*([-+eE0-9.]+)";
import org.testng.annotations.Test;
public class RnaTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testGetSimpleBPs() throws WUSSParseException
{
String rna = "([{})]"; // JAL-1081 example
assertEquals(5, bps.get(2).bp3); // ]
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetSimpleBPs_unmatchedOpener()
{
String rna = "(([{})]";
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetSimpleBPs_unmatchedCloser()
{
String rna = "([{})]]";
}
- @Test
+ @Test(groups ={ "Functional" })
/**
* simple test that mapping from alignment corresponds identical positions.
*/
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testExtractGaps()
{
assertNull(AlignSeq.extractGaps(null, null));
assertEquals("ABCD", AlignSeq.extractGaps(" .-", ". -A-B.C D."));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testPrintAlignment()
{
AlignSeq as = AlignSeq.doGlobalNWAlignment(s1, s3, AlignSeq.PEP);
int[] sf3 = new int[]
{ -1, -1, -1, -1, -1, -1, 76, 77 };
- @Test
+ @Test(groups ={ "Functional" })
public void testFeatureScoreModel() throws Exception
{
AlignFrame alf = new FileLoader(false).LoadFileWaitTillLoaded(alntestFile,
new CommandLineOperations();
}
- @Test(dataProvider = "headlessModeOutputParams")
+ @Test(groups =
+ { "Functional" }, dataProvider = "headlessModeOutputParams")
public void testHeadlessModeOutputs(String harg, String type,
String fileName, boolean withAWT, int expectedMinFileSize)
{
/**
* Test inserting gap characters
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAppendEdit_insertGap()
{
// set a non-standard gap character to prove it is actually used
* Test deleting characters from sequences. Note the deleteGap() action does
* not check that only gap characters are being removed.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAppendEdit_deleteGap()
{
testee.appendEdit(Action.DELETE_GAP, seqs, 4, 3, al, true);
* Test a cut action. The command should store the cut characters to support
* undo.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testCut()
{
Edit ec = testee.new Edit(Action.CUT, seqs, 4, 3, al);
/**
* Test a Paste action, where this adds sequences to an alignment.
*/
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
// TODO fix so it works
public void testPaste_addToAlignment()
{
/**
* Test insertGap followed by undo command
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testUndo_insertGap()
{
// Edit ec = testee.new Edit(Action.INSERT_GAP, seqs, 4, 3, '?');
/**
* Test deleteGap followed by undo command
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testUndo_deleteGap()
{
testee.appendEdit(Action.DELETE_GAP, seqs, 4, 3, al, true);
/**
* Test several commands followed by an undo command
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testUndo_multipleCommands()
{
// delete positions 3/4/5 (counting from 1)
* Unit test for JAL-1594 bug: click and drag sequence right to insert gaps -
* undo did not remove them all.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testUndo_multipleInsertGaps()
{
testee.appendEdit(Action.INSERT_GAP, seqs, 4, 1, al, true);
/**
* Test cut followed by undo command
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testUndo_cut()
{
testee.appendEdit(Action.CUT, seqs, 4, 3, al, true);
/**
* Test the replace command (used to manually edit a sequence)
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testReplace()
{
// seem to need a dataset sequence on the edited sequence here
* Test that the addEdit command correctly merges insert gap commands when
* possible.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAddEdit_multipleInsertGap()
{
/*
* Test that the addEdit command correctly merges delete gap commands when
* possible.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAddEdit_multipleDeleteGap()
{
/*
* case when they appear contiguous but are acting on different sequences.
* They should not be merged.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAddEdit_removeAllGaps()
{
seqs[0].setSequence("a???bcdefghjk");
* Test that the addEdit command correctly merges insert gap commands acting
* on a multi-sequence selection.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAddEdit_groupInsertGaps()
{
/*
* <li>last: --A--B-CDEF</li>
* </ul>
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testPriorState_multipleInserts()
{
EditCommand command = new EditCommand();
* <li>End: ABC</li>
* </ul>
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testPriorState_removeAllGaps()
{
EditCommand command = new EditCommand();
/**
* Test for 'undoing' a single delete edit.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testPriorState_singleDelete()
{
EditCommand command = new EditCommand();
/**
* Test 'undoing' a single gap insertion edit command.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testPriorState_singleInsert()
{
EditCommand command = new EditCommand();
* Test that mimics 'remove all gaps' action. This generates delete gap edits
* for contiguous gaps in each sequence separately.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testPriorState_removeGapsMultipleSeqs()
{
EditCommand command = new EditCommand();
* series Delete Gap edits that each act on all sequences that share a gapped
* column region.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testPriorState_removeGappedCols()
{
EditCommand command = new EditCommand();
/**
* Test the method that locates the first aligned sequence that has a mapping.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testFindAlignedSequence()
{
AlignmentI cdna = new Alignment(new SequenceI[]
/**
* Test the method that locates the mapped codon for a protein position.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetMappedRegion()
{
// introns lower case, exons upper case
assertNull(acf.getMappedRegion(seq1, aseq2, 1));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetMappedCodon()
{
final Sequence seq1 = new Sequence("Seq1", "c-G-TA-gC-gT-T");
/**
* Test normal case for iterating over aligned codons.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testNext()
{
SequenceI from = new Sequence("Seq1", "-CgC-C-cCtAG-AtG-Gc");
/**
* Test weird case where the mapping skips over a peptide.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testNext_unmappedPeptide()
{
SequenceI from = new Sequence("Seq1", "-CgC-C-cCtAG-AtG-Gc");
/**
* Test for exception thrown for an incomplete codon.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testNext_incompleteCodon()
{
SequenceI from = new Sequence("Seq1", "-CgC-C-cCgTt");
/**
* Test normal case for iterating over aligned codons.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAnother()
{
SequenceI from = new Sequence("Seq1", "TGCCATTACCAG-");
public class AlignedCodonTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testEquals()
{
AlignedCodon ac = new AlignedCodon(1, 3, 4);
assertTrue(ac.equals(ac));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testToString() {
AlignedCodon ac = new AlignedCodon(1, 3, 4);
assertEquals("[1, 3, 4]", ac.toString());
public class AlignmentAnnotationTests
{
- @Test
+ @Test(groups ={ "Functional" })
public void testCopyConstructor()
{
SequenceI sq = new Sequence("Foo", "ARAARARARAWEAWEAWRAWEAWE");
* different dataset frames (annotation transferred by mapping between
* sequences)
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testLiftOver()
{
SequenceI sqFrom = new Sequence("fromLong", "QQQCDEWGH");
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testAdjustForAlignment()
{
SequenceI seq = new Sequence("TestSeq", "ABCDEFG");
/**
* Test method that returns annotations that match on calcId.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testFindAnnotation_byCalcId()
{
Iterable<AlignmentAnnotation> anns = al
assertFalse(iter.hasNext());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testDeleteAllAnnotations_includingAutocalculated()
{
AlignmentAnnotation aa = new AlignmentAnnotation("Consensus",
assertEquals("Not all deleted", 0, al.getAlignmentAnnotation().length);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testDeleteAllAnnotations_excludingAutocalculated()
{
AlignmentAnnotation aa = new AlignmentAnnotation("Consensus",
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAlignAs_dnaAsDna() throws IOException
{
// aligned cDNA:
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAlignAs_proteinAsCdna() throws IOException
{
// see also AlignmentUtilsTests
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAlignAs_cdnaAsProtein() throws IOException
{
/*
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAlignAs_dnaAsProtein_withIntrons() throws IOException
{
/*
public class ColumnSelectionTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testAddElement()
{
ColumnSelection cs = new ColumnSelection();
* Test the remove method - in particular to verify that remove(int i) removes
* the element whose value is i, _NOT_ the i'th element.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testRemoveElement()
{
ColumnSelection cs = new ColumnSelection();
* Test the method that finds the visible column position of an alignment
* column, allowing for hidden columns.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testFindColumnPosition()
{
ColumnSelection cs = new ColumnSelection();
/**
* Tests for the method that compares equality of reference (but not mapping)
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testEqualRef()
{
DBRefEntry ref1 = new DBRefEntry("UNIPROT", "1", "V71633");
* trite test of the intersectVisContigs method for a simple DNA -> Protein
* exon map and a range of visContigs
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testIntersectVisContigs()
{
MapList fk = new MapList(new int[]
{
}
- @Test
+ @Test(groups ={ "Functional" })
public void test()
{
try
public class SearchResultsTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testToString()
{
SequenceI seq = new Sequence("", "abcdefghijklm");
*
* TODO: split into separate tests
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSomething() throws Exception
{
String o_seq = "asdfktryasdtqwrtsaslldddptyipqqwaslchvhttt";
package jalview.datamodel;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.testng.annotations.Test;
-import org.junit.Assert;
-import org.junit.Test;
public class SequenceDummyTest
{
/**
* test for become method
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBecome()
{
SequenceI seq = new Sequence("OrigSeq", "ASEQUENCE");
SequenceDummy dummySeq = new SequenceDummy("OrigSeq");
dummySeq.addSequenceFeature(ofeat);
dummySeq.become(seq);
- Assert.assertFalse("Dummy sequence did not become a full sequence",
+ assertFalse("Dummy sequence did not become a full sequence",
dummySeq.isDummy());
- Assert.assertTrue("Sequence was not updated from template", seq
+ assertTrue("Sequence was not updated from template", seq
.getSequenceAsString().equals(dummySeq.getSequenceAsString()));
boolean found = false;
for (SequenceFeature sf : dummySeq.getSequenceFeatures())
break;
}
}
- Assert.assertTrue("Didn't retain original sequence feature", found);
+ assertTrue("Didn't retain original sequence feature", found);
// todo - should test all aspect of copy constructor
}
{
seq = new Sequence("FER1", "AKPNGVL");
}
- @Test
+ @Test(groups ={ "Functional" })
public void testInsertGapsAndGapmaps()
{
SequenceI aseq = seq.deriveSequence();
assertEquals("Gap interval 2 end wrong", 8, gapInt.get(1)[1]);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetAnnotation()
{
// initial state returns null not an empty array
assertNull(seq.getAnnotation());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetAnnotation_forLabel()
{
AlignmentAnnotation ann1 = addAnnotation("label1", "desc1", "calcId1", 1f);
return annotation;
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetAlignmentAnnotations_forCalcIdAndLabel()
{
AlignmentAnnotation ann1 = addAnnotation("label1", "desc1", "calcId1",
* setting the sequenceRef on the annotation. Adding the same annotation twice
* should be ignored.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testAddAlignmentAnnotation()
{
assertNull(seq.getAnnotation());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetStartGetEnd()
{
SequenceI seq = new Sequence("test", "ABCDEF");
* Tests for the method that returns an alignment column position (base 1) for
* a given sequence position (base 1).
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testFindIndex()
{
SequenceI seq = new Sequence("test", "ABCDEF");
* Tests for the method that returns a dataset sequence position (base 1) for
* an aligned column position (base 0).
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testFindPosition()
{
SequenceI seq = new Sequence("test", "ABCDEF");
assertEquals(7, seq.findPosition(11));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testDeleteChars()
{
SequenceI seq = new Sequence("test", "ABCDEF");
assertEquals(6, seq.getEnd());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testInsertCharAt()
{
// non-static methods:
* Test the method that returns an array of aligned sequence positions where
* the array index is the data sequence position (both base 0).
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGapMap()
{
SequenceI seq = new Sequence("test", "-A--B-CD-E--F-");
* Test the method that gets sequence features, either from the sequence or
* its dataset.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetSequenceFeatures()
{
SequenceI seq = new Sequence("test", "GATCAT");
* entries are the residue positions at the sequence position (or to the right
* if a gap)
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testFindPositionMap()
{
/*
/**
* Test for getSubsequence
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetSubsequence()
{
SequenceI seq = new Sequence("TestSeq", "ABCDEFG");
/**
* Test for deriveSequence applied to a sequence with a dataset
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testDeriveSequence_existingDataset()
{
SequenceI seq = new Sequence("Seq1", "CD");
/**
* Test for deriveSequence applied to an ungapped sequence with no dataset
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testDeriveSequence_noDatasetUngapped()
{
SequenceI seq = new Sequence("Seq1", "ABCDEF");
/**
* Test for deriveSequence applied to a gapped sequence with no dataset
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testDeriveSequence_noDatasetGapped()
{
SequenceI seq = new Sequence("Seq1", "AB-C.D EF");
+ "</locationElement></location></feature>"
+ "<sequence type=\"mRNA\" version=\"2\">GTGACG</sequence></entry></EMBL_Services>";
- @Test
+ @Test(groups ={ "Functional" })
public void testGetEmblFile()
{
Vector<EmblEntry> entries = EmblFile.getEmblFile(
Boolean.TRUE.toString());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testAlignmentLoader() throws Exception
{
for (String f : testFile)
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testFileParser() throws Exception
{
for (String pdbStr : testFile)
public class TestAnnotate3D
{
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void test1GIDbyId() throws Exception
{
// use same ID as standard tests given at
testRNAMLcontent(ids, null);
}
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void testIdVsContent2GIS() throws Exception
{
Iterator<Reader> ids = Annotate3D.getRNAMLForPDBId("2GIS");
*
* @throws Exception
*/
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void testPDBfileVsRNAML() throws Exception
{
PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb",
testRNAMLcontent(readers, pdbf);
}
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
private void testRNAMLcontent(Iterator<Reader> readers, PDBfile pdbf)
throws Exception
{
public class ChimeraCommandsTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testAddColourRange()
{
Map<Color, Map<Integer, Map<String, List<int[]>>>> map = new LinkedHashMap<Color, Map<Integer, Map<String, List<int[]>>>>();
{ 5, 9 }, posList.get(0)));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildColourCommands()
{
public class ChimeraConnect
{
- @Test
+ @Test(groups ={ "Functional" })
public void testLaunchAndExit()
{
final StructureManager structureManager = new StructureManager(true);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testSingleSeqViewJMol()
{
String inFile = "examples/1gaq.txt";
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testSingleSeqViewChimera()
{
String inFile = "examples/1gaq.txt";
testee = new AlignViewport(al);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testCollateForPdb()
{
/*
/**
* Test creation of panel with OK and Cancel buttons
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildActionButtonsPanel()
{
testee = new AnnotationChooser(parentPanel);
* Test 'Apply to' has 3 radio buttons enabled, 'Selected Sequences' selected,
* when there is a current selection group.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildApplyToOptionsPanel_withSelectionGroup()
{
selectSequences(0, 2, 3);
* Test 'Apply to' has 1 radio button enabled, 'All Sequences' selected, when
* there is no current selection group.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildApplyToOptionsPanel_noSelectionGroup()
{
testee = new AnnotationChooser(parentPanel);
/**
* Test Show and Hide radio buttons created, with Hide initially selected.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildShowHidePanel()
{
testee = new AnnotationChooser(parentPanel);
/**
* Test construction of panel containing two sub-panels
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildShowHideOptionsPanel()
{
testee = new AnnotationChooser(parentPanel);
* Test that annotation types are (uniquely) identified.
*
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetAnnotationTypes()
{
selectSequences(1);
* We expect all annotations of that type to be set hidden. Other annotations
* should be left visible.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSelectType_hideForAll()
{
selectSequences(1, 2);
* We expect the annotations of that type, linked to the sequence group, to be
* set hidden. Other annotations should be left visible.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSelectType_hideForSelected()
{
selectSequences(1, 2);
* We expect all annotations of that type to be set visible. Other annotations
* should be left unchanged.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testDeselectType_hideForAll()
{
selectSequences(1, 2);
* We expect the annotations of that type, linked to the sequence group, to be
* set visible. Other annotations should be left unchanged.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testDeselectType_hideForSelected()
{
selectSequences(1, 2);
* We expect all annotations of that type to be set visible. Other annotations
* should be left unchanged
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSelectType_showForAll()
{
selectSequences(1, 2);
* We expect all annotations of that type, linked to the sequence group, to be
* set visible. Other annotations should be left unchanged
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSelectType_showForSelected()
{
// sequences 1 and 2 have annotations IUPred and Jmol
* We expect all annotations of that type to be set hidden. Other annotations
* should be left unchanged.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testDeselectType_showForAll()
{
selectSequences(1, 2);
* We expect the annotations of that type, linked to the sequence group, to be
* set hidden. Other annotations should be left unchanged.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testDeselectType_showForSelected()
{
selectSequences(1, 2);
* Test cases include sequences in the selection group, and others not in the
* group.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testIsInActionScope_selectedScope()
{
// sequences 1 and 2 have annotations 4 and 3 respectively
* Test cases include sequences in the selection group, and others not in the
* group.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testIsInActionScope_unselectedScope()
{
// sequences 1 and 2 have annotations 4 and 3 respectively
/**
* Test that the reset method restores previous visibility flags.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testResetOriginalState()
{
testee = new AnnotationChooser(parentPanel);
* available, plain) fonts and point sizes that would be rejected by Jalview's
* FontChooser as having an I-width of less than 1.0.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void dumpInvalidFonts()
{
String[] fonts = java.awt.GraphicsEnvironment
public class HelpTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void checkHelpTargets() throws HelpSetException
{
ClassLoader cl = Desktop.class.getClassLoader();
volatile boolean finish = false;
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void test()
{
Cache.initLogger();
public class JvSwingUtilsTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testGetScrollBarProportion()
{
/*
assertEquals(0.25f, JvSwingUtils.getScrollBarProportion(sb), 0.001f);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetScrollValueForProportion()
{
/*
{
}
- @Test
+ @Test(groups ={ "Functional" })
public void populateCmbSearchTargetOptionsTest()
{
PDBSearchPanel searchPanel = new PDBSearchPanel(null);
searchPanel.populateCmbSearchTargetOptions();
}
- @Test
+ @Test(groups ={ "Functional" })
public void testDecodeSearchTerm()
{
String expectedString = "1xyz OR text:2xyz OR text:3xyz";
assertEquals(expectedString, outcome);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testgetPDBIdwithSpecifiedChain()
{
assertEquals(expectedString, outcome);
}
- @Test
+ @Test(groups =
+ { "Network" }, timeOut = 5000)
public void txt_search_ActionPerformedTest()
{
PDBSearchPanel searchPanel = new PDBSearchPanel(null);
PaintRefresher.components.clear();
}
- @Test
+ @Test(groups ={ "Functional" })
public void testRegister()
{
JPanel jp = new JPanel();
assertTrue(registered.get("44").contains(jp4));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testRemoveComponent()
{
Map<String, List<Component>> registered = PaintRefresher.components;
assertTrue(registered.get("22").contains(jp2));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetAssociatedPanels()
{
SequenceI [] seqs = new SequenceI[]{new Sequence("", "ABC")};
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testConfigureReferenceAnnotationsMenu_noSequenceSelected()
{
JMenuItem menu = new JMenuItem();
* are no reference annotations to add to the alignment. The menu item should
* be disabled.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testConfigureReferenceAnnotationsMenu_noReferenceAnnotations()
{
JMenuItem menu = new JMenuItem();
* reference annotations are already on the alignment. The menu item should be
* disabled.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testConfigureReferenceAnnotationsMenu_alreadyAdded()
{
JMenuItem menu = new JMenuItem();
* The menu item should be enabled, and acquire a tooltip which lists the
* annotation sources (calcIds) and type (labels).
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testConfigureReferenceAnnotationsMenu()
{
JMenuItem menu = new JMenuItem();
* on the alignment. The menu item should be enabled, and acquire a tooltip
* which lists the annotation sources (calcIds) and type (labels).
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testConfigureReferenceAnnotationsMenu_notOnAlignment()
{
JMenuItem menu = new JMenuItem();
* The menu item should be enabled, and acquire a tooltip which lists the
* annotation sources (calcIds) and type (labels).
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testConfigureReferenceAnnotationsMenu_twoViews()
{
}
* Test for building menu options including 'show' and 'hide' annotation
* types.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildAnnotationTypesMenus()
{
JMenu showMenu = new JMenu();
/**
* Test for building menu options with only 'hide' annotation types enabled.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildAnnotationTypesMenus_showDisabled()
{
JMenu showMenu = new JMenu();
/**
* Test for building menu options with only 'show' annotation types enabled.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildAnnotationTypesMenus_hideDisabled()
{
JMenu showMenu = new JMenu();
private JLabel statusBar;
- @Test
+ @Test(groups ={ "Functional" })
public void testConstructor_prematureInstantiation()
{
try
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testConstructor_wrongLayout()
{
statusPanel = new JPanel();
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testSetProgressBar()
{
statusPanel = new JPanel();
public class SequenceRendererTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testGetResidueBoxColour_zappo()
{
SequenceI seq = new Sequence("name", "MATVLGSPRAPAFF"); // FER1_MAIZE...
- @Test
+ @Test(groups ={ "Functional" })
public void buildQueryTest()
{
String query = StructureChooser.buildQuery(seq);
query);
}
- @Test
+ @Test(groups ={ "Functional" })
public void populateFilterComboBoxTest()
{
SequenceI[] selectedSeqs = new SequenceI[]
// should be populated
}
- @Test
+ @Test(groups ={ "Functional" })
public void fetchStructuresInfoTest()
{
SequenceI[] selectedSeqs = new SequenceI[]
.get(0).getId();
}
- @Test
+ @Test(groups ={ "Functional" })
public void checkNoDuplicates()
{
// not strictly a requirement, but strange things may happen if multiple
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void checkPDBannotationSource()
{
/**
* Check sequence features have been added
*/
- @Test
+ @Test(groups ={ "Functional" })
public void checkPDBSequenceFeatures()
{
StructureSelectionManager ssm = StructureSelectionManager
assertEquals("TYR:314 1gaqC", sf[295].getDescription());
}
- @Test
+ @Test(groups ={ "Functional" })
public void checkAnnotationWiring()
{
assertTrue(al.getAlignmentAnnotation() != null);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testJalviewProjectRelocationAnnotation() throws Exception
{
{ "Test hiding/showing of insertions on sequence_ref",
"examples/uniref50.fa", "examples/testdata/uniref50_seqref.jva" } };
- @Test
+ @Test(groups ={ "Functional" })
public void exampleAnnotationFileIO() throws Exception
{
for (String[] testPair : TestFiles)
* f
*/
- // @Test
+ // @Test(groups ={ "Functional" })
public static void testAnnotationFileIO(String testname, File f,
File annotFile)
{
public class BioJsHTMLOutputTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void getJalviewAlignmentAsJsonString()
{
String bjsTemplate = null;
Assert.assertNotNull(bjsTemplate);
}
- @Test(expectedExceptions = NullPointerException.class)
+ @Test(groups =
+ { "Functional" }, expectedExceptions = NullPointerException.class)
public void expectedNullPointerException()
{
try
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void getBioJsMSAVersions()
{
TreeMap<String, File> versions = null;
}
- @Test
+ @Test(groups =
+ { "Network" })
public void testBioJsUpdate()
{
String url = BioJsHTMLOutput.BJS_TEMPLATE_GIT_REPO;
+ "' identified as '" + type + "'", type.equalsIgnoreCase(fmt));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testStarsInFasta1() throws IOException
{
String uri;
assertValidFormat("FASTA", uri, fp);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testStarsInFasta2() throws IOException
{
String uri;
assertValidFormat("FASTA", uri, fp);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGzipIo() throws IOException
{
String uri;
assertValidFormat("FASTA", uri, fp);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGziplocalFileIO() throws IOException
{
String filepath;
assertValidFormat("FASTA", filepath, fp);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testNonGzipURLIO() throws IOException
{
String uri;
assertValidFormat("FASTA", uri, fp);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testNonGziplocalFileIO() throws IOException
{
String filepath;
package jalview.io;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceDummy;
import java.io.IOException;
-import org.junit.Assert;
-import org.junit.Test;
+import org.testng.annotations.Test;
public class Gff3tests
{
exonerateOutput = "examples/testdata/exonerateoutput.gff",
simpleGff3file = "examples/testdata/simpleGff3.gff";
- @Test
+ @Test(groups ={ "Functional" })
public void testExonerateImport()
{
// exonerate does not tag sequences after features, so we have a more
AlignFrame af = loader.LoadFileWaitTillLoaded(exonerateSeqs,
FormatAdapter.FILE);
- Assert.assertEquals("Unexpected number of DNA protein associations", 0,
+ assertEquals("Unexpected number of DNA protein associations", 0,
af.getViewport().getAlignment().getCodonFrames().size());
af.loadJalviewDataFile(exonerateOutput, FormatAdapter.FILE, null, null);
- Assert.assertNotEquals("Expected at least one DNA protein association",
- 0, af.getViewport().getAlignment().getDataset()
- .getCodonFrames().size());
+ assertTrue("Expected at least one DNA protein association", af
+ .getViewport().getAlignment().getDataset().getCodonFrames()
+ .size() > 0);
}
- @Test
+ @Test(groups ={ "Functional" })
public void simpleGff3FileIdentify()
{
- Assert.assertEquals("Didn't recognise file correctly.",
+ assertEquals("Didn't recognise file correctly.",
IdentifyFile.GFF3File,
new IdentifyFile().Identify(simpleGff3file, FormatAdapter.FILE));
}
- @Test
+ @Test(groups ={ "Functional" })
public void simpleGff3FileClass() throws IOException
{
AlignmentI dataset = new Alignment(new SequenceI[]
FormatAdapter.FILE);
boolean parseResult = ffile.parse(dataset, null, null, false, false);
- Assert.assertTrue("return result should be true", parseResult);
+ assertTrue("return result should be true", parseResult);
checkDatasetfromSimpleGff3(dataset);
}
- @Test
+ @Test(groups ={ "Functional" })
public void simpleGff3FileLoader() throws IOException
{
AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded(
simpleGff3file, FormatAdapter.FILE);
- Assert.assertTrue(
+ assertTrue(
"Didn't read the alignment into an alignframe from Gff3 File",
af != null);
checkDatasetfromSimpleGff3(af.getViewport().getAlignment().getDataset());
}
- @Test
+ @Test(groups ={ "Functional" })
public void simpleGff3RelaxedIdMatching() throws IOException
{
AlignmentI dataset = new Alignment(new SequenceI[]
FormatAdapter.FILE);
boolean parseResult = ffile.parse(dataset, null, null, false, true);
- Assert.assertTrue("return result (relaxedID matching) should be true",
+ assertTrue("return result (relaxedID matching) should be true",
parseResult);
checkDatasetfromSimpleGff3(dataset);
}
- @Test
+ @Test(groups ={ "Functional" })
public void readGff3File() throws IOException
{
Gff3File gff3reader = new Gff3File(simpleGff3file, FormatAdapter.FILE);
private void checkDatasetfromSimpleGff3(AlignmentI dataset)
{
- Assert.assertEquals("no sequences extracted from GFF3 file", 2,
+ assertEquals("no sequences extracted from GFF3 file", 2,
dataset.getHeight());
SequenceI seq1 = dataset.findName("seq1"), seq2 = dataset
.findName("seq2");
- Assert.assertNotNull(seq1);
- Assert.assertNotNull(seq2);
- Assert.assertFalse(
+ assertNotNull(seq1);
+ assertNotNull(seq2);
+ assertFalse(
"Failed to replace dummy seq1 with real sequence",
seq1 instanceof SequenceDummy
&& ((SequenceDummy) seq1).isDummy());
- Assert.assertFalse(
+ assertFalse(
"Failed to replace dummy seq2 with real sequence",
seq2 instanceof SequenceDummy
&& ((SequenceDummy) seq2).isDummy());
String placeholderseq = new SequenceDummy("foo").getSequenceAsString();
- Assert.assertFalse("dummy replacement buggy for seq1",
+ assertFalse("dummy replacement buggy for seq1",
placeholderseq.equals(seq1.getSequenceAsString()));
- Assert.assertNotEquals("dummy replacement buggy for seq2",
+ assertFalse("dummy replacement buggy for seq2",
placeholderseq.equals(seq2.getSequenceAsString()));
- Assert.assertNotNull("No features added to seq1",
+ assertNotNull("No features added to seq1",
seq1.getSequenceFeatures());// != null);
- Assert.assertEquals("Wrong number of features", 3,
+ assertEquals("Wrong number of features", 3,
seq1.getSequenceFeatures().length);
- Assert.assertNull(seq2.getSequenceFeatures());
- Assert.assertEquals("Wrong number of features", 0, seq2
+ assertNull(seq2.getSequenceFeatures());
+ assertEquals(
+ "Wrong number of features",
+ 0,
+ seq2
.getSequenceFeatures() == null ? 0
: seq2.getSequenceFeatures().length);
- Assert.assertTrue(
+ assertTrue(
"Expected at least one CDNA/Protein mapping for seq1",
dataset.getCodonFrame(seq1) != null
&& dataset.getCodonFrame(seq1).size() > 0);
}
- // @Test
+ // @Test(groups ={ "Functional" })
// public final void testPrintGFFFormatSequenceIArrayMapOfStringObject()
// {
// fail("Not yet implemented");
// }
//
- // @Test
+ // @Test(groups ={ "Functional" })
// public final void testAlignFileBooleanStringString()
// {
// fail("Not yet implemented");
public class HtmlFileTest
{
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void test()
{
fail("Not yet implemented");
jf = null;
}
- @Test
+ @Test(groups ={ "Functional" })
public void roundTripTest()
{
assertNotNull("JSON roundtrip test failed!", testJsonFile);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testSeqParsed()
{
assertNotNull("Couldn't read supplied alignment data.", testAlignment);
TEST_SEQ_HEIGHT, passedCount);
}
- @Test
+ @Test(groups ={ "Functional" })
public void hiddenColsTest()
{
ColumnSelection cs = testJsonFile.getColumnSelection();
"Mismatched hidden columns!");
}
- @Test
+ @Test(groups ={ "Functional" })
public void hiddenSeqsTest()
{
Assert.assertNotNull(testJsonFile.getHiddenSequences(),
"Hidden sequece");
}
- @Test
+ @Test(groups ={ "Functional" })
public void colorSchemeTest()
{
Assert.assertNotNull(testJsonFile.getColourScheme(),
"Zappo colour scheme expected!");
}
- @Test
+ @Test(groups ={ "Functional" })
public void isShowSeqFeaturesSet()
{
Assert.assertTrue(testJsonFile.isShowSeqFeatures(),
"Sequence feature isDisplayed setting expected to be true");
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGrpParsed()
{
Assert.assertNotNull(testAlignment.getGroups());
TEST_GRP_HEIGHT, passedCount);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testAnnotationParsed()
{
Assert.assertNotNull(testAlignment.getAlignmentAnnotation());
return numdsann;
}
- @Test
+ @Test(groups ={ "Functional" })
public void testRNAStructureRecovery() throws Exception
{
String inFile = "examples/RF00031_folded.stk";
af.getViewport().getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testTCoffeeScores() throws Exception
{
String inFile = "examples/uniref50.fa", inAnnot = "examples/uniref50.score_ascii";
.println("T-Coffee score shading successfully recovered from project.");
}
- @Test
+ @Test(groups ={ "Functional" })
public void testColourByAnnotScores() throws Exception
{
String inFile = "examples/uniref50.fa", inAnnot = "examples/testdata/uniref50_iupred.jva";
.println("Per sequence (Group) colourscheme successfully applied and recovered.");
}
- @Test
+ @Test(groups ={ "Functional" })
public void gatherViewsHere() throws Exception
{
int origCount = Desktop.getAlignFrames() == null ? 0 : Desktop
}
- @Test
+ @Test(groups ={ "Functional" })
public void viewRefPdbAnnotation() throws Exception
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
}
- @Test
+ @Test(groups ={ "Functional" })
public void testCopyViewSettings() throws Exception
{
AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
{
}
- @Test
+ @Test(groups ={ "Functional" })
public void testTreeIO() throws Exception
{
String stage = "Init", treename = " '" + name + "' :";
*
* @throws Exception
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSequentialDataExtraction() throws Exception
{
testDataExtraction(sequentialFile);
*
* @throws Exception
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testInterleavedDataExtraction() throws Exception
{
testDataExtraction(interleavedFile);
*
* @throws Exception
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSequentialIO() throws Exception
{
testIO(sequentialFile);
*
* @throws Exception
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testInterleavedIO() throws Exception
{
testIO(interleavedFile);
{
}
- @Test
+ @Test(groups ={ "Functional" })
public void testRnamlToStockholmIO()
{
StockholmFileTest.testFileIOwithFormat(new File(
static String PfamFile = "examples/PF00111_seed.stk",
RfamFile = "examples/RF00031_folded.stk";
- @Test
+ @Test(groups ={ "Functional" })
public void pfamFileIO() throws Exception
{
testFileIOwithFormat(new File(PfamFile), "STH", -1, 0);
}
- @Test
+ @Test(groups ={ "Functional" })
public void pfamFileDataExtraction() throws Exception
{
AppletFormatAdapter af = new AppletFormatAdapter();
numpdb > 0);
}
- @Test
+ @Test(groups ={ "Functional" })
public void rfamFileIO() throws Exception
{
testFileIOwithFormat(new File(RfamFile), "STH", 2, 1);
final static File ALIGN_FILE = new File(
"test/jalview/io/tcoffee.fasta_aln");
- @Test
+ @Test(groups ={ "Functional" })
public void testReadHeader() throws IOException
{
AssertJUnit.assertEquals(90, header.getScoreFor("cons"));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testWrongFile()
{
try
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testHeightAndWidth() throws IOException
{
TCoffeeScoreFile result = new TCoffeeScoreFile(SCORE_FILE.getPath(),
AssertJUnit.assertEquals(83, result.getWidth());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testReadBlock() throws IOException
{
block.getConsensus());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testParse() throws IOException
{
parser.getScoresFor("cons"));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetAsList() throws IOException
{
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetAsArray() throws IOException
{
}
- @Test
+ @Test(groups ={ "Functional" })
public void testHeightAndWidthWithResidueNumbers() throws Exception
{
String file = "test/jalview/io/tcoffee.score_ascii_with_residue_numbers";
public class DnaCodonTests
{
- @Test
+ @Test(groups ={ "Functional" })
public void testAmbiguityCodeGeneration()
{
assertTrue(ResidueProperties.ambiguityCodes.size() > 0);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testAmbiguityCodon()
{
for (String ac : ResidueProperties.ambiguityCodes.keySet())
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void regenerateCodonTable()
{
for (Map.Entry<String, String> codon : ResidueProperties.codonHash2
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void checkOldCodonagainstNewCodonTable()
{
// note - this test will be removed once the old codon table (including
/**
* Test 'standard' codon translations (no ambiguity codes)
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testCodonTranslate()
{
// standard translation table order column 1/2/3/4
* Test a sample of codon translations involving ambiguity codes. Should
* return a protein value where the ambiguity does not affect the translation.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testCodonTranslate_ambiguityCodes()
{
// Y is C or T
assertNull(ResidueProperties.codonTranslate("WSK"));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetResidues_nucleotide()
{
/*
assertEquals("[A, C, G, I, N, R, T, U, X, Y]", residues.toString());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetResidues_peptide()
{
/*
public class ScoreMatrixPrinter
{
- @Test
+ @Test(groups ={ "Functional" })
public void printAllMatrices()
{
for (Map.Entry<String, ScoreModelI> sm : ResidueProperties.scoreMatrices
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void printHTMLMatrices()
{
for (Map.Entry<String, ScoreModelI> _sm : ResidueProperties.scoreMatrices
* 115 in PDB Res Numbering secondary structure numbers in jmol seem to be in
* msd numbering, not pdb res numbering.
*/
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void pdbEntryPositionMap() throws Exception
{
Assert.fail("This test intentionally left to fail");
}
}
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void testPDBentryMapping() throws Exception
{
Assert.fail("This test intentionally left to fail");
* transform
*
*/
- @Test
+ @Test(groups ={ "Functional" })
public void mapFer1From3W5V() throws Exception
{
AlignFrame seqf = new FileLoader(false)
* compare reference annotation for imported pdb sequence to identical
* seuqence with transferred annotation from mapped pdb file
*/
- @Test
+ @Test(groups ={ "Functional" })
public void compareTransferredToRefPDBAnnot() throws Exception
{
AlignFrame ref = new FileLoader(false)
ssm = new StructureSelectionManager();
}
- @Test
+ @Test(groups ={ "Functional" })
public void testAddMapping()
{
AlignedCodonFrame acf1 = new AlignedCodonFrame();
assertEquals(1, ssm.seqMappingRefCounts.get(acf2).intValue());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testAddMappings()
{
AlignedCodonFrame acf1 = new AlignedCodonFrame();
assertEquals(1, ssm.seqMappingRefCounts.get(acf3).intValue());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testRemoveMapping()
{
AlignedCodonFrame acf1 = new AlignedCodonFrame();
assertEquals(0, ssm.seqMappingRefCounts.size());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testRemoveMappings()
{
AlignedCodonFrame acf1 = new AlignedCodonFrame();
* Verify that the method determines that columns 2, 5 and 6 of the aligment
* are alignable in structure
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testFindSuperposableResidues()
{
SuperposeData[] structs = new SuperposeData[al.getHeight()];
assertTrue(matched[5]);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testFindSuperposableResidues_hiddenColumn()
{
SuperposeData[] structs = new SuperposeData[al.getHeight()];
Color darkColour = new Color(11, 30, 50); // dark blue
- @Test
+ @Test(groups ={ "Functional" })
public void testDarkerThan()
{
assertEquals("Wrong darker shade", new Color(32, 69, 37),
assertNull(ColorUtils.darkerThan(null));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testBrighterThan()
{
assertEquals("Wrong brighter shade", new Color(255, 255, 255), // white
/**
* @see http://www.rtapo.com/notes/named_colors.html
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testToTkCode()
{
assertEquals("#fffafa", ColorUtils.toTkCode(new Color(255, 250, 250))); // snow
public class ComparisonTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testIsGap()
{
assertTrue(Comparison.isGap('-'));
* Test for isNucleotide is that sequences in a dataset are more than 85%
* AGCTU. Test is not case-sensitive and ignores gaps.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testIsNucleotide() {
SequenceI seq = new Sequence("eightypercent", "agctuAGCPV");
assertFalse(Comparison.isNucleotide(new SequenceI[]
/**
* Test percentage identity calculation for two sequences.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testPID_matchGaps()
{
String seq1 = "ABCDEF";
* Test the method that selects DBRefEntry items whose source is in a supplied
* list
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSelectRefs()
{
assertNull(DBRefUtils.selectRefs(null, null));
* Test the method that converts (currently three) database names to a
* canonical name (not case-sensitive)
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetCanonicalName()
{
assertNull(DBRefUtils.getCanonicalName(null));
DBRefUtils.getCanonicalName("UNIPROTKB/SWISS-CHEESE"));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testIsDasCoordinateSystem()
{
assertFalse(DBRefUtils.isDasCoordinateSystem(null, null));
/**
* Test 'parsing' a DBRef - non PDB case
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testParseToDbRef()
{
SequenceI seq = new Sequence("Seq1", "ABCD");
/**
* Test 'parsing' a DBRef - Stockholm PDB format
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testParseToDbRef_PDB()
{
SequenceI seq = new Sequence("Seq1", "ABCD");
* Test the method that searches for matches references - case when we are
* matching a reference with no mappings
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSearchRefs_noMapping()
{
DBRefEntry target = new DBRefEntry("EMBL", "2", "A1234");
* Test the method that searches for matches references - case when we are
* matching a reference with a mapping
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSearchRefs_withMapping()
{
DBRefEntry target = new DBRefEntry("EMBL", "2", "A1234");
public class MapListTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testSomething()
{
MapList ml = new MapList(new int[]
* Tests for method that locates ranges in the 'from' map for given range in
* the 'to' map.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testLocateInFrom_noIntrons()
{
/*
* Tests for method that locates ranges in the 'from' map for given range in
* the 'to' map.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testLocateInFrom_withIntrons()
{
/*
* Tests for method that locates ranges in the 'to' map for given range in the
* 'from' map.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testLocateInTo_noIntrons()
{
/*
* Tests for method that locates ranges in the 'to' map for given range in the
* 'from' map.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testLocateInTo_withIntrons()
{
/*
/**
* Test equals method.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testEquals()
{
int[] codons = new int[]
/**
* Test for the method that flattens a list of ranges into a single array.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetRanges()
{
List<int[]> ranges = new ArrayList<int[]>();
/**
* Check state after construction
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testConstructor()
{
int[] codons =
/**
* Test the method that creates an inverse mapping
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetInverse()
{
int[] codons =
prettyPrint(ml2.getFromRanges()));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testToString()
{
MapList ml = new MapList(new int[]
/**
* Simple test of mapping with no intron involved.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildSearchResults()
{
final Sequence seq1 = new Sequence("Seq1", "C-G-TA-GC");
/**
* Simple test of mapping with introns involved.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testBuildSearchResults_withIntron()
{
final Sequence seq1 = new Sequence("Seq1", "C-G-TAGA-GCAGCTT");
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMapSequenceGroup_sequences() throws IOException
{
/*
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMapColumnSelection_proteinToDna() throws IOException
{
setupMappedAlignments();
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMapColumnSelection_dnaToProtein() throws IOException
{
setupMappedAlignments();
assertEquals("[0, 1, 3]", cs.getSelected().toString());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testMapColumnSelection_null() throws IOException
{
setupMappedAlignments();
* Tests for the method that converts a series of [start, end] ranges to
* single positions
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testFlattenRanges()
{
assertEquals("[1, 2, 3, 4]",
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMapSequenceGroup_columns() throws IOException
{
/*
*
* @throws IOException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testMapSequenceGroup_region() throws IOException
{
/*
assertEquals(4, mappedGroup.getEndRes());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testFindMappingsForSequence()
{
SequenceI seq1 = new Sequence("Seq1", "ABC");
{ c1, c2, c3, c4 };
}
- @Test
+ @Test(groups ={ "Functional" })
public void testSort_byIntValues()
{
int[] values = new int[]
assertTrue(Arrays.equals(sortedThings, things));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testSort_byFloatValues()
{
float[] values = new float[]
assertTrue(Arrays.equals(sortedThings, things));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testSort_byDoubleValues()
{
double[] values = new double[]
/**
* Sort by String is descending order, case-sensitive
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSort_byStringValues()
{
String[] values = new String[]
/**
* Test whether sort is stable i.e. equal values retain their mutual ordering.
*/
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void testSort_withDuplicates()
{
int[] values = new int[]
* Test that exercises sort with a mostly zero-valued sortby array. May be of
* interest to check the sort algorithm is efficient.
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testSort_MostlyZeroValues()
{
char[] residues = new char[64];
public class ShiftListTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testParseMap()
{
assertNull(ShiftList.parseMap(null));
public class StringUtilsTest
{
- @Test
+ @Test(groups ={ "Functional" })
public void testInsertCharAt()
{
char[] c1 = "ABC".toCharArray();
StringUtils.insertCharAt(c1, 7, 2, 'w')));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testDeleteChars()
{
char[] c1 = "ABC".toCharArray();
assertTrue(Arrays.equals(c1, StringUtils.deleteChars(c1, 3, 4)));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testGetLastToken()
{
assertNull(StringUtils.getLastToken(null, null));
"file://localhost:8080/data/examples/file1.dat", "/"));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testSeparatorListToArray()
{
String[] result = StringUtils.separatorListToArray(
.separatorListToArray("abc='|'d|ef|g", "|")));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testArrayToSeparatorList()
{
assertEquals("*", StringUtils.arrayToSeparatorList(null, "*"));
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testCopyConstructor() throws IllegalArgumentException,
IllegalAccessException
{
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testEquals() throws IllegalArgumentException,
IllegalAccessException
{
sf = new SequenceFetcher(false);
}
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void testRnaSeqRetrieve() throws Exception
{
List<DbSourceProxy> sps = sf.getSourceProxy("PDB");
{
}
- @Test
+ @Test(groups =
+ { "External" })
public void executeRequestTest()
{
List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
assertTrue(response.getSearchSummary().size() > 99);
}
- @Test
+ @Test(groups ={ "Functional" })
public void getPDBDocFieldsAsCommaDelimitedStringTest()
{
List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
assertEquals("", expectedResult, actualResult);
}
- @Test
+ @Test(groups =
+ { "External" })
public void parsePDBJsonExceptionStringTest()
{
List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
assertEquals(expectedErrorMsg, parsedErrorResponse);
}
- @Test(expectedExceptions = Exception.class)
+ @Test(groups =
+ { "External" }, expectedExceptions = Exception.class)
public void testForExpectedRuntimeException() throws Exception
{
List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
new PDBRestClient().executeRequest(request);
}
- @Test
+ @Test(groups =
+ { "External" })
public void parsePDBJsonResponseTest()
{
List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
assertTrue(response.getSearchSummary().size() == 14);
}
- @Test
+ @Test(groups ={ "Functional" })
public void getPDBIdColumIndexTest()
{
List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
assertEquals(4, PDBRestClient.getPDBIdColumIndex(wantedFields, false));
}
- @Test
+ @Test(groups =
+ { "External" })
public void externalServiceIntegrationTest()
{
ClientConfig clientConfig = new DefaultClientConfig();
/**
* Test the method that unmarshals XML to a Uniprot model
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetUniprotEntries()
{
Uniprot u = new Uniprot();
/**
* Test the method that formats the sequence name in Fasta style
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testConstructSequenceFastaHeader()
{
Uniprot u = new Uniprot();
* rather than hang
*/
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void testJws2Gui()
{
Iterator<String> presetEnum = presetTests.iterator();
/**
* test for patches to JAL-1294
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testDisorderAnnotExport()
{
disorderClient = new AADisorderClient(iupreds.get(0), af, null, null);
{ "http://localhost:8080/jabaws",
"http://www.compbio.dundee.ac.uk/jabaws" };
- @Test(enabled = false)
+ @Test(groups =
+ { "Functional" }, enabled = false)
public void testAnnotExport()
{
fail("Not yet implemented");
for (Jws2Instance svc : disc.getServices())
{
-
if (svc.getServiceTypeURI().toLowerCase().contains("jpred"))
{
jpredws = svc;
}
System.out.println("State of jpredws: " + jpredws);
-
- if (jpredws == null)
- {
- Assert.fail("jpredws is null");
- }
-
+ Assert.assertNotNull(jpredws, "jpredws is null!");
jalview.io.FileLoader fl = new jalview.io.FileLoader(false);
-
af = fl.LoadFileWaitTillLoaded(testseqs, jalview.io.FormatAdapter.FILE);
-
assertNotNull("Couldn't load test data ('" + testseqs + "')", af);
-
}
@AfterClass
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testJPredStructOneSeqOnly()
{
af.selectAllSequenceMenuItem_actionPerformed(null);
}
- @Test
+ @Test(groups ={ "Functional" })
public void testJPredStructExport()
{
+ "\nCouldn't complete Annotation file roundtrip input/output/input test.");
}
- @Test
+ @Test(groups ={ "Functional" })
public void testJpredwsSettingsRecovery()
{
Assert.fail("not implemnented");
* @throws Exception
*/
@SuppressWarnings("rawtypes")
- @Test
+ @Test(groups =
+ { "Network" })
public void msaTest() throws Exception {
String url;
RegistryWS registry = Jws2Client
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testRNAAliFoldValidStructure()
{
}
}
- @Test
+ @Test(groups ={ "Functional" })
public void testRNAStructExport()
{
+ "\nCouldn't complete Annotation file roundtrip input/output/input test.");
}
- @Test
+ @Test(groups ={ "Functional" })
public void testRnaalifoldSettingsRecovery()
{
List<compbio.metadata.Argument> opts = new ArrayList<compbio.metadata.Argument>();
disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
}
- @Test
+ @Test(groups ={ "Functional" })
public void testWriteParameterSet() throws WrongParameterException
{
for (Jws2Instance service : disc.getServices())
|| serviceTests.contains(service.serviceType.toLowerCase());
}
- @Test
+ @Test(groups ={ "Functional" })
public void testCopyOption()
{
for (Jws2Instance service : disc.getServices())
/**
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testCopyParameter()
{
for (Jws2Instance service : disc.getServices())
/**
* Refactored 'as is' from main method
*/
- @Test
+ @Test(groups ={ "Functional" })
public void testGetRestClient()
{
/*
public class ShmmrRSBSService
{
- @Test
+ @Test(groups ={ "Functional" })
public void testShmmrService()
{
RestClient.makeShmmrRestClient().service));
}
- @Test
+ @Test(groups ={ "Functional" })
public void testShmmrServiceDataprep() throws Exception
{
RestClient _rc = RestClient.makeShmmrRestClient();
public class DasSequenceFetcher
{
- @Test
+ @Test(groups ={ "Functional" })
public void testDasRegistryContact()
{
jalview.bin.Cache.getDasSourceRegistry().refreshSources();
{
}
- @Test
+ @Test(groups ={ "Functional" })
public void testStandardProtDbs()
{
String[] defdb = DBRefSource.PROTEINDBS;
uniprot != null && i < 2);
}
- @Test
+ @Test(groups =
+ { "External" })
public void testEmblUniprotProductRecovery() throws Exception
{
String retrievalId = "CAA23748"; // "V00488";
verifyProteinNucleotideXref(retrievalId, embl);
}
- @Test
+ @Test(groups =
+ { "External" })
public void testEmblCDSUniprotProductRecovery() throws Exception
{
String retrievalId = "AAH29712";