jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicole Luneburg <Nicole.Luneb...@lisasoft.com>
Subject Viewing Test Results
Date Fri, 23 Jan 2009 04:14:16 GMT
Hi all,

I'm running cactus 1.8.0, jboss 4.2.3.
I am able to run my test however all tests fail.

For simplicity I just had one test class and one test method:

package myapp.ejb.service;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import junit.framework.Assert;

import org.apache.cactus.ServletTestCase;
import org.apache.cactus.WebRequest;
import org.apache.cactus.client.authentication.FormAuthentication;
import org.apache.log4j.Logger;

public class UserTest extends ServletTestCase {

                private static final Logger log = Logger.getLogger(UserTest.class);

                public UserTest(final String name) {
                                System.out.println("inside constructor");
                                log.info("inside constructor");

                public void begin(WebRequest theRequest) {
                    System.out.println("inside begin()");
                    log.info("inside begin()");

                public void setUp() throws Exception {
                                System.out.println("inside setUp() ");
                                log.info("inside setUp() ");


                protected void tearDown() throws Exception {
                                System.out.println("inside tearDown() ");
                                log.info("inside tearDown() ");


                public void testGetUserString() {
                                System.out.println("inside testGetUserString()");
                                log.info("inside testGetUserString()");


When I run my ant test target I get the following output (extract):

     [echo] Cargo gets JBoss for running the tests...
   [cactus] -----------------------------------------------------------------
   [cactus] Parsed JBoss version = [4.2.3]
   [cactus] Running tests against JBoss 4.2.3 @ http://localhost:8080
   [cactus] -----------------------------------------------------------------
   [cactus] Deploying [.//cactus/myapp-cactified.ear] to [C:\DOCUME~1\myname\LOCALS~1\Temp\cargo\conf/deploy]...
   [cactus] JBoss 4.2.3 starting...
Server [Apache-Coyote/1.1] started
   [cactus] Running myapp.ejb.service.UserTest
   [cactus] JBoss 4.2.3 started on port [8080]
   [cactus] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.375 sec
   [cactus] Test myapp.ejb.service.UserTest FAILED
   [cactus] JBoss 4.2.3 is stopping...

Total time: 1 minute 52 seconds

As you can see it fails even though I'm not really "testing" anything.
In the cactus sample ejb3 project, running the test target generated a jboss42x directory
in the target directory.
This directory contained files like:


That look like test results.

So I have two questions:

1) How do I see the output of my log4j log.info or System.out.println statements?
2) If I can't see the output of my statements anywhere, is the only way to see the results
in greater detail through generating xml files such as the one shown above?
3) I have almost an identical ant test target as the one that does generate those xml files,
but they aren't generating :(

--------------- In relation to question 3, my ant test target is:

<target name="cactus.test" depends="cactus.cactifyear">
      <echo>Cargo gets JBoss for running the tests...</echo>
      <mkdir dir="${reports.dir}" />

      <cactus earfile="${cactified.archive.name}" printsummary="yes">
                  <path refid="cactus.classpath" />
                  <pathelement location="${cactus.dir}/classes" />
                  <cargo containerId="${jboss.container.id}" output="${cactus.logs.dir}/output.log"
log="${cactus.logs.dir}/cargo.log" home="${cactus.jboss.dir}">
                              <property name="cargo.servlet.port" value="${cargo.servlet.port}"
                              <property name="cargo.logging" value="${cargo.logging}" />
                              <deployable type="ear" file="${cactified.archive.name}" />

            <formatter type="${cactus.formatter.type}" />
            <batchtest todir="${reports.dir}">
                  <fileset dir="${project.test.dir}">
                        <include name="**/*Test.java" />


I hope what I am asking here makes sense.


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.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message