tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Lewis" <wis...@gmail.com>
Subject Re: sample junit test case
Date Thu, 07 Sep 2006 21:21:37 GMT
hi everyone,

    here's some more information that may help out.  I would really like to
get this working, so any/all help is welcome.  Right now it's failing on
launcher.bootApplication(...).   No stack is thrown...

from my TestCase

    protected void setUp() throws Exception {

        ClassLoader cl = getClass().getClassLoader();

        String applicationSCDL = "META-INF/tuscany/system.scdl";

        URL applicationScdlURL = cl.getResource(applicationSCDL);
        if (applicationScdlURL == null) {
            throw new RuntimeException("application SCDL not found: " +
applicationSCDL);
        }

        LauncherImpl launcher = new LauncherImpl();
        launcher.setApplicationLoader(cl);

        component = launcher.bootApplication("application",
applicationScdlURL);
        component.start();

        context = new CompositeContextImpl(component);
        context.start();

        personnelService = context.locateService(PersonnelService.class,
"PersonnelServiceComponent");
}

my system.scdl in META-INF/tuscany/

<?xml version="1.0" encoding="UTF-8"?>

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="personnelsystem">

    <component name="PersonnelComponent">
        <implementation.composite name="personnelcomposite"/>
    </component>

</composite>


my default.scdl in META-INF/sca/

<?xml version="1.0" encoding="UTF-8"?>

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
name="personnelcomposite">

    <service name="PersonnelService" >
        <interface.java interface="
org.myCompany.personnel.composite.PersonnelService"/>
        <reference>PersonnelServiceComponent</reference>
    </service>

    <component name="PersonnelServiceComponent">
        <implementation.java class="
org.myCompany.personnel.composite.PersonnelServiceImpl"/>
    </component>

</composite>

thx in advance!




On 9/5/06, Jon Lewis <wise29@gmail.com> wrote:
>
> hi all,
>
>    I tried a different approach in my setUp for my testCase.  It's failing
> on the call to launcher.bootApplication(...)
>
> protected void setUp() throws Exception {
>
>         ClassLoader cl = getClass().getClassLoader();
>
>         String applicationSCDL = "META-INF/sca/default.scdl";
>
>         URL applicationScdlURL = cl.getResource(applicationSCDL);
>
>         if (applicationScdlURL == null) {
>             throw new RuntimeException("application SCDL not found: " +
> applicationSCDL);
>         }
>
>         LauncherImpl launcher = new LauncherImpl();
>         launcher.setApplicationLoader(cl);
>
>         component = launcher.bootApplication("application",
> applicationScdlURL);
>         component.start();
>
>         context = new CompositeContextImpl(component);
>         context.start ();
>
> any and all help would be great, johnny
>
>
>
>
> On 9/5/06, Jon Lewis <wise29@gmail.com> wrote:
> >
> > hi Jeremy (and all)...
> >
> > thanks for the feedback.  I tried just using JUnit, but when I make the
> > call to:
> >
> > CompositeContext context = CurrentCompositeContext.getContext();
> >
> > the context is coming back null.  So, I'm assuming I need to do some
> > setup, but don't know everything I need to setup I guess...
> >
> > thanks Johnny
> >
> >
> >
> >
> > On 9/5/06, Jeremy Boynes < jboynes@apache.org> wrote:
> > >
> > > Jon,
> > >
> > > For unit testing application code you can use JUnit as normal (or any
> > > other framework such as TestNG) - perhaps using easymock or an
> > > alternative to mock out the services the code is using.
> > >
> > > If you want to do integration testing you could deploy the
> > > application to the runtime host and use an external framework such as
> > > httpunit.
> > >
> > > Or are you trying to do something else?
> > > --
> > > Jeremy
> > >
> > > On Sep 5, 2006, at 2:18 PM, Jon Lewis wrote:
> > >
> > > > hi All,
> > > >
> > > >   Is there a sample app that uses junit and a test case.   I've
> > > > looked at
> > > > the code in the repository and it looks like all the samples build
> > > > on the
> > > > SCATestCase and that's testing the code base.
> > > >
> > > > thanks in advance
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message