@@ -0,0 +1,2305 @@
+/*%0A * Copyright (c) 2007, Rickard %C3%96berg. All Rights Reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *%0A */%0A%0Apackage org.qi4j.composite;%0A%0Aimport static org.hamcrest.CoreMatchers.*;%0Aimport static org.junit.Assert.*;%0Aimport org.junit.Test;%0Aimport org.qi4j.bootstrap.AssemblyException;%0Aimport org.qi4j.bootstrap.ModuleAssembly;%0Aimport org.qi4j.composite.scope.This;%0Aimport org.qi4j.property.Property;%0Aimport org.qi4j.test.AbstractQi4jTest;%0A%0A/**%0A * TODO%0A */%0Apublic class SpecificSideEffectTest%0A    extends AbstractQi4jTest%0A%7B%0A%0A    public void assemble( ModuleAssembly module )%0A        throws AssemblyException%0A    %7B%0A        module.addComposites( SomeComposite.class );%0A    %7D%0A%0A    @Test%0A    public void specificSideEffect()%0A    %7B%0A        SomeComposite some = compositeBuilderFactory.newComposite( SomeComposite.class );%0A        Property%3CInteger%3E count = some.count();%0A        assertThat( %22count is zero%22, count.get(), equalTo( 0 ) );%0A        some.doStuff();%0A        assertThat( %22count is not zero%22, count.get(), not( equalTo( 0 ) ) );%0A    %7D%0A%0A    @SideEffects( CounterSideEffect.class )%0A    @Mixins( SomeMixin.class )%0A    public interface SomeComposite%0A        extends Some, Counter, Composite%0A    %7B%0A    %7D%0A%0A    public interface Some%0A    %7B%0A        public String doStuff();%0A    %7D%0A%0A    public static abstract class SomeMixin%0A        implements Some%0A    %7B%0A        public String doStuff()%0A        %7B%0A            return %22Blah blah%22;%0A        %7D%0A    %7D%0A%0A    public interface Counter%0A    %7B%0A        Property%3CInteger%3E count();%0A    %7D%0A%0A    public static class CounterSideEffect%0A        extends SideEffectOf%3CSome%3E%0A        implements Some%0A    %7B%0A        @This Counter counter;%0A%0A        public String doStuff()%0A        %7B%0A            counter.count().set( counter.count().get() + 1 );%0A            return null;%0A        %7D%0A    %7D%0A%0A%7D

Add test for a side effect on a specific method.