Hoi Gurkan! Fields should generally not be public. That's just pretty horrible to maintain.
I understand that we sometimes need to provide some kind of 'Mock' functionality for passing the TCK, because we won't have a 'real' scenario available. But in this case the flag should either be configurable, or even better - we introduce a subclass of the EJBPlugin and use this instead for the TCK. LieGrue, strub ----- Original Message ---- > From: Gurkan Erdogdu <gurkanerdo...@yahoo.com> > To: dev@openwebbeans.apache.org > Sent: Mon, July 26, 2010 2:55:37 PM > Subject: Re: svn commit: r979198 - >/openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java > > > Not understand concerns except checkstyle. Lots of project uses some public > method/fields solely for testing. > > > > > ________________________________ > From: Mark Struberg <strub...@yahoo.de> > To: dev@openwebbeans.apache.org > Sent: Mon, July 26, 2010 3:45:39 PM > Subject: Re: svn commit: r979198 - >/openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java >a > > > sorry, but this commit was done with a very hot needle! > > a) it doesn't compile > b) it contains PUBLIC boolean flags! (an absolute no-go) > c) it contains code which is a hack for the TCK only. Sorry if I have to say > this, but then all the TCK testing is absolutely worth nothing. > > I'll drop this flag for now to be able to compile OWB again. > > LieGrue, > strub > > > > > ----- Original Message ---- > > From: "gerdo...@apache.org" <gerdo...@apache.org> > > To: comm...@openwebbeans.apache.org > > Sent: Mon, July 26, 2010 10:37:24 AM > > Subject: svn commit: r979198 - >>/openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java >a > > > > > > > > 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 >a > > > > > > > > Modified: >>openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java >a > > > > > > 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 >f > > > > > > >============================================================================== > > ; --- >>openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java >a > > > > a (original) > > +++ >>openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java >a > > > > 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) > > > > > > > >