X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fext%2Fjmol%2FJmolParserTest.java;h=b2d32532610abfad8cce58400be5a21dc9fe0a8d;hb=62cdf4a06bef088c02f81c66ab2fe0bc3264e321;hp=fb092f6f9d2fa3772471448047a8c4967a3e26bb;hpb=528c0f1815bc67b54618ad5b16c2162946974caf;p=jalview.git diff --git a/test/jalview/ext/jmol/JmolParserTest.java b/test/jalview/ext/jmol/JmolParserTest.java index fb092f6..b2d3253 100644 --- a/test/jalview/ext/jmol/JmolParserTest.java +++ b/test/jalview/ext/jmol/JmolParserTest.java @@ -21,6 +21,7 @@ package jalview.ext.jmol; import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertNotNull; import static org.testng.AssertJUnit.assertTrue; import jalview.bin.Cache; @@ -248,4 +249,30 @@ public class JmolParserTest assertEquals('H', structCode[4]); assertEquals('E', structCode[5]); } + + @Test(groups = "Functional") + public void testLocalPDBId() throws Exception + { + JmolParser structureData; + /* + * reads a local structure + */ + structureData = new JmolParser("examples/testdata/localstruct.pdb", + AppletFormatAdapter.FILE); + assertNotNull(structureData); + /* + * local structure files should yield a false ID based on the filename + */ + assertNotNull(structureData.getId()); + assertEquals(structureData.getId(), "localstruct.pdb"); + assertNotNull(structureData.getSeqs()); + /* + * the ID is also the group for features derived from structure data + */ + assertNotNull(structureData.getSeqs().get(0).getSequenceFeatures()[0].featureGroup); + assertEquals( + structureData.getSeqs().get(0).getSequenceFeatures()[0].featureGroup, + "localstruct.pdb"); + + } }