You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Kevin Williams <kj...@gmail.com> on 2007/04/27 20:40:23 UTC

New ComponentContextTestCase

I'd like to add a new iTest class for testing ComponentContext and
associated APIs.  I was thinking to start simple with something like this:

public class ComponentContextTestCase extends TestCase {

    public void testCreateSelfReference() {

        ComponentContext context =
SCARuntime.getComponentContext("MyService");

        ServiceReference<MyService> service = context.createSelfReference(
MyService.class);
        MyService myService = service.getService();

        assertNotNull(myService);
        assertEquals("RTP", myService.getLocation());
        assertEquals("2006", myService.getYear());

    }

    protected void setUp() throws Exception {
        SCARuntime.start("CompositeTest.composite");
   }

    protected void tearDown() throws Exception {
        SCARuntime.stop();
    }
}

Does this sound OK?

Thanks,
--Kevin

Re: New ComponentContextTestCase

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Kevin Williams wrote:
> I'd like to add a new iTest class for testing ComponentContext and
> associated APIs.  I was thinking to start simple with something like 
> this:
>
> public class ComponentContextTestCase extends TestCase {
>
>    public void testCreateSelfReference() {
>
>        ComponentContext context =
> SCARuntime.getComponentContext("MyService");
>
>        ServiceReference<MyService> service = context.createSelfReference(
> MyService.class);
>        MyService myService = service.getService();
>
>        assertNotNull(myService);
>        assertEquals("RTP", myService.getLocation());
>        assertEquals("2006", myService.getYear());
>
>    }
>
>    protected void setUp() throws Exception {
>        SCARuntime.start("CompositeTest.composite");
>   }
>
>    protected void tearDown() throws Exception {
>        SCARuntime.stop();
>    }
> }
>
> Does this sound OK?
>
> Thanks,
> --Kevin
>

It looks OK to me. Thanks Kevin.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org