Return-Path: Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: (qmail 46780 invoked from network); 13 Feb 2011 09:30:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Feb 2011 09:30:04 -0000 Received: (qmail 93911 invoked by uid 500); 13 Feb 2011 09:30:04 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 93526 invoked by uid 500); 13 Feb 2011 09:30:01 -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 93505 invoked by uid 99); 13 Feb 2011 09:30:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Feb 2011 09:30:00 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of clement.escoffier@gmail.com designates 209.85.161.49 as permitted sender) Received: from [209.85.161.49] (HELO mail-fx0-f49.google.com) (209.85.161.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Feb 2011 09:29:50 +0000 Received: by fxm19 with SMTP id 19so4540228fxm.22 for ; Sun, 13 Feb 2011 01:29:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:message-id :thread-topic:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=llAEly8s5NRKwM8KyyyynbHYWaHengZSxgeAxAm3GHQ=; b=u2/aZgpeBcdXhdhu8TB3mm8/v4A7OrXzGZ47o/rzcKt1WuNIEpMAFXHBYui+GJ+nNv kWJKf3OudzZJqa/yxz1tOwX/WxwPbW7Cf1lHaO1wiRsjpma+nzd4ZNl5nR9SLGPcnUd1 TQTDM3senjJKszlna9jznYSgLb+jMmDULqhTc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic:in-reply-to :mime-version:content-type:content-transfer-encoding; b=Wp8GoELXzFTaWBxOBeksIJ8lvygOj70C1DLWv4O3R7mlgkj3rwmoh7ScPUQ9t7+xHj r9n5s4Tw5WBeBnlKsEt7SyhblpgaFzFZbHulfkyJkJbkuKr/zdEjnXF0OXPTmvz1Z7yg 26VoG7+ld7Za9c2B3ZhE45VuEk42P2JWXhwSo= Received: by 10.223.97.78 with SMTP id k14mr2950815fan.89.1297589370380; Sun, 13 Feb 2011 01:29:30 -0800 (PST) Received: from [192.168.0.196] (91-65-155-240-dynip.superkabel.de [91.65.155.240]) by mx.google.com with ESMTPS id r24sm500110fax.27.2011.02.13.01.29.24 (version=SSLv3 cipher=OTHER); Sun, 13 Feb 2011 01:29:28 -0800 (PST) User-Agent: Microsoft-MacOutlook/14.1.0.101012 Date: Sun, 13 Feb 2011 10:29:14 +0100 Subject: Re: Test plugin From: Clement Escoffier To: Apache Felix - Users Mailing List Message-ID: Thread-Topic: Test plugin In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, You need to initialize the iPOJO Helper in the setUp method: helper = new IPOJOHelper(this); This is really important as it's how the helper get the bundle context. Moreover, in the tearDown method it is recommended to dispose the helper: helper.dispose(); The disposal deletes all the instances created using the helper, release services... Regards, Clement On 12.02.11 21:38, "Pierre Henry Perret" wrote: >Hi all, > >I have a junis4osgi test plugin running and that one returns a NPE when >trying accessing the context. >I have made as explained in the tutorial junit4osgi: created a plugin >separate test alon with the bundle to test. >my config is that one: >______________________________ > > org.apache.felix > maven-bundle-plugin > true > > > services.osgi > > ${project.artifactId} > > > services.osgi.StructuralInformationServicesTest > > > > > >org.apache.felix >maven-junit4osgi-plugin > > > >test > > >false > > > > >____________________________________________________ > >Test reports that the iPOJO helper m_context is null ...?! > >I think I havent configured well the test... > >-- >Pierre --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org For additional commands, e-mail: users-help@felix.apache.org