You are viewing a plain text version of this content. The canonical link for it is here.
Posted to graffito-dev@incubator.apache.org by Alexandru Popescu <th...@gmail.com> on 2006/02/02 01:03:38 UTC

problems trying to run test units

Hi!

I am facing problems trying to run jcr-mapping units. Mainly these are due to the following:

1/ I have checked out only the jcr part of the project (it doesn't really has any dependencies on 
the other parts of the project), but this is not allowing Maven to run

I would really like to have this as independent as possible, so that anybody can build JCR mapping 
independent. Unfortunately I am not a maven guy so I cannot help much here.

2/ When trying to run from withing Eclipse the whole set of tests I am seeing lots of problems.

Mainly these are due to:
- tests are using custom nodes definitions, but it doesn't look like we are registering them with 
Jackrabbit (or I just missed this part). Also the order of declaration in custom_nodetypes.xml seems 
a little wrong: graffito:page is referencing graffito:paragraph which is just afterwards declared.

- the repository is not correctly closed when tests are finished


I must say that I am running the tests against a much more recent jackrabbit built. I am usually 
trying to keep my project as uptodate as possible to include the latest bugfixes.

please let me know your opinion,

./alex
--
.w( the_mindstorm )p.

Re: problems trying to run test units

Posted by Christophe Lombart <ch...@gmail.com>.
On 2/2/06, Alexandru Popescu <th...@gmail.com> wrote:
> #: Oliver Kiessler changed the world a bit at a time by saying (astral date: 2/2/2006 11:18 AM) :#
> > On 2/2/06, Christophe Lombart <ch...@gmail.com> wrote:
> >> Can we already generate the custom node types from some class-descriptor ?
> >
> > For simple node types yes (that don't contain child node definitions
> > etc.), but it isn't stable yet.
> >
> > But you could easily create node types by using the jackrabbit node
> > type configuration file until this functionality stabilizes (see
> > o.a.p.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypesFromConfiguration).
> >
> > - Oliver
> >
>
> Hi guys!
>
> I am not very aware of what jcr nodemanagement subproject is doing. But considering that there is no
> standard way (no api available) for this part of JCR spec I would stay with completely separate
> projects.
>
> opinions?
>
> ./alex
> --
> .w( the_mindstorm )p.
>
>


--
Best regards,

Christophe

Re: problems trying to run test units

Posted by Alexandru Popescu <th...@gmail.com>.
#: Christophe Lombart changed the world a bit at a time by saying (astral date: 2/2/2006 2:41 PM) :#
> ok but what are your suggestions ? continur to work like now ?
> 

