Return-Path: Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: (qmail 48156 invoked from network); 27 Jan 2011 20:07:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2011 20:07:24 -0000 Received: (qmail 11906 invoked by uid 500); 27 Jan 2011 20:07:24 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 11811 invoked by uid 500); 27 Jan 2011 20:07:23 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 11799 invoked by uid 99); 27 Jan 2011 20:07:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jan 2011 20:07:23 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tkanstren@gmail.com designates 209.85.216.170 as permitted sender) Received: from [209.85.216.170] (HELO mail-qy0-f170.google.com) (209.85.216.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jan 2011 20:07:17 +0000 Received: by qyk10 with SMTP id 10so7212qyk.1 for ; Thu, 27 Jan 2011 12:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=zn/Zc/IqQexsV1t/g6Wq17aHJphGqVD0Wolwf4YyBK0=; b=oMtGz5hUfoV9szO29rYKZsr/Xm2ZFqy0VqrBajoE4y9oCcLpEBXUK3qXGYYKP3hsTP rIgbPdk8mVUhSBSDO6MmnpXoeou03EJfkQSTeWcUZ0gv3EY+IFpfE4B2JtiWiK/18Krc XxnR6RfxAT+D6NqfEt5J4IVQzP7Df+yNKFwo8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=moPgTsLGm0TK+EFRQVAU0FyEoyijNHGFy23rM0pygEEak2beYYuVRxJ6Unh1mVYj3w C/ffK5rYednFffltg/vKkbvp4mtiTAp4HqWfDmUqfOssvAJhiehNVGL3ETB5WwrDvgPQ IG7BsUyt7FSbKz+WyAndYmefD1JMHI1i5/M4I= MIME-Version: 1.0 Received: by 10.229.99.130 with SMTP id u2mr1986086qcn.87.1296158815811; Thu, 27 Jan 2011 12:06:55 -0800 (PST) Received: by 10.220.165.206 with HTTP; Thu, 27 Jan 2011 12:06:55 -0800 (PST) In-Reply-To: References: <6C038E686DC4D648A881B4634A58E59D38CB9EC7C2@EXMB1.corp.westell.com> Date: Thu, 27 Jan 2011 22:06:55 +0200 Message-ID: Subject: Re: JUnit in Felix OSGI From: teemu kanstren To: users@felix.apache.org Content-Type: multipart/alternative; boundary=0016363b845cc9f83b049ad97d46 X-Virus-Checked: Checked by ClamAV on apache.org --0016363b845cc9f83b049ad97d46 Content-Type: text/plain; charset=ISO-8859-1 Yes, my terminology might have been confusing. My approach is usually to test using JUnit -smaller units (class/method combinations) separate from any bundles, -several of my bundles together using a simple mock BundleContext, -integration with the environment (Felix, external bundles) using a programmatic setup of Felix and programmatic control of Felix/access to bundlecontext, etc. I never could figure out why I would want to use Pax, it just always seemed complex and I could not figure why I would need it. But I think that is up to preferences. I understand I am also "stuck in the past" in the sense that I strongly prefer Ant over Maven :). I just prefer to understand what is going on in my runtime system and build environment and have the tool adapt to me rather than the other way around. But enough about that. I guess this is to say that different options are available but the choice depends.. Teemu 2011/1/27 Toni Menzel > Well don't confuse unit testing with integration test with system testing. > and others. > Its a different level of testing. > > On Thu, Jan 27, 2011 at 3:25 PM, teemu kanstren > wrote: > > > And why do you wish to run your unit tests inside the container? I find > it > > much nicer and cleaner to run everything outside it until I really need > to > > mess with the container.. > > > > 2011/1/25 Justin Edelson > > > > > Have you looked at Pax Exam? > > > > > > On Jan 24, 2011, at 4:50 PM, Bruce Hartman > wrote: > > > > > > > Hi, I'm new to OSGI in general. I have a question, and will > appreciate > > > any or all of your suggestions. I realize that I may need answers to > > > questions I haven't even asked yet. Here's the background. > > > > > > > > I am creating a BundleActivator in Eclipse, adding my own code to it, > > and > > > am exporting as a bundle to the bundle directory in my Felix > > installation. > > > I am doing this in Ubuntu Linux. This is all working well. I can > > install > > > and run my bundle. Just to be complete, here's a list of bundles I am > > > running (minus my bundle): > > > > > > > > g! lb > > > > START LEVEL 1 > > > > ID|State |Level|Name > > > > 0|Active | 0|System Bundle (3.0.6) > > > > 1|Active | 1|Apache Felix Bundle Repository (1.6.2) > > > > 2|Active | 1|Apache Felix Configuration Admin Service > (1.2.8) > > > > 3|Active | 1|Apache Felix Gogo Command (0.6.1) > > > > 4|Active | 1|Apache Felix Gogo Runtime (0.6.1) > > > > 5|Active | 1|Apache Felix Gogo Shell (0.6.1) > > > > 6|Active | 1|Apache Felix Http Bundle (2.0.4) > > > > 7|Active | 1|Apache Felix Http Jetty (2.0.4) > > > > 8|Active | 1|Apache Felix Log Service (1.0.0) > > > > 9|Active | 1|Apache Felix Web Management Console (3.1.6) > > > > 10|Active | 1|OSGi R4 Compendium Bundle (4.1.0) > > > > > > > > Now, I would like to add and run JUnit tests on my bundle. > > > > > > > > I downloaded the JUnit 4 jar, included it in my Eclipse project, and > > > don't have any problems creating and running tests in Eclipse. > > > > > > > > Here's where I start having a problem. When I look online to find > out > > > how to run JUnit tests inside the Felix framework, the only > instructions > > I > > > can find is how to do it with all the IPOJO bundles. I'm not using the > > > IPOJO stuff, and really don't want to include those bundles in my > > deployment > > > if I can get away with not doing it. > > > > > > > > Am I missing something? I imagine that running JUnit tests on my > > bundle > > > inside the Felix framework would be easy. Yet, I am having trouble > > figuring > > > out how to do it. > > > > > > > > Question 1: Do I need the IPOJO bundles to run JUnit tests in Felix? > > > > Question 2: If not, how do I run JUnit tests on a bundle? > > > > Question 3: If questions #1's answer is I do need the IPOJO stuff, > do > > > you have any advise as to what I should look at? I tried adding the > > bundles > > > I thought I needed, and trying to execute "junit 2", but it says that > the > > > junit command is not available. > > > > > > > > Thanks in advance for your answers. > > > > > > > > > > > > > > > > > > > > > > *************************************************************************************** > > > > This e-mail and its attachments are a private communication sent from > > > Westell Technologies, Inc., > > > > a telecommunications company. Its contents may contain confidential > > and > > > proprietary information that is protected. > > > > If you are not the intended recipient, you are hereby notified that > any > > > disclosure, copying, distribution or use of the > > > > information contained in or attached to this message is strictly > > > prohibited. If you have received this e-mail in error, > > > > please notify the sender by replying to this message, and then delete > > it > > > from your system. Thank you. > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > > > For additional commands, e-mail: users-help@felix.apache.org > > > > > > > > > > > > -- > *Toni Menzel - http://www.okidokiteam.com* > --0016363b845cc9f83b049ad97d46--