Return-Path: X-Original-To: apmail-deltaspike-users-archive@www.apache.org Delivered-To: apmail-deltaspike-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BF96710517 for ; Wed, 2 Apr 2014 13:10:26 +0000 (UTC) Received: (qmail 37815 invoked by uid 500); 2 Apr 2014 13:10:26 -0000 Delivered-To: apmail-deltaspike-users-archive@deltaspike.apache.org Received: (qmail 37662 invoked by uid 500); 2 Apr 2014 13:10:22 -0000 Mailing-List: contact users-help@deltaspike.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@deltaspike.apache.org Delivered-To: mailing list users@deltaspike.apache.org Received: (qmail 37645 invoked by uid 99); 2 Apr 2014 13:10:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2014 13:10:20 +0000 X-ASF-Spam-Status: No, hits=0.3 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of rainer.schoen.dev@gmail.com does not designate 195.186.227.120 as permitted sender) Received: from [195.186.227.120] (HELO zhhdzmsp-mail12.bluewin.ch) (195.186.227.120) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2014 13:10:15 +0000 X-Bluewin-Spam-Analysis: v=2.1 cv=IsSpqwnZ c=1 sm=1 tr=0 a=my+udvXS7DXl2hH9ai9izQ==:117 a=my+udvXS7DXl2hH9ai9izQ==:17 a=Tvs_GUuyyx4A:10 a=J27fRkxr0BEA:10 a=nDghuxUhq_wA:10 a=pGLkceISAAAA:8 a=r77TgQKjGQsHNAKrUKIA:9 a=9iDbn-4jx3cA:10 a=cKsnjEOsciEA:10 a=WxdmwFMlAAAA:8 a=7WYPZrkXDIfFssM_42QA:9 a=wPNLvfGTeEIA:10 a=MSl-tDqOz04A:10 a=eLVGBTXJHEhCgrxNzyoA:9 a=IKIoO-ieCDEA:10 X-FXIT-IP: 178.194.5.71 Received: from [178.194.5.71] ([178.194.5.71:52120] helo=[192.168.1.33]) by zhhdzmsp-mail12.bluewin.ch (envelope-from ) (ecelerity 3.5.8.41051 r(Platform:3.5.8.0)) with ESMTP id D4/E2-26804-12C0C335; Wed, 02 Apr 2014 13:09:53 +0000 Message-ID: <533C0C22.3080408@gmail.com> Date: Wed, 02 Apr 2014 15:09:54 +0200 From: =?ISO-8859-1?Q?Rainer_Sch=F6n?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: users@deltaspike.apache.org Subject: TestControl Module - ConversationScope - Demo References: <533BC1BB.1000300@gmail.com> <533BD0B8.3010105@gmail.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------010407040905070905000207" X-Virus-Checked: Checked by ClamAV on apache.org --------------010407040905070905000207 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Dear Gerhard Unfortunately I have no possibility to make a demo publicly available but= I set up a tiny eclipse demo project that shows the (maven) setup and re= produces the error. I hardly can imagine why this should work in your env= ironment and not in mine. But maybe I have missed something. Let me know.= Regards, Rainer Am 02.04.2014 11:29, schrieb Gerhard Petracek: > hi rainer, > > it would be great if you can provide a link to a demo which illustrates= the > issue (with my demo-setup the workaround works fine). > > regards, > gerhard > > http://www.irian.at > > Your JSF/JavaEE powerhouse - > JavaEE Consulting, Development and > Courses in English and German > > Professional Support for Apache MyFaces > > > > 2014-04-02 10:56 GMT+02:00 Rainer Sch=F6n = : > >> Hi Gerhard >> >> Unfortunately your solution does not work neither (I tried it already >> before posting the mail). When I start Weld SE myself (no CdiTestRunne= r) in >> the BeforeClass method, it works fine with all scopes, but then I loos= e the >> comfort of having injection service into the UnitTest file and must do= this >> manually by means of the DS BeanProvider. >> >> I will create a jira-ticket for this. >> >> By the way, +1 for this module as soon as this scope works. It saves = me a >> lot of the more time consuming and sometimes cumbersome deployments of= >> Arquillian tests. >> >> Thanks for your assistance. >> Rainer >> >> Am 02.04.2014 10:10, schrieb Gerhard Petracek: >> >> hi rainer, >>> >>> it looks like a restriction with weld (it works fine with owb) -> ple= ase >>> create a jira-ticket for it. >>> >>> for now you can use: @TestControl(startScopes =3D {RequestScoped.clas= s, >>> SessionScoped.class, ConversationScoped.class}) >>> (for every test method) >>> >>> regards, >>> gerhard >>> >>> http://www.irian.at >>> >>> Your JSF/JavaEE powerhouse - >>> JavaEE Consulting, Development and >>> Courses in English and German >>> >>> Professional Support for Apache MyFaces >>> >>> >>> >>> 2014-04-02 9:52 GMT+02:00 Rainer Sch=F6n : >>> >>> Hi all >>>> >>>> When I inject a ConversationScoped bean into the test, I get the >>>> following >>>> error (Deltapsike 0.6, Weld SE 2.1.1 JUnit 4.11): >>>> >>>> Apr 01, 2014 11:19:37 PM org.apache.deltaspike.testcontrol.api.junit= =2E >>>> CdiTestRunner$ContainerAwareTestContext startScopes >>>> SEVERE: failed to start scope @javax.enterprise.context. >>>> ConversationScoped >>>> java.lang.NullPointerException >>>> at org.jboss.weld.context.bound.BoundConversationContextIm= pl. >>>> setRequestAttribute(BoundConversationContextImpl.java:29) >>>> at org.jboss.weld.context.bound.BoundConversationContextIm= pl. >>>> setRequestAttribute(BoundConversationContextImpl.java:10) >>>> at org.jboss.weld.context.AbstractConversationContext. >>>> associate( >>>> AbstractConversationContext.java:134) >>>> at org.apache.deltaspike.cdise.weld.ContextController. >>>> startConversationScope(ContextController.java:122) >>>> at org.apache.deltaspike.cdise.weld.WeldContextControl. >>>> startConversationScope(WeldContextControl.java:149) >>>> at org.apache.deltaspike.cdise.weld.WeldContextControl. >>>> startContext(WeldContextControl.java:74) >>>> at org.apache.deltaspike.testcontrol.api.junit.CdiTestRunn= er$ >>>> ContainerAwareTestContext.startScopes(CdiTestRunner.java:595) >>>> at org.apache.deltaspike.testcontrol.api.junit.CdiTestRunn= er$ >>>> ContainerAwareTestContext.applyBeforeClassConfig(CdiTestRunner.java:= 462) >>>> at org.apache.deltaspike.testcontrol.api.junit.CdiTestRunn= er$ >>>> BeforeClassStatement.evaluate(CdiTestRunner.java:347) >>>> at org.junit.internal.runners.statements.RunAfters.evaluat= e( >>>> RunAfters.java:27) >>>> at org.apache.deltaspike.testcontrol.api.junit.CdiTestRunn= er$ >>>> AfterClassStatement.evaluate(CdiTestRunner.java:374) >>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:30= 9) >>>> at org.apache.deltaspike.testcontrol.api.junit. >>>> CdiTestRunner.run( >>>> CdiTestRunner.java:129) >>>> at org.eclipse.jdt.internal.junit4.runner. >>>> JUnit4TestReference.run( >>>> JUnit4TestReference.java:50) >>>> at org.eclipse.jdt.internal.junit.runner.TestExecution. >>>> run(TestExecution.java:38) >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.= >>>> runTests(RemoteTestRunner.java:467) >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.= >>>> runTests(RemoteTestRunner.java:683) >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.= >>>> run(RemoteTestRunner.java:390) >>>> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.= >>>> main(RemoteTestRunner.java:197) >>>> >>>> My test set up: >>>> >>>> @FixMethodOrder(MethodSorters.NAME_ASCENDING) >>>> @RunWith(CdiTestRunner.class) >>>> @TestControl(startScopes =3D {ConversationScoped.class}) >>>> public class PubliOrderManagerTest ... >>>> >>>> @Inject >>>> private ManagerBean mgr; // the ConversationScoped bean >>>> >>>> @Inject >>>> private Conversation conversation; >>>> >>>> >>>> @Test >>>> public void A_testLookupItems() { >>>> conversation.begin(); >>>> ... >>>> >>>> @Test >>>> public void Z_testRemove() { >>>> conversation.end(); >>>> ... >>>> >>>> >>>> What am I doing wrong? Any help appreciated. >>>> >>>> Rainer >>>> >>>> >>> >> > --------------010407040905070905000207--