Re: Need guidance for writing unit tests for 55317

2013-08-21 Thread sebb
On 21 August 2013 20:21, Christopher Schultz wrote: > Sebb, > > On 8/21/13 1:46 PM, sebb wrote: >> On 21 August 2013 14:48, Christopher Schultz >> wrote: >>> Nick, >>> >>> On 8/20/13 8:24 PM, Nick Williams wrote: I ran in to a roadblock with this idea. Part of the byte code of a class i

Re: Need guidance for writing unit tests for 55317

2013-08-21 Thread Nick Williams
On Aug 21, 2013, at 12:46 PM, sebb wrote: > On 21 August 2013 14:48, Christopher Schultz > wrote: >> Nick, >> >> On 8/20/13 8:24 PM, Nick Williams wrote: >>> I ran in to a roadblock with this idea. Part of the byte code of a >>> class includes the fully-qualified class name. If I create a class

Re: Need guidance for writing unit tests for 55317

2013-08-21 Thread Christopher Schultz
Sebb, On 8/21/13 1:46 PM, sebb wrote: > On 21 August 2013 14:48, Christopher Schultz > wrote: >> Nick, >> >> On 8/20/13 8:24 PM, Nick Williams wrote: >>> I ran in to a roadblock with this idea. Part of the byte code of a >>> class includes the fully-qualified class name. If I create a class, >>>

Re: Need guidance for writing unit tests for 55317

2013-08-21 Thread sebb
On 21 August 2013 14:48, Christopher Schultz wrote: > Nick, > > On 8/20/13 8:24 PM, Nick Williams wrote: >> I ran in to a roadblock with this idea. Part of the byte code of a >> class includes the fully-qualified class name. If I create a class, >> say UnweavedClass, and replace its byte code in m

Re: Need guidance for writing unit tests for 55317

2013-08-21 Thread Christopher Schultz
Nick, On 8/20/13 8:24 PM, Nick Williams wrote: > I ran in to a roadblock with this idea. Part of the byte code of a > class includes the fully-qualified class name. If I create a class, > say UnweavedClass, and replace its byte code in my fake transformer > with that of another class, the FQCN cha

Re: Need guidance for writing unit tests for 55317

2013-08-21 Thread Nick Williams
On Aug 21, 2013, at 2:58 AM, Mark Thomas wrote: > On 21/08/2013 01:24, Nick Williams wrote: > >> My backup idea is slightly less clean but, IMO, still more clean than adding >> ASM as a test-time dependency and trying to figure all of that out. I >> locally compiled fake "weaved" versions of t

Re: Need guidance for writing unit tests for 55317

2013-08-21 Thread Mark Thomas
On 21/08/2013 01:24, Nick Williams wrote: > My backup idea is slightly less clean but, IMO, still more clean than adding > ASM as a test-time dependency and trying to figure all of that out. I locally > compiled fake "weaved" versions of the UnweavedClass (with the modified > behavior) and then

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Jeremy Boynes
On Aug 20, 2013, at 7:42 AM, Nick Williams wrote: > > Well, yea. I had figured that part out. :-) I just didn't articulate my > question well enough. > > The first step is obviously loading the class through the WACL through the > unit test (so this has to be a class not already loaded). I as

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Nick Williams
On Aug 20, 2013, at 1:10 PM, Mark Thomas wrote: > On 20/08/2013 18:47, Nick Williams wrote: >> My remaining original concern was the best approach for weaving byte >> code in Tomcat's unit tests, which I detailed in an earlier message. > > Use the Weaver to completely replace the byte code of th

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Nicholas Williams
On Tue, Aug 20, 2013 at 1:10 PM, Mark Thomas wrote: > On 20/08/2013 18:47, Nick Williams wrote: >> My remaining original concern was the best approach for weaving byte >> code in Tomcat's unit tests, which I detailed in an earlier message. > > Use the Weaver to completely replace the byte code of

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Mark Thomas
On 20/08/2013 18:47, Nick Williams wrote: > My remaining original concern was the best approach for weaving byte > code in Tomcat's unit tests, which I detailed in an earlier message. Use the Weaver to completely replace the byte code of the weaved class with the byte code from another class? That

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Mark Thomas
On 20/08/2013 18:58, Christopher Schultz wrote: > In case you want to run the entire test suite but don't want to get > APR failures, you can also set -Dexecute.test.apr=false and it will > skip all the APR tests. The unit tests are smart enough that even with that set to true, the tests will be

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Christopher Schultz
Nick, On 8/20/13 1:47 PM, Nick Williams wrote: > > On Aug 20, 2013, at 12:41 PM, Christopher Schultz wrote: > >> Nick, >> >> On 8/20/13 1:25 PM, Christopher Schultz wrote: >>> tcnative can be built on Max OS X like this: >>> >>> $ cd $CATALINA_HOME/bin >>> $ tar xzf tomcat-native.tar.gz >>> $ cd

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Christopher Schultz
Nick, On 8/20/13 1:41 PM, Christopher Schultz wrote: > Nick, > > On 8/20/13 1:25 PM, Christopher Schultz wrote: >> tcnative can be built on Max OS X like this: >> >> $ cd $CATALINA_HOME/bin >> $ tar xzf tomcat-native.tar.gz >> $ cd tomcat-native-*-src/jni/native >> $ ./configure --with-apr=/usr/b

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Nick Williams
On Aug 20, 2013, at 12:41 PM, Christopher Schultz wrote: > Nick, > > On 8/20/13 1:25 PM, Christopher Schultz wrote: >> tcnative can be built on Max OS X like this: >> >> $ cd $CATALINA_HOME/bin >> $ tar xzf tomcat-native.tar.gz >> $ cd tomcat-native-*-src/jni/native >> $ ./configure --with-apr=

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Christopher Schultz
Nick, On 8/20/13 1:25 PM, Christopher Schultz wrote: > tcnative can be built on Max OS X like this: > > $ cd $CATALINA_HOME/bin > $ tar xzf tomcat-native.tar.gz > $ cd tomcat-native-*-src/jni/native > $ ./configure --with-apr=/usr/bin/apr-1-config --with-ssl > --with-java-home=`/usr/libexec/java_

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Christopher Schultz
Nick, On 8/20/13 11:15 AM, Nick Williams wrote: > > On Aug 20, 2013, at 10:12 AM, Christopher Schultz wrote: > >> Mark, >> >> On 8/20/13 9:25 AM, Mark Thomas wrote: >>> On 20/08/2013 14:13, Nick Williams wrote: I'm working on implementing bugzilla 55317. It's a pretty important change

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Nick Williams
On Aug 20, 2013, at 10:12 AM, Christopher Schultz wrote: > Mark, > > On 8/20/13 9:25 AM, Mark Thomas wrote: >> On 20/08/2013 14:13, Nick Williams wrote: >>> I'm working on implementing bugzilla 55317. It's a pretty important >>> change (weaving) to a pretty import class (WebappClassLoader), so i

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Christopher Schultz
Mark, On 8/20/13 9:25 AM, Mark Thomas wrote: > On 20/08/2013 14:13, Nick Williams wrote: >> I'm working on implementing bugzilla 55317. It's a pretty important >> change (weaving) to a pretty import class (WebappClassLoader), so it >> obviously needs some unit tests. However, I need some guidance:

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Nick Williams
On Aug 20, 2013, at 8:25 AM, Mark Thomas wrote: > On 20/08/2013 14:13, Nick Williams wrote: >> I'm working on implementing bugzilla 55317. It's a pretty important >> change (weaving) to a pretty import class (WebappClassLoader), so it >> obviously needs some unit tests. However, I need some guida

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Brian Burch
On 20/08/13 14:32, Violeta Georgieva wrote: 2013/8/20 Nick Williams wrote: I'm working on implementing bugzilla 55317. It's a pretty important change (weaving) to a pretty import class (WebappClassLoader), so it obviously needs some unit tests. However, I need some guidance: 1) I've never go

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Violeta Georgieva
2013/8/20 Nick Williams wrote: > > I'm working on implementing bugzilla 55317. It's a pretty important change (weaving) to a pretty import class (WebappClassLoader), so it obviously needs some unit tests. However, I need some guidance: > > 1) I've never gotten all the existing tests to pass on my m

Re: Need guidance for writing unit tests for 55317

2013-08-20 Thread Mark Thomas
On 20/08/2013 14:13, Nick Williams wrote: > I'm working on implementing bugzilla 55317. It's a pretty important > change (weaving) to a pretty import class (WebappClassLoader), so it > obviously needs some unit tests. However, I need some guidance: > > 1) I've never gotten all the existing tests t

Need guidance for writing unit tests for 55317

2013-08-20 Thread Nick Williams
I'm working on implementing bugzilla 55317. It's a pretty important change (weaving) to a pretty import class (WebappClassLoader), so it obviously needs some unit tests. However, I need some guidance: 1) I've never gotten all the existing tests to pass on my machine. Last time I ran them it too

RE: Writing unit tests

2010-09-20 Thread Caldarale, Charles R
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] > Subject: Re: Writing unit tests > > Yep. Go with the current style of the file. > Gotcha. Just remember: no bloody tabs (even if the source file still has some). - Chuck THIS COMMUNICATION MAY CONTAIN CONF

Re: Writing unit tests

2010-09-20 Thread Christopher Schultz
Mark, On 9/20/2010 4:52 PM, Mark Thomas wrote: > That'll probably be better in 7.0.x. I do wonder what init code you > might need. I was expecting a simple boolean attribute. Once that is > sorted, we can figure out how to port it to 6.0.x Since I was thinking of allowing any set of HTTP methods,

Re: Writing unit tests

2010-09-20 Thread Mark Thomas
On 20/09/2010 13:46, Christopher Schultz wrote: > 1. There's a method in catalina.connector.Connector called init(). When > does that get called? I had expected that it would be called after all > the setXXX attributes had be set on it from the digester upon start-up, > but it appears that Connect

Re: Writing unit tests

2010-09-20 Thread Christopher Schultz
Mark, On 9/20/2010 4:33 PM, Mark Thomas wrote: > On 20/09/2010 11:29, Christopher Schultz wrote: >> All, >> >> I'm attempting a patch for >> https://issues.apache.org/bugzilla/show_bug.cgi?id=49964 and I'd like to >> write a few unit tests for it. In the Tomcat 6.0.x trunk, I can only >> find what

Re: Writing unit tests

2010-09-20 Thread Mark Thomas
On 20/09/2010 11:29, Christopher Schultz wrote: > All, > > I'm attempting a patch for > https://issues.apache.org/bugzilla/show_bug.cgi?id=49964 and I'd like to > write a few unit tests for it. In the Tomcat 6.0.x trunk, I can only > find what appear to be 30-40 test files. Is there a test suite e

Writing unit tests

2010-09-20 Thread Christopher Schultz
All, I'm attempting a patch for https://issues.apache.org/bugzilla/show_bug.cgi?id=49964 and I'd like to write a few unit tests for it. In the Tomcat 6.0.x trunk, I can only find what appear to be 30-40 test files. Is there a test suite elsewhere that I can download and augment in order to properl