Return-Path: Delivered-To: apmail-ws-tuscany-user-archive@locus.apache.org Received: (qmail 41439 invoked from network); 19 Sep 2006 14:49:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Sep 2006 14:49:50 -0000 Received: (qmail 45391 invoked by uid 500); 19 Sep 2006 14:49:50 -0000 Delivered-To: apmail-ws-tuscany-user-archive@ws.apache.org Received: (qmail 45373 invoked by uid 500); 19 Sep 2006 14:49:50 -0000 Mailing-List: contact tuscany-user-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tuscany-user@ws.apache.org Delivered-To: mailing list tuscany-user@ws.apache.org Received: (qmail 45352 invoked by uid 99); 19 Sep 2006 14:49:50 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Sep 2006 07:49:49 -0700 Authentication-Results: idunn.apache.osuosl.org header.from=wise29@gmail.com; domainkeys=good X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=DNS_FROM_RFC_ABUSE,FROM_ENDS_IN_NUMS,HTML_40_50,HTML_MESSAGE,RCVD_BY_IP DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from ([66.249.92.174:47936] helo=ug-out-1314.google.com) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id EF/00-28275-78300154 for ; Tue, 19 Sep 2006 07:49:45 -0700 Received: by ug-out-1314.google.com with SMTP id j40so492339ugd for ; Tue, 19 Sep 2006 07:49:41 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=WgPLDUSt6ZTzeSHCLssgZIfoJsFQLGgHvHoTDIJNVMXklfSnGwpxKH+OrTqnxsca2P1you4STGDgk7Same11Pk3VJffqnDZVwQ6dNI5+44mK1aqxGpIo7BQeBxwSpUwNvPAIkUldOZRbxoiQn+r33A5b5UhV2oyVlM5D7fHnJrI= Received: by 10.67.105.19 with SMTP id h19mr7923658ugm; Tue, 19 Sep 2006 07:49:40 -0700 (PDT) Received: by 10.67.40.20 with HTTP; Tue, 19 Sep 2006 07:49:40 -0700 (PDT) Message-ID: Date: Tue, 19 Sep 2006 08:49:40 -0600 From: "Jon Lewis" To: tuscany-user@ws.apache.org Subject: Re: sample junit test case In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6813_29143325.1158677380738" References: <1F544C14-9341-424A-A26A-6609E141C73C@apache.org> <019001c6d77e$4895dd30$8c654c09@RFENGXP> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_6813_29143325.1158677380738 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Jeremy. I got a sample I created working using the command line working. I would like to get it working in a test case, but for now I can at least come up to speed on things without creating a full blown app... thanks again...and yeah, I'll get on the IRC chat sometime with questions. On 9/13/06, Jeremy Boynes wrote: > > 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" > > To: > > 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/ > >> > >> > >> > >> >> name="personnelsystem"> > >> > >> > >> > >> > >> > >> > >> > >> > >> my default.scdl in META-INF/sca/ > >> > >> > >> > >> >> name="personnelcomposite"> > >> > >> > >> > >> PersonnelServiceComponent > >> > >> > >> > >> > >> > >> > >> > >> > >> thx in advance! > >> > >> > >> > >> > >> On 9/5/06, Jon Lewis 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 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 > >>> > > > >>> > > > >>> > > >>> > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org > > For additional commands, e-mail: tuscany-user-help@ws.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org > For additional commands, e-mail: tuscany-user-help@ws.apache.org > > ------=_Part_6813_29143325.1158677380738--