<classpathentry kind="lib" path="lib/jetty-http-9.2.10.v20150310.jar"/>
<classpathentry kind="lib" path="lib/jetty-io-9.2.10.v20150310.jar"/>
<classpathentry kind="lib" path="lib/java-json.jar"/>
+ <classpathentry kind="con" path="org.testng.TESTNG_CONTAINER"/>
<classpathentry kind="output" path="classes"/>
</classpath>
.project
/dist
/classes
+/tests
+/test-reports
+/test-output
.externalToolBuilders/Jalview Release indices [Builder].launch
/.DS_Store
.DS_Store
<property name="jsonSimple" value="json_simple-1.1.jar" />
<property name="javaJson" value="java-json.jar" />
<property name="jalviewLiteJar" value="jalviewApplet.jar" />
+ <property name="reportDir" value="test-reports" />
+ <property name="testDir" value="test" />
+ <property name="testOutputDir" value="tests" />
<!-- switch to indicate if we should obfuscate jalviewLite -->
<!-- <property name="donotobfuscate" value="true"/> -->
<!-- switch to exclude associations from generated jnlp files -->
<exclude name="com/stevesoft/**" />
</javac>
</target>
+
+
+ <target name="testclean" depends="init">
+ <delete dir="${testOutputDir}" includes="*,**/*"/>
+ </target>
+
+ <target name="prepareTests" depends="init">
+ <mkdir dir="${testOutputDir}" />
+ <copy todir="${testOutputDir}">
+ <fileset dir=".">
+ <include name="${docDir}/**/*.*" />
+ <include name="${helpDir}/**/*.*" />
+ <include name="${libDir}/*.jar" />
+ </fileset>
+ <fileset dir="${resourceDir}">
+ <include name="**/*.*" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="buildTests" depends="prepareTests">
+ <javac source="1.5" target="1.5" srcdir="${sourceDir}" destdir="${testOutputDir}"
+ debug="${javac.debug}" classpathref="build.classpath" includeantruntime="false" >
+ <exclude name="jalview/*applet*" />
+ <exclude name="jalview/appletgui/**" />
+ </javac>
+ <javac source="1.5" target="1.5" srcdir="${testDir}" destdir="${testOutputDir}"
+ debug="${javac.debug}" classpathref="build.classpath" includeantruntime="false" >
+ </javac>
+ </target>
+
+ <taskdef name="testng" classname="org.testng.TestNGAntTask" >
+ <classpath location="utils/testnglibs/testng.jar" />
+ </taskdef>
+
+ <target name="testng" depends="buildTests">
+ <testng classpathref="build.classpath" outputDir="${reportDir}"
+ haltOnFailure="false">
+ <classpath location="${testOutputDir}" />
+ <xmlfileset dir="utils" includes="jalview_testng.xml" />
+ </testng>
+ </target>
+
<target name="buildindices" depends="init, prepare" unless="help.uptodate">
<java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
<arg line="html" />
getSize(currentSize);
g.getClipBounds(rectClip);
- if (jmb.fileLoadingError != null)
+ if (jmb != null && jmb.fileLoadingError != null)
{
g.setColor(Color.black);
g.fillRect(0, 0, currentSize.width, currentSize.height);
*/
package jalview.io;
-import java.io.StringWriter;
import java.io.PrintWriter;
+import java.io.StringWriter;
import java.util.Enumeration;
import java.util.Hashtable;
- alignment.getSequenceAt(i).getStart();
avg += size;
if (size > max)
+ {
max = size;
+ }
if (size < min)
+ {
min = size;
+ }
}
- avg = avg / (float) alignment.getHeight();
+ avg = avg / alignment.getHeight();
pw.print(nl);
pw.print("Sequences: " + alignment.getHeight());
pw.print(nl);
*/
package jalview.io;
-import java.io.*;
-import java.util.*;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
-import jalview.datamodel.*;
+import java.io.IOException;
+import java.util.Vector;
/**
* DOCUMENT ME!
{
line = nextLine();
if (line == null)
+ {
break;
+ }
// seek end of ids
if (line.indexOf("*") > -1)
{
}
} while (!idsFound);
if (line == null)
+ {
break; // end of file.
+ }
int starCol = line.indexOf("*");
seqstrings = new StringBuffer[seqs.size()];
}
if (seqs.size() > 0)
{
- if (headerLines.length() > 1 + numHeaderLines) // could see if buffer is
+ if (headerLines.length() > 1 + numHeaderLines)
+ {
// just whitespace or not.
setAlignmentProperty("Comments", headerLines.toString());
+ }
setAlignmentProperty("iteration", "" + iterationCount);
}
}
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
+
import jalview.ws.seqfetcher.DbSourceProxyImpl;
public abstract class EbiFileRetrievedProxy extends DbSourceProxyImpl
public StringBuffer getRawRecords()
{
if (file == null)
+ {
return null;
+ }
StringBuffer bf = null;
try
{
package MCview;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.junit.Test;
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
+import org.testng.Assert;
public class AtomTest
{
{
new Atom(
"ATOM 34N NE2 GLN A 48 22.290 8.595 17.680 1.00 14.30 N");
- fail("Expected exception");
+ Assert.fail("Expected exception");
} catch (NumberFormatException e)
{
// expected
package MCview;
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
public class BondTest
{
package MCview;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import java.awt.Color;
import java.util.Vector;
-import org.junit.Test;
-
import jalview.analysis.AlignSeq;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Sequence;
package MCview;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+
+import org.testng.annotations.Test;
+
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
import jalview.io.AppletFormatAdapter;
-import java.io.IOException;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
public class PDBfileTest
{
@Test
*
* @throws IOException
*/
- @Test
- @Ignore
+
+ @Test(enabled = false)
public void testParse_withAnnotate3D() throws IOException
{
// TODO requires a mock for Annotate3D processing
package MCview;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import java.util.Vector;
-import org.junit.Test;
-
public class ResidueTest
{
package com.stevesoft.pat;
-import static org.junit.Assert.assertEquals;
+import static org.testng.AssertJUnit.assertEquals;
import java.io.IOException;
import java.io.StringWriter;
-import org.junit.Test;
+import org.testng.annotations.Test;
/**
* Test class refactored from RegexWriter main method
package jalview.analysis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import java.util.Hashtable;
-import org.junit.Test;
-
public class AAFrequencyTest
{
private static final String C = AAFrequency.MAXCOUNT;
package jalview.analysis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
+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 java.io.IOException;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;
import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
-
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
*
* @throws IOException
*/
- @Before
+ @BeforeMethod
public void setUp() throws IOException
{
alignment = new jalview.io.FormatAdapter().readFile(TEST_DATA,
*/
package jalview.analysis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;
-import org.junit.Test;
-
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
package jalview.analysis;
-import static org.junit.Assert.assertEquals;
-import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceI;
+import static org.testng.AssertJUnit.assertEquals;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
-import org.junit.Before;
-import org.junit.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
public class AnnotationSorterTest
{
/*
* Set up 6 sequences and 7 annotations.
*/
- @Before
+ @BeforeMethod
public void setUp()
{
al = buildAlignment(NUM_SEQS);
package jalview.analysis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import java.util.Arrays;
-import org.junit.Test;
-
public class CodingUtilsTest
{
package jalview.analysis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-
-import org.junit.Test;
-
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
import jalview.datamodel.DBRefEntry;
public class CrossRefTest
package jalview.analysis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import jalview.api.AlignViewportI;
import jalview.datamodel.AlignedCodon;
import jalview.datamodel.Alignment;
import java.io.IOException;
-import org.junit.Test;
-
public class DnaTest
{
// @formatter:off
package jalview.analysis;
+import org.testng.annotations.Test;
+import org.testng.AssertJUnit;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.ColumnSelection;
import java.util.ArrayList;
import java.util.Arrays;
-import org.junit.Assert;
-import org.junit.Test;
-
public class GroupingTest
{
Sequence s1 = new Sequence("s1", "AAAADDDDEEEE");
alignment.getSequencesArray(), cs,
Arrays.asList(new SequenceGroup[]
{ sg1, sg2 }));
- Assert.assertEquals(seqgroupsString.length, seqgroupsColSel.length);
+ AssertJUnit.assertEquals(seqgroupsString.length, seqgroupsColSel.length);
for (int p = 0; p < seqgroupsString.length; p++)
{
- Assert.assertEquals(seqgroupsString[p].getName(),
+ AssertJUnit.assertEquals(seqgroupsString[p].getName(),
seqgroupsColSel[p].getName());
- Assert.assertArrayEquals(
+ AssertJUnit.assertArrayEquals(
seqgroupsString[p].getSequencesInOrder(alignment),
seqgroupsColSel[p].getSequencesInOrder(alignment));
if (seqgroupsString[p].getSequences().contains(s2))
{
- Assert.assertTrue(seqgroupsString[p].getSize() == 2);
+ AssertJUnit.assertTrue(seqgroupsString[p].getSize() == 2);
}
}
}
package jalview.analysis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Sequence;
/**
* Construct an alignment with 4 sequences with varying description format
*/
- @Before
+ @BeforeMethod
public void setUp()
{
SequenceI[] seqs = new SequenceI[]
*/
package jalview.analysis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
import java.io.PrintStream;
-import org.junit.Before;
-import org.junit.Test;
-
import jalview.datamodel.Mapping;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
/**
* @throws java.lang.Exception
*/
- @Before
+ @BeforeMethod
public void setUp() throws Exception
{
s1 = new Sequence("Seq1", "ASDFAQQQRRRSSS");
package jalview.analysis.scoremodels;
+import org.testng.annotations.Test;
+import org.testng.AssertJUnit;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.io.FileLoader;
import jalview.io.FormatAdapter;
-import org.junit.Assert;
-import org.junit.Test;
-
public class FeatureScoreModelTest
{
public static String alntestFile = "FER1_MESCR/72-76 DVYIL\nFER1_SPIOL/71-75 DVYIL\nFER3_RAPSA/21-25 DVYVL\nFER1_MAIZE/73-77 DVYIL\n";
AlignFrame alf = new FileLoader(false).LoadFileWaitTillLoaded(alntestFile,
FormatAdapter.PASTE);
AlignmentI al = alf.getViewport().getAlignment();
- Assert.assertEquals(4, al.getHeight());
- Assert.assertEquals(5, al.getWidth());
+ AssertJUnit.assertEquals(4, al.getHeight());
+ AssertJUnit.assertEquals(5, al.getWidth());
for (int i = 0; i < 4; i++)
{
SequenceI ds = al.getSequenceAt(i).getDatasetSequence();
alf.getFeatureRenderer().setVisible("sf2");
alf.getFeatureRenderer().setVisible("sf3");
alf.getFeatureRenderer().findAllFeatures(true);
- Assert.assertEquals("Number of feature types", 3, alf
+ AssertJUnit.assertEquals("Number of feature types", 3, alf
.getFeatureRenderer().getDisplayedFeatureTypes().length);
- Assert.assertTrue(alf.getCurrentView().areFeaturesDisplayed());
+ AssertJUnit.assertTrue(alf.getCurrentView().areFeaturesDisplayed());
FeatureScoreModel fsm = new FeatureScoreModel();
- Assert.assertTrue(fsm.configureFromAlignmentView(alf.getCurrentView()
+ AssertJUnit.assertTrue(fsm.configureFromAlignmentView(alf.getCurrentView()
.getAlignPanel()));
alf.selectAllSequenceMenuItem_actionPerformed(null);
float[][] dm = fsm.findDistances(alf.getViewport().getAlignmentView(
true));
- Assert.assertTrue("FER1_MESCR should be identical with RAPSA (2)",
+ AssertJUnit.assertTrue("FER1_MESCR should be identical with RAPSA (2)",
dm[0][2] == 0f);
- Assert.assertTrue(
+ AssertJUnit.assertTrue(
"FER1_MESCR should be further from SPIOL (1) than it is from RAPSA (2)",
dm[0][1] > dm[0][2]);
*/
package jalview.bin;
-import static org.junit.Assert.*;
-
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
public class CommandLineOperations
{
System.out.println("Testing with Headless argument: '" + harg
+ "'\n");
Worker worker = jalviewDesktopRunner(withAwt, cmd, 9000);
- assertTrue("Didn't create an output EPS file.[" + harg + "]",
- new File("test_uniref50_out.eps").exists());
- assertTrue("Didn't create an EPS file with any content[" + harg
- + "]", new File("test_uniref50_out.eps").length() > 4096);
+ AssertJUnit.assertTrue("Didn't create an output EPS file.[" + harg
+ + "]", new File("test_uniref50_out.eps").exists());
+ AssertJUnit.assertTrue(
+ "Didn't create an EPS file with any content[" + harg + "]",
+ new File("test_uniref50_out.eps").length() > 4096);
if (worker.exit == null)
{
worker.interrupt();
Thread.currentThread().interrupt();
worker.process.destroy();
- fail("Jalview did not exit after EPS generation (try running test again to verify - timeout at 9000ms). ["
+ Assert.fail("Jalview did not exit after EPS generation (try running test again to verify - timeout at 9000ms). ["
+ harg + "]");
}
} while (!withAwt);
package jalview.commands;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertSame;
+
+import java.util.Map;
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
import jalview.commands.EditCommand.Action;
import jalview.commands.EditCommand.Edit;
import jalview.datamodel.Alignment;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
-import java.util.Map;
-
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
/**
* Unit tests for EditCommand
*
private Alignment al;
- @Before
+ @BeforeMethod
public void setUp()
{
testee = new EditCommand();
/**
* Test a Paste action, where this adds sequences to an alignment.
*/
- @Test
- @Ignore
+ @Test(enabled = false)
// TODO fix so it works
public void testPaste_addToAlignment()
{
package jalview.datamodel;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import jalview.util.MapList;
import java.util.Arrays;
-import org.junit.Test;
-
public class AlignedCodonFrameTest
{
package jalview.datamodel;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import org.testng.annotations.Test;
+import org.testng.Assert;
import jalview.util.MapList;
import java.util.Iterator;
-import org.junit.Test;
-
/**
* Unit tests for Mapping$AlignedCodonIterator
*
try
{
codon = codons.next();
- fail("expected exception");
+ Assert.fail("expected exception");
} catch (IncompleteCodonException e)
{
// expected
package jalview.datamodel;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
public class AlignedCodonTest
{
package jalview.datamodel;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import org.junit.Test;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import jalview.analysis.AlignSeq;
import jalview.io.AppletFormatAdapter;
package jalview.datamodel;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+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.junit.Before;
-import org.junit.Test;
-
/**
* Unit tests for Alignment datamodel.
*
* Read in Stockholm format test data including secondary structure
* annotations.
*/
- @Before
+ @BeforeMethod
public void setUp() throws IOException
{
al = loadAlignment(TEST_DATA, "STH");
package jalview.datamodel;
-import static org.junit.Assert.assertEquals;
-
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
import java.util.List;
-import org.junit.Test;
-
public class ColumnSelectionTest
{
package jalview.datamodel;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import jalview.util.MapList;
-import org.junit.Test;
-
public class DBRefEntryTest
{
package jalview.datamodel;
-import static org.junit.Assert.assertEquals;
-
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
import java.util.Arrays;
-import org.junit.Test;
-
import jalview.util.MapList;
/**
package jalview.datamodel;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
public class PDBEntryTest
{
- @Before
+ @BeforeMethod
public void setUp() throws Exception
{
}
- @After
+ @AfterMethod
public void tearDown() throws Exception
{
}
package jalview.datamodel;
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
public class SearchResultsTest
{
package jalview.datamodel;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
-import org.junit.Test;
+import org.testng.annotations.Test;
/**
* Unit tests for SeqCigar
* String
* @return String
*/
+
+
protected void testCigar_string(Sequence seq, String ex_cs_gapped)
{
SeqCigar c_sgapped = new SeqCigar(seq);
cs_gapped);
}
+
protected void testSeqRecovery(SeqCigar gen_sgapped,
SequenceI s_gapped)
{
package jalview.datamodel;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
import java.util.Arrays;
import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-
public class SequenceTest
{
SequenceI seq;
- @Before
+ @BeforeMethod
public void setUp()
{
seq = new Sequence("FER1", "AKPNGVL");
package jalview.datamodel.xdb.embl;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import java.io.StringReader;
import java.util.Vector;
-import org.junit.Test;
-
import jalview.datamodel.DBRefEntry;
public class EmblFileTest
*/
package jalview.ext.jmol;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
import java.util.Vector;
-import org.junit.Before;
-import org.junit.Test;
-
import MCview.PDBfile;
import jalview.bin.Cache;
// "./examples/DNMT1_MOUSE.pdb"
// };
- @Before
+ @BeforeMethod
public void setUp()
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
*/
package jalview.ext.paradise;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertTrue;
import java.io.BufferedReader;
import java.io.File;
import java.io.Reader;
import java.util.Iterator;
-import org.junit.Assert;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
import MCview.PDBfile;
+
import compbio.util.FileUtil;
import jalview.datamodel.AlignmentI;
public class TestAnnotate3D
{
- @Test
+ @Test(enabled = false)
public void test1GIDbyId() throws Exception
{
// use same ID as standard tests given at
testRNAMLcontent(ids, null);
}
- @Test
+ @Test(enabled = false)
public void testIdVsContent2GIS() throws Exception
{
Iterator<Reader> ids = Annotate3D.getRNAMLForPDBId("2GIS");
*
* @throws Exception
*/
- @Test
+ @Test(enabled = false)
public void testPDBfileVsRNAML() throws Exception
{
PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb",
testRNAMLcontent(readers, pdbf);
}
+ @Test(enabled = false)
private void testRNAMLcontent(Iterator<Reader> readers, PDBfile pdbf)
throws Exception
{
}
if (struseq == null)
{
- Assert.fail("Couldn't find this sequence in original input:\n"
+ AssertJUnit.fail("Couldn't find this sequence in original input:\n"
+ new FastaFile().print(new SequenceI[]
{ sq })
+ "\n\nOriginal input:\n"
package jalview.ext.rbvi.chimera;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import java.awt.Color;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
-
public class ChimeraCommandsTest
{
@Test
package jalview.ext.rbvi.chimera;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import ext.edu.ucsf.rbvi.strucviz2.ChimeraManager;
import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
package jalview.ext.rbvi.chimera;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
package jalview.gui;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-
-import org.junit.Before;
-import org.junit.Test;
-
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.PDBEntry;
AlignmentI al;
AlignViewport testee;
- @Before
+ @BeforeMethod
public void setUp()
{
SequenceI seq1 = new Sequence("Seq1", "ABC");
package jalview.gui;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
+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 java.awt.BorderLayout;
import java.awt.Checkbox;
import java.awt.Component;
import javax.swing.JButton;
import javax.swing.JPanel;
-import org.junit.Before;
-import org.junit.Test;
-
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentAnnotation;
AlignFrame af;
- @Before
+ @BeforeMethod
public void setUp() throws IOException
{
// pin down annotation sort order for test
package jalview.gui;
+import org.testng.annotations.Test;
import java.awt.Canvas;
import java.awt.Font;
import java.awt.FontMetrics;
-import org.junit.Test;
-
public class FontChooserTest
{
package jalview.gui;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import jalview.gui.Help.HelpId;
import java.net.URL;
import javax.help.HelpSetException;
import javax.help.Map;
-import org.junit.Test;
-
public class HelpTest
{
@Test
*/
package jalview.gui;
-import jalview.bin.Cache;
-
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JTextArea;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import jalview.bin.Cache;
public class JAL1353bugdemo
{
volatile boolean finish = false;
- @Test
- @Ignore
- // comment out @Ignore to enable this test
+ @Test(enabled = false)
public void test()
{
Cache.initLogger();
package jalview.gui;
-import static org.junit.Assert.assertEquals;
-
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
import javax.swing.JScrollBar;
-import org.junit.Test;
-
public class JvSwingUtilsTest
{
package jalview.gui;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
import javax.swing.JInternalFrame;
import javax.swing.JTextField;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
public class PDBSearchPanelTest
{
- @Before
+ @BeforeMethod
public void setUp() throws Exception
{
}
- @After
+ @AfterMethod
public void tearDown() throws Exception
{
}
package jalview.gui;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
import jalview.datamodel.Alignment;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import javax.swing.JPanel;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
public class PaintRefresherTest
{
// TODO would prefer PaintRefresher to be a single rather than static
- @Before
+ @BeforeMethod
public void setUp()
{
PaintRefresher.components.clear();
}
- @After
+ @AfterMethod
public void tearDown()
{
PaintRefresher.components.clear();
package jalview.gui;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
import java.awt.Component;
import java.io.IOException;
import javax.swing.JPopupMenu;
import javax.swing.JSeparator;
-import org.junit.Before;
-import org.junit.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
PopupMenu testee = null;
- @Before
+ @BeforeMethod
public void setUp() throws IOException
{
alignment = new FormatAdapter().readFile(TEST_DATA,
testee.configureReferenceAnnotationsMenu(menu, seqs);
assertTrue(menu.isEnabled());
- String expected = "<html><table width=350 border=0><tr><td>Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</td></tr></table></html>";
+ String expected = "<html><table width=350 border=0><tr><td align=justify>Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</td></tr></table></html>";
assertEquals(expected, menu.getToolTipText());
}
testee.configureReferenceAnnotationsMenu(menu, seqs);
assertTrue(menu.isEnabled());
- String expected = "<html><table width=350 border=0><tr><td>Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</td></tr></table></html>";
+ String expected = "<html><table width=350 border=0><tr><td align=justify>Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</td></tr></table></html>";
assertEquals(expected, menu.getToolTipText());
}
package jalview.gui;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
+import org.testng.Assert;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
-import org.junit.Test;
-
public class ProgressBarTest
{
try
{
new ProgressBar(null, null);
- fail("Expected exception");
+ Assert.fail("Expected exception");
} catch (NullPointerException e)
{
// expected
try
{
new ProgressBar(statusPanel, null);
- fail("expected exception");
+ Assert.fail("expected exception");
} catch (IllegalArgumentException e)
{
// expected
package jalview.gui;
-import static org.junit.Assert.assertEquals;
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Sequence;
import java.awt.Color;
-import org.junit.Test;
-
public class SequenceRendererTest
{
package jalview.gui;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.Sequence;
import java.util.Vector;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
public class StructureChooserTest
{
Sequence seq;
- @Before
+ @BeforeMethod
public void setUp() throws Exception
{
seq = new Sequence("PDB|4kqy|4KQY|A", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1,
seq.setPDBId(pdbIds);
}
- @After
+ @AfterMethod
public void tearDown() throws Exception
{
seq = null;
package jalview.io;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
import java.io.File;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentAnnotation;
String pdbId;
- @Before
+ @BeforeMethod
public void setup() throws Exception
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
{
for (int q = p + 1; q < avec.length; q++)
{
- assertNotEquals(
+ Assert.assertNotEquals(
"Found a duplicate annotation row " + avec[p].label,
avec[p], avec[q]);
}
*/
package jalview.io;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.ColumnSelection;
-import jalview.io.AnnotationFile.ViewDef;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
import java.io.File;
import java.util.Hashtable;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.ColumnSelection;
+import jalview.io.AnnotationFile.ViewDef;
public class AnnotationFileIOTest
{
{
e.printStackTrace();
}
- fail("Couln't read the alignment in file '" + f.toString() + "'");
+ Assert.fail("Couln't read the alignment in file '" + f.toString() + "'");
return null;
}
* - label for IO class used to write and read back in the data from
* f
*/
+
+ // @Test
public static void testAnnotationFileIO(String testname, File f,
File annotFile)
{
{
e.printStackTrace();
}
- fail("Test "
+ Assert.fail("Test "
+ testname
+ "\nCouldn't complete Annotation file roundtrip input/output/input test for '"
+ annotFile + "'.");
package jalview.io;
-import jalview.json.binding.v1.BioJSReleasePojo;
-import jalview.json.binding.v1.BioJSRepositoryPojo;
-
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URLConnection;
import java.util.TreeMap;
-import org.junit.Assert;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
+
+import jalview.json.binding.v1.BioJSReleasePojo;
+import jalview.json.binding.v1.BioJSRepositoryPojo;
public class BioJsHTMLOutputTest
Assert.assertNotNull(bjsTemplate);
}
- @Test(expected = NullPointerException.class)
+ @Test(expectedExceptions = NullPointerException.class)
public void expectedNullPointerException()
{
try
BioJsHTMLOutput.refreshBioJSVersionsInfo(null);
} catch (URISyntaxException e)
{
- Assert.fail("Expception occured while testing!");
+ AssertJUnit.fail("Expception occured while testing!");
e.printStackTrace();
}
}
versions = BioJsHTMLOutput.getBioJsMSAVersions();
} catch (URISyntaxException e)
{
- Assert.fail("Expception occured while testing!");
+ AssertJUnit.fail("Expception occured while testing!");
e.printStackTrace();
}
- Assert.assertNotNull("No versions found", versions);
- Assert.assertTrue("One or more Templates required", versions.size() > 0);
+ AssertJUnit.assertNotNull("No versions found", versions);
+ AssertJUnit.assertTrue("One or more Templates required", versions.size() > 0);
System.out
.println("Number of discovered versions : "
+ versions.size());
System.out.println("\nCurrent latest version : "
+ BioJsHTMLOutput.getCurrentBJSTemplateFile());
- Assert.assertNotNull("Latest BioJsMSA version NOT found!",
+ AssertJUnit.assertNotNull("Latest BioJsMSA version NOT found!",
BioJsHTMLOutput.getCurrentBJSTemplateFile());
}
public void testBioJsUpdate()
{
String url = BioJsHTMLOutput.BJS_TEMPLATE_GIT_REPO;
- Assert.assertTrue("URL not reacable : " + url, urlIsReachable(url));
+ AssertJUnit.assertTrue("URL not reacable : " + url, urlIsReachable(url));
String response = BioJsHTMLOutput.getURLContentAsString(url);
- Assert.assertNotNull("Null response read from url!", response);
+ AssertJUnit.assertNotNull("Null response read from url!", response);
BioJSRepositoryPojo repository = new BioJSRepositoryPojo(response);
System.out.println(">>> description : " + repository.getDescription());
System.out
*/
package jalview.io;
-import static org.junit.Assert.*;
-
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
+import org.testng.AssertJUnit;
import java.io.File;
import java.io.IOException;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
/**
* @author jimp
*
private void assertValidFormat(String fmt, String src, FileParse fp)
{
- assertTrue("Couldn't resolve " + src + " as a valid file", fp.isValid());
+ AssertJUnit.assertTrue("Couldn't resolve " + src + " as a valid file", fp.isValid());
String type = new IdentifyFile().Identify(fp);
- assertTrue("Data from '" + src + "' Expected to be '" + fmt
+ AssertJUnit.assertTrue("Data from '" + src + "' Expected to be '" + fmt
+ "' identified as '" + type + "'", type.equalsIgnoreCase(fmt));
}
import static org.junit.Assert.fail;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.testng.annotations.Test;
public class HtmlFileTest
{
- @Test
- @Ignore
+ @Test(enabled = false)
public void test()
{
fail("Not yet implemented");
package jalview.io;
-import static org.junit.Assert.assertNotNull;
+import static org.testng.AssertJUnit.assertNotNull;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.AssertJUnit;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import java.util.ArrayList;
import java.util.HashMap;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
public class JSONFileTest
{
HashMap<String, AlignmentAnnotation> testAnnots = new HashMap<String, AlignmentAnnotation>();
HashMap<String, SequenceGroup> testGrps = new HashMap<String, SequenceGroup>();
- @Before
+ @BeforeMethod
public void setup() throws Exception
{
// create and add sequences
TEST_ANOT_HEIGHT = testAnnots.size();
}
- @After
+ @AfterMethod
public void tearDown() throws Exception
{
}
for (SequenceI seq : al.getSequences())
{
SequenceI expectedSeq = testSeqs.get(seq.getName());
- Assert.assertTrue("Failed Sequence Test for >>> " + seq.getName(),
+ AssertJUnit.assertTrue("Failed Sequence Test for >>> " + seq.getName(),
isSeqMatched(expectedSeq, seq));
passedCount++;
}
- Assert.assertEquals("Some Sequences did not pass the test",
+ AssertJUnit.assertEquals("Some Sequences did not pass the test",
TEST_SEQ_HEIGHT, passedCount);
passedCount = 0;
for (SequenceGroup seqGrp : al.getGroups())
{
SequenceGroup expectedGrp = testGrps.get(seqGrp.getName());
- Assert.assertTrue(
+ AssertJUnit.assertTrue(
"Failed SequenceGroup Test for >>> " + seqGrp.getName(),
isGroupMatched(expectedGrp, seqGrp));
passedCount++;
}
- Assert.assertEquals("Some SequenceGroups did not pass the test",
+ AssertJUnit.assertEquals("Some SequenceGroups did not pass the test",
TEST_GRP_HEIGHT, passedCount);
passedCount = 0;
for (AlignmentAnnotation annot : al.getAlignmentAnnotation())
{
AlignmentAnnotation expectedAnnot = testAnnots.get(annot.label);
- Assert.assertTrue("Failed AlignmentAnnotation Test for >>> "
+ AssertJUnit.assertTrue("Failed AlignmentAnnotation Test for >>> "
+ annot.label, isAnnotationMatched(expectedAnnot, annot));
passedCount++;
}
- Assert.assertEquals("Some Sequences did not pass the test",
+ AssertJUnit.assertEquals("Some Sequences did not pass the test",
TEST_ANOT_HEIGHT, passedCount);
// af = new AlignFrame(al, 700, 500);
*/
package jalview.io;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.testng.AssertJUnit.assertTrue;
import java.io.File;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
import jalview.api.AlignmentViewPanel;
import jalview.api.ViewStyleI;
}
catch (NullPointerException q)
{
- fail("Mismatch of alignment annotations at position " + p
+ Assert.fail("Mismatch of alignment annotations at position " + p
+ " Ref seq ann: " + refan.annotations[p]
+ " alignment " + alaa.annotations[p]);
}
{
AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
"examples/exampleFile_2_7.jar", FormatAdapter.FILE);
- Assert.assertTrue("Didn't read in the example file correctly.", af != null);
+ assertTrue("Didn't read in the example file correctly.", af != null);
AlignmentViewPanel sps = null, groups = null;
for (AlignmentViewPanel ap : af.alignPanel.alignFrame.getAlignPanels())
{
ViewStyleI structureStyle = sps.getAlignViewport().getViewStyle();
ViewStyleI groupStyle = groups.getAlignViewport().getViewStyle();
- Assert.assertFalse(structureStyle.sameStyle(groupStyle));
+ AssertJUnit.assertFalse(structureStyle.sameStyle(groupStyle));
groups.getAlignViewport().setViewStyle(structureStyle);
- Assert.assertFalse(groupStyle.sameStyle(groups.getAlignViewport()
+ AssertJUnit.assertFalse(groupStyle.sameStyle(groups.getAlignViewport()
.getViewStyle()));
Assert.assertTrue(structureStyle.sameStyle(groups.getAlignViewport()
.getViewStyle()));
*/
package jalview.io;
-import static org.junit.Assert.*;
-
+import org.testng.annotations.Factory;
+import static org.testng.ConversionUtils.wrapDataProvider;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import jalview.datamodel.SequenceNode;
import org.jmol.util.ArrayUtil;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
/**
* @author jimp
*
*/
-@RunWith(Parameterized.class)
public class NewickFileTests
{
+ @Factory
+ public static Object[] factoryData()
+ {
+ return wrapDataProvider(NewickFileTests.class, data());
+ }
+
@Parameters
public static Collection data()
{
System.out.println(treename + "\n" + testTree);
NewickFile nf = new NewickFile(testTree, FormatAdapter.PASTE);
nf.parse();
- assertTrue(stage + "Invalid Tree '" + nf.getWarningMessage() + "'",
+ AssertJUnit.assertTrue(stage + "Invalid Tree '" + nf.getWarningMessage() + "'",
nf.isValid());
SequenceNode tree = nf.getTree();
- assertTrue(stage + "Null Tree", tree != null);
+ AssertJUnit.assertTrue(stage + "Null Tree", tree != null);
stage = "Creating newick file from testTree " + treename;
String gentree = new NewickFile(tree).print(nf.HasBootstrap(),
nf.HasDistances());
- assertTrue(stage + "Empty string generated", gentree != null
+ AssertJUnit.assertTrue(stage + "Empty string generated", gentree != null
&& gentree.trim().length() > 0);
stage = "Parsing regenerated testTree " + treename;
NewickFile nf_regen = new NewickFile(gentree, FormatAdapter.PASTE);
nf_regen.parse();
- assertTrue(
+ AssertJUnit.assertTrue(
stage + "Newick file is invalid ('"
+ nf_regen.getWarningMessage() + "')",
nf_regen.isValid());
SequenceNode tree_regen = nf.getTree();
- assertTrue(stage + "Null Tree", tree_regen != null);
+ AssertJUnit.assertTrue(stage + "Null Tree", tree_regen != null);
stage = "Compare original and generated tree" + treename;
Vector oseqs, nseqs;
oseqs = new NJTree(new SequenceI[0], nf).findLeaves(nf.getTree(),
new Vector());
- assertTrue(stage + "No nodes in original tree.", oseqs.size() > 0);
+ AssertJUnit.assertTrue(stage + "No nodes in original tree.", oseqs.size() > 0);
SequenceI[] olsqs = new SequenceI[oseqs.size()];
for (int i = 0, iSize = oseqs.size(); i < iSize; i++)
{
}
nseqs = (Vector) new NJTree(new SequenceI[0], nf_regen).findLeaves(
nf_regen.getTree(), new Vector());
- assertTrue(stage + "No nodes in regerated tree.", nseqs.size() > 0);
+ AssertJUnit.assertTrue(stage + "No nodes in regerated tree.", nseqs.size() > 0);
SequenceI[] nsqs = new SequenceI[nseqs.size()];
for (int i = 0, iSize = nseqs.size(); i < iSize; i++)
{
nsqs[i] = (SequenceI) ((SequenceNode) nseqs.get(i)).element();
}
- assertTrue(stage + " Different number of leaves (original "
+ AssertJUnit.assertTrue(stage + " Different number of leaves (original "
+ olsqs.length + " and regen " + nsqs.length + ")",
olsqs.length == nsqs.length);
SequenceIdMatcher omatcher = new SequenceIdMatcher(olsqs), nmatcher = new SequenceIdMatcher(
if (warns.length() > 0)
{
- fail(stage + warns);
+ Assert.fail(stage + warns);
}
} catch (Exception x)
{
package jalview.io;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.SequenceI;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Test;
+import org.testng.annotations.Test;
+
+import jalview.datamodel.Alignment;
+import jalview.datamodel.SequenceI;
/**
* Test file for {@link PhylipFile}.
*/
package jalview.io;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
import java.io.File;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
public class RNAMLfileTest
{
*/
package jalview.io;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.Annotation;
-import jalview.datamodel.SequenceFeature;
-import jalview.datamodel.SequenceI;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
import java.io.File;
import java.util.BitSet;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Test;
+import org.testng.annotations.Test;
+
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
public class StockholmFileTest
{
* - label for IO class used to write and read back in the data from
* f
*/
+
public static void testFileIOwithFormat(File f, String ioformat,
int naliannot, int nminseqann)
{
*/
package jalview.io;
-import static org.junit.Assert.*;
+import org.testng.annotations.Test;
+import org.testng.AssertJUnit;
import jalview.io.TCoffeeScoreFile.Block;
import jalview.io.TCoffeeScoreFile.Header;
import javax.xml.parsers.ParserConfigurationException;
-import org.junit.Test;
import org.xml.sax.SAXException;
import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),
AppletFormatAdapter.FILE);
- assertTrue(scoreFile.getWarningMessage(), scoreFile.isValid());
+ AssertJUnit.assertTrue(scoreFile.getWarningMessage(), scoreFile.isValid());
Header header = scoreFile.header;
- assertNotNull(header);
- assertEquals(
+ AssertJUnit.assertNotNull(header);
+ AssertJUnit.assertEquals(
"T-COFFEE, Version_9.02.r1228 (2012-02-16 18:15:12 - Revision 1228 - Build 336)",
header.head);
- assertEquals(90, header.score);
- assertEquals(89, header.getScoreFor("1PHT"));
- assertEquals(90, header.getScoreFor("1BB9"));
- assertEquals(94, header.getScoreFor("1UHC"));
- assertEquals(94, header.getScoreFor("1YCS"));
- assertEquals(93, header.getScoreFor("1OOT"));
- assertEquals(94, header.getScoreFor("1ABO"));
- assertEquals(94, header.getScoreFor("1FYN"));
- assertEquals(94, header.getScoreFor("1QCF"));
- assertEquals(90, header.getScoreFor("cons"));
+ AssertJUnit.assertEquals(90, header.score);
+ AssertJUnit.assertEquals(89, header.getScoreFor("1PHT"));
+ AssertJUnit.assertEquals(90, header.getScoreFor("1BB9"));
+ AssertJUnit.assertEquals(94, header.getScoreFor("1UHC"));
+ AssertJUnit.assertEquals(94, header.getScoreFor("1YCS"));
+ AssertJUnit.assertEquals(93, header.getScoreFor("1OOT"));
+ AssertJUnit.assertEquals(94, header.getScoreFor("1ABO"));
+ AssertJUnit.assertEquals(94, header.getScoreFor("1FYN"));
+ AssertJUnit.assertEquals(94, header.getScoreFor("1QCF"));
+ AssertJUnit.assertEquals(90, header.getScoreFor("cons"));
}
@Test
{
TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(),
FormatAdapter.FILE);
- assertFalse(result.isValid());
+ AssertJUnit.assertFalse(result.isValid());
} catch (IOException x)
{
- assertTrue("File not found exception thrown",
+ AssertJUnit.assertTrue("File not found exception thrown",
x instanceof FileNotFoundException);
}
}
{
TCoffeeScoreFile result = new TCoffeeScoreFile(SCORE_FILE.getPath(),
FormatAdapter.FILE);
- assertTrue(result.isValid());
- assertEquals(8, result.getHeight());
- assertEquals(83, result.getWidth());
+ AssertJUnit.assertTrue(result.isValid());
+ AssertJUnit.assertEquals(8, result.getHeight());
+ AssertJUnit.assertEquals(83, result.getWidth());
}
@Test
FileParse source = new FileParse(BLOCK, FormatAdapter.PASTE);
Block block = TCoffeeScoreFile.readBlock(source, 0);
- assertNotNull(block);
- assertEquals("999999999999999999999999998762112222543211112134",
+ AssertJUnit.assertNotNull(block);
+ AssertJUnit.assertEquals("999999999999999999999999998762112222543211112134",
block.getScoresFor("1PHT"));
- assertEquals("99999999999999999999999999987-------4322----2234",
+ AssertJUnit.assertEquals("99999999999999999999999999987-------4322----2234",
block.getScoresFor("1BB9"));
- assertEquals("99999999999999999999999999987-------5321----2246",
+ AssertJUnit.assertEquals("99999999999999999999999999987-------5321----2246",
block.getScoresFor("1UHC"));
- assertEquals("99999999999999999999999999986-------4321----1-35",
+ AssertJUnit.assertEquals("99999999999999999999999999986-------4321----1-35",
block.getScoresFor("1YCS"));
- assertEquals("999999999999999999999999999861-------3------1135",
+ AssertJUnit.assertEquals("999999999999999999999999999861-------3------1135",
block.getScoresFor("1OOT"));
- assertEquals("99999999999999999999999999986-------422-------34",
+ AssertJUnit.assertEquals("99999999999999999999999999986-------422-------34",
block.getScoresFor("1ABO"));
- assertEquals("99999999999999999999999999985-------32--------35",
+ AssertJUnit.assertEquals("99999999999999999999999999985-------32--------35",
block.getScoresFor("1FYN"));
- assertEquals("99999999999999999999999999974-------2---------24",
+ AssertJUnit.assertEquals("99999999999999999999999999974-------2---------24",
block.getScoresFor("1QCF"));
- assertEquals("999999999999999999999999999851000110321100001134",
+ AssertJUnit.assertEquals("999999999999999999999999999851000110321100001134",
block.getConsensus());
}
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
FormatAdapter.FILE);
- assertEquals(
+ AssertJUnit.assertEquals(
"999999999999999999999999998762112222543211112134----------5666642367889999999999889",
parser.getScoresFor("1PHT"));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999987-------4322----22341111111111676653-355679999999999889",
parser.getScoresFor("1BB9"));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999987-------5321----2246----------788774--66789999999999889",
parser.getScoresFor("1UHC"));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999986-------4321----1-35----------78777--356789999999999889",
parser.getScoresFor("1YCS"));
- assertEquals(
+ AssertJUnit.assertEquals(
"999999999999999999999999999861-------3------1135----------78877--356789999999997-67",
parser.getScoresFor("1OOT"));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999986-------422-------34----------687774--56779999999999889",
parser.getScoresFor("1ABO"));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999985-------32--------35----------6888842356789999999999889",
parser.getScoresFor("1FYN"));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999974-------2---------24----------6878742356789999999999889",
parser.getScoresFor("1QCF"));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999985100011032110000113400100000006877641356789999999999889",
parser.getScoresFor("cons"));
}
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
FormatAdapter.FILE);
- assertTrue(parser.getWarningMessage(), parser.isValid());
+ AssertJUnit.assertTrue(parser.getWarningMessage(), parser.isValid());
List<String> scores = parser.getScoresList();
- assertEquals(
+ AssertJUnit.assertEquals(
"999999999999999999999999998762112222543211112134----------5666642367889999999999889",
scores.get(0));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999987-------4322----22341111111111676653-355679999999999889",
scores.get(1));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999987-------5321----2246----------788774--66789999999999889",
scores.get(2));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999986-------4321----1-35----------78777--356789999999999889",
scores.get(3));
- assertEquals(
+ AssertJUnit.assertEquals(
"999999999999999999999999999861-------3------1135----------78877--356789999999997-67",
scores.get(4));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999986-------422-------34----------687774--56779999999999889",
scores.get(5));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999985-------32--------35----------6888842356789999999999889",
scores.get(6));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999974-------2---------24----------6878742356789999999999889",
scores.get(7));
- assertEquals(
+ AssertJUnit.assertEquals(
"99999999999999999999999999985100011032110000113400100000006877641356789999999999889",
scores.get(8));
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
FormatAdapter.FILE);
- assertTrue(parser.getWarningMessage(), parser.isValid());
+ AssertJUnit.assertTrue(parser.getWarningMessage(), parser.isValid());
byte[][] scores = parser.getScoresArray();
- assertEquals(9, scores[0][0]);
- assertEquals(9, scores[1][0]);
- assertEquals(9, scores[2][0]);
- assertEquals(9, scores[3][0]);
- assertEquals(9, scores[4][0]);
- assertEquals(9, scores[5][0]);
- assertEquals(9, scores[6][0]);
- assertEquals(9, scores[7][0]);
- assertEquals(9, scores[8][0]);
-
- assertEquals(5, scores[0][36]);
- assertEquals(4, scores[1][36]);
- assertEquals(5, scores[2][36]);
- assertEquals(4, scores[3][36]);
- assertEquals(-1, scores[4][36]);
- assertEquals(4, scores[5][36]);
- assertEquals(3, scores[6][36]);
- assertEquals(2, scores[7][36]);
- assertEquals(3, scores[8][36]);
+ AssertJUnit.assertEquals(9, scores[0][0]);
+ AssertJUnit.assertEquals(9, scores[1][0]);
+ AssertJUnit.assertEquals(9, scores[2][0]);
+ AssertJUnit.assertEquals(9, scores[3][0]);
+ AssertJUnit.assertEquals(9, scores[4][0]);
+ AssertJUnit.assertEquals(9, scores[5][0]);
+ AssertJUnit.assertEquals(9, scores[6][0]);
+ AssertJUnit.assertEquals(9, scores[7][0]);
+ AssertJUnit.assertEquals(9, scores[8][0]);
+
+ AssertJUnit.assertEquals(5, scores[0][36]);
+ AssertJUnit.assertEquals(4, scores[1][36]);
+ AssertJUnit.assertEquals(5, scores[2][36]);
+ AssertJUnit.assertEquals(4, scores[3][36]);
+ AssertJUnit.assertEquals(-1, scores[4][36]);
+ AssertJUnit.assertEquals(4, scores[5][36]);
+ AssertJUnit.assertEquals(3, scores[6][36]);
+ AssertJUnit.assertEquals(2, scores[7][36]);
+ AssertJUnit.assertEquals(3, scores[8][36]);
}
{
String file = "test/jalview/io/tcoffee.score_ascii_with_residue_numbers";
TCoffeeScoreFile result = new TCoffeeScoreFile(file, FormatAdapter.FILE);
- assertTrue(result.isValid());
- assertEquals(5, result.getHeight());
- assertEquals(84, result.getWidth());
+ AssertJUnit.assertTrue(result.isValid());
+ AssertJUnit.assertEquals(5, result.getHeight());
+ AssertJUnit.assertEquals(84, result.getWidth());
}
}
*/
package jalview.schemes;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import java.util.Map;
-import org.junit.Test;
-
public class DnaCodonTests
{
package jalview.schemes;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import java.util.Collections;
import java.util.List;
-import org.junit.Test;
-
public class ResiduePropertiesTest
{
*/
package jalview.schemes;
+import org.testng.annotations.Test;
import jalview.api.analysis.ScoreModelI;
import java.util.Map;
-import org.junit.Test;
-
public class ScoreMatrixPrinter
{
@Test
package jalview.structure;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
import MCview.PDBfile;
* 115 in PDB Res Numbering secondary structure numbers in jmol seem to be in
* msd numbering, not pdb res numbering.
*/
- @Test
- @Ignore
+ @Test(enabled = false)
public void pdbEntryPositionMap() throws Exception
{
- fail("This test intentionally left to fail");
+ Assert.fail("This test intentionally left to fail");
for (int offset = 0; offset < 20; offset += 6)
{
// check we put the secondary structure in the right position
}
}
- @Test
- @Ignore
+ @Test(enabled = false)
public void testPDBentryMapping() throws Exception
{
- fail("This test intentionally left to fail");
+ Assert.fail("This test intentionally left to fail");
Sequence sq = new Sequence(
"1GAQ A subseq 126 to 219",
"EIVKGVCSNFLCDLQPGDNVQITGPVGKEMLMPKDPNATIIMLATGTGIAPFRSFLWKMFFEKHDDYKFNGLGWLFLGVPTSSSLLYKEEFGKM");
jalview.io.FormatAdapter.FILE);
if (pmap == null)
{
- Assert.fail("Couldn't make a mapping for 3W5V to FER1_MAIZE");
+ AssertJUnit.fail("Couldn't make a mapping for 3W5V to FER1_MAIZE");
}
}
package jalview.structure;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
import jalview.datamodel.AlignedCodonFrame;
import java.util.HashSet;
import java.util.Set;
-import org.junit.Before;
-import org.junit.Test;
-
public class StructureSelectionManagerTest
{
private StructureSelectionManager ssm;
- @Before
+ @BeforeMethod
public void setUp()
{
ssm = new StructureSelectionManager();
package jalview.structures.models;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
+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 java.util.Arrays;
import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.PDBEntry;
/**
* Set up test conditions with three aligned sequences,
*/
- @Before
+ @BeforeMethod
public void setUp()
{
SequenceI seq1 = new Sequence("1YCS", "-VPSQK");
package jalview.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import java.awt.Color;
-import org.junit.Test;
-
public class ColorUtilsTest
{
package jalview.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
package jalview.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
import jalview.datamodel.Mapping;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
-import org.junit.Test;
-
public class DBRefUtilsTest
{
package jalview.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.junit.Assert;
-import org.junit.Test;
+import org.testng.annotations.Test;
public class MapListTest
{
private static void testLocateFrom(MapList mldna, int i, int j, int[] ks)
{
int[] frm = mldna.locateInFrom(i, j);
- Assert.assertEquals("Failed test locate from " + i + " to " + j,
+ assertEquals("Failed test locate from " + i + " to " + j,
Arrays.toString(frm), Arrays.toString(ks));
}
package jalview.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import java.awt.Color;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
-import org.junit.Test;
-
import jalview.api.AlignViewportI;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
package jalview.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
import java.util.Arrays;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
public class QuickSortTest
{
private final Object[] sortedThings = new Object[]
{ c4, c2, c1, c3 };
- @Before
+ @BeforeMethod
public void setUp()
{
things = new Object[]
/**
* Test whether sort is stable i.e. equal values retain their mutual ordering.
*/
- @Test
- @Ignore
+ @Test(enabled = false)
public void testSort_withDuplicates()
{
int[] values = new int[]
package jalview.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.List;
-import org.junit.Test;
-
public class ShiftListTest
{
package jalview.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import java.util.Arrays;
-import org.junit.Test;
-
public class StringUtilsTest
{
package jalview.viewmodel.styles;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
+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.AssertJUnit;
import java.awt.Color;
import java.lang.reflect.Field;
import java.util.Random;
-import org.junit.Assert;
-import org.junit.Test;
-
public class ViewStyleTest
{
}
else
{
- Assert.fail("Unhandled field type (add to test): " + field.getName()
+ AssertJUnit.fail("Unhandled field type (add to test): " + field.getName()
+ ":" + type);
}
}
*/
package jalview.ws;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertTrue;
import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
SequenceFetcher sf;
- @Before
+ @BeforeMethod
public void setUp() throws Exception
{
// ensure 'add annotation from structure' is selected
sf = new SequenceFetcher(false);
}
- @Test
+ @Test(enabled = false)
public void testRnaSeqRetrieve() throws Exception
{
List<DbSourceProxy> sps = sf.getSourceProxy("PDB");
package jalview.ws.dbsources;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.Assert;
import jalview.ws.dbsources.PDBRestClient.PDBDocField;
import jalview.ws.uimodel.PDBRestRequest;
import jalview.ws.uimodel.PDBRestResponse;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
public class PDBRestClientTest
{
- @Before
+ @BeforeMethod
public void setUp() throws Exception
{
}
- @After
+ @AfterMethod
public void tearDown() throws Exception
{
}
} catch (Exception e)
{
e.printStackTrace();
- fail("Couldn't execute webservice call!");
+ Assert.fail("Couldn't execute webservice call!");
return;
}
assertTrue(response.getNumberOfItemsFound() > 99);
assertEquals(expectedErrorMsg, parsedErrorResponse);
}
- @Test(expected = Exception.class)
+ @Test(expectedExceptions = Exception.class)
public void testForExpectedRuntimeException() throws Exception
{
List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
// Check the response status and report exception if one occurs
if (clientResponse.getStatus() != 200)
{
- fail("Webservice call failed!!!");
+ Assert.fail("Webservice call failed!!!");
}
else
{
}
} catch (ParseException e)
{
- fail(">>> Test failed due to exception while parsing pdb response json !!!");
+ Assert.fail(">>> Test failed due to exception while parsing pdb response json !!!");
e.printStackTrace();
}
}
package jalview.ws.dbsources;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+import org.testng.annotations.Test;
import java.io.Reader;
import java.io.StringReader;
import java.util.Vector;
-import org.junit.Test;
-
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.UniprotEntry;
import javax.swing.JFrame;
import javax.swing.JPanel;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
import compbio.metadata.Preset;
import compbio.metadata.PresetManager;
* This test marked Ignore as it appears to need user action to complete
* rather than hang
*/
- @Test
- @Ignore
+
+ @Test(enabled = false)
public void testJws2Gui()
{
Iterator<String> presetEnum = presetTests.iterator();
*/
package jalview.ws.jabaws;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
+import org.testng.Assert;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.io.AnnotationFile;
import java.util.ArrayList;
import java.util.List;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
public class DisorderAnnotExportImport
{
public static String testseqs = "examples/uniref50.fa";
{
e.printStackTrace();
}
- fail("Test "
+ Assert.fail("Test "
+ testname
+ "\nCouldn't complete Annotation file roundtrip input/output/input test.");
}
import java.util.Vector;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
import jalview.ws.jws2.Jws2Discoverer;
{ "http://localhost:8080/jabaws",
"http://www.compbio.dundee.ac.uk/jabaws" };
- @Test
- @Ignore
+ @Test(enabled = false)
public void testAnnotExport()
{
fail("Not yet implemented");
*/
package jalview.ws.jabaws;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
import java.awt.Component;
import java.util.ArrayList;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
import compbio.metadata.Argument;
import compbio.metadata.WrongParameterException;
if (jpredws == null)
{
- fail("jpredws is null");
+ Assert.fail("jpredws is null");
}
jalview.io.FileLoader fl = new jalview.io.FileLoader(false);
if (!success)
{
jpredClient.cancelCurrentJob();
- fail("Jpred Client didn't run with hardwired default parameters.");
+ Assert.fail("Jpred Client didn't run with hardwired default parameters.");
}
} catch (InterruptedException x)
{
e.printStackTrace();
}
- fail("Test "
+ Assert.fail("Test "
+ testname
+ "\nCouldn't complete Annotation file roundtrip input/output/input test.");
}
- // @Test
+ @Test
public void testJpredwsSettingsRecovery()
{
- fail("not implemnented");
+ Assert.fail("not implemnented");
List<compbio.metadata.Argument> opts = new ArrayList<compbio.metadata.Argument>();
for (compbio.metadata.Argument rg : (List<compbio.metadata.Argument>) jpredws
.getRunnerConfig().getArguments())
rg.setValue("292");
} catch (WrongParameterException q)
{
- fail("Couldn't set the temperature parameter "
+ Assert.fail("Couldn't set the temperature parameter "
+ q.getStackTrace());
}
opts.add(rg);
package jalview.ws.jabaws;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
+import org.testng.Assert;
import java.util.ArrayList;
import java.util.List;
-import org.junit.Test;
-
import compbio.data.msa.MsaWS;
import compbio.data.msa.RegistryWS;
import compbio.data.sequence.FastaSequence;
}
}
if (msaservice == null) {
- fail("couldn't find a clustalO service on the public registry");
+ Assert.fail("couldn't find a clustalO service on the public registry");
}
FastaSequence fsq = new FastaSequence("seqA",
"SESESESESESESESSESESSESESESESESESESESESEEEEEESSESESESESSSSESESESESESESE");
*/
package jalview.ws.jabaws;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import compbio.metadata.WrongParameterException;
+
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.gui.Jalview2XML;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.AutoCalcSetting;
-import java.awt.Component;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
-
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import compbio.metadata.WrongParameterException;
-
public class RNAStructExportImport
{
public static String testseqs = "examples/RF00031_folded.stk";
if (rnaalifoldws == null)
{
- fail("no web service");
+ Assert.fail("no web service");
}
jalview.io.FileLoader fl = new jalview.io.FileLoader(false);
{
if (aa.isRNA())
{
- Assert.assertTrue("Did not create valid structure from RNAALiFold prediction", aa.isValidStruc());
+ assertTrue(
+ "Did not create valid structure from RNAALiFold prediction",
+ aa.isValidStruc());
}
}
}
{
e.printStackTrace();
}
- fail("Test "
+ Assert.fail("Test "
+ testname
+ "\nCouldn't complete Annotation file roundtrip input/output/input test.");
}
rg.setValue("292");
} catch (WrongParameterException q)
{
- fail("Couldn't set the temperature parameter "
+ Assert.fail("Couldn't set the temperature parameter "
+ q.getStackTrace());
}
opts.add(rg);
*/
package jalview.ws.jws2;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
+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.BeforeClass;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
import compbio.metadata.Option;
import compbio.metadata.Parameter;
import compbio.metadata.Preset;
package jalview.ws.rest;
-import static org.junit.Assert.assertEquals;
-
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
import java.util.Vector;
-import org.junit.Test;
-
import jalview.bin.Cache;
public class RestClientTest
*/
package jalview.ws.rest;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
import java.util.Map;
-import org.junit.Test;
+import org.testng.annotations.Test;
import jalview.gui.AlignFrame;
-import jalview.util.StringUtils;
/**
* @author jimp
package jalview.ws.seqfetcher;
-import static org.junit.Assert.*;
-
-import org.junit.Test;
+import org.testng.annotations.Test;
+import org.testng.AssertJUnit;
public class DasSequenceFetcher
{
public void testDasRegistryContact()
{
jalview.bin.Cache.getDasSourceRegistry().refreshSources();
- assertTrue(
+ AssertJUnit.assertTrue(
"Expected to find at least one DAS source at the registry. Check config.",
jalview.bin.Cache.getDasSourceRegistry().getSources().size() > 0);
}
*/
package jalview.ws.seqfetcher;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
import java.util.ArrayList;
import java.util.List;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
import jalview.analysis.CrossRef;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Suite" parallel="none">
+ <test verbose="2" name="Test">
+ <classes>
+ <class name="jalview.gui.AlignViewportTest"/>
+ <class name="jalview.util.ShiftListTest"/>
+ <class name="jalview.util.ColorUtilsTest"/>
+ <class name="jalview.gui.PDBSearchPanelTest"/>
+ <class name="MCview.PDBfileTest"/>
+ <class name="jalview.io.BioJsHTMLOutputTest"/>
+ <class name="jalview.io.JSONFileTest"/>
+ <class name="jalview.ext.jmol.PDBFileWithJmolTest"/>
+ <class name="jalview.ws.jabaws.RNAStructExportImport"/>
+ <class name="jalview.ext.paradise.TestAnnotate3D"/>
+ <class name="MCview.PDBChainTest"/>
+ <class name="jalview.io.StockholmFileTest"/>
+ <class name="jalview.schemes.ScoreMatrixPrinter"/>
+ <class name="jalview.datamodel.SearchResultsTest"/>
+ <class name="jalview.ws.seqfetcher.DasSequenceFetcher"/>
+ <class name="jalview.util.DBRefUtilsTest"/>
+ <class name="jalview.analysis.CrossRefTest"/>
+ <class name="jalview.ws.jabaws.MinJabawsClientTests"/>
+ <class name="jalview.datamodel.AlignedCodonTest"/>
+ <class name="MCview.AtomTest"/>
+ <class name="jalview.gui.PopupMenuTest"/>
+ <class name="jalview.viewmodel.styles.ViewStyleTest"/>
+ <class name="jalview.io.AnnotationFileIOTest"/>
+ <class name="jalview.ws.jws2.ParameterUtilsTest"/>
+ <class name="jalview.io.RNAMLfileTest"/>
+ <class name="jalview.analysis.AlignmentUtilsTests"/>
+ <class name="jalview.gui.SequenceRendererTest"/>
+ <class name="jalview.bin.CommandLineOperations"/>
+ <class name="jalview.gui.PaintRefresherTest"/>
+ <class name="jalview.ws.seqfetcher.DbRefFetcherTest"/>
+ <class name="jalview.datamodel.AlignmentAnnotationTests"/>
+ <class name="jalview.schemes.ResiduePropertiesTest"/>
+ <class name="jalview.ext.rbvi.chimera.ChimeraCommandsTest"/>
+ <class name="MCview.ResidueTest"/>
+ <class name="jalview.io.PhylipFileTests"/>
+ <class name="jalview.util.MappingUtilsTest"/>
+ <class name="jalview.ws.jabaws.DisorderAnnotExportImport"/>
+ <class name="jalview.analysis.GroupingTest"/>
+ <class name="jalview.analysis.AnnotationSorterTest"/>
+ <class name="jalview.io.FileIOTester"/>
+ <class name="jalview.util.MapListTest"/>
+ <class name="jalview.datamodel.ColumnSelectionTest"/>
+ <class name="jalview.ext.rbvi.chimera.ChimeraConnect"/>
+ <class name="jalview.gui.ProgressBarTest"/>
+ <class name="jalview.analysis.AlignmentAnnotationUtilsTest"/>
+ <class name="jalview.structure.StructureSelectionManagerTest"/>
+ <class name="jalview.io.TCoffeeScoreFileTest"/>
+ <class name="jalview.analysis.AAFrequencyTest"/>
+ <class name="jalview.ws.dbsources.PDBRestClientTest"/>
+ <class name="jalview.analysis.DnaTest"/>
+ <class name="jalview.util.StringUtilsTest"/>
+ <class name="jalview.structures.models.AAStructureBindingModelTest"/>
+ <class name="jalview.gui.JvSwingUtilsTest"/>
+ <class name="jalview.analysis.CodingUtilsTest"/>
+ <class name="jalview.io.AnnotatedPDBFileInputTest"/>
+ <class name="jalview.ws.rest.ShmmrRSBSService"/>
+ <class name="jalview.io.NewickFileTests"/>
+ <class name="jalview.analysis.ParsePropertiesTest"/>
+ <class name="MCview.BondTest"/>
+ <class name="jalview.commands.EditCommandTest"/>
+ <class name="jalview.ext.rbvi.chimera.JalviewChimeraView"/>
+ <class name="jalview.ws.jabaws.JpredJabaStructExportImport"/>
+ <class name="jalview.gui.HelpTest"/>
+ <class name="jalview.datamodel.AlignedCodonIteratorTest"/>
+ <class name="jalview.datamodel.xdb.embl.EmblFileTest"/>
+ <class name="jalview.util.ComparisonTest"/>
+ <class name="jalview.util.QuickSortTest"/>
+ <class name="jalview.ws.PDBSequenceFetcherTest"/>
+ <class name="jalview.analysis.scoremodels.FeatureScoreModelTest"/>
+ <class name="jalview.io.Jalview2xmlTests"/>
+ <class name="jalview.ws.rest.RestClientTest"/>
+ <class name="jalview.datamodel.AlignedCodonFrameTest"/>
+ <class name="jalview.datamodel.MappingTest"/>
+ <class name="jalview.datamodel.AlignmentTest"/>
+ <class name="jalview.ws.dbsources.UniprotTest"/>
+ <class name="jalview.gui.AnnotationChooserTest"/>
+ <class name="jalview.structure.Mapping"/>
+ <class name="jalview.datamodel.SequenceTest"/>
+ <class name="jalview.datamodel.PDBEntryTest"/>
+ <class name="jalview.gui.StructureChooserTest"/>
+ <class name="jalview.schemes.DnaCodonTests"/>
+ <class name="com.stevesoft.pat.RegexWriterTest"/>
+ <class name="jalview.datamodel.DBRefEntryTest"/>
+ <class name="jalview.gui.FontChooserTest"/>
+ <class name="jalview.analysis.TestAlignSeq"/>
+ <class name="jalview.datamodel.SeqCigarTest"/>
+ <class name="jalview.gui.JAL1353bugdemo"/>
+ </classes>
+ </test> <!-- Test -->
+</suite> <!-- Suite -->