Return-Path: Delivered-To: apmail-jakarta-cactus-user-archive@www.apache.org Received: (qmail 95050 invoked from network); 8 Jan 2009 22:20:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jan 2009 22:20:49 -0000 Received: (qmail 28713 invoked by uid 500); 8 Jan 2009 22:20:48 -0000 Delivered-To: apmail-jakarta-cactus-user-archive@jakarta.apache.org Received: (qmail 28698 invoked by uid 500); 8 Jan 2009 22:20:48 -0000 Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Cactus Users List" Reply-To: "Cactus Users List" Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 28687 invoked by uid 99); 8 Jan 2009 22:20:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jan 2009 14:20:48 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [203.11.83.254] (HELO mail1.ardec.com.au) (203.11.83.254) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jan 2009 22:20:39 +0000 Received: from optimus.ms.a2end.com (optimus.adl.ardec.com.au [192.168.1.70]) by mail1.ardec.com.au (8.14.1/8.14.1) with ESMTP id n08MKDPk011450 for ; Fri, 9 Jan 2009 08:50:14 +1030 (CST) Received: from optimus.ms.a2end.com ([192.168.1.70]) by optimus.ms.a2end.com ([192.168.1.70]) with mapi; Fri, 9 Jan 2009 08:50:13 +1030 From: Nicole Luneburg To: Cactus Users List Date: Fri, 9 Jan 2009 08:50:08 +1030 Subject: RE: How to set user principal in setUp() Thread-Topic: How to set user principal in setUp() Thread-Index: Aclx3GZKrqYdqXC9RaOyrgKLl7O9SAAArXBg Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_CB506E813C77E9498F043F1F951BB276809332D2optimusmsa2endc_" MIME-Version: 1.0 X-Virus-Scanned: ClamAV 0.92/8843/Thu Jan 8 16:31:58 2009 on mizaru.adl.ardec.com.au X-Virus-Status: Clean X-SMTP-Vilter-Version: 1.3.6 X-Spamd-Symbols: ALL_TRUSTED,AWL,BAYES_00,HTML_MESSAGE X-SMTP-Vilter-Spam-Backend: spamd X-Spam-Score: -4.4 X-Spam-Threshold: 5.0 X-Spam-Probability: -0.9 X-Virus-Checked: Checked by ClamAV on apache.org --_000_CB506E813C77E9498F043F1F951BB276809332D2optimusmsa2endc_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Petar, Thank you. Just quickly before I continue with your instructions ... "apply the patch I have attached to this letter" I didn't get any attachment except a "ATT00001.c" file which only contained= the subscribe/unsubscribe info to the mailing list. nic From: Petar Tahchiev [mailto:paranoiabla@gmail.com] Sent: Friday, 9 January 2009 8:29 AM To: Cactus Users List Subject: Re: How to set user principal in setUp() Here is a detailed instruction on how to run the tests: 1) checkout cactus from source: svn co http://svn.apache.org/repos/asf/jakarta/cactus/trunk/ cactus 2) build it cd cactus mvn clean install 3) go to folder sample/ejb3 and apply the patch I have attached to this let= ter. This will create two .java files - MyEJB3ServiceBean.java and IMyEJB3Servic= eBean.java. It will also patch the build.xml and the cactus-web.xml files. 4) Create users.properties and roles. properties in JBOSS_HOME/server/default/= conf/ In these files fill in the following: =3D=3D=3D=3D=3D=3D=3D=3D=3Dusers.properties=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D testuser=3Dtestpassword =3D=3D=3D=3D=3D=3D=3D=3D=3Droles.properties=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D testuser=3Dtest I have a jboss4.2 installation in folder cactus/sample/ejb3/install/jboss-4= .2.2.GA but you can change the home of your JBoss installation by changing the home= property of the cargo element in the cactus task in the build.xml 5) start the tests with ant. Go to the ejb3 folder and type in: ant 6) Voila. Tests should be working. Please let me know how this works and also for homework write an email describing why didn't your tests work before and did I change so that they = are (probably) working now. This way you will be sure that you understand how c= actus is working :-). Cheers, Petar. 2009/1/8, Nicole Luneburg >: Oh also, how are you running the test? -----Original Message----- From: Nicole Luneburg [mailto:Nicole.Luneburg@lisasoft.com] Sent: Friday, 9 January 2009 7:49 AM To: Cactus Users List Subject: RE: How to set user principal in setUp() Hi Petar, Thanks for looking at this. I did have a play around with users.properties and roles.properties, but ne= ver got that working. Yes seeing ur configurations for that would be excellent. Thanks! Nicole -----Original Message----- From: Petar Tahchiev [mailto:paranoiabla@gmail.com] Sent: Thursday, 8 January 2009 9:56 PM To: Cactus Users List Subject: Re: How to set user principal in setUp() Hi Nicole, I got your example working on my machine. This line will return always false: if(this.context.getCallerPrincipal().getName() =3D=3D "admin1") { Try to change to use .equals() method. Also, did you create users.proeprties and roles.properties for your JBoss installation? If this does not help I will send you my configurations to take a look. Cheers, Petar. The contents of this email are confidential and may be subject to legal or = professional privilege and copyright. No representation is made that this e= mail is free of viruses or other defects. If you have received this communi= cation in error, you may not copy or distribute any part of it or otherwise= disclose its contents to anyone. Please advise the sender of your incorrec= t receipt of this correspondence. --------------------------------------------------------------------- To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: cactus-user-help@jakarta.apache.org The contents of this email are confidential and may be subject to legal or = professional privilege and copyright. No representation is made that this e= mail is free of viruses or other defects. If you have received this communi= cation in error, you may not copy or distribute any part of it or otherwise= disclose its contents to anyone. Please advise the sender of your incorrec= t receipt of this correspondence. --------------------------------------------------------------------- To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: cactus-user-help@jakarta.apache.org -- Regards, Petar! Karlovo, Bulgaria. - - - - - - - - | Author @ Manning Publications. | Senior Solution Architect @ Unic | BGJUG-Bulgarian Java User Group Leader. | Apache Jakarta PMC member. | Jakarta Cactus Lead Developer. | Blogger: http://weblogs.java.net/blog/paranoiabla/ - - - - - - - - Public PGP Key at: https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid= =3D0x19658550C3110611 Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611 ________________________________ The contents of this email are confidential and may be subject to legal or = professional privilege and copyright. No representation is made that this e= mail is free of viruses or other defects. If you have received this communi= cation in error, you may not copy or distribute any part of it or otherwise= disclose its contents to anyone. Please advise the sender of your incorrec= t receipt of this correspondence. --_000_CB506E813C77E9498F043F1F951BB276809332D2optimusmsa2endc_--