Nandish MC
2017-02-27 02:45:39 UTC
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
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
--
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/5da962c5-74da-466d-b96f-53cb647a0eb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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/5da962c5-74da-466d-b96f-53cb647a0eb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.