sorry, can you detail the question :-(.

./alex
--
.w( the_mindstorm )p.

> On 2/2/06, Alexandru Popescu <th...@gmail.com> wrote:
>> #: Oliver Kiessler changed the world a bit at a time by saying (astral date: 2/2/2006 11:18 AM) :#
>> > On 2/2/06, Christophe Lombart <ch...@gmail.com> wrote:
>> >> Can we already generate the custom node types from some class-descriptor ?
>> >
>> > For simple node types yes (that don't contain child node definitions
>> > etc.), but it isn't stable yet.
>> >
>> > But you could easily create node types by using the jackrabbit node
>> > type configuration file until this functionality stabilizes (see
>> > o.a.p.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypesFromConfiguration).
>> >
>> > - Oliver
>> >
>>
>> Hi guys!
>>
>> I am not very aware of what jcr nodemanagement subproject is doing. But considering that there is no
>> standard way (no api available) for this part of JCR spec I would stay with completely separate
>> projects.
>>
>> opinions?
>>
>> ./alex
>> --
>> .w( the_mindstorm )p.
>>
>>
> 
> 
> --
> Best regards,
> 
> Christophe
> 


Re: problems trying to run test units

Posted by Christophe Lombart <ch...@gmail.com>.
ok but what are your suggestions ? continur to work like now ?

On 2/2/06, Alexandru Popescu <th...@gmail.com> wrote:
> #: Oliver Kiessler changed the world a bit at a time by saying (astral date: 2/2/2006 11:18 AM) :#
> > On 2/2/06, Christophe Lombart <ch...@gmail.com> wrote:
> >> Can we already generate the custom node types from some class-descriptor ?
> >
> > For simple node types yes (that don't contain child node definitions
> > etc.), but it isn't stable yet.
> >
> > But you could easily create node types by using the jackrabbit node
> > type configuration file until this functionality stabilizes (see
> > o.a.p.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypesFromConfiguration).
> >
> > - Oliver
> >
>
> Hi guys!
>
> I am not very aware of what jcr nodemanagement subproject is doing. But considering that there is no
> standard way (no api available) for this part of JCR spec I would stay with completely separate
> projects.
>
> opinions?
>
> ./alex
> --
> .w( the_mindstorm )p.
>
>


--
Best regards,

Christophe

Re: problems trying to run test units

Posted by Alexandru Popescu <th...@gmail.com>.
#: Oliver Kiessler changed the world a bit at a time by saying (astral date: 2/2/2006 11:18 AM) :#
> On 2/2/06, Christophe Lombart <ch...@gmail.com> wrote:
>> Can we already generate the custom node types from some class-descriptor ?
> 
> For simple node types yes (that don't contain child node definitions
> etc.), but it isn't stable yet.
> 
> But you could easily create node types by using the jackrabbit node
> type configuration file until this functionality stabilizes (see
> o.a.p.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypesFromConfiguration).
> 
> - Oliver
> 

Hi guys!

I am not very aware of what jcr nodemanagement subproject is doing. But considering that there is no 
standard way (no api available) for this part of JCR spec I would stay with completely separate 
projects.

opinions?

./alex
--
.w( the_mindstorm )p.


Re: problems trying to run test units

Posted by Oliver Kiessler <ki...@inceedo.com>.
On 2/2/06, Christophe Lombart <ch...@gmail.com> wrote:
> Can we already generate the custom node types from some class-descriptor ?

For simple node types yes (that don't contain child node definitions
etc.), but it isn't stable yet.

But you could easily create node types by using the jackrabbit node
type configuration file until this functionality stabilizes (see
o.a.p.graffito.jcr.nodemanagement.NodeTypeManager#createNodeTypesFromConfiguration).

- Oliver

Re: problems trying to run test units

Posted by Christophe Lombart <ch...@gmail.com>.
Can we already generate the custom node types from some class-descriptor ?

On 2/2/06, Oliver Kiessler <ki...@inceedo.com> wrote:
> > 2/ I never run the unit tests from Eclipse but you are right. The unit
> > test uses some custome node types. Right now, they are copied into the
> > target folder before running the unit test. This is done with a maven
> > pregoal.
>
> We could solve this by using the jcr nodemanagement tools to create
> the node types we need for tests. The nodemanagement tools as a whole
> are not finished yet but this piece of functionality is already
> implemented and could be used.
>
> - oliver
>


--
Best regards,

Christophe

Re: problems trying to run test units

Posted by Oliver Kiessler <ki...@inceedo.com>.
> 2/ I never run the unit tests from Eclipse but you are right. The unit
> test uses some custome node types. Right now, they are copied into the
> target folder before running the unit test. This is done with a maven
> pregoal.

We could solve this by using the jcr nodemanagement tools to create
the node types we need for tests. The nodemanagement tools as a whole
are not finished yet but this piece of functionality is already
implemented and could be used.

- oliver

Re: problems trying to run test units

Posted by Christophe Lombart <ch...@gmail.com>.
On 2/3/06, Alexandru Popescu <th...@gmail.com> wrote:
> Hi!
>
> Thanks for the explanation about how it works. Considering that I had problems running the suite
> from withing the IDE, I have modified the base test to use the Jackrabbit API to import custom nodes.
>
> Considering that there is no specification to handle custom node types, I would say that both
> solutions are oke. The single difference is that the programmatic approach (the way i have modified
> the base test) will allow running the suite from within the IDE.

OK that's better if you want to run the test one by one - Thanks !

>
> ./alex
> --
> .w( the_mindstorm )p.
>
> #: Christophe Lombart changed the world a bit at a time by saying (astral date: 2/2/2006 9:35 PM) :#
> > For unit test, the custom node type file solution is quite easy.
> > of course, for real applications I see good reasons to use the API to
> > import the node types.
> >
> > How is it working for the unit tests  ? (see the maven.xml, it is
> > quite simple to understand) :
> >
> > 1/ Node types used in the unit tests are added in :
> > /src/test-config/repository/repository/nodetypes/custom_nodetypes.xml
> >
> > 2/ target/repository contains the repository for the unit test and can
> > clean up with " maven clean" .
> >
> > 3/ before starting the unit tests,
> > /src/test-config/repository/repository/nodetypes/custom_nodetypes.xml
> >  is copied into target/repository/repository/nodetypes
> >
> >
> > of course, we have the same result by using the API but I didn't know
> > that Oliver has finished that. Up to you to choose what you want.
> >
> >
> >
> > On 2/2/06, Oliver Kiessler <ki...@inceedo.com> wrote:
> >> > That's how I have modified the BaseTest to do ;-). Register the custom node types using Jackrabbit
> >> > API (before Christophe explaining how it works with Maven).
> >>
> >> sorry about that! I didn't know... Well, both ways are possible but I
> >> prefer solving this programmatically.... ;)
> >>
> >> - oliver
> >>
> >
> >
> > --
> > Best regards,
> >
> > Christophe
> >
>
>


--
Best regards,

Christophe

Re: problems trying to run test units

Posted by Alexandru Popescu <th...@gmail.com>.
Hi!

Thanks for the explanation about how it works. Considering that I had problems running the suite 
from withing the IDE, I have modified the base test to use the Jackrabbit API to import custom nodes.

Considering that there is no specification to handle custom node types, I would say that both 
solutions are oke. The single difference is that the programmatic approach (the way i have modified 
the base test) will allow running the suite from within the IDE.

./alex
--
.w( the_mindstorm )p.

#: Christophe Lombart changed the world a bit at a time by saying (astral date: 2/2/2006 9:35 PM) :#
> For unit test, the custom node type file solution is quite easy.
> of course, for real applications I see good reasons to use the API to
> import the node types.
> 
> How is it working for the unit tests  ? (see the maven.xml, it is
> quite simple to understand) :
> 
> 1/ Node types used in the unit tests are added in :
> /src/test-config/repository/repository/nodetypes/custom_nodetypes.xml
> 
> 2/ target/repository contains the repository for the unit test and can
> clean up with " maven clean" .
> 
> 3/ before starting the unit tests,
> /src/test-config/repository/repository/nodetypes/custom_nodetypes.xml
>  is copied into target/repository/repository/nodetypes
> 
> 
> of course, we have the same result by using the API but I didn't know
> that Oliver has finished that. Up to you to choose what you want.
> 
> 
> 
> On 2/2/06, Oliver Kiessler <ki...@inceedo.com> wrote:
>> > That's how I have modified the BaseTest to do ;-). Register the custom node types using Jackrabbit
>> > API (before Christophe explaining how it works with Maven).
>>
>> sorry about that! I didn't know... Well, both ways are possible but I
>> prefer solving this programmatically.... ;)
>>
>> - oliver
>>
> 
> 
> --
> Best regards,
> 
> Christophe
> 


