+ @Test(groups= {"Functional"})
+ public void testImportPDBPreservesChainMappings() throws IOException
+ {
+ AlignmentI importedAl = new jalview.io.FormatAdapter().readFile(
+ PDB_4_MC, DataSourceType.PASTE, FileFormats.getInstance()
+ .forName(jalview.io.FileFormat.PDB.toString()));
+ // ideally, we would match on the actual data for the 'File' handle for
+ // pasted files,
+ // see JAL-623 - pasting is still not correctly handled...
+ PDBEntry importedPDB = new PDBEntry("3A6S", "", Type.PDB,
+ "Paste");
+ AAStructureBindingModel binder = new AAStructureBindingModel(
+ new StructureSelectionManager(), new PDBEntry[]
+ { importedPDB },
+ new SequenceI[][]
+ { importedAl.getSequencesArray() }, null)
+ {
+
+ @Override
+ public void updateColours(Object source)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void releaseReferences(Object svl)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public String[] getStructureFiles()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String superposeStructures(AlignmentI[] alignments,
+ int[] structureIndices, HiddenColumns[] hiddenCols)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setJalviewColourScheme(ColourSchemeI cs)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setBackgroundColour(Color col)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void highlightAtoms(List<AtomSpec> atoms)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public SequenceRenderer getSequenceRenderer(AlignmentViewPanel alignment)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public FeatureRenderer getFeatureRenderer(AlignmentViewPanel alignment)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected String[] getColourBySequenceCommands(String[] files,
+ AlignmentViewPanel avp)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected void colourBySequence(String[] colourBySequenceCommands)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void colourByCharge()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void colourByChain()
+ {
+ // TODO Auto-generated method stub
+
+ }
+ };
+ String[][] chains = binder.getChains();
+ assertFalse(chains == null || chains[0] == null,
+ "No chains discovered by binding");
+ assertEquals(2, chains[0].length);
+ assertEquals("A", chains[0][0]);
+ assertEquals("B", chains[0][1]);
+ }