notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r904 - trunk/main/planet/http/demo/src/test/net/dpml/http
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r904 - trunk/main/planet/http/demo/src/test/net/dpml/http
- Date: Wed, 11 Jan 2006 07:18:09 +0100
Author: mcconnell
Date: 2006-01-11 07:17:54 +0100 (Wed, 11 Jan 2006)
New Revision: 904
Modified:
trunk/main/planet/http/demo/src/test/net/dpml/http/HttpTestCase.java
Log:
trap security exception in http testcase
Modified: trunk/main/planet/http/demo/src/test/net/dpml/http/HttpTestCase.java
===================================================================
--- trunk/main/planet/http/demo/src/test/net/dpml/http/HttpTestCase.java
2006-01-11 06:06:36 UTC (rev 903)
+++ trunk/main/planet/http/demo/src/test/net/dpml/http/HttpTestCase.java
2006-01-11 06:17:54 UTC (rev 904)
@@ -26,6 +26,7 @@
import net.dpml.part.Controller;
import net.dpml.part.Component;
+import net.dpml.part.ControlException;
import net.dpml.http.demo.Demo;
@@ -50,8 +51,29 @@
URI uri = new File( test, PATH ).toURI();
Controller control = Controller.STANDARD;
Component component = control.createComponent( uri );
- Demo demo = (Demo) component.getProvider().getValue( false );
- component.deactivate();
+ try
+ {
+ Demo demo = (Demo) component.getProvider().getValue( false );
+ }
+ catch( ControlException e )
+ {
+ Throwable cause = e.getRootCause();
+ if( cause instanceof SecurityException )
+ {
+ final String error =
+ "Skipping test due to security exception."
+ + cause.getMessage();
+ System.out.println( error );
+ }
+ else
+ {
+ throw e;
+ }
+ }
+ finally
+ {
+ component.deactivate();
+ }
}
static
- r904 - trunk/main/planet/http/demo/src/test/net/dpml/http, mcconnell at BerliOS, 01/11/2006
Archive powered by MHonArc 2.6.24.