You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by Harry Metske <ha...@gmail.com> on 2009/04/10 19:30:43 UTC

JUnit testing 3.0 => "Page removed already!?! " errors

the WikiEngineTest also reports a lot of these errors (because it happens in
the tearDown method) :

Page removed already!?!

org.apache.wiki.InternalWikiException: Page removed already!?!
at
org.apache.wiki.search.SearchManager.actionPerformed(SearchManager.java:388)
at
org.apache.wiki.event.WikiEventManager$WikiEventDelegate.fireEvent(WikiEventManager.java:568)
at
org.apache.wiki.event.WikiEventManager.fireEvent(WikiEventManager.java:349)
at
org.apache.wiki.content.ContentManager.fireEvent(ContentManager.java:1079)
at
org.apache.wiki.content.ContentManager.deletePage(ContentManager.java:827)
at org.apache.wiki.TestEngine.emptyRepository(TestEngine.java:198)
at org.apache.wiki.WikiEngineTest.tearDown(WikiEngineTest.java:74)
Caused by: org.apache.wiki.content.PageNotFoundException: Main:mrmxyzptlk
at org.apache.wiki.content.ContentManager.getPage(ContentManager.java:1183)
at org.apache.wiki.WikiEngine.getPage(WikiEngine.java:1961)
at org.apache.wiki.WikiEngine.getPage(WikiEngine.java:1955)
at
org.apache.wiki.search.SearchManager.actionPerformed(SearchManager.java:382)

Is this because the page was never added to the SearchEngine to be indexed ?
Or is there a double delete somewhere ?

Harry

Re: JUnit testing 3.0 => "Page removed already!?! " errors

Posted by Janne Jalkanen <ja...@ecyrd.com>.
> I have noticed that there does not seem to be any way to rename  
> anything with ContrntManager, either, which is causing PageRenamer  
> etc to fail.

Correct. I'm not there yet.

> The good news, I think, is that a large number of errors seem to be  
> caused by only a few bugs.

Correct.  Most of them come from the fact that ContentManager works in  
subtly different ways than the old PageManager.  For example, it's a  
different thing to say createPage() than to say new WikiPage(),  
because their side-effects are different. Hunting down those side- 
effects is taking a bit of time (not exactly helped by the kid  
screaming his lungs off into my ear).

/Janne

Re: JUnit testing 3.0 => "Page removed already!?! " errors

Posted by Andrew Jaquith <an...@gmail.com>.
Aha! Harry, good catch!

I have noticed that there does not seem to be any way to rename  
anything with ContrntManager, either, which is causing PageRenamer etc  
to fail.

The good news, I think, is that a large number of errors seem to be  
caused by only a few bugs.

Andrew

On Apr 11, 2009, at 6:18, Harry Metske <ha...@gmail.com> wrote:

> The event handling looks good, SearchManager handles the  
> PAGE_DELETE_REQUEST
> event properly.
> The root cause is that there is no VersionHistory support yet.
>
> When calling ContentManager.getAllPages(), you get duplicate pages  
> in the
> returned List, when trying to delete these, only the first one (of  
> course)
> succeeds, when trying to delete the second one you get the mentioned
> Exception.
>
> Harry
>
> 2009/4/10 Janne Jalkanen <ja...@ecyrd.com>
>
>>
>> We've got two event for delete - one which is DELETE_REQUEST and  
>> one which
>> is actual DELETED.  The removal of the page occurs between these  
>> two.  It
>> looks like SearchManager might be subscribing to the wrong event  
>> and as a
>> result, accessing the page after it has been already removed.
>>
>> Now, 2.x does not really care, since it's possible to access the  
>> page after
>> its deletion since WikiPage is still live even if its contents  
>> aren't. 3.0
>> is a lot stricter in this regard.
>>
>> /Janne
>>
>>
>> On 10 Apr 2009, at 20:30, Harry Metske wrote:
>>
>> the WikiEngineTest also reports a lot of these errors (because it  
>> happens
>>> in
>>> the tearDown method) :
>>>
>>> Page removed already!?!
>>>
>>> org.apache.wiki.InternalWikiException: Page removed already!?!
>>> at
>>>
>>> org. 
>>> apache. 
>>> wiki.search.SearchManager.actionPerformed(SearchManager.java:388)
>>> at
>>>
>>> org.apache.wiki.event.WikiEventManager 
>>> $WikiEventDelegate.fireEvent(WikiEventManager.java:568)
>>> at
>>>
>>> org. 
>>> apache.wiki.event.WikiEventManager.fireEvent(WikiEventManager.java: 
>>> 349)
>>> at
>>> org. 
>>> apache.wiki.content.ContentManager.fireEvent(ContentManager.java: 
>>> 1079)
>>> at
>>> org. 
>>> apache.wiki.content.ContentManager.deletePage(ContentManager.java: 
>>> 827)
>>> at org.apache.wiki.TestEngine.emptyRepository(TestEngine.java:198)
>>> at org.apache.wiki.WikiEngineTest.tearDown(WikiEngineTest.java:74)
>>> Caused by: org.apache.wiki.content.PageNotFoundException:  
>>> Main:mrmxyzptlk
>>> at
>>> org.apache.wiki.content.ContentManager.getPage(ContentManager.java: 
>>> 1183)
>>> at org.apache.wiki.WikiEngine.getPage(WikiEngine.java:1961)
>>> at org.apache.wiki.WikiEngine.getPage(WikiEngine.java:1955)
>>> at
>>>
>>> org. 
>>> apache. 
>>> wiki.search.SearchManager.actionPerformed(SearchManager.java:382)
>>>
>>> Is this because the page was never added to the SearchEngine to be  
>>> indexed
>>> ?
>>> Or is there a double delete somewhere ?
>>>
>>> Harry
>>>
>>
>>

