On Thu, Jan 15, 2009 at 10:22 PM, Mathieu <[email protected]> wrote:
>
> 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.

Ok, I'll post my setup in an issue's list. Thanks.

In regard to inheritence. I was using a BaseTestClass for a

@BeforeMethod and @AfterMethod which would initialize a time and the
afterMethod would log the time it took.

I also put my logger initialization in the base class. Just one less
thing to always have to put in each class.

I'm sure some AOP stuff could help out but using a BaseTest class for
this simple stuff seems to work fine. I'm open for some other
approaches.

--~--~---------~--~----~------------~-------~--~----~
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