git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2326 added setup method for JvOptionPane in all Jalveiw test classes to enable...
[jalview.git]
/
test
/
jalview
/
io
/
FileIOTester.java
diff --git
a/test/jalview/io/FileIOTester.java
b/test/jalview/io/FileIOTester.java
index
e9165e2
..
26ece71
100644
(file)
--- a/
test/jalview/io/FileIOTester.java
+++ b/
test/jalview/io/FileIOTester.java
@@
-20,14
+20,15
@@
*/
package jalview.io;
*/
package jalview.io;
-import static org.junit.Assert.*;
+import jalview.gui.JvOptionPane;
import java.io.File;
import java.io.IOException;
import java.io.File;
import java.io.IOException;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.testng.AssertJUnit;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
/**
* @author jimp
/**
* @author jimp
@@
-36,10
+37,17
@@
import org.junit.Test;
public class FileIOTester
{
public class FileIOTester
{
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
/**
* @throws java.lang.Exception
*/
/**
* @throws java.lang.Exception
*/
- @BeforeClass
+ @BeforeClass(alwaysRun = true)
public static void setUpBeforeClass() throws Exception
{
}
public static void setUpBeforeClass() throws Exception
{
}
@@
-47,7
+55,7
@@
public class FileIOTester
/**
* @throws java.lang.Exception
*/
/**
* @throws java.lang.Exception
*/
- @AfterClass
+ @AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
}
public static void tearDownAfterClass() throws Exception
{
}
@@
-68,13
+76,14
@@
public class FileIOTester
private void assertValidFormat(String fmt, String src, FileParse fp)
{
private void assertValidFormat(String fmt, String src, FileParse fp)
{
- 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("Couldn't resolve " + src + " as a valid file",
+ fp.isValid());
+ String type = new IdentifyFile().identify(fp);
+ AssertJUnit.assertTrue("Data from '" + src + "' Expected to be '" + fmt
+ "' identified as '" + type + "'", type.equalsIgnoreCase(fmt));
}
+ "' identified as '" + type + "'", type.equalsIgnoreCase(fmt));
}
- @Test
+ @Test(groups = { "Functional" })
public void testStarsInFasta1() throws IOException
{
String uri;
public void testStarsInFasta1() throws IOException
{
String uri;
@@
-83,7
+92,7
@@
public class FileIOTester
assertValidFormat("FASTA", uri, fp);
}
assertValidFormat("FASTA", uri, fp);
}
- @Test
+ @Test(groups = { "Functional" })
public void testStarsInFasta2() throws IOException
{
String uri;
public void testStarsInFasta2() throws IOException
{
String uri;
@@
-92,7
+101,7
@@
public class FileIOTester
assertValidFormat("FASTA", uri, fp);
}
assertValidFormat("FASTA", uri, fp);
}
- @Test
+ @Test(groups = { "Functional" })
public void testGzipIo() throws IOException
{
String uri;
public void testGzipIo() throws IOException
{
String uri;
@@
-101,7
+110,7
@@
public class FileIOTester
assertValidFormat("FASTA", uri, fp);
}
assertValidFormat("FASTA", uri, fp);
}
- @Test
+ @Test(groups = { "Functional" })
public void testGziplocalFileIO() throws IOException
{
String filepath;
public void testGziplocalFileIO() throws IOException
{
String filepath;
@@
-110,7
+119,7
@@
public class FileIOTester
assertValidFormat("FASTA", filepath, fp);
}
assertValidFormat("FASTA", filepath, fp);
}
- @Test
+ @Test(groups = { "Functional" })
public void testNonGzipURLIO() throws IOException
{
String uri;
public void testNonGzipURLIO() throws IOException
{
String uri;
@@
-119,7
+128,7
@@
public class FileIOTester
assertValidFormat("FASTA", uri, fp);
}
assertValidFormat("FASTA", uri, fp);
}
- @Test
+ @Test(groups = { "Functional" })
public void testNonGziplocalFileIO() throws IOException
{
String filepath;
public void testNonGziplocalFileIO() throws IOException
{
String filepath;