Raymond, folk should not normally need to mess with system scdl, with
the known defect that SCATestCase needs you to mess with this stuff
to start adding in extensions.
Jon, have you had a look at the calculator sample? The test case in
there at
https://svn.apache.org/repos/asf/incubator/tuscany/java/samples/sca/
calculator/src/test/java/calculator/CalculatorTestCase.java
shows how to get a simple composite loaded and running - we look for
a default SCDL file at META-INF/sca/default.scdl
https://svn.apache.org/repos/asf/incubator/tuscany/java/samples/sca/
calculator/src/main/resources/META-INF/sca/default.scdl
For the calculator, this is a single composite with the application
components in it. If you have a more complex structure (includes,
composite implementations for example) that should work but I would
suggest getting something simple to work first.
I hope this works for you - please don't give up on us quite yet :)
If you can jump on IRC we can help you debug any environment stuff.
--
Jeremy
On Sep 13, 2006, at 2:47 PM, Raymond Feng wrote:
Hi,
It seems that you're using a wrong "system.scdl". The system.scdl
is meant to be the one declaring all the runtime components for the
Tuscany runtime (we use SCA components to build the container). You
can get a copy from the "test/src/main/resources/META-INF/tuscany/
system.scdl".
Thanks,
Raymond
----- Original Message ----- From: "Jon Lewis" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, September 07, 2006 2:21 PM
Subject: Re: sample junit test case
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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 < [EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]