You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Daniel Fagerstrom <da...@nada.kth.se> on 2005/04/23 09:16:51 UTC

Re: svn commit: r164112 - in /cocoon: blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/ blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/ trunk/ trunk/src/java/org/apache/cocoon/ trunk/src/java/org/apache/cocoon/bean/ trunk/src/java/org/apache/cocoon/core/ trunk/src/java/org/apache/cocoon/core/container/ trunk/src/java/org/apache/cocoon/serialization/ trunk/src/test/org/apache/cocoon/ trunk/src/test/org/apache/cocoon/core/container/

cziegeler@apache.org wrote:
> Author: cziegeler
> Date: Thu Apr 21 13:04:01 2005
> New Revision: 164112
> 
> URL: http://svn.apache.org/viewcvs?rev=164112&view=rev
> Log:
> Remove the need for context object (where possible)
> Reduce default logging output during junit tests
> 
> Modified:
<snip/>
> Modified: cocoon/trunk/src/test/org/apache/cocoon/core/container/ContainerTestCase.java
> URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/core/container/ContainerTestCase.java?rev=164112&r1=164111&r2=164112&view=diff
> ==============================================================================
> --- cocoon/trunk/src/test/org/apache/cocoon/core/container/ContainerTestCase.java (original)
> +++ cocoon/trunk/src/test/org/apache/cocoon/core/container/ContainerTestCase.java Thu Apr 21 13:04:01 2005
> @@ -36,6 +36,9 @@
>  import org.apache.avalon.framework.parameters.Parameters;
>  import org.apache.avalon.framework.service.ServiceException;
>  import org.apache.avalon.framework.service.ServiceManager;
> +import org.apache.cocoon.configuration.Settings;
> +import org.apache.cocoon.core.Core;
> +import org.apache.cocoon.core.CoreUtil;
>  import org.apache.cocoon.util.log.DeprecationLogger;
>  
>  /**
> @@ -296,8 +299,12 @@
>          roleManager.enableLogging( this.getLogger() );
>          roleManager.configure( confRM );
>  
> +        // Set up root manager for Core
> +        Core core = new Core(new Settings(), this.context);
> +        CoreUtil.RootServiceManager rsm = new CoreUtil.RootServiceManager(null, core);
> + 
>          // Set up the ComponentLocator
> -        CoreServiceManager ecManager = new CoreServiceManager(null);
> +        CoreServiceManager ecManager = new CoreServiceManager(rsm);
>          ecManager.enableLogging( this.getLogger() );
>          ecManager.contextualize( this.context );
>          ecManager.setRoleManager( roleManager );

Carsten, this brook all my the test cases for the VPCs and the block 
stuff, and probably all other test cases. Could you please run the tests 
while refactoring the Core. It is the second or third time your 
refactoring breakes my tests in the last few weeks, so it start to get 
annoying.

                              --- o0o ---

What happens is that I get this exception:

org.apache.avalon.framework.context.ContextException: Unable to resolve 
context key: org.apache.cocoon.core.Core

AFAIU there is a need to create a BootstrapEnvironment for the tests and 
  call the CoreUtil constructor with that as argument, or should it be 
done in some other way?

                              --- o0o ---

I think that the work you have done on the Core this far is very 
important and good stuff, but as Sylvain has written before, the Cocoon 
core isn't your private business, as it affects everything else. Could 
you please write a roadmap about where you are heading with your 
refactoring. The blocks stuff that I try to write, need to set up an own 
component manager and an own processor so I am dependent of core stuff. 
But it is quite hard to develop it, if the core is a moving target and I 
have no idea about where it is moving.

/Daniel

Re: svn commit: r164112 - in /cocoon: blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/ blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/ trunk/ trunk/src/java/org/apache/cocoon/ trunk/src/java/org/apache/cocoon/bean/ trunk/src/java/org/apache/cocoon/core/ trunk/src/java/org/apache/cocoon/core/container/ trunk/src/java/org/apache/cocoon/serialization/ trunk/src/test/org/apache/cocoon/ trunk/src/test/org/apache/cocoon/core/container/

Posted by Carsten Ziegeler <cz...@apache.org>.
Daniel Fagerstrom wrote:
> 
> Not that I know, but I havn't checked. I did a quick fix that helped the 
> test cases I need right now.
> 
Great, yes, this fix is the right way for now. Thanks.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: svn commit: r164112 - in /cocoon: blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/ blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/ trunk/ trunk/src/java/org/apache/cocoon/ trunk/src/java/org/apache/cocoon/bean/ trunk/src/java/org/apache/cocoon/core/ trunk/src/java/org/apache/cocoon/core/container/ trunk/src/java/org/apache/cocoon/serialization/ trunk/src/test/org/apache/cocoon/ trunk/src/test/org/apache/cocoon/core/container/

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Carsten Ziegeler wrote:
> Sorry, that I broke something - I will look into it asap, but the
> current code of the core is not test-friendly. So I think it's better to
> refactor the code until it is more test-friendly than to make the tests
> run. And I fear this will take some time; as soon as the tests are
> running again, we see that we are finished. Apart from the tests is
> anything else broken?

Not that I know, but I havn't checked. I did a quick fix that helped the 
test cases I need right now.

I'm also refactoring the SitemapTestCase that I use for fuctional test 
to use Core and CoreUtil.

> Currently, I don't have a real roadmap I'm folling. When I have time,
> I'm just trying to clean up the core. The vision I have is to make it
> very easy to create new environments and remove all duplicate code,
> followed by making it easier to write own components and followed by
> enabling monitoring and runtime administration of the core. So if you
> want a roadmap this is all I can give you right now :)

Seem like a good plan.

> Again, sorry for breaking something.
No problem, just got a little bit irritated when I had to dive into your 
code changes instead of doing what I planned to do. OTH I learned a 
little bit more about the core and started some test case refactoring 
that I need to do sooner or later anyway.

/Daniel

Re: svn commit: r164112 - in /cocoon: blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/ blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/ trunk/ trunk/src/java/org/apache/cocoon/ trunk/src/java/org/apache/cocoon/bean/ trunk/src/java/org/apache/cocoon/core/ trunk/src/java/org/apache/cocoon/core/container/ trunk/src/java/org/apache/cocoon/serialization/ trunk/src/test/org/apache/cocoon/ trunk/src/test/org/apache/cocoon/core/container/

Posted by Carsten Ziegeler <cz...@apache.org>.
Sorry, that I broke something - I will look into it asap, but the
current code of the core is not test-friendly. So I think it's better to
refactor the code until it is more test-friendly than to make the tests
run. And I fear this will take some time; as soon as the tests are
running again, we see that we are finished. Apart from the tests is
anything else broken?

Currently, I don't have a real roadmap I'm folling. When I have time,
I'm just trying to clean up the core. The vision I have is to make it
very easy to create new environments and remove all duplicate code,
followed by making it easier to write own components and followed by
enabling monitoring and runtime administration of the core. So if you
want a roadmap this is all I can give you right now :)

Again, sorry for breaking something.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/