@@ -0,0 +1,3344 @@
+package org.ow2.chameleon.fuchsia.core.test;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0Aimport org.osgi.framework.BundleContext;%0Aimport org.osgi.framework.Filter;%0Aimport org.ow2.chameleon.fuchsia.core.component.DefaultExportationLinker;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0Aimport static org.fest.reflect.core.Reflection.field;%0A%0Apublic class DefaultExportationLinkerTest %7B%0A%0A    @Mock%0A    BundleContext bundleContext;%0A%0A    @Before%0A    public void setUp() %7B%0A        MockitoAnnotations.initMocks(this); //initialize the object with mocks annotations%0A    %7D%0A%0A    @After%0A    public void tearDown() %7B%0A%0A    %7D%0A%0A    public void setProperties(DefaultExportationLinker il, String name, String filterIDec, String filterIServ)%7B%0A        field(%22linkerName%22).ofType(String.class).in(il).set(name);%0A        field(%22exportDeclarationFilterProperty%22).ofType(Object.class).in(il).set(filterIDec);%0A        field(%22exporterServiceFilterProperty%22).ofType(Object.class).in(il).set(filterIServ);%0A    %7D%0A%0A    @Test%0A    public void testCreation() %7B%0A        DefaultExportationLinker il = new DefaultExportationLinker(bundleContext);%0A        il.start();%0A        assertThat(il.getExportDeclarations()).isEmpty();%0A        assertThat(il.getLinkedExporters()).isEmpty();%0A        il.stop();%0A    %7D%0A%0A    @Test%0A    public void testProperties() %7B%0A        DefaultExportationLinker il = new DefaultExportationLinker(bundleContext);%0A        il.start();%0A        setProperties(il, %22TestedLinker%22, %22(scope=generic)%22, %22(instance.name=TestExporter)%22);%0A        assertThat(il.getName()).isEqualTo(%22TestedLinker%22);%0A        il.updated();%0A        Filter exportDeclarationFilter = field(%22exportDeclarationFilter%22).ofType(Filter.class).in(il).get();%0A        Filter exporterServiceFilter = field(%22exporterServiceFilter%22).ofType(Filter.class).in(il).get();%0A        assertThat(exportDeclarationFilter.toString()).isEqualTo(%22(scope=generic)%22);%0A        assertThat(exporterServiceFilter.toString()).isEqualTo(%22(instance.name=TestExporter)%22);%0A        assertThat(field(%22state%22).ofType(boolean.class).in(il).get()).isTrue();%0A    %7D%0A%0A    @Test%0A    public void testIServPropFilterFail() %7B%0A        DefaultExportationLinker il = new DefaultExportationLinker(bundleContext);%0A        il.start();%0A        setProperties(il, %22TestedLinker%22, %22(scope=generic)%22, %22(instance.name=TestExporter%22);%0A        assertThat(il.getName()).isEqualTo(%22TestedLinker%22);%0A        il.updated();%0A        Filter exporterServiceFilter = field(%22exporterServiceFilter%22).ofType(Filter.class).in(il).get();%0A        assertThat(exporterServiceFilter).isNull();%0A        assertThat(field(%22state%22).ofType(boolean.class).in(il).get()).isFalse();%0A    %7D%0A%0A    @Test%0A    public void testIDecPropFilterFail() %7B%0A        DefaultExportationLinker il = new DefaultExportationLinker(bundleContext);%0A        il.start();%0A        setProperties(il, %22TestedLinker%22, %22(scope=generic%22, %22(instance.name=TestExporter)%22);%0A        assertThat(il.getName()).isEqualTo(%22TestedLinker%22);%0A        il.updated();%0A        Filter exportDeclarationFilter = field(%22exportDeclarationFilter%22).ofType(Filter.class).in(il).get();%0A        assertThat(exportDeclarationFilter).isNull();%0A        assertThat(field(%22state%22).ofType(boolean.class).in(il).get()).isFalse();%0A%0A    %7D%0A%0A%7D%0A

Add tests for DefaultExportationLinker