You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Boring, Jeff W (N-Viper)" <je...@lmco.com> on 2008/10/07 00:05:09 UTC

Loose logging when using forkmode

Environment: ant 1.7.1, junit4.4 

 

We lost log4j logging output (eg. log.debug) in the <system-out> section
of the XML files when we switched to perBatch forkmode. [perBatch
forkmode helps us greatly with performance of the tests.] Actually, the
FIRST test case that runs includes the log4j logging output but all
others after that do not. Note that System.out.println's always appear
in the xml files, just not log.debug.

 

Below is target from the build.xml file. If I remove the
'forkmode="perBatch"' the log4j logging output works fine. Any ideas how
to get logging with forkmode? Anyone using forkmode and getting the
logging output (ie it's just me :-)) 

             

 

<target name="testI" depends="setUpInstrument,build" description=""   >

    <taskdef classpathref="cobertura.classpath"
resource="tasks.properties"/>

    <junit printsummary="yes" haltonerror="false"
failureproperty="junit_test_failed" forkmode="perBatch" maxmemory="512m"
>

                        

        <sysproperty key="net.sourceforge.cobertura.datafile"
file="${base.dir}/cobertura.ser" />

        <classpath refid="cobertura.classpath" />

        <classpath>

            <pathelement path="${FmFileUrlMap.jar.file}" />

            <pathelement path="${GiJpaAbCd.jar.file}" />

            <pathelement location="${AllTests.path}"/>

            <pathelement path="${GiAdapterI.jar.file}" /> 

            <pathelement path="${local.classpath}" />

        </classpath>

        <formatter type="xml"/>

            <batchtest fork="yes" todir="${reports.dir}">

            <fileset dir="${AllTests.path}">

                <include name="**/Test*.class"/>

                <not> <filename name="**/*$*"/></not>

            </fileset>

            </batchtest>

      </junit>

      <fail if="junit_test_failed" message="One or more JUnit  tests
failed"/>

</target>    

 

 

Jeff Boring

Orlando, Florida


RE: find file in specify directory and its sub-directory

Posted by Ben Tu <bt...@adobe.com>.
It worked. thanks

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com]
Sent: Tuesday, October 07, 2008 11:03 AM
To: Ant Users List
Subject: RE: find file in specify directory and its sub-directory

pathsep="${line.separator}"

--- Ben Tu <bt...@adobe.com> wrote:

> Matt,
> This will returned the list of files separate with
> path separator.
> I want it returns a list of files as follow.
>
> ${basedir}/com/abc/a.class
> ${basedir}/com/abc/b.class
>
> Thanks, Ben
>
>
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com]
> Sent: Tuesday, October 07, 2008 10:35 AM
> To: Ant Users List
> Subject: Re: find file in specify directory and its
> sub-directory
>
> Are your sed commands trying to strip off the
> leading
> ./ , then escape dollar signs found?  If so, the
> second probably wouldn't be relevant:
>
> <pathconvert>
>   <fileset dir="${basedir}" includes="**/*.class" />
>   <globmapper from="${basedir}/*" to="*" />
> </pathconvert>
>
> Something like that?
>
> HTH,
> Matt
>
> --- Ben Tu <bt...@adobe.com> wrote:
>
> > Hi,
> > I would like to accomplish the similar task below
> in
> > ant script.
> > Does anyone know how?
> >
> > find . -name '*.class' | sed -e 's/^.\///g' -e
> > 's/\$/\\\$/g' | sort > log.txt
> >
> > thanks
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> >
> >
>
>
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: find file in specify directory and its sub-directory

Posted by Matt Benson <gu...@yahoo.com>.
pathsep="${line.separator}"

--- Ben Tu <bt...@adobe.com> wrote:

> Matt,
> This will returned the list of files separate with
> path separator.
> I want it returns a list of files as follow.
> 
> ${basedir}/com/abc/a.class
> ${basedir}/com/abc/b.class
> 
> Thanks, Ben
> 
> 
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com]
> Sent: Tuesday, October 07, 2008 10:35 AM
> To: Ant Users List
> Subject: Re: find file in specify directory and its
> sub-directory
> 
> Are your sed commands trying to strip off the
> leading
> ./ , then escape dollar signs found?  If so, the
> second probably wouldn't be relevant:
> 
> <pathconvert>
>   <fileset dir="${basedir}" includes="**/*.class" />
>   <globmapper from="${basedir}/*" to="*" />
> </pathconvert>
> 
> Something like that?
> 
> HTH,
> Matt
> 
> --- Ben Tu <bt...@adobe.com> wrote:
> 
> > Hi,
> > I would like to accomplish the similar task below
> in
> > ant script.
> > Does anyone know how?
> >
> > find . -name '*.class' | sed -e 's/^.\///g' -e
> > 's/\$/\\\$/g' | sort > log.txt
> >
> > thanks
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> >
> >
> 
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: find file in specify directory and its sub-directory

Posted by Ben Tu <bt...@adobe.com>.
Matt,
This will returned the list of files separate with path separator.
I want it returns a list of files as follow.

