Package org.sonar.api.platform

Examples of org.sonar.api.platform.ComponentContainer


    assertThat(formulaDecorator.dependsUponDecorators()).hasSize(1);
    assertThat(Iterables.get(formulaDecorator.dependsUponDecorators(), 0)).isEqualTo(firstDecorator);
  }

  private BatchExtensionDictionnary newBatchDictionnary(Object... extensions) {
    ComponentContainer ioc = new ComponentContainer();
    for (Object extension : extensions) {
      ioc.addSingleton(extension);
    }
    return new BatchExtensionDictionnary(ioc);
  }
View Full Code Here


import static org.mockito.Mockito.mock;

public class BatchExtensionDictionnaryTest {

  private BatchExtensionDictionnary newSelector(BatchExtension... extensions) {
    ComponentContainer iocContainer = new ComponentContainer();
    for (BatchExtension extension : extensions) {
      iocContainer.addSingleton(extension);
    }
    return new BatchExtensionDictionnary(iocContainer);
  }
View Full Code Here

  public void shouldSearchInParentContainers() {
    BatchExtension a = new FakeSensor();
    BatchExtension b = new FakeSensor();
    BatchExtension c = new FakeSensor();

    ComponentContainer grandParent = new ComponentContainer();
    grandParent.addSingleton(a);

    ComponentContainer parent = grandParent.createChild();
    parent.addSingleton(b);

    ComponentContainer child = parent.createChild();
    child.addSingleton(c);

    BatchExtensionDictionnary dictionnary = new BatchExtensionDictionnary(child);
    assertThat(dictionnary.select(BatchExtension.class)).containsOnly(a, b, c);
  }
View Full Code Here

TOP

Related Classes of org.sonar.api.platform.ComponentContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.