+
+ @Test(groups = "Functional")
+ public void testCopyConstructor() throws IOException
+ {
+ AlignmentI protein = loadAlignment(AA_SEQS_1, FormatAdapter.PASTE);
+ protein.setDataset(null);
+ AlignedCodonFrame acf = new AlignedCodonFrame();
+ protein.getDataset().setCodonFrames(Collections.singleton(acf));
+ AlignmentI copy = new Alignment(protein);
+
+ /*
+ * copy has different aligned sequences but the same dataset sequences
+ */
+ assertFalse(copy.getSequenceAt(0) == protein.getSequenceAt(0));
+ assertFalse(copy.getSequenceAt(1) == protein.getSequenceAt(1));
+ assertSame(copy.getSequenceAt(0).getDatasetSequence(), protein
+ .getSequenceAt(0).getDatasetSequence());
+ assertSame(copy.getSequenceAt(1).getDatasetSequence(), protein
+ .getSequenceAt(1).getDatasetSequence());
+ // and the same alignment dataset (?)
+ // or a new one with the same dataset sequences?
+ assertSame(copy.getDataset(), protein.getDataset());
+ }