RE: urgent help needed -to run cactus on jboss-4.2.0

2008-06-26 Thread Daniel Lipofsky
First off, I was never able to get cactus to run
out of the box on JBoss 4.2.x.  I had to patch it.
You can see my patch at http://danlipofsky.com/technical/cactus/
My cactus tests ran on other app servers (Orion 2.0.7 and
WebSphere 6.0).  They seem to work pretty well on JBoss 4.2.2
with this patch, but it is definitely a hack.

If anyone has a better way please let me know.

Here are my ant targets.
It's probably more complex than you need.
Hopefully the vars are self-explanatory.
Don't start or stop the server but does test that it is running.

target name=test.cactus.all depends=init
antcall target=test.cactus.generic
param name=cactus_test_target value=test.cactus.junit/
param name=cactus_test_pattern value=**/*Test.java/
/antcall
/target

!-- run the Cactus tests (takes ${cactus_test_target} param) --
target name=test.cactus.generic depends=init description=run the
Cactus tests on the core module

echotest.cactus.generic: target=${cactus_test_target}/echo
echocactusContextURL: ${cactusContextURL}/echo
fail unless=cactus_test_target message=Missing
cactus_test_target parameter/

!-- Check if server is running --
delete file=${java.io.tmpdir}/servercheck.txt /
get
src=${install.frontend_server_protocol}://${install.frontend_server_nam
e}:${install.frontend_server_port}/ws/
dest=${java.io.tmpdir}/servercheck.txt ignoreerrors=yes /
fail message=Cannot connect to
${install.frontend_server_protocol}://${install.frontend_server_name}:${
install.frontend_server_port}/ws/

Start application before running this task.

condition
not
available file=${java.io.tmpdir}/servercheck.txt /
/not
/condition
/fail

!-- Define the Cactus tasks --
taskdef resource=cactus.tasks
classpath refid=test.jar.path /
/taskdef

runservertests
testurl=${cactusContextURL}/ServletTestRunner?Cactus_Service=RUN_TEST
starttarget=test.server.start.bogus
stoptarget=test.server.stop.bogus testtarget=${cactus_test_target}
/
/target

target name=test.cactus.junit depends=init

echotest.cactus.junit: pattern=${cactus_test_pattern}/echo
fail unless=cactus_test_target message=Missing
cactus_test_target parameter/

mkdir dir=${test.report.dir} /
junit printsummary=yes fork=yes
classpath refid=cactus.full.path /
sysproperty key=cactus.contextURL value=${cactusContextURL}
/
sysproperty key=test.app.server value=${install.app.server}
/
sysproperty key=baseDirectory value=${install.dir} /

formatter type=xml /

batchtest fork=yes todir=${test.report.dir}
fileset dir=${test.src.web.dir}
include name=${cactus_test_pattern} /
exclude name=**/*BaseTest.java /
/fileset
fileset dir=${test.generated.java.dir}
include name=${cactus_test_pattern} /
/fileset
/batchtest
/junit
/target

 -Original Message-
 From: SRINIVASAN, KUMARAN [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 18, 2008 1:43 PM
 To: cactus-user@jakarta.apache.org
 Subject: urgent help needed -to run cactus on jboss-4.2.0
 
 Hi,
 
   I want to run cactus test as part of my automation build
(via
 cruisecontrol  ) using ant  on already running jboss-4.2.0. server
 After completing the cactus test i don't want to stop the jboss-4.2.0.
 Please send me the sample ant script code snippet. Cactus test should
 not initiate neither start nor stop the server ,it should just run the
 test alone on running Jboss-4.2.0
 
 
 
 Thanks
 
 Kumaran


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: urgent help needed -to run cactus on jboss-4.2.0

2008-06-28 Thread Daniel Lipofsky
Petar, does your app require user authentication?
Authentication was the problem that required me to hack
cactus 1.7.2 on JBoss 4.2.2 (this was before 1.8.0).
I believe I tried an unhacked 1.8.0 and it didn't work
for me either, although I wasn't using the cargo integration
like you show below.

Thanks,
Dan

 -Original Message-
 From: Petar Tahchiev [mailto:[EMAIL PROTECTED]
 Sent: Friday, June 27, 2008 4:08 AM
 
 HI guys,
 
 I am really amazed that no-one uses Cactus 1.8.0, since it offers so
 many facilitation!
 I use no hacks at all, and I am still able to start, deploy, execute
 the tests in, and stop JBoss 4.2.2.
 I use Cactus 1.8.0 with the Cargo Integration.  Here is a snippet from
 my build.xml (this actually is the ejb
 samples module that comes with Cactus):
 
 target name=test depends=cactifyear
   echoPlease take a deep breath while Cargo gets JBoss for
 running the
 sample ejb tests.../echo
 cactus earfile=${cactified.ejb.archive.name}
 printsummary=yes
 classpath
 path refid=cactus.classpath/
 pathelement location=${build.dir}/
 pathelement location=${cactus.build.dir}/
 pathelement location=${basedir}/cactus/
 pathelement path=src/main/app/
 pathelement location=${basedir}/cactus.properties/
 path refid=jboss.client/
 /classpath
 containerset
 cargo containerId=${jboss.container.id}
 output=${logs.dir}/output.log log=${logs.dir}/cargo.log
 home=/home/peter/bin/jboss/jboss-4.2.2.GA action=start
 configuration
 property name=cargo.servlet.port
 value=${cargo.servlet.port}/
 property name=cargo.logging
 value=${cargo.logging}/
 deployable
 type=${cactus.sample.archive.type}
 file=${cactified.ejb.archive.name}/
 
 /configuration
 /cargo
 /containerset
 sysproperty key=cactus.jndi.initialContextFactory
 value=org.jnp.interfaces.NamingContextFactory/
 sysproperty key=cactus.jndi.providerUrl
 value=jnp://localhost:1099/
 sysproperty key=cactus.jndi.securityPrincipal
 value=system/
 sysproperty key=cactus.jndi.securityCredentials
 value=jboss/
 sysproperty key=cactus.jndi.urlPkgPrefixes
 value=org.jboss.naming.client/
 
 !--sysproperty key=java.naming.factory.initial
 value=org.jnp.interfaces.NamingContextFactory/--
 
 sysproperty key=cactus.jms.connectionFactoryJndiName
 value=java:comp/env/jms/MyConnectionFactory/
 
 formatter type=${cactus.formatter.type}/
 batchtest todir=${reports.dir}
 fileset dir=${src.dir}
 include name=**/Test*.java/
 /fileset
 /batchtest
 /cactus
 /target
 
 
 All you have to do is prepare the archive (cactify it), and change the
 JBoss
 home directory.
 And it is all perfectly documented.
 
 I hope I have helped someone.
 
 Cheers, Petar.
 
  -Original Message-
  From: Daniel Lipofsky [mailto:[EMAIL PROTECTED]
  Sent: Thursday, June 26, 2008 1:37 PM
  To: Cactus Users List
  Subject: RE: urgent help needed -to run cactus on jboss-4.2.0
 
  First off, I was never able to get cactus to run
  out of the box on JBoss 4.2.x.  I had to patch it.
  You can see my patch at http://danlipofsky.com/technical/cactus/
  My cactus tests ran on other app servers (Orion 2.0.7 and
  WebSphere 6.0).  They seem to work pretty well on JBoss 4.2.2
  with this patch, but it is definitely a hack.
 
  If anyone has a better way please let me know.
 
  Here are my ant targets.
  It's probably more complex than you need.
  Hopefully the vars are self-explanatory.
  Don't start or stop the server but does test that it is running.
 
  target name=test.cactus.all depends=init
  antcall target=test.cactus.generic
  param name=cactus_test_target value=test.cactus.junit/
  param name=cactus_test_pattern value=**/*Test.java/
  /antcall
  /target
 
  !-- run the Cactus tests (takes ${cactus_test_target} param) --
  target name=test.cactus.generic depends=init description=run
the Cactus tests on the core module
 
  echotest.cactus.generic: target=${cactus_test_target}/echo
  echocactusContextURL: ${cactusContextURL}/echo
  fail unless=cactus_test_target message=Missing
  cactus_test_target parameter/
 
  !-- Check if server is running --
  delete file=${java.io.tmpdir}/servercheck.txt /
  get
src=${install.frontend_server_protocol}://${install.frontend_server_nam
e}:${install.frontend_server_port}/ws/
  dest=${java.io.tmpdir}/servercheck.txt ignoreerrors=yes /
  fail message=Cannot connect to
${install.frontend_server_protocol}://${install.frontend_server_name}:${
install.frontend_server_port}/ws/
 
  Start application before

RE: urgent help needed -to run cactus on jboss-4.2.0

2008-07-02 Thread Daniel Lipofsky
Petar, I saw these old threads and I think this gets to the
core of my problem.  I see you said you added the changes to SVN.
Would this be including in 1.8.1?  and when would that get released?

http://www.mail-archive.com/cactus-user@jakarta.apache.org/msg07524.html
http://www.mail-archive.com/cactus-user@jakarta.apache.org/msg07526.html
http://marc.info/?l=tomcat-userm=119098089904045w=2

Thanks,
Dan


 -Original Message-
 From: Petar Tahchiev [mailto:[EMAIL PROTECTED]
 Sent: Saturday, June 28, 2008 12:54 PM
 To: Cactus Users List
 Subject: Re: urgent help needed -to run cactus on jboss-4.2.0
 
 Hi Daniel,
 
 my tests does not require user authentication, but I will
 try to use one and see if you are right.
 
 Thanks, Petar.
 
 2008/6/28, Daniel Lipofsky [EMAIL PROTECTED]:
 
  Petar, does your app require user authentication?
  Authentication was the problem that required me to hack
  cactus 1.7.2 on JBoss 4.2.2 (this was before 1.8.0).
  I believe I tried an unhacked 1.8.0 and it didn't work
  for me either, although I wasn't using the cargo integration
  like you show below.
 
  Thanks,
  Dan
 
 
   -Original Message-
   From: Petar Tahchiev [mailto:[EMAIL PROTECTED]
   Sent: Friday, June 27, 2008 4:08 AM
  
   HI guys,
  
   I am really amazed that no-one uses Cactus 1.8.0, since it offers
 so
   many facilitation!
   I use no hacks at all, and I am still able to start, deploy,
 execute
   the tests in, and stop JBoss 4.2.2.
   I use Cactus 1.8.0 with the Cargo Integration.  Here is a snippet
 from
   my build.xml (this actually is the ejb
   samples module that comes with Cactus):
  
   target name=test depends=cactifyear
 echoPlease take a deep breath while Cargo gets JBoss for
   running the
   sample ejb tests.../echo
   cactus earfile=${cactified.ejb.archive.name}
   printsummary=yes
   classpath
   path refid=cactus.classpath/
   pathelement location=${build.dir}/
   pathelement location=${cactus.build.dir}/
   pathelement location=${basedir}/cactus/
   pathelement path=src/main/app/
   pathelement
 location=${basedir}/cactus.properties/
   path refid=jboss.client/
   /classpath
   containerset
   cargo containerId=${jboss.container.id}
   output=${logs.dir}/output.log log=${logs.dir}/cargo.log
   home=/home/peter/bin/jboss/jboss-4.2.2.GA action=start
   configuration
   property name=cargo.servlet.port
   value=${cargo.servlet.port}/
   property name=cargo.logging
   value=${cargo.logging}/
   deployable
   type=${cactus.sample.archive.type}
   file=${cactified.ejb.archive.name}/
  
   /configuration
   /cargo
   /containerset
   sysproperty key=cactus.jndi.initialContextFactory
   value=org.jnp.interfaces.NamingContextFactory/
   sysproperty key=cactus.jndi.providerUrl
   value=jnp://localhost:1099/
   sysproperty key=cactus.jndi.securityPrincipal
   value=system/
   sysproperty key=cactus.jndi.securityCredentials
   value=jboss/
   sysproperty key=cactus.jndi.urlPkgPrefixes
   value=org.jboss.naming.client/
  
   !--sysproperty key=java.naming.factory.initial
   value=org.jnp.interfaces.NamingContextFactory/--
  
   sysproperty
key=cactus.jms.connectionFactoryJndiName
   value=java:comp/env/jms/MyConnectionFactory/
  
   formatter type=${cactus.formatter.type}/
   batchtest todir=${reports.dir}
   fileset dir=${src.dir}
   include name=**/Test*.java/
   /fileset
   /batchtest
   /cactus
   /target
  
  
   All you have to do is prepare the archive (cactify it), and change
 the
   JBoss
   home directory.
   And it is all perfectly documented.
  
   I hope I have helped someone.
  
   Cheers, Petar.
  
 
-Original Message-
From: Daniel Lipofsky [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2008 1:37 PM
To: Cactus Users List
Subject: RE: urgent help needed -to run cactus on jboss-4.2.0
   
First off, I was never able to get cactus to run
out of the box on JBoss 4.2.x.  I had to patch it.
You can see my patch at http://danlipofsky.com/technical/cactus/
My cactus tests ran on other app servers (Orion 2.0.7 and
WebSphere 6.0).  They seem to work pretty well on JBoss 4.2.2
with this patch, but it is definitely a hack.
   
If anyone has a better way please let me know.
   
Here are my ant targets.
It's probably more complex than you need.
Hopefully the vars are self-explanatory.
Don't start or stop the server but does test that it is running.
   
target name=test.cactus.all depends=init

RE: java.lang.NoSuchFieldError: config

2008-12-11 Thread Daniel Lipofsky
I don't remember what error I had, but I know I
had to patch StrutsTest 2.1.4 to work with Cactus 1.8.0.
Try this patch (at bottom of page) and see if it helps:
http://danlipofsky.com/technical/cactus/

- Dan

 -Original Message-
 From: sach Beeharry [mailto:[EMAIL PROTECTED]
 Sent: Thursday, December 11, 2008 5:23 AM
 To: cactus-user@jakarta.apache.org
 Subject: java.lang.NoSuchFieldError: config
 
 Hi,
 
 I am trying to test my action class using cactus. My web application
is
 on
 Tomcat and I am running the test from Eclipse.
 But I am getting the following error when the test runs:
 
 java.lang.NoSuchFieldError: config
  at

servletunit.struts.CactusStrutsTestCase.setUp(CactusStrutsTestCase.java
 :101)
  at junit.framework.TestCase.runBare(TestCase.java:128)
  at

org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(Abstrac
 tCactusTestCase.java:155)
  at

org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(Abstract
 WebTestCaller.java:120)
  at

org.apache.cactus.internal.server.AbstractWebTestController.handleReque
 st_aroundBody0(AbstractWebTestController.java:94)
  at

org.apache.cactus.internal.server.AbstractWebTestController.handleReque
 st_aroundBody1$advice(AbstractWebTestController.java:218)
  at

org.apache.cactus.internal.server.AbstractWebTestController.handleReque
 st(AbstractWebTestController.java:1)
 
 I think this error is caused because the *config* field cannot be
found
 in
 the setUp() method of the CactusStrutsTestCase class. May be some
 compatibility issue.
 
 protected void setUp()
 throws Exception
 {
 if(logger.isDebugEnabled())
 {
 logger.debug(Entering);
 }
 try
 {
 if(actionServlet == null)
 {
 actionServlet = new ActionServlet();
 }
 ServletContext servletContext = new
 StrutsServletContextWrapper*
 (config*.getServletContext());
 
 also:
 
 *CactusStrutsTestCase  extends ServletTestCase* and ServletTestCase
 contains
 the attribute *public AbstractServletConfigWrapper config
 *
 From the above the config  field should normally be accessible, but it
 is
 not the case.
 
 Can anyone help me solving this?
 
 Thanks in advance.
 
 Sach

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]