Re: problems trying to run test units

Posted by Christophe Lombart <ch...@gmail.com>.
For unit test, the custom node type file solution is quite easy.
of course, for real applications I see good reasons to use the API to
import the node types.

How is it working for the unit tests  ? (see the maven.xml, it is
quite simple to understand) :

1/ Node types used in the unit tests are added in :
/src/test-config/repository/repository/nodetypes/custom_nodetypes.xml

2/ target/repository contains the repository for the unit test and can
clean up with " maven clean" .

3/ before starting the unit tests,
/src/test-config/repository/repository/nodetypes/custom_nodetypes.xml
 is copied into target/repository/repository/nodetypes


of course, we have the same result by using the API but I didn't know
that Oliver has finished that. Up to you to choose what you want.



On 2/2/06, Oliver Kiessler <ki...@inceedo.com> wrote:
> > That's how I have modified the BaseTest to do ;-). Register the custom node types using Jackrabbit
> > API (before Christophe explaining how it works with Maven).
>
> sorry about that! I didn't know... Well, both ways are possible but I
> prefer solving this programmatically.... ;)
>
> - oliver
>


--
Best regards,

Christophe

Re: problems trying to run test units

Posted by Oliver Kiessler <ki...@inceedo.com>.
> That's how I have modified the BaseTest to do ;-). Register the custom node types using Jackrabbit
> API (before Christophe explaining how it works with Maven).

