Hi,

I don't know how you setup your environment, but this usage has been
tested and works well: In example:

@GuiceContext(AModule.class)
public final class ExtendTest extends AbstractMycilaTestNGTest {
    @Inject
    @Named("service1")
    Service service1;
    @Test
    public void test_inject() {
        assertEquals(service1.go(), "go1");
    }
}

If you need some help, i suggest you post fore information on your
setup and the libraries you are using on your classpath at
http://code.google.com/p/mycila/issues/list so that we can help you.
Nevertheless, i hardly advise to not use inheritance even for test
classes since it leads to junk classes having an accumulation of
methods which leads to tests that are time consuming to maintain.
There are plenty of ways to avoid that, static methods, delegation and
annotations are some.

Thank you !

On Jan 15, 8:40 pm, Rick <[email protected]> wrote:
> In case anyone else searches the list for tenstng solutions, I found
> this approach to work 
> great.http://asemantics.dyndns.org/m2doc/com.asemantics/testnguice/1.0/inje...
>  (I'm using this now instead of mycila.)
>
> Just make sure your factory class is listed first and it runs great
> (the document above has a typo in the class name or the name has since
> changed since that was written... the class is AbstractObjectFactory
> not AbstractTestObjectFactory.)
>
>
>
> On Thu, Jan 15, 2009 at 5:59 PM, Rick <[email protected]> wrote:
> > I'm asking here for lack of a better list and for any other recommendations.
>
> > I'm trying to use mycilia for testing and according to  the testng
> > example herehttp://code.mycila.com/wiki/MycilaTestingI should be
> > able to just extend AbstractMycilaTestNGTest and annotate with my
> > GuiceContext However that abstract class doesn't seem to help me,
> > instead I have to use the other approarch shown in each of my test
> > classes:
>
> > @BeforeClass
> >    public void setup() {
> >        TestSetup.setup(this);
> >    }
>
> > I was hoping I could just have all my classes extend a BaseTest class
> > which extends AbstractMycilaTestNGTest and everything would be fine,
> > but it's not working for me (None of my Injections take place nor do I
> > see my Module even loaded.)
>
> > I was hoping to just extends my tests from:
>
> > @GuiceContext(OndpServicesTestModule.class)
> > public abstract class BaseTest extends AbstractMycilaTestNGTest {
>
> > }
>
> > (As a side note even when I push up the @BeforeClass implementation
> > into this base class, things aren't working. It seems odd that I have
> > to actually use the @BeforeClass setUp method in my actual concrete
> > Test classes and not in the BaseTest class?)
>
> > I'm hopefully missing something very simple, but I'm stumped right now.
>
> --
> Rick
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to