Return-Path: Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: (qmail 56960 invoked from network); 27 Jan 2011 20:27:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2011 20:27:25 -0000 Received: (qmail 57202 invoked by uid 500); 27 Jan 2011 20:27:24 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 57160 invoked by uid 500); 27 Jan 2011 20:27:24 -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 57149 invoked by uid 99); 27 Jan 2011 20:27:24 -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:27:24 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mvangeertruy@comcast.net designates 76.96.59.211 as permitted sender) Received: from [76.96.59.211] (HELO QMTA11.westchester.pa.mail.comcast.net) (76.96.59.211) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jan 2011 20:27:15 +0000 Received: from omta05.westchester.pa.mail.comcast.net ([76.96.62.43]) by QMTA11.westchester.pa.mail.comcast.net with comcast id 0kSd1g0060vyq2s5BkSukh; Thu, 27 Jan 2011 20:26:54 +0000 Received: from sz0116.wc.mail.comcast.net ([76.96.58.178]) by omta05.westchester.pa.mail.comcast.net with comcast id 0kSu1g0153qjNpo3RkSu7c; Thu, 27 Jan 2011 20:26:54 +0000 Date: Thu, 27 Jan 2011 20:26:54 +0000 (UTC) From: mvangeertruy@comcast.net To: users@felix.apache.org Message-ID: <1074772033.1993885.1296160014279.JavaMail.root@sz0116a.westchester.pa.mail.comcast.net> In-Reply-To: Subject: Re: JUnit in Felix OSGI MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1993884_69061459.1296160014278" X-Originating-IP: [173.66.100.57] X-Mailer: Zimbra 6.0.5_GA_2431.RHEL5_64 (ZimbraWebClient - IE8 (Win)/6.0.5_GA_2427.RHEL4) X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_1993884_69061459.1296160014278 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Teemu,=20 On my project, we use JUnit to test code outside of Karaf to ensure it work= s before deploying into OSGi.=C2=A0 Then we deploy our junit-passed bundles= into Karaf and the exercise them using test-harnesses.=C2=A0 The test harn= esses simply write data to whichever camel-endpoints the bundles consume da= ta from, and then looks on the camel-endpoints the bundles write to for the= appropriate output.=C2=A0=20 This works for us because my project is mostly back-end data processing wit= h very little gui interaction.=C2=A0 If your project is similar to this, yo= u may want to also use this approach.=C2=A0=20 ----- Original Message -----=20 From: "teemu kanstren" =20 To: users@felix.apache.org=20 Sent: Thursday, January 27, 2011 3:06:55 PM=20 Subject: Re: JUnit in Felix OSGI=20 Yes, my terminology might have been confusing.=20 My approach is usually to test using JUnit=20 -smaller units (class/method combinations) separate from any bundles,=20 -several of my bundles together using a simple mock BundleContext,=20 -integration with the environment (Felix, external bundles) using a=20 programmatic setup of Felix and programmatic control of Felix/access to=20 bundlecontext, etc.=20 I never could figure out why I would want to use Pax, it just always seemed= =20 complex and I could not figure why I would need it. But I think that is up= =20 to preferences. I understand I am also "stuck in the past" in the sense tha= t=20 I strongly prefer Ant over Maven :). I just prefer to understand what is=20 going on in my runtime system and build environment and have the tool adapt= =20 to me rather than the other way around. But enough about that. I guess this= =20 is to say that different options are available but the choice depends..=20 Teemu=20 2011/1/27 Toni Menzel =20 > Well don't confuse unit testing with integration test with system testing= .=20 > and others.=20 > Its a different level of testing.=20 >=20 > On Thu, Jan 27, 2011 at 3:25 PM, teemu kanstren =20 > wrote:=20 >=20 > > And why do you wish to run your unit tests inside the container? I find= =20 > it=20 > > much nicer and cleaner to run everything outside it until I really need= =20 > to=20 > > mess with the container..=20 > >=20 > > 2011/1/25 Justin Edelson =20 > >=20 > > > Have you looked at Pax Exam?=20 > > >=20 > > > On Jan 24, 2011, at 4:50 PM, Bruce Hartman =20 > wrote:=20 > > >=20 > > > > Hi, I'm new to OSGI in general. =C2=A0I have a question, and will= =20 > appreciate=20 > > > any or all of your suggestions. =C2=A0I realize that I may need answe= rs to=20 > > > questions I haven't even asked yet. =C2=A0Here's the background.=20 > > > >=20 > > > > I am creating a BundleActivator in Eclipse, adding my own code to i= t,=20 > > and=20 > > > am exporting as a bundle to the bundle directory in my Felix=20 > > installation.=20 > > > =C2=A0I am doing this in Ubuntu Linux. =C2=A0This is all working well= . =C2=A0I can=20 > > install=20 > > > and run my bundle. =C2=A0Just to be complete, here's a list of bundle= s I am=20 > > > running (minus my bundle):=20 > > > >=20 > > > > g! lb=20 > > > > START LEVEL 1=20 > > > > =C2=A0 ID|State =C2=A0 =C2=A0 =C2=A0|Level|Name=20 > > > > =C2=A0 =C2=A00|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A00|System Bundle = (3.0.6)=20 > > > > =C2=A0 =C2=A01|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A01|Apache Felix B= undle Repository (1.6.2)=20 > > > > =C2=A0 =C2=A02|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A01|Apache Felix C= onfiguration Admin Service=20 > (1.2.8)=20 > > > > =C2=A0 =C2=A03|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A01|Apache Felix G= ogo Command (0.6.1)=20 > > > > =C2=A0 =C2=A04|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A01|Apache Felix G= ogo Runtime (0.6.1)=20 > > > > =C2=A0 =C2=A05|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A01|Apache Felix G= ogo Shell (0.6.1)=20 > > > > =C2=A0 =C2=A06|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A01|Apache Felix H= ttp Bundle (2.0.4)=20 > > > > =C2=A0 =C2=A07|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A01|Apache Felix H= ttp Jetty (2.0.4)=20 > > > > =C2=A0 =C2=A08|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A01|Apache Felix L= og Service (1.0.0)=20 > > > > =C2=A0 =C2=A09|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A01|Apache Felix W= eb Management Console (3.1.6)=20 > > > > =C2=A0 10|Active =C2=A0 =C2=A0 | =C2=A0 =C2=A01|OSGi R4 Compendium = Bundle (4.1.0)=20 > > > >=20 > > > > Now, I would like to add and run JUnit tests on my bundle.=20 > > > >=20 > > > > I downloaded the JUnit 4 jar, included it in my Eclipse project, an= d=20 > > > don't have any problems creating and running tests in Eclipse.=20 > > > >=20 > > > > Here's where I start having a problem. =C2=A0When I look online to = find=20 > out=20 > > > how to run JUnit tests inside the Felix framework, the only=20 > instructions=20 > > I=20 > > > can find is how to do it with all the IPOJO bundles. =C2=A0I'm not us= ing the=20 > > > IPOJO stuff, and really don't want to include those bundles in my=20 > > deployment=20 > > > if I can get away with not doing it.=20 > > > >=20 > > > > Am I missing something? =C2=A0I imagine that running JUnit tests on= my=20 > > bundle=20 > > > inside the Felix framework would be easy. =C2=A0Yet, I am having trou= ble=20 > > figuring=20 > > > out how to do it.=20 > > > >=20 > > > > Question 1: =C2=A0Do I need the IPOJO bundles to run JUnit tests in= Felix?=20 > > > > Question 2: =C2=A0If not, how do I run JUnit tests on a bundle?=20 > > > > Question 3: =C2=A0If questions #1's answer is I do need the IPOJO s= tuff,=20 > do=20 > > > you have any advise as to what I should look at? =C2=A0I tried adding= the=20 > > bundles=20 > > > I thought I needed, and trying to execute "junit 2", but it says that= =20 > the=20 > > > junit command is not available.=20 > > > >=20 > > > > Thanks in advance for your answers.=20 > > > >=20 > > > >=20 > > > >=20 > > > >=20 > > >=20 > >=20 > *************************************************************************= **************=20 > > > > This e-mail and its attachments are a private communication sent fr= om=20 > > > Westell Technologies, Inc.,=20 > > > > a telecommunications company. =C2=A0Its contents may contain confid= ential=20 > > and=20 > > > proprietary information that is protected.=20 > > > > If you are not the intended recipient, you are hereby notified that= =20 > any=20 > > > disclosure, copying, distribution or use of the=20 > > > > information contained in or attached to this message is strictly=20 > > > prohibited. =C2=A0If you have received this e-mail in error,=20 > > > > please notify the sender by replying to this message, and then dele= te=20 > > it=20 > > > from your system. =C2=A0Thank you.=20 > > >=20 > > > ---------------------------------------------------------------------= =20 > > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org=20 > > > For additional commands, e-mail: users-help@felix.apache.org=20 > > >=20 > > >=20 > >=20 >=20 >=20 >=20 > --=20 > *Toni Menzel - http://www.okidokiteam.com*=20 >=20 ------=_Part_1993884_69061459.1296160014278--