@@ -0,0 +1,2261 @@
+/*%0A *                    BioJava development code%0A *%0A * This code may be freely distributed and modified under the%0A * terms of the GNU Lesser General Public Licence.  This should%0A * be distributed with the code.  If you do not have a copy,%0A * see:%0A *%0A *      http://www.gnu.org/copyleft/lesser.html%0A *%0A * Copyright for this code is held jointly by the individual%0A * authors.  These should be listed in @author doc comments.%0A *%0A * For more information on the BioJava project and its aims,%0A * or to join the biojava-l mailing list, visit the home page%0A * at:%0A *%0A *      http://www.biojava.org/%0A *%0A */%0A%0Apackage org.biojava.bio.seq;%0A%0Aimport java.util.*;%0Aimport org.biojava.utils.*;%0Aimport org.biojava.bio.*;%0Aimport org.biojava.bio.symbol.*;%0Aimport org.biojava.bio.seq.impl.*;%0Aimport junit.framework.TestCase;%0A%0A/**%0A * Tests for ProjectedFeatureHolder%0A *%0A * @author Thomas Down%0A * @since 1.3%0A */%0A%0Apublic class ProjectedFeatureHolderTest extends TestCase%0A%7B%0A    public ProjectedFeatureHolderTest(String name) %7B%0A        super(name);%0A    %7D%0A%0A    public void testFeatureChangeEvent()%0A        throws Exception%0A    %7B%0A        Sequence seq = new SimpleSequence(%0A                DNATools.createDNA(%22gattaca%22),%0A                %22test%22,%0A                %22test%22,%0A                Annotation.EMPTY_ANNOTATION%0A        );%0A        Feature.Template template = new Feature.Template();%0A        template.type = %22test%22;%0A        template.source = %22foo%22;%0A        template.location = new RangeLocation(2, 4);%0A        template.annotation = Annotation.EMPTY_ANNOTATION;%0A        Feature seqFeature = seq.createFeature(template);%0A        %0A        ProjectedFeatureHolder pfh = new ProjectedFeatureHolder(seq, seq, 7, true);%0A        Feature pfhFeature = (Feature) pfh.filter(new FeatureFilter.ByType(%22test%22)).features().next();%0A        %0A        pfhFeature.addChangeListener(ChangeListener.ALWAYS_VETO, ChangeType.UNKNOWN);%0A        boolean vetoed = false;%0A        try %7B%0A            seqFeature.setLocation(new RangeLocation(1, 3));%0A        %7D catch (ChangeVetoException cve) %7B%0A            vetoed = true;%0A        %7D%0A        assertTrue(vetoed);%0A        %0A        pfhFeature.removeChangeListener(ChangeListener.ALWAYS_VETO, ChangeType.UNKNOWN);%0A        seqFeature.setLocation(new RangeLocation(1, 3));%0A    %7D%0A%7D%0A

Test for event handling of projections.