- * Adding both sets adds acf2 twice and acf1 and acf3 once each.
- */
- ssm.addMappings(set1);
- ssm.addMappings(set2);
-
- assertEquals(3, ssm.seqmappings.size());
- assertTrue(ssm.seqmappings.contains(acf1));
- assertTrue(ssm.seqmappings.contains(acf2));
- assertTrue(ssm.seqmappings.contains(acf3));
- assertEquals(1, ssm.getMappingReferenceCount(acf1));
- assertEquals(2, ssm.getMappingReferenceCount(acf2));
- assertEquals(1, ssm.getMappingReferenceCount(acf3));
- }
-
- @Test(groups ={ "Functional" })
- public void testRemoveMapping()
- {
- AlignedCodonFrame acf1 = new AlignedCodonFrame();
- AlignedCodonFrame acf2 = new AlignedCodonFrame();
-
- /*
- * Add one and remove it.
- */
- ssm.addMapping(acf1);
- ssm.removeMapping(acf1);
- ssm.removeMapping(acf2);
- assertEquals(0, ssm.seqmappings.size());
- assertEquals(0, ssm.getMappingReferenceCount(acf1));
- assertEquals(0, ssm.getMappingReferenceCount(acf2));
-
- /*
- * Add one twice and remove it once.
- */
- ssm.addMapping(acf1);
- ssm.addMapping(acf2);
- ssm.addMapping(acf1);
- ssm.removeMapping(acf1);
- assertEquals(2, ssm.seqmappings.size());
- assertTrue(ssm.seqmappings.contains(acf1));
- assertTrue(ssm.seqmappings.contains(acf2));
- assertEquals(1, ssm.getMappingReferenceCount(acf1));
- assertEquals(1, ssm.getMappingReferenceCount(acf2));
-
- /*
- * Remove both once more to clear the set.