On 09/01/2015 12:58, Felix Schumacher wrote:
> Hi all,
> 
> while trying to setup a unit test for bug 57425 I stumbled about two
> things.
> 
> First the Tomcat class always uses a StandardContext even if I set
> another name for a context class on StandardHost.
> 
> If I change addWebapp to use the contextClass from the StandardHost the
> ReplicatedContext will be used.
> 
> Would this be the right way to test ReplicatedContext?

Yes.

> The other thing I noticed was the stopInternal method from
> ReplicatedContext calling super.stopInternal before accessing
> this.context, but super.stopInternal will set this.context to null.
> Which will naturally lead to a NullpointerException.
> 
> Calling super.stopInternal after the logic in stopInternal will make my
> test work. Would it be OK to change the logic?

It looks like there is no choice.

Generally, I think stop() and start() should be symmetrical. To that end
I'd probably just swap the call to super.getInternal() and obtaining the
reference to the Map.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to