Return-Path: Delivered-To: apmail-jakarta-cactus-user-archive@www.apache.org Received: (qmail 82021 invoked from network); 8 Jan 2009 21:59:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jan 2009 21:59:30 -0000 Received: (qmail 99675 invoked by uid 500); 8 Jan 2009 21:59:29 -0000 Delivered-To: apmail-jakarta-cactus-user-archive@jakarta.apache.org Received: (qmail 99658 invoked by uid 500); 8 Jan 2009 21:59:29 -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 99646 invoked by uid 99); 8 Jan 2009 21:59:28 -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 13:59:28 -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: domain of paranoiabla@gmail.com designates 209.85.218.21 as permitted sender) Received: from [209.85.218.21] (HELO mail-bw0-f21.google.com) (209.85.218.21) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jan 2009 21:59:20 +0000 Received: by bwz14 with SMTP id 14so28089614bwz.13 for ; Thu, 08 Jan 2009 13:58:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=yZ/CZaQdTYVRfMgffNSNX4qMXfACssM4/U/v8iMG2Es=; b=Z9ynKoLSIRrhT5xsGtADdekijwLdNW3kDN+v/OyZuVlEVU5Q8JBEGWotqb4Hcn4Ik8 HpAvP5mpScpTkUitGyrYxWfzruUGOVYdUSQjpBWEadTSmSXeZxJRLlQIQbG/dvgY2zsv +Z66gOX2AVlFvEJoh+thrcOga/Xj5zs3YtfCw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=cjWZ4vmFu8S+QySAOXV1lUWs0PDhjK7UlTuvFTpLUteN5GccJsN23K/k8YNTkq+XY4 4H1x80EBF8dieOGfyva4Vzt6wn93t2wyuFRo0X2bL9hZeS6zNf/b0WAcKLsvk2UDCyr8 cC6IS/QuZW3HIxpfpMZGtAz16sd6gFMHDZO9U= Received: by 10.180.205.20 with SMTP id c20mr8860182bkg.62.1231451937890; Thu, 08 Jan 2009 13:58:57 -0800 (PST) Received: by 10.180.209.17 with HTTP; Thu, 8 Jan 2009 13:58:57 -0800 (PST) Message-ID: Date: Thu, 8 Jan 2009 22:58:57 +0100 From: "Petar Tahchiev" To: "Cactus Users List" Subject: Re: How to set user principal in setUp() In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_59094_21857764.1231451937888" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_59094_21857764.1231451937888 Content-Type: multipart/alternative; boundary="----=_Part_59095_30121938.1231451937888" ------=_Part_59095_30121938.1231451937888 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 letter. This will create two .java files - MyEJB3ServiceBean.java and IMyEJB3ServiceBean.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: =========users.properties========== testuser=testpassword =========roles.properties========== testuser=test 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 cactus 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 > never 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() == "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 > email is free of viruses or other defects. If you have received this > communication 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 > incorrect 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 > email is free of viruses or other defects. If you have received this > communication 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 > incorrect 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=0x19658550C3110611 Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611 ------=_Part_59095_30121938.1231451937888 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 letter.
This will create two .java files - MyEJB3ServiceBean.java and IMyEJB3ServiceBean.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:
=========users.properties==========
testuser=testpassword

=========roles.properties==========
testuser=test

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 cactus is
working :-).

Cheers, Petar.
2009/1/8, Nicole Luneburg <Nicole.Luneburg@lisasoft.com>:
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 never 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() == "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 email is free of viruses or other defects. If you have received this communication 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 incorrect 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 email is free of viruses or other defects. If you have received this communication 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 incorrect 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=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611 ------=_Part_59095_30121938.1231451937888-- ------=_Part_59094_21857764.1231451937888 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: cactus-user-help@jakarta.apache.org ------=_Part_59094_21857764.1231451937888--