openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r979198 - /openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
Date Mon, 26 Jul 2010 08:37:24 GMT
Author: gerdogdu
Date: Mon Jul 26 08:37:23 2010
New Revision: 979198

URL: http://svn.apache.org/viewvc?rev=979198&view=rev
Log:
[OWB-426] Tweak EJBPlugin to work with Standalone Tests

Modified:
    openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java

Modified: openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java?rev=979198&r1=979197&r2=979198&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
(original)
+++ openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
Mon Jul 26 08:37:23 2010
@@ -101,6 +101,10 @@ public class EjbPlugin extends AbstractO
     private static final SecurityService SECURITY_SERVICE = new OpenEJBSecurityService();
 
     private final Map<String, JndiNameStrategy> nameStrategies = new TreeMap<String,
JndiNameStrategy>();
+    
+    //This is here for standalone tests are correctly run
+    //Not used in anywhere
+    public static boolean CONFIGURED_FOR_USED_IN_TEST = false;
 
     public EjbPlugin()
     {
@@ -296,8 +300,12 @@ public class EjbPlugin extends AbstractO
 
     public boolean isSessionBean(Class<?> clazz)
     {
-        if (this.containerSystem == null)
+    	//This is used in tests, because in reality containerSystem is not null 
+        if (this.containerSystem == null || CONFIGURED_FOR_USED_IN_TEST)
         {
+        	//Used for tests
+        	CONFIGURED_FOR_USED_IN_TEST = false;
+        	
             this.containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
             Container[] containers = this.containerSystem.containers();
             for (Container container : containers)



Mime
View raw message