Author: rmannibucau
Date: Fri Nov  9 15:57:17 2012
New Revision: 1407510

URL: http://svn.apache.org/viewvc?rev=1407510&view=rev
Log:
adding httpDebug property to EnableServices

Modified:
    
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/junit/ApplicationComposer.java
    
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/junit/EnableServices.java

Modified: 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/junit/ApplicationComposer.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/junit/ApplicationComposer.java?rev=1407510&r1=1407509&r2=1407510&view=diff
==============================================================================
--- 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/junit/ApplicationComposer.java
 (original)
+++ 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/junit/ApplicationComposer.java
 Fri Nov  9 15:57:17 2012
@@ -258,6 +258,13 @@ public class ApplicationComposer extends
             final Properties configuration = new Properties();
             configuration.put(DEPLOYMENTS_CLASSPATH_PROPERTY, "false");
 
+            final EnableServices annotation = 
testClass.getJavaClass().getAnnotation(EnableServices.class);
+            if (annotation != null && annotation.httpDebug()) {
+                configuration.setProperty("httpejbd.print", "true");
+                configuration.setProperty("httpejbd.indent.xml", "true");
+                configuration.setProperty("logging.level.OpenEJB.server.http", 
"FINE");
+            }
+
             final List<FrameworkMethod> methods = 
testClass.getAnnotatedMethods(Configuration.class);
             for (FrameworkMethod method : methods) {
                 final Object o = method.invokeExplosively(testInstance);
@@ -486,7 +493,6 @@ public class ApplicationComposer extends
 
                 
assembler.buildContainerSystem(config.getOpenEjbConfiguration());
 
-                EnableServices annotation = 
testClass.getJavaClass().getAnnotation(EnableServices.class);
                 if 
("true".equals(configuration.getProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE,
 "false"))
                         || annotation != null) {
                     try {

Modified: 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/junit/EnableServices.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/junit/EnableServices.java?rev=1407510&r1=1407509&r2=1407510&view=diff
==============================================================================
--- 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/junit/EnableServices.java
 (original)
+++ 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/junit/EnableServices.java
 Fri Nov  9 15:57:17 2012
@@ -27,4 +27,5 @@ public @interface EnableServices {
     // should contain the list of services to activate
     // default is empty list which means that all services gonna be activated
     String[] value () default {};
+    boolean httpDebug() default false;
 }


Reply via email to