You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robin Rigby <ro...@gondolier.org.uk> on 2008/01/27 23:11:03 UTC

AbstractTestCase

Hi 

Have written action.  Compile OK, Install OK.

Need to test.  Found AbstractTestCase in cocoon-sitemap-impl.

How can I add a dependency to my POM that will make AbstractTestCase
available to my test cases?  It is not included in
cocoon-sitemap-impl.nnn.jar, is it?  So, no kind of <scope>test</scope> will
help?  Do I have to copy it?

Thanks




 
Robin



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: MockLogger configuration

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Robin Rigby pisze:
> I'd really appreciate some help with debugging.  I'm very new to Eclipse,
> too.  :-) 
> 
> More generally, it would be great to find some high quality advice on the
> web site on problem solving in general, particularly on the POM and Spring.
> There are now some very clear pages on the sitemap and writing and using
> components.  They are very welcome. 

Your probably have imported your block to Eclipse using mvn eclipse:eclipse command which generates
static Eclipse configuration. There is a better approach to integrate Maven project with Eclipse
IDE. It's called q4e[1].

Before you install this plug-in make sure to:

1. delete your block from Eclipse workspace (without deleting block's files of course)
2. run mvn eclipse:clean in your block

Then you can install q4e and import Maven project using File > Import > General > Maven 2 Project.

The advantage of q4e is that it well integrates with Eclipse so for example, you can run your test
cases from it being sure all classpath is set ok. It means that you will be able to debug test cases
the same way as any other class in Eclipse.

I hope that it helps you a little bit.

[1] http://code.google.com/p/q4e/

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: MockLogger configuration

Posted by Robin Rigby <ro...@gondolier.org.uk>.
I'd really appreciate some help with debugging.  I'm very new to Eclipse,
too.  :-) 

More generally, it would be great to find some high quality advice on the
web site on problem solving in general, particularly on the POM and Spring.
There are now some very clear pages on the sitemap and writing and using
components.  They are very welcome. 

Many thanks
 
Robin
 

-----Original Message-----
From: Grzegorz Kossakowski [mailto:gkossakowski@apache.org] 
Sent: 29 January 2008 21:14
To: users@cocoon.apache.org
Subject: Re: MockLogger configuration

Robin Rigby pisze:
> Am I right that the MockLogger delegates to log4j?  I get warnings about
> configuring log4j.
> 
> Where should I put log4j.xconf for testing?
> 
> Better, where should I look to find out for myself?

Yes, MockLogger delegates to log4j but I fail to see where it's used. I
think that in order to
figure out how this logging in tests works (I don't know myself) you would
need to debug this.

If you need debugging advice of unit tests (which is not that obvious but
once learned very
convenient) just ask.

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: MockLogger configuration

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Robin Rigby pisze:
> Am I right that the MockLogger delegates to log4j?  I get warnings about
> configuring log4j.
> 
> Where should I put log4j.xconf for testing?
> 
> Better, where should I look to find out for myself?

Yes, MockLogger delegates to log4j but I fail to see where it's used. I think that in order to
figure out how this logging in tests works (I don't know myself) you would need to debug this.

If you need debugging advice of unit tests (which is not that obvious but once learned very
convenient) just ask.

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


MockLogger configuration

Posted by Robin Rigby <ro...@gondolier.org.uk>.
Am I right that the MockLogger delegates to log4j?  I get warnings about
configuring log4j.

Where should I put log4j.xconf for testing?

Better, where should I look to find out for myself?

Many thanks
 
Robin



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: AbstractTestCase

Posted by Robin Rigby <ro...@gondolier.org.uk>.
Neat.  Thank you 


 
Robin

-----Original Message-----
From: Grzegorz Kossakowski [mailto:gkossakowski@apache.org] 
Sent: 27 January 2008 23:03
To: users@cocoon.apache.org
Subject: Re: AbstractTestCase

Robin Rigby pisze:
> Hi 
> 
> Have written action.  Compile OK, Install OK.
> 
> Need to test.  Found AbstractTestCase in cocoon-sitemap-impl.
> 
> How can I add a dependency to my POM that will make AbstractTestCase
> available to my test cases?  It is not included in
> cocoon-sitemap-impl.nnn.jar, is it?  So, no kind of <scope>test</scope>
will
> help?  Do I have to copy it?

AbstractTestCase is stored in separate jar
cocoon-sitemap-impl-tests-nnn.jar. The reason for doing
that is that our testing framework still introduces quite a lot of heavy
dependencies (we are
constantly working on cleaning up things) so we decided to put it into
separate jar to not pollute
applications build on top of Cocoon. Fortunately enough, Maven has native
support for such practice.

All you have to do is to add:

    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-sitemap-impl</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
      <version>...</version>
    </dependency>

(the trick was: <type> tag)

Ok... it's not enough due to annying bug described here[1]. Full snippet you
need to add is:
    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-sitemap-impl</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

Voting for MNG-1378 is probably a good idea.

[1] http://jira.codehaus.org/browse/MNG-1378

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: AbstractTestCase

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Robin Rigby pisze:
> Hi 
> 
> Have written action.  Compile OK, Install OK.
> 
> Need to test.  Found AbstractTestCase in cocoon-sitemap-impl.
> 
> How can I add a dependency to my POM that will make AbstractTestCase
> available to my test cases?  It is not included in
> cocoon-sitemap-impl.nnn.jar, is it?  So, no kind of <scope>test</scope> will
> help?  Do I have to copy it?

AbstractTestCase is stored in separate jar cocoon-sitemap-impl-tests-nnn.jar. The reason for doing
that is that our testing framework still introduces quite a lot of heavy dependencies (we are
constantly working on cleaning up things) so we decided to put it into separate jar to not pollute
applications build on top of Cocoon. Fortunately enough, Maven has native support for such practice.

All you have to do is to add:

    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-sitemap-impl</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
      <version>...</version>
    </dependency>

(the trick was: <type> tag)

Ok... it's not enough due to annying bug described here[1]. Full snippet you need to add is:
    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-sitemap-impl</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

Voting for MNG-1378 is probably a good idea.

[1] http://jira.codehaus.org/browse/MNG-1378

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org