${basedir}/com/abc/a.class
${basedir}/com/abc/b.class

Thanks, Ben


-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com]
Sent: Tuesday, October 07, 2008 10:35 AM
To: Ant Users List
Subject: Re: find file in specify directory and its sub-directory

Are your sed commands trying to strip off the leading
./ , then escape dollar signs found?  If so, the
second probably wouldn't be relevant:

<pathconvert>
  <fileset dir="${basedir}" includes="**/*.class" />
  <globmapper from="${basedir}/*" to="*" />
</pathconvert>

Something like that?

HTH,
Matt

--- Ben Tu <bt...@adobe.com> wrote:

> Hi,
> I would like to accomplish the similar task below in
> ant script.
> Does anyone know how?
>
> find . -name '*.class' | sed -e 's/^.\///g' -e
> 's/\$/\\\$/g' | sort > log.txt
>
> thanks
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: find file in specify directory and its sub-directory

Posted by Ben Tu <bt...@adobe.com>.
Scot,
Thank you for your response. This returns the number of files not the list of actual files.
Ben

-----Original Message-----
From: Scot P. Floess [mailto:floess@mindspring.com]
Sent: Tuesday, October 07, 2008 10:28 AM
To: Ant Users List
Subject: Re: find file in specify directory and its sub-directory


You might check the resourcecount target

On Tue, 7 Oct 2008, Ben Tu wrote:

> Hi,
> I would like to accomplish the similar task below in ant script.
> Does anyone know how?
>
> find . -name '*.class' | sed -e 's/^.\///g' -e 's/\$/\\\$/g' | sort > log.txt
>
> thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Using filters to write property values

Posted by Alec Fernandez <Al...@sas.com>.
Hello,

I am trying to use a copy/filter to replace tokens in a file.

The file is a properties file and the tokens should be replaced with property values.

myproperty=@myvalue@

Obviously this involves writing the property values in escaped unicode encoding so I end up with

myproperty=c\:\\my_dir_name_with_nls_char_\u1234

I've done an ugly workaround that involves using propertyfile to write out the values in the correct format and then using loadfile with a filterchain to read these values back into properties as Strings but I'm thinking there has to be an easier way.

Thanks for any ideas.

-Alec


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: find file in specify directory and its sub-directory

Posted by "Scot P. Floess" <fl...@mindspring.com>.
You might check the resourcecount target

On Tue, 7 Oct 2008, Ben Tu wrote:

> Hi,
> I would like to accomplish the similar task below in ant script.
> Does anyone know how?
>
> find . -name '*.class' | sed -e 's/^.\///g' -e 's/\$/\\\$/g' | sort > log.txt
>
> thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: find file in specify directory and its sub-directory

Posted by Matt Benson <gu...@yahoo.com>.
Are your sed commands trying to strip off the leading
./ , then escape dollar signs found?  If so, the
second probably wouldn't be relevant:

<pathconvert>
  <fileset dir="${basedir}" includes="**/*.class" />
  <globmapper from="${basedir}/*" to="*" />
</pathconvert>

Something like that?

HTH,
Matt

--- Ben Tu <bt...@adobe.com> wrote:

> Hi,
> I would like to accomplish the similar task below in
> ant script.
> Does anyone know how?
> 
> find . -name '*.class' | sed -e 's/^.\///g' -e
> 's/\$/\\\$/g' | sort > log.txt
> 
> thanks
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


find file in specify directory and its sub-directory

Posted by Ben Tu <bt...@adobe.com>.
Hi,
I would like to accomplish the similar task below in ant script.
Does anyone know how?

find . -name '*.class' | sed -e 's/^.\///g' -e 's/\$/\\\$/g' | sort > log.txt

thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Loose logging when using forkmode

Posted by "Boring, Jeff W (N-Viper)" <je...@lmco.com>.
This fixed it, thanks! For those using XML to configure log4j, add the
following line to your console appender definition.

	<param name="Follow" value="true"/>

Jeff 
-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Monday, October 06, 2008 6:58 PM
To: Ant Users List
Cc: Ravindran, Neal; Michael Dunn
Subject: RE: Loose logging when using forkmode


Neal

does your log4j.properties contain log4j.appender.STDOUT.follow=true
# need to set follow for stdout as it gets moved around in junit tests
log4j.appender.STDOUT.follow=true

as suggested by pete in Bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44530

With Warm Regards
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission. 