Re: JUnit testing 3.0 => "Page removed already!?! " errors

Posted by Harry Metske <ha...@gmail.com>.
The event handling looks good, SearchManager handles the PAGE_DELETE_REQUEST
event properly.
The root cause is that there is no VersionHistory support yet.

When calling ContentManager.getAllPages(), you get duplicate pages in the
returned List, when trying to delete these, only the first one (of course)
succeeds, when trying to delete the second one you get the mentioned
Exception.

Harry

2009/4/10 Janne Jalkanen <ja...@ecyrd.com>

>
> We've got two event for delete - one which is DELETE_REQUEST and one which
> is actual DELETED.  The removal of the page occurs between these two.  It
> looks like SearchManager might be subscribing to the wrong event and as a
> result, accessing the page after it has been already removed.
>
> Now, 2.x does not really care, since it's possible to access the page after
> its deletion since WikiPage is still live even if its contents aren't. 3.0
> is a lot stricter in this regard.
>
> /Janne
>
>
> On 10 Apr 2009, at 20:30, Harry Metske wrote:
>
>  the WikiEngineTest also reports a lot of these errors (because it happens
>> in
>> the tearDown method) :
>>
>> Page removed already!?!
>>
>> org.apache.wiki.InternalWikiException: Page removed already!?!
>> at
>>
>> org.apache.wiki.search.SearchManager.actionPerformed(SearchManager.java:388)
>> at
>>
>> org.apache.wiki.event.WikiEventManager$WikiEventDelegate.fireEvent(WikiEventManager.java:568)
>> at
>>
>> org.apache.wiki.event.WikiEventManager.fireEvent(WikiEventManager.java:349)
>> at
>> org.apache.wiki.content.ContentManager.fireEvent(ContentManager.java:1079)
>> at
>> org.apache.wiki.content.ContentManager.deletePage(ContentManager.java:827)
>> at org.apache.wiki.TestEngine.emptyRepository(TestEngine.java:198)
>> at org.apache.wiki.WikiEngineTest.tearDown(WikiEngineTest.java:74)
>> Caused by: org.apache.wiki.content.PageNotFoundException: Main:mrmxyzptlk
>> at
>> org.apache.wiki.content.ContentManager.getPage(ContentManager.java:1183)
>> at org.apache.wiki.WikiEngine.getPage(WikiEngine.java:1961)
>> at org.apache.wiki.WikiEngine.getPage(WikiEngine.java:1955)
>> at
>>
>> org.apache.wiki.search.SearchManager.actionPerformed(SearchManager.java:382)
>>
>> Is this because the page was never added to the SearchEngine to be indexed
>> ?
>> Or is there a double delete somewhere ?
>>
>> Harry
>>
>
>

Re: JUnit testing 3.0 => "Page removed already!?! " errors

Posted by Janne Jalkanen <ja...@ecyrd.com>.
We've got two event for delete - one which is DELETE_REQUEST and one  
which is actual DELETED.  The removal of the page occurs between these  
two.  It looks like SearchManager might be subscribing to the wrong  
event and as a result, accessing the page after it has been already  
removed.

Now, 2.x does not really care, since it's possible to access the page  
after its deletion since WikiPage is still live even if its contents  
aren't. 3.0 is a lot stricter in this regard.

/Janne

On 10 Apr 2009, at 20:30, Harry Metske wrote:

> the WikiEngineTest also reports a lot of these errors (because it  
> happens in
> the tearDown method) :
>
> Page removed already!?!
>
> org.apache.wiki.InternalWikiException: Page removed already!?!
> at
> org 
> .apache.wiki.search.SearchManager.actionPerformed(SearchManager.java: 
> 388)
> at
> org.apache.wiki.event.WikiEventManager 
> $WikiEventDelegate.fireEvent(WikiEventManager.java:568)
> at
> org 
> .apache.wiki.event.WikiEventManager.fireEvent(WikiEventManager.java: 
> 349)
> at
> org.apache.wiki.content.ContentManager.fireEvent(ContentManager.java: 
> 1079)
> at
> org 
> .apache.wiki.content.ContentManager.deletePage(ContentManager.java: 
> 827)
> at org.apache.wiki.TestEngine.emptyRepository(TestEngine.java:198)
> at org.apache.wiki.WikiEngineTest.tearDown(WikiEngineTest.java:74)
> Caused by: org.apache.wiki.content.PageNotFoundException:  
> Main:mrmxyzptlk
> at  
> org.apache.wiki.content.ContentManager.getPage(ContentManager.java: 
> 1183)
> at org.apache.wiki.WikiEngine.getPage(WikiEngine.java:1961)
> at org.apache.wiki.WikiEngine.getPage(WikiEngine.java:1955)
> at
> org 
> .apache.wiki.search.SearchManager.actionPerformed(SearchManager.java: 
> 382)
>
> Is this because the page was never added to the SearchEngine to be  
> indexed ?
> Or is there a double delete somewhere ?
>
> Harry