On Aug 15, 2008, at 7:15 PM, Paul Smith wrote:

I went and finally revisited a patch I proposed about a million years ago to enable testing of the JMSAppender class using ActiveMQ (Bug 38153).

See my patch below [1]. However when I run the tests locally I'm getting a compile error:

...
prepare:
[available] DEPRECATED - <available> used to override an existing property. [available] Build file should not reuse the same property name for different values.

build:
   [javac] Compiling 2 source files to /workspace/log4j/tests/classes
/workspace/log4j/tests/src/java/org/apache/log4j/jms/ JMSAppenderTest.java:19: package javax.jms does not exist
import javax.jms.Connection;

We appear to run the tests via an antrun call within Maven, is that right? Just curious of the rationale there, why we couldn't just make it a standard maven test phase. Maybe there's a complication I'm not aware of, it's just not something I've had to deal with before, so I'm a bit confused on how to proceed. Normally for testing under Maven I've just added dependencies under the test scope and been on my way.

I fought and fought to try to get the unit tests to run under maven- surefire-plugin when doing the initial Maven build, but think I ran into a wall. There are some artifacts of my previous attempts in the pom.xml file. My earlier posts didn't jump out in the mailing list archives and I don't have time at the moment to cross-reference the changes I made to pom.xml and against my posts to try to find them to see exactly what I ran into.

tests/build.xml does not appear to have any JMS support in it. I'm guessing this is the first test that requires JMS and that the test would also fail if you did:

cd tests
ant runAll

tests/build.xml needs to be kept working since it is the only mechanism to test on JDK 1.3 and on Gump.

You'd also need to update the Gump descriptor to make log4j-test depend on ActiveMQ.

jndi.properties would still need an ASF source file header license notice.


The following changes were enough for me to get JMSAppenderTest to compile for me. There would still need to be modifications to add an explicit target to run the JMS test and then add the JMS test into the regression target.

Index: build.xml
===================================================================
--- build.xml   (revision 686147)
+++ build.xml   (working copy)
@@ -36,8 +36,11 @@
<property name="checkstyle.jar" location="${m2_repo}/checkstyle/ checkstyle/${checkstyle.version}/checkstyle-${checkstyle.version}.jar"/> <property name="javamail.jar" location="${m2_repo}/javax/mail/mail/ 1.4/mail-1.4.jar"/> <property name="activation.jar" location="${m2_repo}/javax/ activation/activation/1.1/activation-1.1.jar"/>
+  <property name="activemq-core.version" value="4.1.2"/>
+ <property name="activemq-core.jar" location="${m2_repo}/org/apache/ activemq/activemq-core/${activemq-core.version}/activemq-core-$ {activemq-core.version}.jar"/>
+  <property name="geronimo-jms.jar"
+ value="${m2_repo}/org/apache/geronimo/specs/geronimo- jms_1.1_spec/1.0/geronimo-jms_1.1_spec-1.0.jar"/>

-
<!-- Read the system environment variables and stores them in properties, -->
   <!-- prefixed with "env". -->
   <property environment="env"/>
@@ -69,6 +72,8 @@
     <pathelement location="${junit.jar}"/>
     <pathelement location="${javamail.jar}"/>
     <pathelement location="${activation.jar}"/>
+    <pathelement location="${activemq-core.jar}"/>
+    <pathelement location="${geronimo-jms.jar}"/>
     <pathelement path="${java.class.path}"/>
   </path>

I'll go ahead and preemptively add the JMS dependency to Gump. The derby dependency seems unrelated but there would be similar issues when you add whatever tests depend on it.

I'm going to be busy this weekend. Might be able to check some emails, but no heavy lifting.

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

Reply via email to