> Date: Mon, 6 Oct 2008 18:05:09 -0400
> From: jeff.w.boring@lmco.com
> Subject: Loose logging when using forkmode
> To: user@ant.apache.org
> CC: neal.ravindran@lmco.com; kerry.t.johnson@lmco.com;
taranis70@gmail.com
> 
> Environment: ant 1.7.1, junit4.4 
> 
>  
> 
> We lost log4j logging output (eg. log.debug) in the <system-out>
section
> of the XML files when we switched to perBatch forkmode. [perBatch
> forkmode helps us greatly with performance of the tests.] Actually,
the
> FIRST test case that runs includes the log4j logging output but all
> others after that do not. Note that System.out.println's always appear
> in the xml files, just not log.debug.
> 
>  
> 
> Below is target from the build.xml file. If I remove the
> 'forkmode="perBatch"' the log4j logging output works fine. Any ideas
how
> to get logging with forkmode? Anyone using forkmode and getting the
> logging output (ie it's just me :-)) 
> 
>              
> 
>  
> 
> <target name="testI" depends="setUpInstrument,build" description=""
>
> 
>     <taskdef classpathref="cobertura.classpath"
> resource="tasks.properties"/>
> 
>     <junit printsummary="yes" haltonerror="false"
> failureproperty="junit_test_failed" forkmode="perBatch"
maxmemory="512m"
> >
> 
>                         
> 
>         <sysproperty key="net.sourceforge.cobertura.datafile"
> file="${base.dir}/cobertura.ser" />
> 
>         <classpath refid="cobertura.classpath" />
> 
>         <classpath>
> 
>             <pathelement path="${FmFileUrlMap.jar.file}" />
> 
>             <pathelement path="${GiJpaAbCd.jar.file}" />
> 
>             <pathelement location="${AllTests.path}"/>
> 
>             <pathelement path="${GiAdapterI.jar.file}" /> 
> 
>             <pathelement path="${local.classpath}" />
> 
>         </classpath>
> 
>         <formatter type="xml"/>
> 
>             <batchtest fork="yes" todir="${reports.dir}">
> 
>             <fileset dir="${AllTests.path}">
> 
>                 <include name="**/Test*.class"/>
> 
>                 <not> <filename name="**/*$*"/></not>
> 
>             </fileset>
> 
>             </batchtest>
> 
>       </junit>
> 
>       <fail if="junit_test_failed" message="One or more JUnit  tests
> failed"/>
> 
> </target>    
> 
>  
> 
>  
> 
> Jeff Boring
> 
> Orlando, Florida
> 

_________________________________________________________________
See how Windows connects the people, information, and fun that are part
of your life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Loose logging when using forkmode

Posted by Martin Gainty <mg...@hotmail.com>.
Neal

does your log4j.properties contain log4j.appender.STDOUT.follow=true
# need to set follow for stdout as it gets moved around in junit tests
log4j.appender.STDOUT.follow=true

as suggested by pete in Bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44530

With Warm Regards
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> Date: Mon, 6 Oct 2008 18:05:09 -0400
> From: jeff.w.boring@lmco.com
> Subject: Loose logging when using forkmode
> To: user@ant.apache.org
> CC: neal.ravindran@lmco.com; kerry.t.johnson@lmco.com; taranis70@gmail.com
> 
> Environment: ant 1.7.1, junit4.4 
> 
>  
> 
> We lost log4j logging output (eg. log.debug) in the <system-out> section
> of the XML files when we switched to perBatch forkmode. [perBatch
> forkmode helps us greatly with performance of the tests.] Actually, the
> FIRST test case that runs includes the log4j logging output but all
> others after that do not. Note that System.out.println's always appear
> in the xml files, just not log.debug.
> 
>  
> 
> Below is target from the build.xml file. If I remove the
> 'forkmode="perBatch"' the log4j logging output works fine. Any ideas how
> to get logging with forkmode? Anyone using forkmode and getting the
> logging output (ie it's just me :-)) 
> 
>              
> 
>  
> 
> <target name="testI" depends="setUpInstrument,build" description=""   >
> 
>     <taskdef classpathref="cobertura.classpath"
> resource="tasks.properties"/>
> 
>     <junit printsummary="yes" haltonerror="false"
> failureproperty="junit_test_failed" forkmode="perBatch" maxmemory="512m"
> >
> 
>                         
> 
>         <sysproperty key="net.sourceforge.cobertura.datafile"
> file="${base.dir}/cobertura.ser" />
> 
>         <classpath refid="cobertura.classpath" />
> 
>         <classpath>
> 
>             <pathelement path="${FmFileUrlMap.jar.file}" />
> 
>             <pathelement path="${GiJpaAbCd.jar.file}" />
> 
>             <pathelement location="${AllTests.path}"/>
> 
>             <pathelement path="${GiAdapterI.jar.file}" /> 
> 
>             <pathelement path="${local.classpath}" />
> 
>         </classpath>
> 
>         <formatter type="xml"/>
> 
>             <batchtest fork="yes" todir="${reports.dir}">
> 
>             <fileset dir="${AllTests.path}">
> 
>                 <include name="**/Test*.class"/>
> 
>                 <not> <filename name="**/*$*"/></not>
> 
>             </fileset>
> 
>             </batchtest>
> 
>       </junit>
> 
>       <fail if="junit_test_failed" message="One or more JUnit  tests
> failed"/>
> 
> </target>    
> 
>  
> 
>  
> 
> Jeff Boring
> 
> Orlando, Florida
> 

_________________________________________________________________
See how Windows connects the people, information, and fun that are part of your life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/