Return-Path: Delivered-To: apmail-openwebbeans-commits-archive@www.apache.org Received: (qmail 88515 invoked from network); 26 Jul 2010 08:38:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Jul 2010 08:38:20 -0000 Received: (qmail 15118 invoked by uid 500); 26 Jul 2010 08:38:20 -0000 Delivered-To: apmail-openwebbeans-commits-archive@openwebbeans.apache.org Received: (qmail 15085 invoked by uid 500); 26 Jul 2010 08:38:19 -0000 Mailing-List: contact commits-help@openwebbeans.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwebbeans.apache.org Delivered-To: mailing list commits@openwebbeans.apache.org Received: (qmail 15077 invoked by uid 99); 26 Jul 2010 08:38:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jul 2010 08:38:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jul 2010 08:38:17 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2028523889B2; Mon, 26 Jul 2010 08:37:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@openwebbeans.apache.org From: gerdogdu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100726083724.2028523889B2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 nameStrategies = new TreeMap(); + + //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)