Questions tagged [picocontainer]

PicoContainer is a highly embeddable, full-service, Inversion of Control (IoC) container for components honor the Dependency Injection pattern

PicoContainer

PicoContainer is a highly embeddable, full-service, Inversion of Control (IoC) container for components honor the Dependency Injection pattern. The project started in 2003 and pioneered Constructor Injection auto-wiring. It is also Open Source and therefore free to use. The license is BSD and thus you can safely use this with commercial or other open source software.

PicoContainer 2.14 is the Latest Released Version, and the download is disponible here. The project is hosted in http://picocontainer.codehaus.org/.

75 questions
1
vote
4 answers

Can I share two objects of the same class using pico container?

Can I have like private SharableClass object1; private SharableClass object2; public ClassA(SharableClass object1, SharableClass object2){ this.object1=object1; this.object2=object2; } Then fill the object1 and object2 and share it. Is…
HudBud108
  • 41
  • 1
  • 5
1
vote
0 answers

How can I use Picocontainer for my Scenaio and stepdefinitions?

My feature file is search.feature. And there are two stepdefinitions file named: Backgroundstepdef and Searchstepdef. I have to use status of Backgroundstepdef into Searchstepdef. How can i use status of steps in Backgroundstepdef using DI…
1
vote
1 answer

Picocontainer: Inject multiple objects of same type

I am using DI and have the following public DoSomethingWithUsers(User user1, User user2){ this.user1 = user1; this.user2 = user2; } Notice that the same type is being injected twice. As I proceed with my coding/testing I noticed…
Walter Kelt
  • 2,199
  • 1
  • 18
  • 22
1
vote
1 answer

Does using dependency injection in cucumber-jvm consider bad practise?

I am still very new in Cucumber-jvm/Selenium, so I am very sorry if the question sounds dumb. Background: I'm an intern in a big company. I'm doing an automated software testing for a product. There is already an existing automated test steps. What…
1
vote
0 answers

Cucumber framework scenarios not found when picocontainer jar is added to java build path

I am trying to build a Cucumber BDD framework with multiple step definition files. I am still trying to understand how to use picocontainer to run the step definition files. My problem is that once I have added the picocontainer jar into a…
1
vote
2 answers

Sharing state between step definitions in Cucumber

I have 4 step definition classes and a set of domain object classes. My first step definition class looks like this: public class ClaimProcessSteps { Claim claim; public ClaimProcessSteps(Claim w){ this.claim = w; } …
mrdeived
  • 85
  • 1
  • 2
  • 7
1
vote
1 answer

Register a list of implementations with Pico Container

I have an interface public interface IInterface{} And I have a list of implementations of this interface: public class MyClass1 implements IInterface{} public class MyClass2 implements IInterface{} What I'd like to do with Pico…
dr11
  • 5,166
  • 11
  • 35
  • 77
1
vote
1 answer

Polymorphic Step Definitions with Cucumber, PicoContainer & Conductor Framework

The issue I'm having is that Locomotive is not being terminated after each Cucumber scenario is run. Then I'm being left with orphaned Selenium processes, e.g.: 501 75709 1 0 1:29PM ?? 0:00.05…
risteard
  • 47
  • 5
1
vote
1 answer

How do I get PicoContainer to start/stop/dispose a component injected by a factory?

I have a PicoContainer which caches all components. Since it caches all components, I expect it to call start, stop and dispose at the appropriate points in the container lifecycle. However, I'm finding that if I construct a component using a…
Hakanai
  • 12,010
  • 10
  • 62
  • 132
1
vote
1 answer

Cucumber-jvm Either the specified parameters do not match any of the following constructors: [private java.lang.Class()];

I am testing a simple Cucumber BDD test on Android and getting a cucumber error org.picocontainer.PicoCompositionException: Either the specified parameters do not match any of the following constructors: [private java.lang.Class()]; OR the…
Emma
  • 8,518
  • 1
  • 18
  • 35
1
vote
2 answers

Error instantiating org.picocontainer.web.PicoServletContainerFilter

I'm green in Java development. I'm trying to use PicoContainer in a servlet application. I configured the container in the web.xml and it fails when it try to create the filter. So I tried to instantiate the filter manually like this: Class clazz…
Felice Pollano
  • 32,832
  • 9
  • 75
  • 115
1
vote
2 answers

Picocontainer 2.14.3 and AOP

I'm trying to use AOP with picocontainer. so far I found in the documentation: http://picocontainer.codehaus.org/interception.html pico = new DefaultPicoContainer(); pico.as(INTERCEPT).addComponent(Apple.class, BraeburnApple.class); and then…
RamonBoza
  • 8,898
  • 6
  • 36
  • 48
1
vote
1 answer

Setting up multiple decorators with pico container

I have been using the pico container in java to do DI for a minecraft plugin framework I designed. The plugins have event listener methods that are defined in interfaces, one method per interface. If a particular class wants events when players join…
0
votes
1 answer

Can PicoContainer caching be thread-safe?

Lost a bunch of time just trying to figure out what was going on here, but I think I'm finally onto something. We have some fairly normal PicoContainer code which simply turns on caching, which I thought was supposed to result in singleton…
Hakanai
  • 12,010
  • 10
  • 62
  • 132
0
votes
0 answers

How to use single instance of Selenium WebDriver in multiple java classes including hooks?

I want to use single instance of WebDriver across multiple classes. I have pageObject.java class that contains web elements and actions ex: click links, send value, etc. public class pageObject { private WebDriver driver; private BaseTest…