Factory Madness Attempt 2

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Factory Madness Attempt 2

Joe DeSantis
Attempting to implement factories and guice together.


@org.testng.annotations.Guice(modules=ActorObtainableModule.class)
public class VanityUrlFactory {

private GuiceFactory guiceFactory;

// public interface GuiceFactory {
// VanityUrl create(TestingUrl url, boolean useOfferCode, String realCpc);
// }

// @Inject
// public VanityUrl(@Assisted TestingUrl url, @Assisted boolean useOfferCode, @Assisted String realCpc, FunnelActor actor) {

@Inject
VanityUrlFactory(GuiceFactory guiceFactory){
this.guiceFactory = guiceFactory;
}

@Factory
// @Inject
public Object[] factoryMethod() {
System.out.println(guiceFactory);
return new Object[]{
// No offer code tests
guiceFactory.create(TestingUrl.VANITYQUICK, false, "ebf93e"),
guiceFactory.create(TestingUrl.VANITYFAST, false, "c47385")
};
}
}

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.