Esempio n. 1
0
  public void setUp() {
    tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
    totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
    tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
    tataFactory2.stop();
    tataFactory.stop();

    Properties props = new Properties();
    props.put("instance.name", "toto provider");
    try {
      totoProv = totoFactory.createComponentInstance(props);
    } catch (Exception e) {
      e.printStackTrace();
    }

    Properties props3 = new Properties();
    props3.put("instance.name", "toto provider 2");
    try {
      totoProv2 = totoFactory.createComponentInstance(props3);
    } catch (Exception e) {
      e.printStackTrace();
    }

    totoProv.stop();
    totoProv2.stop();

    Factory factory = Utils.getFactoryByName(getContext(), "comp-2");
    Properties props2 = new Properties();
    props2.put("instance.name", "ff");
    try {
      under = factory.createComponentInstance(props2);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Esempio n. 2
0
  @Before
  public void setUp() {
    tataFactory = (ComponentFactory) ipojoHelper.getFactory("tata");
    totoFactory = (ComponentFactory) ipojoHelper.getFactory("toto");
    tataFactory2 = (ComponentFactory) ipojoHelper.getFactory("comp-6");
    tataFactory2.stop();

    Properties props = new Properties();
    props.put("instance.name", "toto provider");
    try {
      totoProv = totoFactory.createComponentInstance(props);
    } catch (Exception e) {
      e.printStackTrace();
    }

    Properties props3 = new Properties();
    props3.put("instance.name", "toto provider 2");
    try {
      totoProv2 = totoFactory.createComponentInstance(props3);
    } catch (Exception e) {
      e.printStackTrace();
    }

    totoProv.stop();
    totoProv2.stop();

    Factory factory = ipojoHelper.getFactory("comp-7");
    Properties props2 = new Properties();
    props2.put("instance.name", "ff");
    try {
      under = factory.createComponentInstance(props2);
    } catch (Exception e) {
      e.printStackTrace();
    }
    tataFactory.stop();
  }