+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
+ * Copyright (C) 2015 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 <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.datamodel;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
import static org.testng.AssertJUnit.assertTrue;
-import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
+
import jalview.io.AppletFormatAdapter;
import jalview.io.FormatAdapter;
import jalview.util.MapList;
import java.io.IOException;
import java.util.Iterator;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
/**
* Unit tests for Alignment datamodel.
*
protected AlignmentI loadAlignment(final String data, String format)
throws IOException
{
- Alignment a = new FormatAdapter().readFile(data,
+ AlignmentI a = new FormatAdapter().readFile(data,
AppletFormatAdapter.PASTE, format);
a.setDataset(null);
return a;
* Read in Stockholm format test data including secondary structure
* annotations.
*/
- @BeforeMethod
+ @BeforeMethod(alwaysRun = true)
public void setUp() throws IOException
{
al = loadAlignment(TEST_DATA, "STH");
/**
* 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:
* of what would normally be protein here.
*/
AlignedCodonFrame acf = new AlignedCodonFrame();
- MapList ml = new MapList(new int[]
- { 1, 12 }, new int[]
- { 1, 12 }, 1, 1);
+ MapList ml = new MapList(new int[] { 1, 12 }, new int[] { 1, 12 }, 1, 1);
acf.addMap(al2.getSequenceAt(0), al1.getSequenceAt(0), ml);
acf.addMap(al2.getSequenceAt(1), al1.getSequenceAt(1), ml);
al1.addCodonFrame(acf);
*
* @throws IOException
*/
- @Test
+ @Test(groups = { "Functional" })
public void testAlignAs_proteinAsCdna() throws IOException
{
// see also AlignmentUtilsTests
AlignmentI al1 = loadAlignment(CDNA_SEQS_1, "FASTA");
AlignmentI al2 = loadAlignment(AA_SEQS_1, "FASTA");
AlignedCodonFrame acf = new AlignedCodonFrame();
- MapList ml = new MapList(new int[]
- { 1, 12 }, new int[]
- { 1, 4 }, 3, 1);
+ MapList ml = new MapList(new int[] { 1, 12 }, new int[] { 1, 4 }, 3, 1);
acf.addMap(al1.getSequenceAt(0), al2.getSequenceAt(0), ml);
acf.addMap(al1.getSequenceAt(1), al2.getSequenceAt(1), ml);
al2.addCodonFrame(acf);
*
* @throws IOException
*/
- @Test
+ @Test(groups = { "Functional" })
public void testAlignAs_cdnaAsProtein() throws IOException
{
/*
AlignmentI al1 = loadAlignment(CDNA_SEQS_1, "FASTA");
AlignmentI al2 = loadAlignment(AA_SEQS_1, "FASTA");
AlignedCodonFrame acf = new AlignedCodonFrame();
- MapList ml = new MapList(new int[]
- { 1, 12 }, new int[]
- { 1, 4 }, 3, 1);
+ MapList ml = new MapList(new int[] { 1, 12 }, new int[] { 1, 4 }, 3, 1);
acf.addMap(al1.getSequenceAt(0), al2.getSequenceAt(0), ml);
acf.addMap(al1.getSequenceAt(1), al2.getSequenceAt(1), ml);
al2.addCodonFrame(acf);
*
* @throws IOException
*/
- @Test
+ @Test(groups = { "Functional" })
public void testAlignAs_dnaAsProtein_withIntrons() throws IOException
{
/*
AlignedCodonFrame acf = new AlignedCodonFrame();
// Seq1 has intron at dna positions 3,4,9 so splice is AAG GCC TTT
// Seq2 has intron at dna positions 1,5,6 so splice is CCG TTT AAA
- MapList ml1 = new MapList(new int[]
- { 1, 2, 5, 8, 10, 12 }, new int[]
- { 1, 3 }, 3, 1);
+ MapList ml1 = new MapList(new int[] { 1, 2, 5, 8, 10, 12 }, new int[] {
+ 1, 3 }, 3, 1);
acf.addMap(al1.getSequenceAt(0), al2.getSequenceAt(0), ml1);
- MapList ml2 = new MapList(new int[]
- { 2, 4, 7, 12 }, new int[]
- { 1, 3 }, 3, 1);
+ MapList ml2 = new MapList(new int[] { 2, 4, 7, 12 },
+ new int[] { 1, 3 }, 3, 1);
acf.addMap(al1.getSequenceAt(1), al2.getSequenceAt(1), ml2);
al2.addCodonFrame(acf);