You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Cord Awtry <ki...@gmail.com> on 2008/05/29 16:41:30 UTC

Logging messages from unit test

All,

  I'm running a junit test that calls several remote webservices using cxf.
I've been beating my head against a wall trying to figure out to get cxf to
log, on my local machine, the messages it's sending. Any thoughts on how to
do this properly?

  Thanks a lot,

    -C-

Re: Logging messages from unit test

Posted by Mieke Mocke <mm...@zag.com>.
Thanks for the pointer Dan. There is indeed a NPE being thrown as my 
SessionServiceImpl class on the service side is supposed to have the 
'sessionServiceDAO' bean injected, so my config here below is missing 
that ...

    <simple:server id="SessionService" 
serviceClass="com.zag.sessionservice.common.SessionService"
        address="/SessionService">
        <simple:dataBinding>
            <bean 
class="org.apache.cxf.aegis.databinding.AegisDatabinding"/>
        </simple:dataBinding>
        <simple:serviceBean>
            <bean class="com.zag.sessionservice.service.SessionServiceImpl">
            </bean>
        </simple:serviceBean>
    </simple:server>

<bean id="sessionServiceDAO" 
class="com.zag.sessionservice.dao.hibernate.HibernateSessionServiceDAO">
    <property name="sessionFactory" ref="sessionFactorySS"/>
</bean>

Mieke

Daniel Kulp wrote:
>
> One way to do this is to stick into your target/test-classes dir, a 
> cxf.xml file that looks something like:
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:cxf="http://cxf.apache.org/core"
> xsi:schemaLocation=" http://cxf.apache.org/core 
> http://cxf.apache.org/schemas/core.xsd
> http://www.springframework.org/schema/beans 
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
> <cxf:bus>
>   <cxf:features>
>     <cxf:logging/>
>   </cxf:features>
> </cxf:bus>
> </beans>
>
>
> You could also add an annotation like:
> @Features(features = {"org.apache.cxf.feature.LoggingFeature"})
> to your SEI interfaces or Test servers or similar.
>
> Dan
>
>
>
>
> On May 29, 2008, at 10:41 AM, Cord Awtry wrote:
>
>> All,
>>
>>  I'm running a junit test that calls several remote webservices using 
>> cxf.
>> I've been beating my head against a wall trying to figure out to get 
>> cxf to
>> log, on my local machine, the messages it's sending. Any thoughts on 
>> how to
>> do this properly?
>>
>>  Thanks a lot,
>>
>>    -C-
>
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
>
>
>
>

-- 
Mieke Mocke
Sr. Software Developer
Zag.com
800.584-5000
mmocke@zag.com



Re: Logging messages from unit test

Posted by Daniel Kulp <dk...@apache.org>.
One way to do this is to stick into your target/test-classes dir, a  
cxf.xml file that looks something like:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
xsi:schemaLocation=" http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
">
<cxf:bus>
   <cxf:features>
     <cxf:logging/>
   </cxf:features>
</cxf:bus>
</beans>


You could also add an annotation like:
@Features(features = {"org.apache.cxf.feature.LoggingFeature"})
to your SEI interfaces or Test servers or similar.

Dan




On May 29, 2008, at 10:41 AM, Cord Awtry wrote:

> All,
>
>  I'm running a junit test that calls several remote webservices  
> using cxf.
> I've been beating my head against a wall trying to figure out to get  
> cxf to
> log, on my local machine, the messages it's sending. Any thoughts on  
> how to
> do this properly?
>
>  Thanks a lot,
>
>    -C-

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog