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-2480 more efficient contains check on add; tidied comparators
[jalview.git]
/
test
/
jalview
/
io
/
AnnotatedPDBFileInputTest.java
diff --git
a/test/jalview/io/AnnotatedPDBFileInputTest.java
b/test/jalview/io/AnnotatedPDBFileInputTest.java
index
c0251b6
..
d8ae999
100644
(file)
--- a/
test/jalview/io/AnnotatedPDBFileInputTest.java
+++ b/
test/jalview/io/AnnotatedPDBFileInputTest.java
@@
-1,6
+1,6
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*
* This file is part of Jalview.
*
@@
-31,10
+31,12
@@
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
+import jalview.gui.JvOptionPane;
+import jalview.structure.StructureImportSettings;
+import jalview.structure.StructureImportSettings.StructureParser;
import java.io.File;
import java.io.File;
-import org.junit.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
@@
-43,6
+45,13
@@
import org.testng.annotations.Test;
public class AnnotatedPDBFileInputTest
{
public class AnnotatedPDBFileInputTest
{
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
AlignmentI al;
String pdbId;
AlignmentI al;
String pdbId;
@@
-62,10
+71,13
@@
public class AnnotatedPDBFileInputTest
Boolean.TRUE.toString());
FileLoader loader = new FileLoader(false);
AlignFrame af = loader.LoadFileWaitTillLoaded("examples/1gaq.txt",
Boolean.TRUE.toString());
FileLoader loader = new FileLoader(false);
AlignFrame af = loader.LoadFileWaitTillLoaded("examples/1gaq.txt",
- FormatAdapter.FILE);
+ DataSourceType.FILE);
al = af.getViewport().getAlignment();
pdbId = al.getSequenceAt(0).getDatasetSequence().getAllPDBEntries()
.get(0).getId();
al = af.getViewport().getAlignment();
pdbId = al.getSequenceAt(0).getDatasetSequence().getAllPDBEntries()
.get(0).getId();
+ StructureImportSettings.setDefaultStructureFileFormat("PDB");
+ // StructureImportSettings
+ // .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER);
}
@Test(groups = { "Functional" })
}
@Test(groups = { "Functional" })
@@
-81,8
+93,8
@@
public class AnnotatedPDBFileInputTest
{
for (int q = p + 1; q < avec.length; q++)
{
{
for (int q = p + 1; q < avec.length; q++)
{
- Assert.assertNotEquals("Found a duplicate annotation row "
- + avec[p].label, avec[p], avec[q]);
+ assertTrue("Found a duplicate annotation row " + avec[p].label,
+ avec[p] != avec[q]);
}
}
}
}
}
}
@@
-97,7
+109,11
@@
public class AnnotatedPDBFileInputTest
{
System.out.println("CalcId: " + aa.getCalcId());
{
System.out.println("CalcId: " + aa.getCalcId());
- assertTrue(MCview.PDBfile.isCalcIdForFile(aa, pdbId));
+ if (StructureImportSettings.getDefaultPDBFileParser().equals(
+ StructureParser.JALVIEW_PARSER))
+ {
+ assertTrue(MCview.PDBfile.isCalcIdForFile(aa, pdbId));
+ }
}
}
}
}
}
}
@@
-181,7
+197,7
@@
public class AnnotatedPDBFileInputTest
/**
* @throws java.lang.Exception
*/
/**
* @throws java.lang.Exception
*/
- @AfterClass
+ @AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
jalview.gui.Desktop.instance.closeAll_actionPerformed(null);
public static void tearDownAfterClass() throws Exception
{
jalview.gui.Desktop.instance.closeAll_actionPerformed(null);
@@
-196,14
+212,14
@@
public class AnnotatedPDBFileInputTest
String tfile = File.createTempFile("JalviewTest", ".jvp")
.getAbsolutePath();
AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
String tfile = File.createTempFile("JalviewTest", ".jvp")
.getAbsolutePath();
AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
- inFile, FormatAdapter.FILE);
+ inFile, DataSourceType.FILE);
assertTrue("Didn't read input file " + inFile, af != null);
assertTrue("Failed to store as a project.",
assertTrue("Didn't read input file " + inFile, af != null);
assertTrue("Failed to store as a project.",
- af.saveAlignment(tfile, "Jalview"));
+ af.saveAlignment(tfile, FileFormat.Jalview));
af.closeMenuItem_actionPerformed(true);
af = null;
af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile,
af.closeMenuItem_actionPerformed(true);
af = null;
af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile,
- FormatAdapter.FILE);
+ DataSourceType.FILE);
assertTrue("Failed to import new project", af != null);
for (SequenceI asq : af.getViewport().getAlignment().getSequences())
{
assertTrue("Failed to import new project", af != null);
for (SequenceI asq : af.getViewport().getAlignment().getSequences())
{
@@
-213,8
+229,8
@@
public class AnnotatedPDBFileInputTest
sq = sq.getDatasetSequence();
}
assertNotNull(sq.getAllPDBEntries());
sq = sq.getDatasetSequence();
}
assertNotNull(sq.getAllPDBEntries());
- assertEquals("Expected only one PDB ID",
- sq.getAllPDBEntries().size(), 1);
+ assertEquals("Expected only one PDB ID", 1, sq.getAllPDBEntries()
+ .size());
for (PDBEntry pdbentry : sq.getAllPDBEntries())
{
System.err.println("PDB Entry " + pdbentry.getId() + " "
for (PDBEntry pdbentry : sq.getAllPDBEntries())
{
System.err.println("PDB Entry " + pdbentry.getId() + " "