From: tcofoegbu Date: Fri, 19 Jun 2015 13:04:02 +0000 (+0100) Subject: JAL-1270 JUnit to TestNG refactoring X-Git-Tag: Release_2_10_0~296^2~137^2~1^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3412b273e964fb1a9d22564b04a5f0c827ec2461;p=jalview.git JAL-1270 JUnit to TestNG refactoring --- diff --git a/.classpath b/.classpath index 0abfdb3..3fac886 100644 --- a/.classpath +++ b/.classpath @@ -66,5 +66,6 @@ + diff --git a/.gitignore b/.gitignore index 0c12fb0..2b6921b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ .project /dist /classes +/tests +/test-reports +/test-output .externalToolBuilders/Jalview Release indices [Builder].launch /.DS_Store .DS_Store diff --git a/build.xml b/build.xml index c079df9..dbf1df3 100755 --- a/build.xml +++ b/build.xml @@ -115,6 +115,9 @@ + + + @@ -239,6 +242,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 6139669..c2a7299 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -1084,7 +1084,7 @@ public class AppJmol extends StructureViewerBase 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); diff --git a/src/jalview/io/AlignmentProperties.java b/src/jalview/io/AlignmentProperties.java index 9effa74..cb4b7ad 100644 --- a/src/jalview/io/AlignmentProperties.java +++ b/src/jalview/io/AlignmentProperties.java @@ -20,8 +20,8 @@ */ package jalview.io; -import java.io.StringWriter; import java.io.PrintWriter; +import java.io.StringWriter; import java.util.Enumeration; import java.util.Hashtable; @@ -61,11 +61,15 @@ public class AlignmentProperties - 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); diff --git a/src/jalview/io/BLCFile.java b/src/jalview/io/BLCFile.java index 0376c2c..c7cf2d6 100755 --- a/src/jalview/io/BLCFile.java +++ b/src/jalview/io/BLCFile.java @@ -20,10 +20,11 @@ */ 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! @@ -115,7 +116,9 @@ public class BLCFile extends AlignFile { line = nextLine(); if (line == null) + { break; + } // seek end of ids if (line.indexOf("*") > -1) { @@ -150,7 +153,9 @@ public class BLCFile extends AlignFile } } while (!idsFound); if (line == null) + { break; // end of file. + } int starCol = line.indexOf("*"); seqstrings = new StringBuffer[seqs.size()]; @@ -198,9 +203,11 @@ public class BLCFile extends AlignFile } 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); } } diff --git a/src/jalview/ws/dbsources/EbiFileRetrievedProxy.java b/src/jalview/ws/dbsources/EbiFileRetrievedProxy.java index 45f4f7a..40e2193 100644 --- a/src/jalview/ws/dbsources/EbiFileRetrievedProxy.java +++ b/src/jalview/ws/dbsources/EbiFileRetrievedProxy.java @@ -23,6 +23,7 @@ package jalview.ws.dbsources; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; + import jalview.ws.seqfetcher.DbSourceProxyImpl; public abstract class EbiFileRetrievedProxy extends DbSourceProxyImpl @@ -36,7 +37,9 @@ public abstract class EbiFileRetrievedProxy extends DbSourceProxyImpl public StringBuffer getRawRecords() { if (file == null) + { return null; + } StringBuffer bf = null; try { diff --git a/test/MCview/AtomTest.java b/test/MCview/AtomTest.java index 8c271b3..f337535 100644 --- a/test/MCview/AtomTest.java +++ b/test/MCview/AtomTest.java @@ -1,9 +1,8 @@ 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 { @@ -54,7 +53,7 @@ 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 diff --git a/test/MCview/BondTest.java b/test/MCview/BondTest.java index 333bfce..0060e3f 100644 --- a/test/MCview/BondTest.java +++ b/test/MCview/BondTest.java @@ -1,8 +1,7 @@ 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 { diff --git a/test/MCview/PDBChainTest.java b/test/MCview/PDBChainTest.java index 5be43b3..193d294 100644 --- a/test/MCview/PDBChainTest.java +++ b/test/MCview/PDBChainTest.java @@ -1,15 +1,13 @@ 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; diff --git a/test/MCview/PDBfileTest.java b/test/MCview/PDBfileTest.java index 5d69a00..cce8634 100644 --- a/test/MCview/PDBfileTest.java +++ b/test/MCview/PDBfileTest.java @@ -1,10 +1,15 @@ 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; @@ -13,11 +18,6 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.io.AppletFormatAdapter; -import java.io.IOException; - -import org.junit.Ignore; -import org.junit.Test; - public class PDBfileTest { @Test @@ -247,8 +247,8 @@ public class PDBfileTest * * @throws IOException */ - @Test - @Ignore + + @Test(enabled = false) public void testParse_withAnnotate3D() throws IOException { // TODO requires a mock for Annotate3D processing diff --git a/test/MCview/ResidueTest.java b/test/MCview/ResidueTest.java index ed98c5b..5cebe3c 100644 --- a/test/MCview/ResidueTest.java +++ b/test/MCview/ResidueTest.java @@ -1,12 +1,10 @@ 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 { diff --git a/test/com/stevesoft/pat/RegexWriterTest.java b/test/com/stevesoft/pat/RegexWriterTest.java index d91502e..ea07aa2 100644 --- a/test/com/stevesoft/pat/RegexWriterTest.java +++ b/test/com/stevesoft/pat/RegexWriterTest.java @@ -1,11 +1,11 @@ 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 diff --git a/test/jalview/analysis/AAFrequencyTest.java b/test/jalview/analysis/AAFrequencyTest.java index 788e742..04ab3bf 100644 --- a/test/jalview/analysis/AAFrequencyTest.java +++ b/test/jalview/analysis/AAFrequencyTest.java @@ -1,14 +1,13 @@ 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; diff --git a/test/jalview/analysis/AlignmentAnnotationUtilsTest.java b/test/jalview/analysis/AlignmentAnnotationUtilsTest.java index c34bb68..34d2f32 100644 --- a/test/jalview/analysis/AlignmentAnnotationUtilsTest.java +++ b/test/jalview/analysis/AlignmentAnnotationUtilsTest.java @@ -1,9 +1,10 @@ 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; @@ -12,9 +13,6 @@ import java.util.HashMap; 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; @@ -118,7 +116,7 @@ public class AlignmentAnnotationUtilsTest * * @throws IOException */ - @Before + @BeforeMethod public void setUp() throws IOException { alignment = new jalview.io.FormatAdapter().readFile(TEST_DATA, diff --git a/test/jalview/analysis/AlignmentUtilsTests.java b/test/jalview/analysis/AlignmentUtilsTests.java index 02955f1..d32181f 100644 --- a/test/jalview/analysis/AlignmentUtilsTests.java +++ b/test/jalview/analysis/AlignmentUtilsTests.java @@ -20,12 +20,12 @@ */ 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; @@ -37,8 +37,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Test; - import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; diff --git a/test/jalview/analysis/AnnotationSorterTest.java b/test/jalview/analysis/AnnotationSorterTest.java index 239eb4c..dfe5532 100644 --- a/test/jalview/analysis/AnnotationSorterTest.java +++ b/test/jalview/analysis/AnnotationSorterTest.java @@ -1,18 +1,19 @@ 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 { @@ -29,7 +30,7 @@ public class AnnotationSorterTest /* * Set up 6 sequences and 7 annotations. */ - @Before + @BeforeMethod public void setUp() { al = buildAlignment(NUM_SEQS); diff --git a/test/jalview/analysis/CodingUtilsTest.java b/test/jalview/analysis/CodingUtilsTest.java index 0f235fb..a4b6c3f 100644 --- a/test/jalview/analysis/CodingUtilsTest.java +++ b/test/jalview/analysis/CodingUtilsTest.java @@ -1,12 +1,10 @@ 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 { diff --git a/test/jalview/analysis/CrossRefTest.java b/test/jalview/analysis/CrossRefTest.java index 35606f0..77bd6b9 100644 --- a/test/jalview/analysis/CrossRefTest.java +++ b/test/jalview/analysis/CrossRefTest.java @@ -1,10 +1,8 @@ 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 diff --git a/test/jalview/analysis/DnaTest.java b/test/jalview/analysis/DnaTest.java index 01ed183..693c912 100644 --- a/test/jalview/analysis/DnaTest.java +++ b/test/jalview/analysis/DnaTest.java @@ -1,8 +1,9 @@ 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; @@ -14,8 +15,6 @@ import jalview.io.FormatAdapter; import java.io.IOException; -import org.junit.Test; - public class DnaTest { // @formatter:off diff --git a/test/jalview/analysis/GroupingTest.java b/test/jalview/analysis/GroupingTest.java index 5c7a305..e046c0c 100644 --- a/test/jalview/analysis/GroupingTest.java +++ b/test/jalview/analysis/GroupingTest.java @@ -1,5 +1,7 @@ package jalview.analysis; +import org.testng.annotations.Test; +import org.testng.AssertJUnit; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.ColumnSelection; @@ -10,9 +12,6 @@ import jalview.datamodel.SequenceI; 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"); @@ -64,17 +63,17 @@ public class GroupingTest 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); } } } diff --git a/test/jalview/analysis/ParsePropertiesTest.java b/test/jalview/analysis/ParsePropertiesTest.java index a01d255..acf295e 100644 --- a/test/jalview/analysis/ParsePropertiesTest.java +++ b/test/jalview/analysis/ParsePropertiesTest.java @@ -1,13 +1,11 @@ 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; @@ -23,7 +21,7 @@ public class ParsePropertiesTest /** * Construct an alignment with 4 sequences with varying description format */ - @Before + @BeforeMethod public void setUp() { SequenceI[] seqs = new SequenceI[] diff --git a/test/jalview/analysis/TestAlignSeq.java b/test/jalview/analysis/TestAlignSeq.java index 4956bd8..2845d91 100644 --- a/test/jalview/analysis/TestAlignSeq.java +++ b/test/jalview/analysis/TestAlignSeq.java @@ -20,14 +20,12 @@ */ 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; @@ -46,7 +44,7 @@ public class TestAlignSeq /** * @throws java.lang.Exception */ - @Before + @BeforeMethod public void setUp() throws Exception { s1 = new Sequence("Seq1", "ASDFAQQQRRRSSS"); diff --git a/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java index 1dbaa4a..b40382d 100644 --- a/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java +++ b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java @@ -1,5 +1,7 @@ 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; @@ -7,9 +9,6 @@ import jalview.gui.AlignFrame; 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"; @@ -29,8 +28,8 @@ public class FeatureScoreModelTest 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(); @@ -55,18 +54,18 @@ public class FeatureScoreModelTest 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]); diff --git a/test/jalview/bin/CommandLineOperations.java b/test/jalview/bin/CommandLineOperations.java index ec0b160..d9d3bb3 100644 --- a/test/jalview/bin/CommandLineOperations.java +++ b/test/jalview/bin/CommandLineOperations.java @@ -20,16 +20,16 @@ */ 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 { @@ -131,16 +131,17 @@ 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); diff --git a/test/jalview/commands/EditCommandTest.java b/test/jalview/commands/EditCommandTest.java index 6ea05e6..df5e796 100644 --- a/test/jalview/commands/EditCommandTest.java +++ b/test/jalview/commands/EditCommandTest.java @@ -1,7 +1,13 @@ 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; @@ -9,12 +15,6 @@ import jalview.datamodel.AlignmentI; 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 * @@ -30,7 +30,7 @@ public class EditCommandTest private Alignment al; - @Before + @BeforeMethod public void setUp() { testee = new EditCommand(); @@ -102,8 +102,7 @@ public class EditCommandTest /** * 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() { diff --git a/test/jalview/datamodel/AlignedCodonFrameTest.java b/test/jalview/datamodel/AlignedCodonFrameTest.java index 0e24bf6..c081ced 100644 --- a/test/jalview/datamodel/AlignedCodonFrameTest.java +++ b/test/jalview/datamodel/AlignedCodonFrameTest.java @@ -1,13 +1,12 @@ 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 { diff --git a/test/jalview/datamodel/AlignedCodonIteratorTest.java b/test/jalview/datamodel/AlignedCodonIteratorTest.java index 671c51d..3e3a46d 100644 --- a/test/jalview/datamodel/AlignedCodonIteratorTest.java +++ b/test/jalview/datamodel/AlignedCodonIteratorTest.java @@ -1,14 +1,13 @@ 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 * @@ -95,7 +94,7 @@ public class AlignedCodonIteratorTest try { codon = codons.next(); - fail("expected exception"); + Assert.fail("expected exception"); } catch (IncompleteCodonException e) { // expected diff --git a/test/jalview/datamodel/AlignedCodonTest.java b/test/jalview/datamodel/AlignedCodonTest.java index 60368b1..8391e97 100644 --- a/test/jalview/datamodel/AlignedCodonTest.java +++ b/test/jalview/datamodel/AlignedCodonTest.java @@ -1,10 +1,9 @@ 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 { diff --git a/test/jalview/datamodel/AlignmentAnnotationTests.java b/test/jalview/datamodel/AlignmentAnnotationTests.java index 7c1aa81..5d67cb7 100644 --- a/test/jalview/datamodel/AlignmentAnnotationTests.java +++ b/test/jalview/datamodel/AlignmentAnnotationTests.java @@ -1,10 +1,8 @@ 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; diff --git a/test/jalview/datamodel/AlignmentTest.java b/test/jalview/datamodel/AlignmentTest.java index df98af9..fc73307 100644 --- a/test/jalview/datamodel/AlignmentTest.java +++ b/test/jalview/datamodel/AlignmentTest.java @@ -1,8 +1,10 @@ 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; @@ -10,9 +12,6 @@ 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. * @@ -78,7 +77,7 @@ public class AlignmentTest * Read in Stockholm format test data including secondary structure * annotations. */ - @Before + @BeforeMethod public void setUp() throws IOException { al = loadAlignment(TEST_DATA, "STH"); diff --git a/test/jalview/datamodel/ColumnSelectionTest.java b/test/jalview/datamodel/ColumnSelectionTest.java index 97ef079..5e10337 100644 --- a/test/jalview/datamodel/ColumnSelectionTest.java +++ b/test/jalview/datamodel/ColumnSelectionTest.java @@ -1,11 +1,9 @@ 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 { diff --git a/test/jalview/datamodel/DBRefEntryTest.java b/test/jalview/datamodel/DBRefEntryTest.java index 38c7f51..7e1e9a6 100644 --- a/test/jalview/datamodel/DBRefEntryTest.java +++ b/test/jalview/datamodel/DBRefEntryTest.java @@ -1,11 +1,10 @@ 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 { diff --git a/test/jalview/datamodel/MappingTest.java b/test/jalview/datamodel/MappingTest.java index fe2ff59..8bf036a 100644 --- a/test/jalview/datamodel/MappingTest.java +++ b/test/jalview/datamodel/MappingTest.java @@ -1,11 +1,9 @@ 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; /** diff --git a/test/jalview/datamodel/PDBEntryTest.java b/test/jalview/datamodel/PDBEntryTest.java index 01fb4a1..71f46ee 100644 --- a/test/jalview/datamodel/PDBEntryTest.java +++ b/test/jalview/datamodel/PDBEntryTest.java @@ -1,20 +1,19 @@ 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 { } diff --git a/test/jalview/datamodel/SearchResultsTest.java b/test/jalview/datamodel/SearchResultsTest.java index 15b0314..d0e58ea 100644 --- a/test/jalview/datamodel/SearchResultsTest.java +++ b/test/jalview/datamodel/SearchResultsTest.java @@ -1,8 +1,7 @@ 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 { diff --git a/test/jalview/datamodel/SeqCigarTest.java b/test/jalview/datamodel/SeqCigarTest.java index fc0cb0e..b8748b6 100644 --- a/test/jalview/datamodel/SeqCigarTest.java +++ b/test/jalview/datamodel/SeqCigarTest.java @@ -1,9 +1,9 @@ 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 @@ -125,6 +125,8 @@ public class SeqCigarTest * String * @return String */ + + protected void testCigar_string(Sequence seq, String ex_cs_gapped) { SeqCigar c_sgapped = new SeqCigar(seq); @@ -133,6 +135,7 @@ public class SeqCigarTest cs_gapped); } + protected void testSeqRecovery(SeqCigar gen_sgapped, SequenceI s_gapped) { diff --git a/test/jalview/datamodel/SequenceTest.java b/test/jalview/datamodel/SequenceTest.java index 5e73bbc..37d39b6 100644 --- a/test/jalview/datamodel/SequenceTest.java +++ b/test/jalview/datamodel/SequenceTest.java @@ -1,21 +1,19 @@ 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"); diff --git a/test/jalview/datamodel/xdb/embl/EmblFileTest.java b/test/jalview/datamodel/xdb/embl/EmblFileTest.java index e89245c..9919186 100644 --- a/test/jalview/datamodel/xdb/embl/EmblFileTest.java +++ b/test/jalview/datamodel/xdb/embl/EmblFileTest.java @@ -1,15 +1,13 @@ 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 diff --git a/test/jalview/ext/jmol/PDBFileWithJmolTest.java b/test/jalview/ext/jmol/PDBFileWithJmolTest.java index ae50bdf..87078a9 100644 --- a/test/jalview/ext/jmol/PDBFileWithJmolTest.java +++ b/test/jalview/ext/jmol/PDBFileWithJmolTest.java @@ -20,14 +20,12 @@ */ 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; @@ -50,7 +48,7 @@ public class PDBFileWithJmolTest // "./examples/DNMT1_MOUSE.pdb" // }; - @Before + @BeforeMethod public void setUp() { Cache.applicationProperties.setProperty("STRUCT_FROM_PDB", diff --git a/test/jalview/ext/paradise/TestAnnotate3D.java b/test/jalview/ext/paradise/TestAnnotate3D.java index 3365c52..d4f57d8 100644 --- a/test/jalview/ext/paradise/TestAnnotate3D.java +++ b/test/jalview/ext/paradise/TestAnnotate3D.java @@ -20,17 +20,19 @@ */ 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; @@ -41,7 +43,7 @@ import jalview.io.FormatAdapter; public class TestAnnotate3D { - @Test + @Test(enabled = false) public void test1GIDbyId() throws Exception { // use same ID as standard tests given at @@ -51,7 +53,7 @@ public class TestAnnotate3D testRNAMLcontent(ids, null); } - @Test + @Test(enabled = false) public void testIdVsContent2GIS() throws Exception { Iterator ids = Annotate3D.getRNAMLForPDBId("2GIS"); @@ -95,7 +97,7 @@ public class TestAnnotate3D * * @throws Exception */ - @Test + @Test(enabled = false) public void testPDBfileVsRNAML() throws Exception { PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb", @@ -109,6 +111,7 @@ public class TestAnnotate3D testRNAMLcontent(readers, pdbf); } + @Test(enabled = false) private void testRNAMLcontent(Iterator readers, PDBfile pdbf) throws Exception { @@ -152,7 +155,7 @@ public class TestAnnotate3D } 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" diff --git a/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java b/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java index 7dfbba1..fa3b3bc 100644 --- a/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java +++ b/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java @@ -1,16 +1,14 @@ 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 diff --git a/test/jalview/ext/rbvi/chimera/ChimeraConnect.java b/test/jalview/ext/rbvi/chimera/ChimeraConnect.java index de7235b..b96f4e5 100644 --- a/test/jalview/ext/rbvi/chimera/ChimeraConnect.java +++ b/test/jalview/ext/rbvi/chimera/ChimeraConnect.java @@ -1,10 +1,8 @@ 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; diff --git a/test/jalview/ext/rbvi/chimera/JalviewChimeraView.java b/test/jalview/ext/rbvi/chimera/JalviewChimeraView.java index 807d7bb..8786ca5 100644 --- a/test/jalview/ext/rbvi/chimera/JalviewChimeraView.java +++ b/test/jalview/ext/rbvi/chimera/JalviewChimeraView.java @@ -1,11 +1,9 @@ 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; diff --git a/test/jalview/gui/AlignViewportTest.java b/test/jalview/gui/AlignViewportTest.java index ac7d84d..69ca3a2 100644 --- a/test/jalview/gui/AlignViewportTest.java +++ b/test/jalview/gui/AlignViewportTest.java @@ -1,11 +1,9 @@ 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; @@ -19,7 +17,7 @@ public class AlignViewportTest AlignmentI al; AlignViewport testee; - @Before + @BeforeMethod public void setUp() { SequenceI seq1 = new Sequence("Seq1", "ABC"); diff --git a/test/jalview/gui/AnnotationChooserTest.java b/test/jalview/gui/AnnotationChooserTest.java index 33ffd32..6bee4ec 100644 --- a/test/jalview/gui/AnnotationChooserTest.java +++ b/test/jalview/gui/AnnotationChooserTest.java @@ -1,9 +1,10 @@ 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; @@ -16,9 +17,6 @@ import java.util.List; 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; @@ -52,7 +50,7 @@ public class AnnotationChooserTest AlignFrame af; - @Before + @BeforeMethod public void setUp() throws IOException { // pin down annotation sort order for test diff --git a/test/jalview/gui/FontChooserTest.java b/test/jalview/gui/FontChooserTest.java index 338a48f..0d2d2e8 100644 --- a/test/jalview/gui/FontChooserTest.java +++ b/test/jalview/gui/FontChooserTest.java @@ -1,11 +1,10 @@ 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 { diff --git a/test/jalview/gui/HelpTest.java b/test/jalview/gui/HelpTest.java index e4068d7..745cb2e 100644 --- a/test/jalview/gui/HelpTest.java +++ b/test/jalview/gui/HelpTest.java @@ -1,6 +1,7 @@ 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; @@ -9,8 +10,6 @@ import javax.help.HelpSet; import javax.help.HelpSetException; import javax.help.Map; -import org.junit.Test; - public class HelpTest { @Test diff --git a/test/jalview/gui/JAL1353bugdemo.java b/test/jalview/gui/JAL1353bugdemo.java index b46a52f..3cad6b2 100644 --- a/test/jalview/gui/JAL1353bugdemo.java +++ b/test/jalview/gui/JAL1353bugdemo.java @@ -20,8 +20,6 @@ */ package jalview.gui; -import jalview.bin.Cache; - import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -35,10 +33,11 @@ import javax.swing.JMenu; 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 { @@ -55,9 +54,7 @@ public class JAL1353bugdemo volatile boolean finish = false; - @Test - @Ignore - // comment out @Ignore to enable this test + @Test(enabled = false) public void test() { Cache.initLogger(); diff --git a/test/jalview/gui/JvSwingUtilsTest.java b/test/jalview/gui/JvSwingUtilsTest.java index 11e6ea5..868fe38 100644 --- a/test/jalview/gui/JvSwingUtilsTest.java +++ b/test/jalview/gui/JvSwingUtilsTest.java @@ -1,11 +1,9 @@ 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 { diff --git a/test/jalview/gui/PDBSearchPanelTest.java b/test/jalview/gui/PDBSearchPanelTest.java index 4595ad1..e06a870 100644 --- a/test/jalview/gui/PDBSearchPanelTest.java +++ b/test/jalview/gui/PDBSearchPanelTest.java @@ -1,24 +1,22 @@ 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 { } diff --git a/test/jalview/gui/PaintRefresherTest.java b/test/jalview/gui/PaintRefresherTest.java index 1da7c8c..aff4715 100644 --- a/test/jalview/gui/PaintRefresherTest.java +++ b/test/jalview/gui/PaintRefresherTest.java @@ -1,8 +1,11 @@ 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; @@ -14,20 +17,16 @@ import java.util.Map; 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(); diff --git a/test/jalview/gui/PopupMenuTest.java b/test/jalview/gui/PopupMenuTest.java index e1f0708..787171d 100644 --- a/test/jalview/gui/PopupMenuTest.java +++ b/test/jalview/gui/PopupMenuTest.java @@ -1,8 +1,8 @@ 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; @@ -14,8 +14,8 @@ import javax.swing.JMenuItem; 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; @@ -41,7 +41,7 @@ public class PopupMenuTest PopupMenu testee = null; - @Before + @BeforeMethod public void setUp() throws IOException { alignment = new FormatAdapter().readFile(TEST_DATA, @@ -130,7 +130,7 @@ public class PopupMenuTest testee.configureReferenceAnnotationsMenu(menu, seqs); assertTrue(menu.isEnabled()); - String expected = "
Add annotations for
JMOL/secondary structure
PBD/Temp
"; + String expected = "
Add annotations for
JMOL/secondary structure
PBD/Temp
"; assertEquals(expected, menu.getToolTipText()); } @@ -151,7 +151,7 @@ public class PopupMenuTest testee.configureReferenceAnnotationsMenu(menu, seqs); assertTrue(menu.isEnabled()); - String expected = "
Add annotations for
JMOL/secondary structure
PBD/Temp
"; + String expected = "
Add annotations for
JMOL/secondary structure
PBD/Temp
"; assertEquals(expected, menu.getToolTipText()); } diff --git a/test/jalview/gui/ProgressBarTest.java b/test/jalview/gui/ProgressBarTest.java index 2d3db68..192c941 100644 --- a/test/jalview/gui/ProgressBarTest.java +++ b/test/jalview/gui/ProgressBarTest.java @@ -1,9 +1,9 @@ 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; @@ -11,8 +11,6 @@ import java.awt.GridLayout; import javax.swing.JLabel; import javax.swing.JPanel; -import org.junit.Test; - public class ProgressBarTest { @@ -26,7 +24,7 @@ public class ProgressBarTest try { new ProgressBar(null, null); - fail("Expected exception"); + Assert.fail("Expected exception"); } catch (NullPointerException e) { // expected @@ -41,7 +39,7 @@ public class ProgressBarTest try { new ProgressBar(statusPanel, null); - fail("expected exception"); + Assert.fail("expected exception"); } catch (IllegalArgumentException e) { // expected diff --git a/test/jalview/gui/SequenceRendererTest.java b/test/jalview/gui/SequenceRendererTest.java index 3f8b96a..f01562e 100644 --- a/test/jalview/gui/SequenceRendererTest.java +++ b/test/jalview/gui/SequenceRendererTest.java @@ -1,6 +1,7 @@ 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; @@ -9,8 +10,6 @@ import jalview.schemes.ZappoColourScheme; import java.awt.Color; -import org.junit.Test; - public class SequenceRendererTest { diff --git a/test/jalview/gui/StructureChooserTest.java b/test/jalview/gui/StructureChooserTest.java index 1e73d3e..6d5af25 100644 --- a/test/jalview/gui/StructureChooserTest.java +++ b/test/jalview/gui/StructureChooserTest.java @@ -1,7 +1,10 @@ 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; @@ -9,15 +12,11 @@ import jalview.datamodel.SequenceI; 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, @@ -39,7 +38,7 @@ public class StructureChooserTest seq.setPDBId(pdbIds); } - @After + @AfterMethod public void tearDown() throws Exception { seq = null; diff --git a/test/jalview/io/AnnotatedPDBFileInputTest.java b/test/jalview/io/AnnotatedPDBFileInputTest.java index ef88ca5..576201a 100644 --- a/test/jalview/io/AnnotatedPDBFileInputTest.java +++ b/test/jalview/io/AnnotatedPDBFileInputTest.java @@ -1,16 +1,16 @@ 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; @@ -32,7 +32,7 @@ public class AnnotatedPDBFileInputTest String pdbId; - @Before + @BeforeMethod public void setup() throws Exception { Cache.applicationProperties.setProperty("STRUCT_FROM_PDB", @@ -60,7 +60,7 @@ public class AnnotatedPDBFileInputTest { for (int q = p + 1; q < avec.length; q++) { - assertNotEquals( + Assert.assertNotEquals( "Found a duplicate annotation row " + avec[p].label, avec[p], avec[q]); } diff --git a/test/jalview/io/AnnotationFileIOTest.java b/test/jalview/io/AnnotationFileIOTest.java index 0e066c2..3d911e0 100644 --- a/test/jalview/io/AnnotationFileIOTest.java +++ b/test/jalview/io/AnnotationFileIOTest.java @@ -20,17 +20,18 @@ */ 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 { @@ -84,7 +85,7 @@ 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; } @@ -98,6 +99,8 @@ public class AnnotationFileIOTest * - 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) { @@ -150,7 +153,7 @@ public class AnnotationFileIOTest { e.printStackTrace(); } - fail("Test " + Assert.fail("Test " + testname + "\nCouldn't complete Annotation file roundtrip input/output/input test for '" + annotFile + "'."); diff --git a/test/jalview/io/BioJsHTMLOutputTest.java b/test/jalview/io/BioJsHTMLOutputTest.java index ac2b599..619a4e0 100644 --- a/test/jalview/io/BioJsHTMLOutputTest.java +++ b/test/jalview/io/BioJsHTMLOutputTest.java @@ -1,8 +1,5 @@ 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; @@ -11,8 +8,12 @@ import java.net.URL; 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 @@ -43,7 +44,7 @@ public class BioJsHTMLOutputTest Assert.assertNotNull(bjsTemplate); } - @Test(expected = NullPointerException.class) + @Test(expectedExceptions = NullPointerException.class) public void expectedNullPointerException() { try @@ -51,7 +52,7 @@ public class BioJsHTMLOutputTest BioJsHTMLOutput.refreshBioJSVersionsInfo(null); } catch (URISyntaxException e) { - Assert.fail("Expception occured while testing!"); + AssertJUnit.fail("Expception occured while testing!"); e.printStackTrace(); } } @@ -67,11 +68,11 @@ public class BioJsHTMLOutputTest 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()); @@ -83,7 +84,7 @@ public class BioJsHTMLOutputTest System.out.println("\nCurrent latest version : " + BioJsHTMLOutput.getCurrentBJSTemplateFile()); - Assert.assertNotNull("Latest BioJsMSA version NOT found!", + AssertJUnit.assertNotNull("Latest BioJsMSA version NOT found!", BioJsHTMLOutput.getCurrentBJSTemplateFile()); } @@ -92,9 +93,9 @@ public class BioJsHTMLOutputTest 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 diff --git a/test/jalview/io/FileIOTester.java b/test/jalview/io/FileIOTester.java index e9165e2..1f3df1f 100644 --- a/test/jalview/io/FileIOTester.java +++ b/test/jalview/io/FileIOTester.java @@ -20,15 +20,13 @@ */ 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 * @@ -68,9 +66,9 @@ public class FileIOTester 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)); } diff --git a/test/jalview/io/HtmlFileTest.java b/test/jalview/io/HtmlFileTest.java index 59a5b68..eca3984 100644 --- a/test/jalview/io/HtmlFileTest.java +++ b/test/jalview/io/HtmlFileTest.java @@ -2,14 +2,12 @@ package jalview.io; 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"); diff --git a/test/jalview/io/JSONFileTest.java b/test/jalview/io/JSONFileTest.java index 92b172c..ec3f77b 100644 --- a/test/jalview/io/JSONFileTest.java +++ b/test/jalview/io/JSONFileTest.java @@ -1,7 +1,11 @@ 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; @@ -19,11 +23,6 @@ import java.io.IOException; 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 { @@ -43,7 +42,7 @@ public class JSONFileTest HashMap testAnnots = new HashMap(); HashMap testGrps = new HashMap(); - @Before + @BeforeMethod public void setup() throws Exception { // create and add sequences @@ -146,7 +145,7 @@ public class JSONFileTest TEST_ANOT_HEIGHT = testAnnots.size(); } - @After + @AfterMethod public void tearDown() throws Exception { } @@ -171,34 +170,34 @@ public class JSONFileTest 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); diff --git a/test/jalview/io/Jalview2xmlTests.java b/test/jalview/io/Jalview2xmlTests.java index 771250b..b3e37f4 100644 --- a/test/jalview/io/Jalview2xmlTests.java +++ b/test/jalview/io/Jalview2xmlTests.java @@ -20,15 +20,15 @@ */ 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; @@ -305,7 +305,7 @@ public class Jalview2xmlTests } 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]); } @@ -320,7 +320,7 @@ public class Jalview2xmlTests { 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()) { @@ -338,10 +338,10 @@ public class Jalview2xmlTests 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())); diff --git a/test/jalview/io/NewickFileTests.java b/test/jalview/io/NewickFileTests.java index bd0bb52..ee731e8 100644 --- a/test/jalview/io/NewickFileTests.java +++ b/test/jalview/io/NewickFileTests.java @@ -20,8 +20,13 @@ */ 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; @@ -33,21 +38,21 @@ import jalview.datamodel.SequenceI; 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() { @@ -95,30 +100,30 @@ public class NewickFileTests 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++) { @@ -126,13 +131,13 @@ public class NewickFileTests } 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( @@ -157,7 +162,7 @@ public class NewickFileTests if (warns.length() > 0) { - fail(stage + warns); + Assert.fail(stage + warns); } } catch (Exception x) { diff --git a/test/jalview/io/PhylipFileTests.java b/test/jalview/io/PhylipFileTests.java index e411272..2fd8e20 100644 --- a/test/jalview/io/PhylipFileTests.java +++ b/test/jalview/io/PhylipFileTests.java @@ -1,15 +1,16 @@ 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}. diff --git a/test/jalview/io/RNAMLfileTest.java b/test/jalview/io/RNAMLfileTest.java index c7e6398..a838cf7 100644 --- a/test/jalview/io/RNAMLfileTest.java +++ b/test/jalview/io/RNAMLfileTest.java @@ -20,12 +20,11 @@ */ 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 { diff --git a/test/jalview/io/StockholmFileTest.java b/test/jalview/io/StockholmFileTest.java index 806e4dc..12a8e9c 100644 --- a/test/jalview/io/StockholmFileTest.java +++ b/test/jalview/io/StockholmFileTest.java @@ -20,22 +20,23 @@ */ 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 { @@ -84,6 +85,7 @@ 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) { diff --git a/test/jalview/io/TCoffeeScoreFileTest.java b/test/jalview/io/TCoffeeScoreFileTest.java index edf7f20..df4b660 100644 --- a/test/jalview/io/TCoffeeScoreFileTest.java +++ b/test/jalview/io/TCoffeeScoreFileTest.java @@ -20,7 +20,8 @@ */ 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; @@ -31,7 +32,6 @@ import java.util.List; import javax.xml.parsers.ParserConfigurationException; -import org.junit.Test; import org.xml.sax.SAXException; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; @@ -54,23 +54,23 @@ public class TCoffeeScoreFileTest 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 @@ -80,10 +80,10 @@ public class TCoffeeScoreFileTest { 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); } } @@ -93,9 +93,9 @@ public class TCoffeeScoreFileTest { 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 @@ -116,24 +116,24 @@ public class TCoffeeScoreFileTest 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()); } @@ -144,31 +144,31 @@ public class TCoffeeScoreFileTest 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")); } @@ -179,33 +179,33 @@ public class TCoffeeScoreFileTest TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE); - assertTrue(parser.getWarningMessage(), parser.isValid()); + AssertJUnit.assertTrue(parser.getWarningMessage(), parser.isValid()); List 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)); @@ -217,28 +217,28 @@ public class TCoffeeScoreFileTest 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]); } @@ -247,9 +247,9 @@ public class TCoffeeScoreFileTest { 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()); } } diff --git a/test/jalview/schemes/DnaCodonTests.java b/test/jalview/schemes/DnaCodonTests.java index 42f17fd..d84f567 100644 --- a/test/jalview/schemes/DnaCodonTests.java +++ b/test/jalview/schemes/DnaCodonTests.java @@ -20,12 +20,10 @@ */ 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 { diff --git a/test/jalview/schemes/ResiduePropertiesTest.java b/test/jalview/schemes/ResiduePropertiesTest.java index b82d338..429323b 100644 --- a/test/jalview/schemes/ResiduePropertiesTest.java +++ b/test/jalview/schemes/ResiduePropertiesTest.java @@ -1,13 +1,11 @@ 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 { diff --git a/test/jalview/schemes/ScoreMatrixPrinter.java b/test/jalview/schemes/ScoreMatrixPrinter.java index 89f9f8a..5868210 100644 --- a/test/jalview/schemes/ScoreMatrixPrinter.java +++ b/test/jalview/schemes/ScoreMatrixPrinter.java @@ -20,12 +20,11 @@ */ 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 diff --git a/test/jalview/structure/Mapping.java b/test/jalview/structure/Mapping.java index cc8138c..74dddb4 100644 --- a/test/jalview/structure/Mapping.java +++ b/test/jalview/structure/Mapping.java @@ -1,12 +1,11 @@ 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; @@ -28,11 +27,10 @@ public class Mapping * 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 @@ -111,11 +109,10 @@ public class Mapping } } - @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"); @@ -228,7 +225,7 @@ public class Mapping 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"); } } diff --git a/test/jalview/structure/StructureSelectionManagerTest.java b/test/jalview/structure/StructureSelectionManagerTest.java index 487ef2c..62a9f43 100644 --- a/test/jalview/structure/StructureSelectionManagerTest.java +++ b/test/jalview/structure/StructureSelectionManagerTest.java @@ -1,20 +1,19 @@ 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(); diff --git a/test/jalview/structures/models/AAStructureBindingModelTest.java b/test/jalview/structures/models/AAStructureBindingModelTest.java index 3db7f23..4209577 100644 --- a/test/jalview/structures/models/AAStructureBindingModelTest.java +++ b/test/jalview/structures/models/AAStructureBindingModelTest.java @@ -1,15 +1,13 @@ 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; @@ -57,7 +55,7 @@ public class AAStructureBindingModelTest /** * Set up test conditions with three aligned sequences, */ - @Before + @BeforeMethod public void setUp() { SequenceI seq1 = new Sequence("1YCS", "-VPSQK"); diff --git a/test/jalview/util/ColorUtilsTest.java b/test/jalview/util/ColorUtilsTest.java index 3bbcf27..4e2c92e 100644 --- a/test/jalview/util/ColorUtilsTest.java +++ b/test/jalview/util/ColorUtilsTest.java @@ -1,12 +1,10 @@ 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 { diff --git a/test/jalview/util/ComparisonTest.java b/test/jalview/util/ComparisonTest.java index 57d1ac1..0a40784 100644 --- a/test/jalview/util/ComparisonTest.java +++ b/test/jalview/util/ComparisonTest.java @@ -1,11 +1,9 @@ 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; diff --git a/test/jalview/util/DBRefUtilsTest.java b/test/jalview/util/DBRefUtilsTest.java index 959c55d..925a375 100644 --- a/test/jalview/util/DBRefUtilsTest.java +++ b/test/jalview/util/DBRefUtilsTest.java @@ -1,10 +1,11 @@ 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; @@ -12,8 +13,6 @@ import jalview.datamodel.PDBEntry; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; -import org.junit.Test; - public class DBRefUtilsTest { diff --git a/test/jalview/util/MapListTest.java b/test/jalview/util/MapListTest.java index bfb0837..5579efb 100644 --- a/test/jalview/util/MapListTest.java +++ b/test/jalview/util/MapListTest.java @@ -1,16 +1,15 @@ 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 { @@ -48,7 +47,7 @@ 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)); } diff --git a/test/jalview/util/MappingUtilsTest.java b/test/jalview/util/MappingUtilsTest.java index ec9ace4..1bbdc1e 100644 --- a/test/jalview/util/MappingUtilsTest.java +++ b/test/jalview/util/MappingUtilsTest.java @@ -1,9 +1,9 @@ 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; @@ -12,8 +12,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import org.junit.Test; - import jalview.api.AlignViewportI; import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.Alignment; diff --git a/test/jalview/util/QuickSortTest.java b/test/jalview/util/QuickSortTest.java index 2293163..7d10758 100644 --- a/test/jalview/util/QuickSortTest.java +++ b/test/jalview/util/QuickSortTest.java @@ -1,13 +1,12 @@ 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 { @@ -24,7 +23,7 @@ public class QuickSortTest private final Object[] sortedThings = new Object[] { c4, c2, c1, c3 }; - @Before + @BeforeMethod public void setUp() { things = new Object[] @@ -82,8 +81,7 @@ public class QuickSortTest /** * 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[] diff --git a/test/jalview/util/ShiftListTest.java b/test/jalview/util/ShiftListTest.java index f680d6c..fa240d5 100644 --- a/test/jalview/util/ShiftListTest.java +++ b/test/jalview/util/ShiftListTest.java @@ -1,13 +1,11 @@ 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 { diff --git a/test/jalview/util/StringUtilsTest.java b/test/jalview/util/StringUtilsTest.java index 6930e40..0a0fac0 100644 --- a/test/jalview/util/StringUtilsTest.java +++ b/test/jalview/util/StringUtilsTest.java @@ -1,13 +1,11 @@ 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 { diff --git a/test/jalview/viewmodel/styles/ViewStyleTest.java b/test/jalview/viewmodel/styles/ViewStyleTest.java index 115c5d3..32003c2 100644 --- a/test/jalview/viewmodel/styles/ViewStyleTest.java +++ b/test/jalview/viewmodel/styles/ViewStyleTest.java @@ -1,16 +1,14 @@ 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 { @@ -137,7 +135,7 @@ 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); } } diff --git a/test/jalview/ws/PDBSequenceFetcherTest.java b/test/jalview/ws/PDBSequenceFetcherTest.java index 778fc18..9ecf524 100644 --- a/test/jalview/ws/PDBSequenceFetcherTest.java +++ b/test/jalview/ws/PDBSequenceFetcherTest.java @@ -20,12 +20,12 @@ */ 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; @@ -37,7 +37,7 @@ public class PDBSequenceFetcherTest SequenceFetcher sf; - @Before + @BeforeMethod public void setUp() throws Exception { // ensure 'add annotation from structure' is selected @@ -49,7 +49,7 @@ public class PDBSequenceFetcherTest sf = new SequenceFetcher(false); } - @Test + @Test(enabled = false) public void testRnaSeqRetrieve() throws Exception { List sps = sf.getSourceProxy("PDB"); diff --git a/test/jalview/ws/dbsources/PDBRestClientTest.java b/test/jalview/ws/dbsources/PDBRestClientTest.java index a97f3e0..f92a32e 100644 --- a/test/jalview/ws/dbsources/PDBRestClientTest.java +++ b/test/jalview/ws/dbsources/PDBRestClientTest.java @@ -1,8 +1,11 @@ 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; @@ -20,10 +23,6 @@ import org.json.simple.JSONArray; 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; @@ -33,12 +32,12 @@ import com.sun.jersey.api.client.config.DefaultClientConfig; public class PDBRestClientTest { - @Before + @BeforeMethod public void setUp() throws Exception { } - @After + @AfterMethod public void tearDown() throws Exception { } @@ -67,7 +66,7 @@ public class PDBRestClientTest } catch (Exception e) { e.printStackTrace(); - fail("Couldn't execute webservice call!"); + Assert.fail("Couldn't execute webservice call!"); return; } assertTrue(response.getNumberOfItemsFound() > 99); @@ -130,7 +129,7 @@ public class PDBRestClientTest assertEquals(expectedErrorMsg, parsedErrorResponse); } - @Test(expected = Exception.class) + @Test(expectedExceptions = Exception.class) public void testForExpectedRuntimeException() throws Exception { List wantedFields = new ArrayList(); @@ -207,7 +206,7 @@ public class PDBRestClientTest // Check the response status and report exception if one occurs if (clientResponse.getStatus() != 200) { - fail("Webservice call failed!!!"); + Assert.fail("Webservice call failed!!!"); } else { @@ -248,7 +247,7 @@ public class PDBRestClientTest } } 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(); } } diff --git a/test/jalview/ws/dbsources/UniprotTest.java b/test/jalview/ws/dbsources/UniprotTest.java index 7325527..60a1111 100644 --- a/test/jalview/ws/dbsources/UniprotTest.java +++ b/test/jalview/ws/dbsources/UniprotTest.java @@ -1,14 +1,12 @@ 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; diff --git a/test/jalview/ws/gui/Jws2ParamView.java b/test/jalview/ws/gui/Jws2ParamView.java index 4c67d25..5ff4aed 100644 --- a/test/jalview/ws/gui/Jws2ParamView.java +++ b/test/jalview/ws/gui/Jws2ParamView.java @@ -30,9 +30,8 @@ import java.util.List; 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; @@ -74,8 +73,8 @@ public class Jws2ParamView * 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 presetEnum = presetTests.iterator(); diff --git a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java index e561479..c184722 100644 --- a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java +++ b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java @@ -20,9 +20,12 @@ */ 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; @@ -35,10 +38,6 @@ import jalview.ws.jws2.jabaws2.Jws2Instance; 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"; @@ -157,7 +156,7 @@ public class DisorderAnnotExportImport { e.printStackTrace(); } - fail("Test " + Assert.fail("Test " + testname + "\nCouldn't complete Annotation file roundtrip input/output/input test."); } diff --git a/test/jalview/ws/jabaws/JalviewJabawsTestUtils.java b/test/jalview/ws/jabaws/JalviewJabawsTestUtils.java index 72fa7a4..546ba90 100644 --- a/test/jalview/ws/jabaws/JalviewJabawsTestUtils.java +++ b/test/jalview/ws/jabaws/JalviewJabawsTestUtils.java @@ -25,10 +25,9 @@ import static org.junit.Assert.fail; 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; @@ -52,8 +51,7 @@ public class JalviewJabawsTestUtils { "http://localhost:8080/jabaws", "http://www.compbio.dundee.ac.uk/jabaws" }; - @Test - @Ignore + @Test(enabled = false) public void testAnnotExport() { fail("Not yet implemented"); diff --git a/test/jalview/ws/jabaws/JpredJabaStructExportImport.java b/test/jalview/ws/jabaws/JpredJabaStructExportImport.java index 7afaeed..0b17169 100644 --- a/test/jalview/ws/jabaws/JpredJabaStructExportImport.java +++ b/test/jalview/ws/jabaws/JpredJabaStructExportImport.java @@ -20,9 +20,8 @@ */ 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; @@ -31,9 +30,10 @@ import java.util.List; 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; @@ -82,7 +82,7 @@ public class JpredJabaStructExportImport if (jpredws == null) { - fail("jpredws is null"); + Assert.fail("jpredws is null"); } jalview.io.FileLoader fl = new jalview.io.FileLoader(false); @@ -144,7 +144,7 @@ public class JpredJabaStructExportImport 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) @@ -221,15 +221,15 @@ public class JpredJabaStructExportImport { 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 opts = new ArrayList(); for (compbio.metadata.Argument rg : (List) jpredws .getRunnerConfig().getArguments()) @@ -241,7 +241,7 @@ public class JpredJabaStructExportImport 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); diff --git a/test/jalview/ws/jabaws/MinJabawsClientTests.java b/test/jalview/ws/jabaws/MinJabawsClientTests.java index 0c25cdb..244ee4f 100644 --- a/test/jalview/ws/jabaws/MinJabawsClientTests.java +++ b/test/jalview/ws/jabaws/MinJabawsClientTests.java @@ -1,13 +1,11 @@ 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; @@ -39,7 +37,7 @@ public class MinJabawsClientTests { } } 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"); diff --git a/test/jalview/ws/jabaws/RNAStructExportImport.java b/test/jalview/ws/jabaws/RNAStructExportImport.java index 1475b4e..6b92b85 100644 --- a/test/jalview/ws/jabaws/RNAStructExportImport.java +++ b/test/jalview/ws/jabaws/RNAStructExportImport.java @@ -20,9 +20,23 @@ */ 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; @@ -35,20 +49,6 @@ import jalview.ws.jws2.SequenceAnnotationWSClient; 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"; @@ -81,7 +81,7 @@ public class RNAStructExportImport if (rnaalifoldws == null) { - fail("no web service"); + Assert.fail("no web service"); } jalview.io.FileLoader fl = new jalview.io.FileLoader(false); @@ -144,7 +144,9 @@ public class RNAStructExportImport { 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()); } } } @@ -216,7 +218,7 @@ public class RNAStructExportImport { e.printStackTrace(); } - fail("Test " + Assert.fail("Test " + testname + "\nCouldn't complete Annotation file roundtrip input/output/input test."); } @@ -235,7 +237,7 @@ public class RNAStructExportImport 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); diff --git a/test/jalview/ws/jws2/ParameterUtilsTest.java b/test/jalview/ws/jws2/ParameterUtilsTest.java index bf1b8ee..d24a790 100644 --- a/test/jalview/ws/jws2/ParameterUtilsTest.java +++ b/test/jalview/ws/jws2/ParameterUtilsTest.java @@ -20,17 +20,15 @@ */ 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; diff --git a/test/jalview/ws/rest/RestClientTest.java b/test/jalview/ws/rest/RestClientTest.java index 66cdc42..325febc 100644 --- a/test/jalview/ws/rest/RestClientTest.java +++ b/test/jalview/ws/rest/RestClientTest.java @@ -1,11 +1,9 @@ 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 diff --git a/test/jalview/ws/rest/ShmmrRSBSService.java b/test/jalview/ws/rest/ShmmrRSBSService.java index c4430ad..d562644 100644 --- a/test/jalview/ws/rest/ShmmrRSBSService.java +++ b/test/jalview/ws/rest/ShmmrRSBSService.java @@ -20,15 +20,14 @@ */ 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 diff --git a/test/jalview/ws/seqfetcher/DasSequenceFetcher.java b/test/jalview/ws/seqfetcher/DasSequenceFetcher.java index 7f82252..bac0b5e 100644 --- a/test/jalview/ws/seqfetcher/DasSequenceFetcher.java +++ b/test/jalview/ws/seqfetcher/DasSequenceFetcher.java @@ -1,8 +1,7 @@ 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 { @@ -11,7 +10,7 @@ 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); } diff --git a/test/jalview/ws/seqfetcher/DbRefFetcherTest.java b/test/jalview/ws/seqfetcher/DbRefFetcherTest.java index 7540edf..302c0f7 100644 --- a/test/jalview/ws/seqfetcher/DbRefFetcherTest.java +++ b/test/jalview/ws/seqfetcher/DbRefFetcherTest.java @@ -20,17 +20,15 @@ */ 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; diff --git a/utils/hamcrest-core-1.3.jar b/utils/hamcrest-core-1.3.jar new file mode 100644 index 0000000..9d5fe16 Binary files /dev/null and b/utils/hamcrest-core-1.3.jar differ diff --git a/utils/jalview_testng.xml b/utils/jalview_testng.xml new file mode 100644 index 0000000..6ebda65 --- /dev/null +++ b/utils/jalview_testng.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/utils/junit-4.12.jar b/utils/junit-4.12.jar new file mode 100644 index 0000000..3a7fc26 Binary files /dev/null and b/utils/junit-4.12.jar differ diff --git a/utils/testnglibs/bsh-2.0b4.jar b/utils/testnglibs/bsh-2.0b4.jar new file mode 100644 index 0000000..36fe03d Binary files /dev/null and b/utils/testnglibs/bsh-2.0b4.jar differ diff --git a/utils/testnglibs/guava-base-r03.jar b/utils/testnglibs/guava-base-r03.jar new file mode 100644 index 0000000..2323db9 Binary files /dev/null and b/utils/testnglibs/guava-base-r03.jar differ diff --git a/utils/testnglibs/guava-collections-r03.jar b/utils/testnglibs/guava-collections-r03.jar new file mode 100644 index 0000000..e8f908d Binary files /dev/null and b/utils/testnglibs/guava-collections-r03.jar differ diff --git a/utils/testnglibs/jcommander.jar b/utils/testnglibs/jcommander.jar new file mode 100644 index 0000000..ad0a12c Binary files /dev/null and b/utils/testnglibs/jcommander.jar differ diff --git a/utils/testnglibs/junit-4.12.jar b/utils/testnglibs/junit-4.12.jar new file mode 100644 index 0000000..3a7fc26 Binary files /dev/null and b/utils/testnglibs/junit-4.12.jar differ diff --git a/utils/testnglibs/snakeyaml.jar b/utils/testnglibs/snakeyaml.jar new file mode 100644 index 0000000..fd314d3 Binary files /dev/null and b/utils/testnglibs/snakeyaml.jar differ diff --git a/utils/testnglibs/testng-sources.jar b/utils/testnglibs/testng-sources.jar new file mode 100644 index 0000000..7a80303 Binary files /dev/null and b/utils/testnglibs/testng-sources.jar differ diff --git a/utils/testnglibs/testng.jar b/utils/testnglibs/testng.jar new file mode 100644 index 0000000..e1f127e Binary files /dev/null and b/utils/testnglibs/testng.jar differ