I have multiple hierarchical class like below
public abstract class Page extends SelPage
{
public method 1{}
public method 2{}
public method 3{}
}
Class DashboardPage extens Class Page{
{ }
Here I need to bind new Page class
Class ProjPage extends Page{
public method1{} /* change method implementation /
public method 2{} / change method implementation /
public method 3{} / change method implementation */
}
public class ProjSeleniumSuite extends SeleniumSuite {
private static Injector injector;
@BeforeClass
public static void setUp() throws Exception {
injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
System.out.println("configuriung");
bind(Page.class).to(ProjPage.class);
}
});
}
@AfterClass
public static void tearDown() throws Exception {
injector = null;
}
}
The above code runs fine..but it is not binding the Page class method implementation with ProjPage class methods
Can i achieve this using Guice binder like above?
The thing i need to achieve is, when i instantiate DashboardPage , i want ProjPage methods to be called instead of Page class methods.
Please help
I see in you code how you construct the injector. But I never see
you making use of it.
I am not familiar with the Selenium library. Does it make use of
the injector in the SeleniumTest.getCurrentPage() method?
I rather doubt that Selenium will use you injector. So where do
you use the injector?
-- You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice...@googlegroups.com. To post to this group, send email to google...@googlegroups.com. Visit this group at https://groups.google.com/group/google-guice. To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/43253ec2-1e7e-401d-99dd-d429f2d14a0d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "google-guice" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-guice/Kema1MvYHtg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-guice...@googlegroups.com.
To post to this group, send email to google...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/34fec307-4722-c48f-ff44-343de6609986%40gmx.ch.
I guess you could do i the following way:
1. make the static injector field on SeleniumSuite public (or package private if all classes reside in the same package)
2. change the following implementation
-- You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice...@googlegroups.com. To post to this group, send email to google...@googlegroups.com. Visit this group at https://groups.google.com/group/google-guice. To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/4613CA3C-987E-4252-A597-141D2AB0D827%40gmail.com. For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/123018ac-eebc-31c1-d2bb-0b1672daa7ea%40gmx.ch.