sorry about that! I didn't know... Well, both ways are possible but I
prefer solving this programmatically.... ;)

- oliver

Re: problems trying to run test units

Posted by Alexandru Popescu <th...@gmail.com>.
#: Oliver Kiessler changed the world a bit at a time by saying (astral date: 2/2/2006 3:19 PM) :#
>> Not in the classpath but in the jackrabbit repository folder (see in
>> /jcr-mapping/target/repository/repository/nodetypes). This one is
>> create in the Target folder before running the unit tests. By this
>> way, it is quite easy to clean up the repo before running the unit
>> test. I'm agree it is not the ideal solution.
>> Another solution is importing the custom node type via the Jackrabbit
>> API which is not standard. This is not also an ideal solution.
> 
> Well, the nodetype manager api will have support for different
> repository implementations sometime, so using it and going with
> jackrabbit for now shouldn't be a problem.
> 
> Then we would just need a jackrabbit nodetype xml configuration file
> for the test nodetypes. On the first test run the TestBase class will
> initialize the repo (once) and create the nodetypes from the file.
> 
> Copying files manually into the repository is not recommended at all
> (that's what the jackrabbit people say).
> 
> - Oliver
> 

That's how I have modified the BaseTest to do ;-). Register the custom node types using Jackrabbit 
API (before Christophe explaining how it works with Maven).

./alex
--
.w( the_mindstorm )p.




Re: problems trying to run test units

Posted by Oliver Kiessler <ki...@inceedo.com>.
> Not in the classpath but in the jackrabbit repository folder (see in
> /jcr-mapping/target/repository/repository/nodetypes). This one is
> create in the Target folder before running the unit tests. By this
> way, it is quite easy to clean up the repo before running the unit
> test. I'm agree it is not the ideal solution.
> Another solution is importing the custom node type via the Jackrabbit
> API which is not standard. This is not also an ideal solution.

Well, the nodetype manager api will have support for different
repository implementations sometime, so using it and going with
jackrabbit for now shouldn't be a problem.

Then we would just need a jackrabbit nodetype xml configuration file
for the test nodetypes. On the first test run the TestBase class will
initialize the repo (once) and create the nodetypes from the file.

Copying files manually into the repository is not recommended at all
(that's what the jackrabbit people say).

- Oliver

Re: problems trying to run test units

Posted by Christophe Lombart <ch...@gmail.com>.
On 2/2/06, Alexandru Popescu <th...@gmail.com> wrote:
> #: Christophe Lombart changed the world a bit at a time by saying (astral date: 2/2/2006 10:36 AM) :#

> Are you suggesting that Jackrabbit is gonna automatically load any custom_nodetypes.xml found in the
> classpath?

Not in the classpath but in the jackrabbit repository folder (see in
/jcr-mapping/target/repository/repository/nodetypes). This one is
create in the Target folder before running the unit tests. By this
way, it is quite easy to clean up the repo before running the unit
test. I'm agree it is not the ideal solution.
Another solution is importing the custom node type via the Jackrabbit
API which is not standard. This is not also an ideal solution.


--
Best regards,

Christophe

Re: problems trying to run test units

Posted by Alexandru Popescu <th...@gmail.com>.
#: Christophe Lombart changed the world a bit at a time by saying (astral date: 2/2/2006 10:36 AM) :#
> Alex,
> 
> 1/ I'm +1 to see the jcr tools more independant but the maven goals &
> setup are to be reviewed. This is not a big work. Can you create a new
> JIRA issue ? I can work on that in a couple of days.
> 

I will do it whenever I can :-S.

> 2/ I never run the unit tests from Eclipse but you are right. The unit
> test uses some custome node types. Right now, they are copied into the
> target folder before running the unit test. This is done with a maven
> pregoal.
>

Are you suggesting that Jackrabbit is gonna automatically load any custom_nodetypes.xml found in the 
classpath?

> 3/ By default the unit tests are disable by default. Unit tests take
> time and Graffito users are not always interested by the unit test
> results. Of course, this is an important tasks for the dev team. If
> you want to run the unit test, you can :
> - on the command line do : maven -Dmaven.test.skip=false [the maven goal]
> - In your "build.properties" defined in your USER_HOME, add
> "maven.test.skip=false". By this way, the unit test are always
> executed.
> 
> I  disable the unit tests because we have not some distribution and
> building the complete Graffito project takes more and more time which
> is not very  interesting for a Graffito user.
> 
> 

Great.

tia,

./alex
--
.w( the_mindstorm )p.

> 
> 
> 
> On 2/2/06, Alexandru Popescu <th...@gmail.com> wrote:
>> (continuation)
>>
>> I have done so that the project.xml in jcr-mapping can correctly find project.xml. But still when
>> running maven jar:jar in jcr-mapping I only see the resource copy goal, but no tests are run. Any
>> idea why?
>>
>> ./alex
>> --
>> .w( the_mindstorm )p.
>>
>> #: Alexandru Popescu changed the world a bit at a time by saying (astral date: 2/2/2006 3:03 AM) :#
>> > Hi!
>> >
>> > I am facing problems trying to run jcr-mapping units. Mainly these are due to the following:
>> >
>> > 1/ I have checked out only the jcr part of the project (it doesn't really has any dependencies on
>> > the other parts of the project), but this is not allowing Maven to run
>> >
>> > I would really like to have this as independent as possible, so that anybody can build JCR mapping
>> > independent. Unfortunately I am not a maven guy so I cannot help much here.
>> >
>> > 2/ When trying to run from withing Eclipse the whole set of tests I am seeing lots of problems.
>> >
>> > Mainly these are due to:
>> > - tests are using custom nodes definitions, but it doesn't look like we are registering them with
>> > Jackrabbit (or I just missed this part). Also the order of declaration in custom_nodetypes.xml seems
>> > a little wrong: graffito:page is referencing graffito:paragraph which is just afterwards declared.
>> >
>> > - the repository is not correctly closed when tests are finished
>> >
>> >
>> > I must say that I am running the tests against a much more recent jackrabbit built. I am usually
>> > trying to keep my project as uptodate as possible to include the latest bugfixes.
>> >
>> > please let me know your opinion,
>> >
>> > ./alex
>> > --
>> > .w( the_mindstorm )p.
>> >
>>
>>
> 
> 
> --
> Best regards,
> 
> Christophe
> 


Re: problems trying to run test units

Posted by Christophe Lombart <ch...@gmail.com>.
Alex,

1/ I'm +1 to see the jcr tools more independant but the maven goals &
setup are to be reviewed. This is not a big work. Can you create a new
JIRA issue ? I can work on that in a couple of days.

2/ I never run the unit tests from Eclipse but you are right. The unit
test uses some custome node types. Right now, they are copied into the
target folder before running the unit test. This is done with a maven
pregoal.

3/ By default the unit tests are disable by default. Unit tests take
time and Graffito users are not always interested by the unit test
results. Of course, this is an important tasks for the dev team. If
you want to run the unit test, you can :
- on the command line do : maven -Dmaven.test.skip=false [the maven goal]
- In your "build.properties" defined in your USER_HOME, add
"maven.test.skip=false". By this way, the unit test are always
executed.

I  disable the unit tests because we have not some distribution and
building the complete Graffito project takes more and more time which
is not very  interesting for a Graffito user.





On 2/2/06, Alexandru Popescu <th...@gmail.com> wrote:
> (continuation)
>
> I have done so that the project.xml in jcr-mapping can correctly find project.xml. But still when
> running maven jar:jar in jcr-mapping I only see the resource copy goal, but no tests are run. Any
> idea why?
>
> ./alex
> --
> .w( the_mindstorm )p.
>
> #: Alexandru Popescu changed the world a bit at a time by saying (astral date: 2/2/2006 3:03 AM) :#
> > Hi!
> >
> > I am facing problems trying to run jcr-mapping units. Mainly these are due to the following:
> >
> > 1/ I have checked out only the jcr part of the project (it doesn't really has any dependencies on
> > the other parts of the project), but this is not allowing Maven to run
> >
> > I would really like to have this as independent as possible, so that anybody can build JCR mapping
> > independent. Unfortunately I am not a maven guy so I cannot help much here.
> >
> > 2/ When trying to run from withing Eclipse the whole set of tests I am seeing lots of problems.
> >
> > Mainly these are due to:
> > - tests are using custom nodes definitions, but it doesn't look like we are registering them with
> > Jackrabbit (or I just missed this part). Also the order of declaration in custom_nodetypes.xml seems
> > a little wrong: graffito:page is referencing graffito:paragraph which is just afterwards declared.
> >
> > - the repository is not correctly closed when tests are finished
> >
> >
> > I must say that I am running the tests against a much more recent jackrabbit built. I am usually
> > trying to keep my project as uptodate as possible to include the latest bugfixes.
> >
> > please let me know your opinion,
> >
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >
>
>


--
Best regards,

Christophe

Re: problems trying to run test units

Posted by Alexandru Popescu <th...@gmail.com>.
(continuation)

I have done so that the project.xml in jcr-mapping can correctly find project.xml. But still when 
running maven jar:jar in jcr-mapping I only see the resource copy goal, but no tests are run. Any 
idea why?

./alex
--
.w( the_mindstorm )p.

#: Alexandru Popescu changed the world a bit at a time by saying (astral date: 2/2/2006 3:03 AM) :#
> Hi!
> 
> I am facing problems trying to run jcr-mapping units. Mainly these are due to the following:
> 
> 1/ I have checked out only the jcr part of the project (it doesn't really has any dependencies on 
> the other parts of the project), but this is not allowing Maven to run
> 
> I would really like to have this as independent as possible, so that anybody can build JCR mapping 
> independent. Unfortunately I am not a maven guy so I cannot help much here.
> 
> 2/ When trying to run from withing Eclipse the whole set of tests I am seeing lots of problems.
> 
> Mainly these are due to:
> - tests are using custom nodes definitions, but it doesn't look like we are registering them with 
> Jackrabbit (or I just missed this part). Also the order of declaration in custom_nodetypes.xml seems 
> a little wrong: graffito:page is referencing graffito:paragraph which is just afterwards declared.
> 
> - the repository is not correctly closed when tests are finished
> 
> 
> I must say that I am running the tests against a much more recent jackrabbit built. I am usually 
> trying to keep my project as uptodate as possible to include the latest bugfixes.
> 
> please let me know your opinion,
> 
> ./alex
> --
> .w( the_mindstorm )p.
> 


Re: problems trying to run test units

Posted by Alexandru Popescu <th...@gmail.com>.
(continuation)

I have done so that the project.xml in jcr-mapping can correctly find project.xml. But still when 
running maven jar:jar in jcr-mapping I only see the resource copy goal, but no tests are run. Any 
idea why?

./alex
--
.w( the_mindstorm )p.

#: Alexandru Popescu changed the world a bit at a time by saying (astral date: 2/2/2006 3:03 AM) :#
> Hi!
> 
> I am facing problems trying to run jcr-mapping units. Mainly these are due to the following:
> 
> 1/ I have checked out only the jcr part of the project (it doesn't really has any dependencies on 
> the other parts of the project), but this is not allowing Maven to run
> 
> I would really like to have this as independent as possible, so that anybody can build JCR mapping 
> independent. Unfortunately I am not a maven guy so I cannot help much here.
> 
> 2/ When trying to run from withing Eclipse the whole set of tests I am seeing lots of problems.
> 
> Mainly these are due to:
> - tests are using custom nodes definitions, but it doesn't look like we are registering them with 
> Jackrabbit (or I just missed this part). Also the order of declaration in custom_nodetypes.xml seems 
> a little wrong: graffito:page is referencing graffito:paragraph which is just afterwards declared.
> 
> - the repository is not correctly closed when tests are finished
> 
> 
> I must say that I am running the tests against a much more recent jackrabbit built. I am usually 
> trying to keep my project as uptodate as possible to include the latest bugfixes.
> 
> please let me know your opinion,
> 
> ./alex
> --
> .w( the_mindstorm )p.
>