[webbeans-commits] Webbeans SVN: r413 - in ri/trunk/webbeans-ri/src: main/java/org/jboss/webbeans/contexts and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-05 07:04:56 -0500 (Fri, 05 Dec 2008)
New Revision: 413
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ApplicationContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/BeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/PrivateContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/RequestContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java
Log:
better structure for contexts
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -75,7 +75,7 @@
{
public static final String JNDI_KEY = "java:comp/Manager";
- private static ManagerImpl instance = new ManagerImpl();
+ protected static ManagerImpl instance = new ManagerImpl();
public static ManagerImpl instance()
{
@@ -157,7 +157,7 @@
{
addContext(new DependentContext());
addContext(new RequestContext());
- addContext(new SessionContext(this));
+ addContext(new SessionContext());
addContext(new ApplicationContext());
}
else
@@ -690,12 +690,6 @@
return buffer.toString();
}
- // TODO: Temp
- public static void setInstance(ManagerImpl manager)
- {
- ManagerImpl.instance = manager;
- }
-
public Manager parse(InputStream xmlStream)
{
// TODO Auto-generated method stub
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.contexts;
+
+import javax.webbeans.manager.Contextual;
+
+import org.jboss.webbeans.ManagerImpl;
+
+public abstract class AbstractBeanMapAdaptor implements BeanMap
+{
+
+ protected abstract String getKeyPrefix();
+
+ /**
+ * Returns a map key to a bean. Uses a known prefix and appends the index of
+ * the Bean in the Manager bean list.
+ *
+ * @param bean The bean to generate a key for.
+ * @return A unique key;
+ */
+ protected String getBeanKey(Contextual<?> bean)
+ {
+ return getKeyPrefix() + "#" + ManagerImpl.instance().getBeans().indexOf(bean);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ApplicationContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ApplicationContext.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ApplicationContext.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -19,6 +19,8 @@
import javax.webbeans.ApplicationScoped;
+import org.jboss.webbeans.ManagerImpl;
+
/**
* The Application context
*
@@ -29,9 +31,27 @@
public class ApplicationContext extends SharedContext
{
+ private BeanMap beanMap;
+
public ApplicationContext()
{
super(ApplicationScoped.class);
}
+ @Override
+ public BeanMap getBeanMap()
+ {
+ return this.beanMap;
+ }
+
+ public void setBeanMap(BeanMap applicationBeanMap)
+ {
+ this.beanMap = applicationBeanMap;
+ }
+
+ public static ApplicationContext instance()
+ {
+ return (ApplicationContext) ManagerImpl.instance().getBuiltInContext(ApplicationScoped.class);
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/BeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/BeanMap.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/BeanMap.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -26,7 +26,7 @@
* @author Nicklas Karlsson
*
* @see org.jboss.webbeans.contexts.SimpleBeanMap
- * @see org.jboss.webbeans.contexts.SessionBeanMap
+ * @see org.jboss.webbeans.servlet.SessionBeanMap
*/
public interface BeanMap
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/PrivateContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/PrivateContext.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/PrivateContext.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -24,6 +24,8 @@
* The abstraction of a private context, on that operates on a ThreadLocal
* BeanMap and ThreadLocal active state
*
+ * A private context doesn't rely on some external context to hold it's state
+ *
* @author Nicklas Karlsson
*
* @see org.jboss.webbeans.contexts.DependentContext
@@ -39,8 +41,16 @@
public PrivateContext(Class<? extends Annotation> scopeType)
{
super(scopeType);
- beans = new ThreadLocal<BeanMap>();
- beans.set(new SimpleBeanMap());
+ beans = new ThreadLocal<BeanMap>()
+ {
+
+ @Override
+ protected BeanMap initialValue()
+ {
+ return new SimpleBeanMap();
+ }
+
+ };
active = new ThreadLocal<AtomicBoolean>();
active.set(new AtomicBoolean(true));
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/RequestContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/RequestContext.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/RequestContext.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -19,6 +19,8 @@
import javax.webbeans.RequestScoped;
+import org.jboss.webbeans.ManagerImpl;
+
/**
* The request context
*
@@ -31,5 +33,11 @@
{
super(RequestScoped.class);
}
+
+ public static RequestContext instance()
+ {
+ return (RequestContext) ManagerImpl.instance().getBuiltInContext(RequestScoped.class);
+ }
+
}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -1,232 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.contexts;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.servlet.http.HttpSession;
-import javax.webbeans.manager.Bean;
-import javax.webbeans.manager.Contextual;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-
-/**
- * A BeanMap that uses a HTTP session as backing map
- *
- * @author Nicklas Karlsson
- *
- * @see org.jboss.webbeans.contexts.SessionContext
- */
-public class SessionBeanMap implements BeanMap
-{
- private static LogProvider log = Logging.getLogProvider(SessionBeanMap.class);
-
- // The HTTP session to use as backing map
- private HttpSession session;
- // The storage prefix to put before names
- private String keyPrefix;
-
- /**
- * Constructor
- *
- * @param manager The Web Beans manager
- * @param keyPrefix The storage names prefix
- */
- public SessionBeanMap(String keyPrefix)
- {
- super();
- this.keyPrefix = keyPrefix;
- log.trace("SessionBeanMap created with prefix " + keyPrefix);
- }
-
- /**
- * The SessionBeanMap requires a HTTP session to work. It is created without
- * one so this method must be called before it can be operated upon
- *
- * @param session The session to use as a backing map
- */
- public void setSession(HttpSession session)
- {
- this.session = session;
- log.trace("Session context associated with session id " + session.getId());
- }
-
- /**
- * Used to check if the session has been set and throws an exception if it's
- * null.
- */
- private void checkSession()
- {
- if (session == null)
- {
- throw new IllegalArgumentException("Session has not been initialized in SessionBeanMap");
- }
- }
-
- /**
- * Returns a map key to a bean. Uses a known prefix and appends the index of
- * the Bean in the Manager bean list.
- *
- * @param bean The bean to generate a key for.
- * @return A unique key;
- */
- private String getBeanKey(Contextual<?> bean)
- {
- return keyPrefix + ManagerImpl.instance().getBeans().indexOf(bean);
- }
-
- /**
- * Gets a bean from the session
- *
- * First, checks that the session is present. It determines an ID for the
- * bean which and looks for it in the session. The bean instance is returned
- * (null if not found in the session).
- *
- * @param bean The bean to get from the session
- * @return An instance of the bean
- *
- * @see org.jboss.webbeans.contexts.BeanMap#get(Bean)
- */
- @SuppressWarnings("unchecked")
- public <T> T get(Contextual<? extends T> bean)
- {
- checkSession();
- String key = getBeanKey(bean);
- T instance = (T) session.getAttribute(key);
- log.trace("Searched session for key " + key + " and got " + instance);
- return instance;
- }
-
- /**
- * Removes a bean instance from the session
- *
- * First, checks that the session is present. It determines an ID for the
- * bean and that key is then removed from the session, whether it was present
- * in the first place or not.
- *
- * @param bean The bean whose instance to remove.
- * @return The instance removed
- *
- * @see org.jboss.webbeans.contexts.BeanMap#remove(Bean)
- */
- public <T> T remove(Contextual<? extends T> bean)
- {
- checkSession();
- T instance = get(bean);
- String key = getBeanKey(bean);
- session.removeAttribute(key);
- log.trace("Removed bean " + bean + " with key " + key + " from session");
- return instance;
- }
-
- /**
- * Clears the session of any beans.
- *
- * First, checks that the session is present. Then, iterates over the
- * attribute names in the session and removes them if they start with the
- * know prefix.
- *
- * @see org.jboss.webbeans.contexts.BeanMap#clear()
- */
- @SuppressWarnings("unchecked")
- public void clear()
- {
- checkSession();
- Enumeration names = session.getAttributeNames();
- while (names.hasMoreElements())
- {
- String name = (String) names.nextElement();
- session.removeAttribute(name);
- }
- log.trace("Session cleared");
- }
-
- /**
- * Gets an iterable over the beans present in the storage.
- *
- * Iterates over the names in the session. If a name starts with the known
- * prefix, strips it out to get the index to the bean in the manager bean
- * list. Retrieves the bean from that list and puts it in the result-list.
- * Finally, returns the list.
- *
- * @return An Iterable to the beans in the storage
- *
- * @see org.jboss.webbeans.contexts.BeanMap#keySet()
- */
- @SuppressWarnings("unchecked")
- public Iterable<Contextual<? extends Object>> keySet()
- {
- checkSession();
-
- List<Contextual<?>> beans = new ArrayList<Contextual<?>>();
-
- Enumeration names = session.getAttributeNames();
- while (names.hasMoreElements())
- {
- String name = (String) names.nextElement();
- if (name.startsWith(keyPrefix))
- {
- String id = name.substring(keyPrefix.length());
- Contextual<?> bean = ManagerImpl.instance().getBeans().get(Integer.parseInt(id));
- beans.add(bean);
- }
- }
-
- return beans;
- }
-
- /**
- * Puts a bean instance in the session
- *
- * First, checks that the session is present. Generates a bean map key, puts
- * the instance in the session under that key.
- *
- * @param bean The bean to use as key
- * @param instance The bean instance to add
- *
- * @see org.jboss.webbeans.contexts.BeanMap#put(Bean, Object)
- */
- public <T> void put(Contextual<? extends T> bean, T instance)
- {
- checkSession();
- String key = getBeanKey(bean);
- session.setAttribute(key, instance);
- log.trace("Stored instance " + instance + " for bean " + bean + " under key " + key + " in session");
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder();
- List<Contextual<?>> beans = (List) keySet();
- buffer.append("Bean -> bean instance mappings in HTTP session: " + beans.size() + "\n");
- int i = 0;
- for (Contextual<?> bean : beans)
- {
- Object instance = get(bean);
- buffer.append(++i + " - " + getBeanKey(bean) + ": " + instance + "\n");
- }
- return buffer.toString();
- }
-
-}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -0,0 +1,232 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.contexts;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.servlet.http.HttpSession;
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Contextual;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+/**
+ * A BeanMap that uses a HTTP session as backing map
+ *
+ * @author Nicklas Karlsson
+ *
+ * @see org.jboss.webbeans.contexts.SessionContext
+ */
+public class SessionBeanMap implements BeanMap
+{
+ private static LogProvider log = Logging.getLogProvider(SessionBeanMap.class);
+
+ // The HTTP session to use as backing map
+ private HttpSession session;
+ // The storage prefix to put before names
+ private String keyPrefix;
+
+ /**
+ * Constructor
+ *
+ * @param manager The Web Beans manager
+ * @param keyPrefix The storage names prefix
+ */
+ public SessionBeanMap(String keyPrefix)
+ {
+ super();
+ this.keyPrefix = keyPrefix;
+ log.trace("SessionBeanMap created with prefix " + keyPrefix);
+ }
+
+ /**
+ * The SessionBeanMap requires a HTTP session to work. It is created without
+ * one so this method must be called before it can be operated upon
+ *
+ * @param session The session to use as a backing map
+ */
+ public void setSession(HttpSession session)
+ {
+ this.session = session;
+ log.trace("Session context associated with session id " + session.getId());
+ }
+
+ /**
+ * Used to check if the session has been set and throws an exception if it's
+ * null.
+ */
+ private void checkSession()
+ {
+ if (session == null)
+ {
+ throw new IllegalArgumentException("Session has not been initialized in SessionBeanMap");
+ }
+ }
+
+ /**
+ * Returns a map key to a bean. Uses a known prefix and appends the index of
+ * the Bean in the Manager bean list.
+ *
+ * @param bean The bean to generate a key for.
+ * @return A unique key;
+ */
+ private String getBeanKey(Contextual<?> bean)
+ {
+ return keyPrefix + ManagerImpl.instance().getBeans().indexOf(bean);
+ }
+
+ /**
+ * Gets a bean from the session
+ *
+ * First, checks that the session is present. It determines an ID for the
+ * bean which and looks for it in the session. The bean instance is returned
+ * (null if not found in the session).
+ *
+ * @param bean The bean to get from the session
+ * @return An instance of the bean
+ *
+ * @see org.jboss.webbeans.contexts.BeanMap#get(Bean)
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T get(Contextual<? extends T> bean)
+ {
+ checkSession();
+ String key = getBeanKey(bean);
+ T instance = (T) session.getAttribute(key);
+ log.trace("Searched session for key " + key + " and got " + instance);
+ return instance;
+ }
+
+ /**
+ * Removes a bean instance from the session
+ *
+ * First, checks that the session is present. It determines an ID for the
+ * bean and that key is then removed from the session, whether it was present
+ * in the first place or not.
+ *
+ * @param bean The bean whose instance to remove.
+ * @return The instance removed
+ *
+ * @see org.jboss.webbeans.contexts.BeanMap#remove(Bean)
+ */
+ public <T> T remove(Contextual<? extends T> bean)
+ {
+ checkSession();
+ T instance = get(bean);
+ String key = getBeanKey(bean);
+ session.removeAttribute(key);
+ log.trace("Removed bean " + bean + " with key " + key + " from session");
+ return instance;
+ }
+
+ /**
+ * Clears the session of any beans.
+ *
+ * First, checks that the session is present. Then, iterates over the
+ * attribute names in the session and removes them if they start with the
+ * know prefix.
+ *
+ * @see org.jboss.webbeans.contexts.BeanMap#clear()
+ */
+ @SuppressWarnings("unchecked")
+ public void clear()
+ {
+ checkSession();
+ Enumeration names = session.getAttributeNames();
+ while (names.hasMoreElements())
+ {
+ String name = (String) names.nextElement();
+ session.removeAttribute(name);
+ }
+ log.trace("Session cleared");
+ }
+
+ /**
+ * Gets an iterable over the beans present in the storage.
+ *
+ * Iterates over the names in the session. If a name starts with the known
+ * prefix, strips it out to get the index to the bean in the manager bean
+ * list. Retrieves the bean from that list and puts it in the result-list.
+ * Finally, returns the list.
+ *
+ * @return An Iterable to the beans in the storage
+ *
+ * @see org.jboss.webbeans.contexts.BeanMap#keySet()
+ */
+ @SuppressWarnings("unchecked")
+ public Iterable<Contextual<? extends Object>> keySet()
+ {
+ checkSession();
+
+ List<Contextual<?>> beans = new ArrayList<Contextual<?>>();
+
+ Enumeration names = session.getAttributeNames();
+ while (names.hasMoreElements())
+ {
+ String name = (String) names.nextElement();
+ if (name.startsWith(keyPrefix))
+ {
+ String id = name.substring(keyPrefix.length());
+ Contextual<?> bean = ManagerImpl.instance().getBeans().get(Integer.parseInt(id));
+ beans.add(bean);
+ }
+ }
+
+ return beans;
+ }
+
+ /**
+ * Puts a bean instance in the session
+ *
+ * First, checks that the session is present. Generates a bean map key, puts
+ * the instance in the session under that key.
+ *
+ * @param bean The bean to use as key
+ * @param instance The bean instance to add
+ *
+ * @see org.jboss.webbeans.contexts.BeanMap#put(Bean, Object)
+ */
+ public <T> void put(Contextual<? extends T> bean, T instance)
+ {
+ checkSession();
+ String key = getBeanKey(bean);
+ session.setAttribute(key, instance);
+ log.trace("Stored instance " + instance + " for bean " + bean + " under key " + key + " in session");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ List<Contextual<?>> beans = (List) keySet();
+ buffer.append("Bean -> bean instance mappings in HTTP session: " + beans.size() + "\n");
+ int i = 0;
+ for (Contextual<?> bean : beans)
+ {
+ Object instance = get(bean);
+ buffer.append(++i + " - " + getBeanKey(bean) + ": " + instance + "\n");
+ }
+ return buffer.toString();
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -17,7 +17,6 @@
package org.jboss.webbeans.contexts;
-import javax.servlet.http.HttpSession;
import javax.webbeans.SessionScoped;
import org.jboss.webbeans.ManagerImpl;
@@ -29,27 +28,34 @@
*
* @author Nicklas Karlsson
*/
-public class SessionContext extends PrivateContext
+public class SessionContext extends SharedContext
{
private static LogProvider log = Logging.getLogProvider(SessionContext.class);
+
+ private ThreadLocal<BeanMap> beanMap;
- public SessionContext(ManagerImpl manager)
+ public SessionContext()
{
super(SessionScoped.class);
- // Replaces the BeanMap implementation with a session-based one
- beans.set(new SessionBeanMap(getScopeType().getName() + "#"));
log.trace("Created session context");
}
-
- /**
- * Sets the session in the session bean map
- *
- * @param session The session to set
- */
- public void setSession(HttpSession session)
+
+ @Override
+ public BeanMap getBeanMap()
{
- ((SessionBeanMap) getBeanMap()).setSession(session);
+ return beanMap.get();
}
+
+ @Override
+ public void setBeanMap(BeanMap beanMap)
+ {
+ this.beanMap.set(beanMap);
+ }
+
+ public static SessionContext instance()
+ {
+ return (SessionContext) ManagerImpl.instance().getBuiltInContext(SessionScoped.class);
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -27,15 +27,13 @@
*
* @see org.jboss.webbeans.contexts.ApplicationContext
*/
-public class SharedContext extends AbstractContext
+public abstract class SharedContext extends AbstractContext
{
- private BeanMap beans;
private AtomicBoolean active;
public SharedContext(Class<? extends Annotation> scopeType)
{
super(scopeType);
- beans = new SimpleBeanMap();
active = new AtomicBoolean(true);
}
@@ -47,14 +45,9 @@
{
return active;
}
+
+ protected abstract BeanMap getBeanMap();
+
+ public abstract void setBeanMap(BeanMap beanMap);
- /**
- * Delegates to the map implementation
- */
- @Override
- protected BeanMap getBeanMap()
- {
- return beans;
- }
-
}
\ No newline at end of file
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.webbeans.servlet;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.manager.Contextual;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.contexts.AbstractBeanMapAdaptor;
+import org.jboss.webbeans.contexts.ApplicationContext;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+/**
+ * Abstracts the servlet API specific application context
+ * as a Map.
+ *
+ * @author Gavin King
+ */
+public class ApplicationBeanMap extends AbstractBeanMapAdaptor
+{
+ private LogProvider log = Logging.getLogProvider(ApplicationBeanMap.class);
+
+ private ServletContext servletContext;
+
+ public ApplicationBeanMap(ServletContext servletContext)
+ {
+ this.servletContext = servletContext;
+ }
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T get(Contextual<? extends T> bean)
+ {
+ String key = getBeanKey(bean);
+ T instance = (T) servletContext.getAttribute(key);
+ log.trace("Searched application for key " + key + " and got " + instance);
+ return instance;
+ }
+
+ public <T> void put(Contextual<? extends T> bean, T instance)
+ {
+ String key = getBeanKey(bean);
+ servletContext.setAttribute(key, instance);
+ log.trace("Stored instance " + instance + " for bean " + bean + " under key " + key + " in session");
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T remove(Contextual<? extends T> bean)
+ {
+ String key = getBeanKey(bean);
+ T result = (T) servletContext.getAttribute(key);
+ servletContext.removeAttribute(key);
+ return result;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterable<Contextual<? extends Object>> keySet()
+ {
+ List<Contextual<?>> beans = new ArrayList<Contextual<?>>();
+
+ Enumeration names = servletContext.getAttributeNames();
+ while (names.hasMoreElements())
+ {
+ String name = (String) names.nextElement();
+ if (name.startsWith(getKeyPrefix()))
+ {
+ String id = name.substring(getKeyPrefix().length());
+ Contextual<?> bean = ManagerImpl.instance().getBeans().get(Integer.parseInt(id));
+ beans.add(bean);
+ }
+ }
+
+ return beans;
+ }
+
+ @Override
+ protected String getKeyPrefix()
+ {
+ return ApplicationContext.class.getName();
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -23,11 +23,10 @@
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import javax.webbeans.SessionScoped;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bootstrap.Bootstrap;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.contexts.ApplicationContext;
import org.jboss.webbeans.contexts.SessionContext;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -57,12 +56,15 @@
servletContext = context;
Bootstrap bootstrap = new Bootstrap();
bootstrap.boot(getWebBeanDiscovery());
+ ApplicationContext.instance().setBeanMap(new ApplicationBeanMap(servletContext));
}
/**
* Ends the application
*/
- public static void endApplication() {
+ public static void endApplication()
+ {
+ ApplicationContext.instance().setBeanMap(null);
servletContext = null;
}
@@ -80,7 +82,8 @@
*
* @param session The HTTP session
*/
- public static void endSession(HttpSession session) {
+ public static void endSession(HttpSession session)
+ {
}
/**
@@ -90,10 +93,9 @@
*
* @param request The request
*/
- public static void beginRequest(HttpServletRequest request) {
- ManagerImpl manager = ManagerImpl.instance();
- SessionContext sessionContext = (SessionContext) manager.getBuiltInContext(SessionScoped.class);
- sessionContext.setSession(request.getSession(true));
+ public static void beginRequest(HttpServletRequest request)
+ {
+ SessionContext.instance().setBeanMap(new SessionBeanMap(request.getSession()));
}
/**
@@ -101,7 +103,9 @@
*
* @param request The request
*/
- public static void endRequest(HttpServletRequest request) {
+ public static void endRequest(HttpServletRequest request)
+ {
+ SessionContext.instance().setBeanMap(null);
}
/**
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java (from rev 408, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -0,0 +1,197 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.servlet;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.servlet.http.HttpSession;
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Contextual;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.contexts.AbstractBeanMapAdaptor;
+import org.jboss.webbeans.contexts.SessionContext;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+/**
+ * A BeanMap that uses a HTTP session as backing map
+ *
+ * @author Nicklas Karlsson
+ *
+ * @see org.jboss.webbeans.contexts.SessionContext
+ */
+public class SessionBeanMap extends AbstractBeanMapAdaptor
+{
+ private static LogProvider log = Logging.getLogProvider(SessionBeanMap.class);
+
+ // The HTTP session to use as backing map
+ private HttpSession session;
+
+ /**
+ * Constructor
+ *
+ * @param manager The Web Beans manager
+ * @param keyPrefix The storage names prefix
+ */
+ public SessionBeanMap(HttpSession httpSession)
+ {
+ super();
+ this.session = httpSession;
+ log.trace("SessionBeanMap created with prefix " + getKeyPrefix());
+ }
+
+ /**
+ * Gets a bean from the session
+ *
+ * It determines an ID for the
+ * bean which and looks for it in the session. The bean instance is returned
+ * (null if not found in the session).
+ *
+ * @param bean The bean to get from the session
+ * @return An instance of the bean
+ *
+ * @see org.jboss.webbeans.contexts.BeanMap#get(Bean)
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T get(Contextual<? extends T> bean)
+ {
+ String key = getBeanKey(bean);
+ T instance = (T) session.getAttribute(key);
+ log.trace("Searched session for key " + key + " and got " + instance);
+ return instance;
+ }
+
+ /**
+ * Removes a bean instance from the session
+ *
+ * It determines an ID for the
+ * bean and that key is then removed from the session, whether it was present
+ * in the first place or not.
+ *
+ * @param bean The bean whose instance to remove.
+ * @return The instance removed
+ *
+ * @see org.jboss.webbeans.contexts.BeanMap#remove(Bean)
+ */
+ public <T> T remove(Contextual<? extends T> bean)
+ {
+ T instance = get(bean);
+ String key = getBeanKey(bean);
+ session.removeAttribute(key);
+ log.trace("Removed bean " + bean + " with key " + key + " from session");
+ return instance;
+ }
+
+ /**
+ * Clears the session of any beans.
+ *
+ * First, checks that the session is present. Then, iterates over the
+ * attribute names in the session and removes them if they start with the
+ * know prefix.
+ *
+ * @see org.jboss.webbeans.contexts.BeanMap#clear()
+ */
+ @SuppressWarnings("unchecked")
+ public void clear()
+ {
+ Enumeration names = session.getAttributeNames();
+ while (names.hasMoreElements())
+ {
+ String name = (String) names.nextElement();
+ session.removeAttribute(name);
+ }
+ log.trace("Session cleared");
+ }
+
+ /**
+ * Gets an iterable over the beans present in the storage.
+ *
+ * Iterates over the names in the session. If a name starts with the known
+ * prefix, strips it out to get the index to the bean in the manager bean
+ * list. Retrieves the bean from that list and puts it in the result-list.
+ * Finally, returns the list.
+ *
+ * @return An Iterable to the beans in the storage
+ *
+ * @see org.jboss.webbeans.contexts.BeanMap#keySet()
+ */
+ @SuppressWarnings("unchecked")
+ public Iterable<Contextual<? extends Object>> keySet()
+ {
+
+ List<Contextual<?>> beans = new ArrayList<Contextual<?>>();
+
+ Enumeration names = session.getAttributeNames();
+ while (names.hasMoreElements())
+ {
+ String name = (String) names.nextElement();
+ if (name.startsWith(getKeyPrefix()))
+ {
+ String id = name.substring(getKeyPrefix().length());
+ Contextual<?> bean = ManagerImpl.instance().getBeans().get(Integer.parseInt(id));
+ beans.add(bean);
+ }
+ }
+
+ return beans;
+ }
+
+ /**
+ * Puts a bean instance in the session
+ *
+ * Generates a bean map key, puts
+ * the instance in the session under that key.
+ *
+ * @param bean The bean to use as key
+ * @param instance The bean instance to add
+ *
+ * @see org.jboss.webbeans.contexts.BeanMap#put(Bean, Object)
+ */
+ public <T> void put(Contextual<? extends T> bean, T instance)
+ {
+ String key = getBeanKey(bean);
+ session.setAttribute(key, instance);
+ log.trace("Stored instance " + instance + " for bean " + bean + " under key " + key + " in session");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ List<Contextual<?>> beans = (List) keySet();
+ buffer.append("Bean -> bean instance mappings in HTTP session: " + beans.size() + "\n");
+ int i = 0;
+ for (Contextual<?> bean : beans)
+ {
+ Object instance = get(bean);
+ buffer.append(++i + " - " + getBeanKey(bean) + ": " + instance + "\n");
+ }
+ return buffer.toString();
+ }
+
+ @Override
+ protected String getKeyPrefix()
+ {
+ return SessionContext.class.getName();
+ }
+
+}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -3,8 +3,9 @@
import javax.webbeans.Production;
import javax.webbeans.Standard;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bootstrap.Bootstrap;
+import org.jboss.webbeans.contexts.ApplicationContext;
+import org.jboss.webbeans.contexts.SimpleBeanMap;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
import org.jboss.webbeans.test.mock.MockBootstrap;
@@ -22,7 +23,9 @@
public final void before()
{
manager = new MockManagerImpl();
- ManagerImpl.setInstance(manager);
+ MockManagerImpl.setInstance(manager);
+ // Mock the ApplicationContext as a simple map
+ ApplicationContext.instance().setBeanMap(new SimpleBeanMap());
bootstrap = new MockBootstrap();
init();
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java 2008-12-05 11:58:59 UTC (rev 412)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java 2008-12-05 12:04:56 UTC (rev 413)
@@ -5,15 +5,18 @@
import java.util.HashSet;
import java.util.Set;
-import javax.webbeans.Observer;
-import javax.webbeans.TypeLiteral;
import javax.webbeans.manager.Context;
-import javax.webbeans.manager.Manager;
import org.jboss.webbeans.ManagerImpl;
public class MockManagerImpl extends ManagerImpl
{
+
+ public static void setInstance(ManagerImpl manager)
+ {
+ ManagerImpl.instance = manager;
+ }
+
private Object event = null;
private Class<? extends Object> eventType = null;
private Annotation[] eventBindings = null;
16 years
[webbeans-commits] Webbeans SVN: r412 - in ri/trunk: webbeans-ri/src/main/java/org/jboss/webbeans and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-05 06:58:59 -0500 (Fri, 05 Dec 2008)
New Revision: 412
Modified:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
Log:
Manager.validate and Manager.parse
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java 2008-12-05 11:44:38 UTC (rev 411)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java 2008-12-05 11:58:59 UTC (rev 412)
@@ -17,6 +17,7 @@
package javax.webbeans.manager;
+import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.Set;
@@ -36,13 +37,11 @@
public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... bindings);
- public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,
- Annotation... bindings);
+ public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType, Annotation... bindings);
public <T> T getInstanceByType(Class<T> type, Annotation... bindings);
- public <T> T getInstanceByType(TypeLiteral<T> type,
- Annotation... bindings);
+ public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindings);
public Set<Bean<?>> resolveByName(String name);
@@ -61,25 +60,23 @@
public Manager addInterceptor(Interceptor interceptor);
public Manager addDecorator(Decorator decorator);
+
+ public Manager validate();
+
+ public Manager parse(InputStream xmlStream);
- public <T> Manager addObserver(Observer<T> observer, Class<T> eventType,
- Annotation... bindings);
+ public <T> Manager addObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings);
- public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType,
- Annotation... bindings);
+ public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings);
- public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType,
- Annotation... bindings);
+ public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings);
- public <T> Manager removeObserver(Observer<T> observer,
- TypeLiteral<T> eventType, Annotation... bindings);
+ public <T> Manager removeObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings);
public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings);
- public List<Interceptor> resolveInterceptors(InterceptionType type,
- Annotation... interceptorBindings);
+ public List<Interceptor> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings);
- public List<Decorator> resolveDecorators(Set<Class<?>> types,
- Annotation... bindings);
+ public List<Decorator> resolveDecorators(Set<Class<?>> types, Annotation... bindings);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05 11:44:38 UTC (rev 411)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05 11:58:59 UTC (rev 412)
@@ -17,6 +17,7 @@
package org.jboss.webbeans;
+import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.Collections;
@@ -72,7 +73,6 @@
*/
public class ManagerImpl implements Manager
{
-
public static final String JNDI_KEY = "java:comp/Manager";
private static ManagerImpl instance = new ManagerImpl();
@@ -696,4 +696,16 @@
ManagerImpl.instance = manager;
}
+ public Manager parse(InputStream xmlStream)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Manager validate()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
16 years
[webbeans-commits] Webbeans SVN: r411 - in ri/trunk/webbeans-ri/src: main/java/org/jboss/webbeans/bean and 11 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-05 06:44:38 -0500 (Fri, 05 Dec 2008)
New Revision: 411
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/MyTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/Param.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/JNDI.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventManagerTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InitializerMethodTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByNameTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanDeclarationTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanSpecializationTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java
Log:
ManagerImpl.instance()
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -73,6 +73,8 @@
public class ManagerImpl implements Manager
{
+ public static final String JNDI_KEY = "java:comp/Manager";
+
private static ManagerImpl instance = new ManagerImpl();
public static ManagerImpl instance()
@@ -95,9 +97,9 @@
{
this.metaDataCache = new MetaDataCache();
this.beans = new CopyOnWriteArrayList<Bean<?>>();
- this.eventManager = new EventManager(this);
- this.resolver = new Resolver(this);
- this.proxyPool = new ProxyPool(this);
+ this.eventManager = new EventManager();
+ this.resolver = new Resolver();
+ this.proxyPool = new ProxyPool();
this.decorators = new HashSet<Decorator>();
this.interceptors = new HashSet<Interceptor>();
initEnabledDeploymentTypes();
@@ -110,7 +112,7 @@
*/
protected void initStandardBeans()
{
- addBean(new SimpleBean<DefaultEnterpriseBeanLookup>(DefaultEnterpriseBeanLookup.class, this));
+ addBean(new SimpleBean<DefaultEnterpriseBeanLookup>(DefaultEnterpriseBeanLookup.class));
}
/**
@@ -688,4 +690,10 @@
return buffer.toString();
}
+ // TODO: Temp
+ public static void setInstance(ManagerImpl manager)
+ {
+ ManagerImpl.instance = manager;
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -92,11 +92,8 @@
private ConcurrentCache<String, Set<Bean<?>>> resolvedNames;
- private ManagerImpl manager;
-
- public Resolver(ManagerImpl manager)
+ public Resolver()
{
- this.manager = manager;
this.injectionPoints = new HashSet<AnnotatedItem<?, ?>>();
this.resolvedInjectionPoints = new ConcurrentCache<ResolvableAnnotatedItem<?,?>, Set<Bean<?>>>();
this.resolvedNames = new ConcurrentCache<String, Set<Bean<?>>>();
@@ -118,7 +115,7 @@
public Set<Bean<T>> call() throws Exception
{
- Set<Bean<T>> beans = retainHighestPrecedenceBeans(getMatchingBeans(element, manager.getBeans(), manager.getMetaDataCache()), manager.getEnabledDeploymentTypes());
+ Set<Bean<T>> beans = retainHighestPrecedenceBeans(getMatchingBeans(element, ManagerImpl.instance().getBeans(), ManagerImpl.instance().getMetaDataCache()), ManagerImpl.instance().getEnabledDeploymentTypes());
if (element.getType().isPrimitive())
{
for (Bean<?> bean : beans)
@@ -150,6 +147,7 @@
* Resolve all injection points added using
* {@link #addInjectionPoints(Collection)}
*/
+ @SuppressWarnings("unchecked")
public void resolveInjectionPoints()
{
for (final AnnotatedItem injectable : injectionPoints)
@@ -188,7 +186,7 @@
if (element.getType().equals(Object.class))
{
// TODO Fix this cast
- beans = new HashSet<Bean<T>>((List) manager.getBeans());
+ beans = new HashSet<Bean<T>>((List) ManagerImpl.instance().getBeans());
}
else
{
@@ -205,17 +203,18 @@
return resolvedNames.putIfAbsent(name, new Callable<Set<Bean<?>>>()
{
+ @SuppressWarnings("unchecked")
public Set<Bean<?>> call() throws Exception
{
Set<Bean<?>> beans = new HashSet<Bean<?>>();
- for (Bean<?> bean : manager.getBeans())
+ for (Bean<?> bean : ManagerImpl.instance().getBeans())
{
if ((bean.getName() == null && name == null) || (bean.getName() != null && bean.getName().equals(name)))
{
beans.add(bean);
}
}
- return retainHighestPrecedenceBeans((Set) beans, manager.getEnabledDeploymentTypes());
+ return retainHighestPrecedenceBeans((Set) beans, ManagerImpl.instance().getEnabledDeploymentTypes());
}
});
@@ -252,6 +251,7 @@
}
}
+ @SuppressWarnings("unchecked")
private static <T> Set<Bean<T>> getMatchingBeans(AnnotatedItem<T, ?> element, List<Bean<?>> beans, MetaDataCache metaDataCache)
{
Set<Bean<T>> resolvedBeans = new HashSet<Bean<T>>();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -90,8 +90,6 @@
// Logger
private LogProvider log = Logging.getLogProvider(AbstractBean.class);
- // Reference to WBRI manager
- private ManagerImpl manager;
private Set<Annotation> bindingTypes;
protected String name;
protected Class<? extends Annotation> scopeType;
@@ -112,10 +110,9 @@
*
* @param manager The Web Beans manager
*/
- public AbstractBean(ManagerImpl manager)
+ public AbstractBean()
{
- super(manager);
- this.manager = manager;
+ super(ManagerImpl.instance());
}
/**
@@ -123,7 +120,7 @@
*/
protected void init()
{
- mergedStereotypes = new MergedStereotypes<T, E>(getAnnotatedItem().getMetaAnnotations(Stereotype.class), manager);
+ mergedStereotypes = new MergedStereotypes<T, E>(getAnnotatedItem().getMetaAnnotations(Stereotype.class));
initType();
initPrimitive();
log.debug("Building Web Bean bean metadata for " + getType());
@@ -226,7 +223,7 @@
if (getMergedStereotypes().getPossibleDeploymentTypes().size() > 0)
{
- this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(), getMergedStereotypes().getPossibleDeploymentTypes());
+ this.deploymentType = getDeploymentType(ManagerImpl.instance().getEnabledDeploymentTypes(), getMergedStereotypes().getPossibleDeploymentTypes());
log.trace("Deployment type " + deploymentType + " specified by stereotype");
return;
}
@@ -493,17 +490,6 @@
}
/**
- * Returns the Web Beans manager reference
- *
- * @return The manager
- */
- @Override
- protected ManagerImpl getManager()
- {
- return manager;
- }
-
- /**
* Returns the merged sterotypes of the bean
*
* @return The set of merged stereotypes
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -29,7 +29,6 @@
import javax.webbeans.Observes;
import javax.webbeans.Produces;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -62,9 +61,9 @@
* @param xmlAnnotatedItem Annotations read from XML
* @param manager The Web Beans manager
*/
- public AbstractClassBean(Class<T> type, ManagerImpl manager)
+ public AbstractClassBean(Class<T> type)
{
- super(manager);
+ super();
this.annotatedItem = new AnnotatedClassImpl<T>(type);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -58,9 +58,9 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- public EnterpriseBean(Class<T> type, ManagerImpl manager)
+ public EnterpriseBean(Class<T> type)
{
- super(type, manager);
+ super(type);
init();
}
@@ -139,14 +139,14 @@
}
if (!isDefinedInXml())
{
- if (!getManager().getMetaDataCache().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
+ if (!ManagerImpl.instance().getMetaDataCache().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
{
throw new DefinitionException("Annotation defined specializing EJB must have EJB superclass");
}
}
else
{
- if (getManager().getMetaDataCache().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
+ if (ManagerImpl.instance().getMetaDataCache().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
{
throw new DefinitionException("XML defined specializing EJB must have annotation defined EJB implementation");
}
@@ -225,7 +225,7 @@
@Override
public T create()
{
- T instance = (T) getManager().getInstanceByType(EnterpriseBeanLookup.class).lookup(ejbMetaData.getEjbName());
+ T instance = (T) ManagerImpl.instance().getInstanceByType(EnterpriseBeanLookup.class).lookup(ejbMetaData.getEjbName());
bindDecorators();
bindInterceptors();
injectEjbAndCommonFields();
@@ -254,7 +254,7 @@
{
for (AnnotatedMethod<Object> initializer : getInitializerMethods())
{
- initializer.invoke(getManager(), instance);
+ initializer.invoke(instance);
}
}
@@ -275,7 +275,7 @@
{
for (AnnotatedField<?> field : getInjectableFields())
{
- field.inject(instance, getManager());
+ field.inject(instance);
}
}
@@ -307,7 +307,7 @@
if (superclass != null)
{
// TODO look up this bean and do this via init
- return new EnterpriseBean(superclass, getManager());
+ return new EnterpriseBean(superclass);
}
else
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -25,7 +25,6 @@
import javax.webbeans.Event;
import javax.webbeans.Standard;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedItem;
@@ -57,9 +56,9 @@
* @param manager The Web Beans manager
*/
@SuppressWarnings("unchecked")
- public EventBean(AnnotatedField<T> field, ManagerImpl manager)
+ public EventBean(AnnotatedField<T> field)
{
- super(manager);
+ super();
this.annotatedItem = (AnnotatedField<Event<T>>) field;
init();
}
@@ -167,7 +166,7 @@
@Override
public Event<T> create()
{
- return new EventImpl<T>(getManager(), annotatedItem.getBindingTypesAsArray());
+ return new EventImpl<T>(annotatedItem.getBindingTypesAsArray());
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -20,7 +20,6 @@
import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.Set;
-import java.util.Map.Entry;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem.AnnotationMap;
@@ -44,20 +43,20 @@
private Set<Class<?>> requiredTypes;
// The supported scopes
private Set<Class<? extends Annotation>> supportedScopes;
-
+
/**
* Constructor
*
* @param stereotypeAnnotations The stereotypes to merge
* @param manager The Web Beans manager
*/
- public MergedStereotypes(Set<Annotation> stereotypeAnnotations, ManagerImpl manager)
+ public MergedStereotypes(Set<Annotation> stereotypeAnnotations)
{
possibleDeploymentTypes = new AnnotationMap();
possibleScopeTypes = new HashSet<Annotation>();
requiredTypes = new HashSet<Class<?>>();
supportedScopes = new HashSet<Class<? extends Annotation>>();
- merge(stereotypeAnnotations, manager);
+ merge(stereotypeAnnotations);
}
/**
@@ -66,12 +65,12 @@
* @param stereotypeAnnotations The stereotype annotations
* @param manager The Web Beans manager
*/
- protected void merge(Set<Annotation> stereotypeAnnotations, ManagerImpl manager)
+ protected void merge(Set<Annotation> stereotypeAnnotations)
{
for (Annotation stereotypeAnnotation : stereotypeAnnotations)
{
// Retrieve and merge all metadata from stereotypes
- StereotypeModel<?> stereotype = manager.getMetaDataCache().getStereotype(stereotypeAnnotation.annotationType());
+ StereotypeModel<?> stereotype = ManagerImpl.instance().getMetaDataCache().getStereotype(stereotypeAnnotation.annotationType());
if (stereotype == null)
{
throw new IllegalStateException("Stereotype " + stereotypeAnnotation + " not registered with container");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -58,9 +58,9 @@
* @param declaringBean The declaring bean instance
* @param manager The Web Beans manager
*/
- public ProducerMethodBean(Method method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public ProducerMethodBean(Method method, AbstractClassBean<?> declaringBean)
{
- this(new AnnotatedMethodImpl<T>(method, declaringBean.getAnnotatedItem()), declaringBean, manager);
+ this(new AnnotatedMethodImpl<T>(method, declaringBean.getAnnotatedItem()), declaringBean);
}
/**
@@ -70,9 +70,9 @@
* @param declaringBean The declaring bean
* @param manager The Web Beans manager
*/
- public ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean)
{
- super(manager);
+ super();
this.method = method;
this.declaringBean = declaringBean;
init();
@@ -86,7 +86,7 @@
@Override
public T create()
{
- T instance = method.invoke(getManager(), getManager().getInstance(getDeclaringBean()));
+ T instance = method.invoke(ManagerImpl.instance().getInstance(getDeclaringBean()));
if (instance == null && !getScopeType().equals(Dependent.class))
{
throw new IllegalProductException("Cannot return null from a non-dependent method");
@@ -177,7 +177,7 @@
*/
protected void initRemoveMethod()
{
- Set<AnnotatedMethod<Object>> disposalMethods = getManager().resolveDisposalMethods(getType(), getBindingTypes().toArray(new Annotation[0]));
+ Set<AnnotatedMethod<Object>> disposalMethods = ManagerImpl.instance().resolveDisposalMethods(getType(), getBindingTypes().toArray(new Annotation[0]));
if (disposalMethods.size() == 1)
{
removeMethod = disposalMethods.iterator().next();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -26,7 +26,6 @@
import javax.webbeans.DefinitionException;
import javax.webbeans.Initializer;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -54,16 +53,16 @@
private AnnotatedMethod<Object> postConstruct;
private AnnotatedMethod<Object> preDestroy;
-
+
/**
* Constructor
*
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- public SimpleBean(Class<T> type, ManagerImpl manager)
+ public SimpleBean(Class<T> type)
{
- super(type, manager);
+ super(type);
init();
}
@@ -75,7 +74,7 @@
@Override
public T create()
{
- T instance = constructor.newInstance(getManager());
+ T instance = constructor.newInstance();
bindDecorators();
bindInterceptors();
injectEjbAndCommonFields();
@@ -147,7 +146,7 @@
{
for (AnnotatedMethod<Object> initializer : getInitializerMethods())
{
- initializer.invoke(getManager(), instance);
+ initializer.invoke(instance);
}
}
@@ -168,7 +167,7 @@
{
for (AnnotatedField<?> injectableField : getInjectableFields())
{
- injectableField.inject(instance, getManager());
+ injectableField.inject(instance);
}
}
@@ -330,7 +329,7 @@
if (superclass != null)
{
// TODO look up this bean and do this via init
- return new SimpleBean(superclass, getManager());
+ return new SimpleBean(superclass);
}
else
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -17,7 +17,6 @@
package org.jboss.webbeans.bean;
-import org.jboss.webbeans.ManagerImpl;
/**
* Represents an XML defined enterprise bean
@@ -35,9 +34,9 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- public XmlEnterpriseBean(Class<T> type, ManagerImpl manager)
+ public XmlEnterpriseBean(Class<T> type)
{
- super(type, manager);
+ super(type);
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -17,7 +17,6 @@
package org.jboss.webbeans.bean;
-import org.jboss.webbeans.ManagerImpl;
/**
* Represents a simple, XML defined bean
@@ -35,9 +34,9 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- public XmlSimpleBean(Class<T> type, ManagerImpl manager)
+ public XmlSimpleBean(Class<T> type)
{
- super(type, manager);
+ super(type);
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -43,7 +43,6 @@
private transient Bean<?> bean;
private int beanIndex;
- private static ManagerImpl manager;
/**
* Constructor
@@ -52,11 +51,10 @@
* @param beanIndex The index to the bean in the manager bean list
* @param manager The manager implementation
*/
- public ProxyMethodHandler(Bean<?> bean, int beanIndex, ManagerImpl manager)
+ public ProxyMethodHandler(Bean<?> bean, int beanIndex)
{
this.bean = bean;
this.beanIndex = beanIndex;
- ProxyMethodHandler.manager = manager;
}
/**
@@ -74,9 +72,9 @@
{
if (bean == null)
{
- bean = manager.getBeans().get(beanIndex);
+ bean = ManagerImpl.instance().getBeans().get(beanIndex);
}
- Context context = manager.getContext(bean.getScopeType());
+ Context context = ManagerImpl.instance().getContext(bean.getScopeType());
Object proxiedInstance = context.get(bean, true);
Method proxiedMethod = Reflections.lookupMethod(method, proxiedInstance);
return proxiedMethod.invoke(proxiedInstance, args);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -47,12 +47,10 @@
* @author Nicklas Karlsson
*/
- private ManagerImpl manager;
private ConcurrentCache<Bean<? extends Object>, Object> pool;
- public ProxyPool(ManagerImpl manager)
+ public ProxyPool()
{
- this.manager = manager;
this.pool = new ConcurrentCache<Bean<? extends Object>, Object>();
}
@@ -113,7 +111,7 @@
* @throws IllegalAccessException When the proxy couldn't be created
*/
@SuppressWarnings("unchecked")
- private static <T> T createClientProxy(Bean<T> bean, int beanIndex, ManagerImpl manager) throws RuntimeException
+ private static <T> T createClientProxy(Bean<T> bean, int beanIndex) throws RuntimeException
{
ProxyFactory proxyFactory = new ProxyFactory();
TypeInfo typeInfo = getTypeInfo(bean.getTypes());
@@ -132,7 +130,7 @@
{
throw new RuntimeException("Could not access bean correctly when creating client proxy for " + bean, e);
}
- ProxyMethodHandler proxyMethodHandler = new ProxyMethodHandler(bean, beanIndex, manager);
+ ProxyMethodHandler proxyMethodHandler = new ProxyMethodHandler(bean, beanIndex);
((ProxyObject) clientProxy).setHandler(proxyMethodHandler);
return clientProxy;
}
@@ -153,12 +151,12 @@
public T call() throws Exception
{
- int beanIndex = manager.getBeans().indexOf(bean);
+ int beanIndex = ManagerImpl.instance().getBeans().indexOf(bean);
if (beanIndex < 0)
{
throw new DefinitionException(bean + " is not known to the manager");
}
- return createClientProxy(bean, beanIndex, manager);
+ return createClientProxy(bean, beanIndex);
}
});
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -36,6 +36,7 @@
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.util.JNDI;
/**
* Bootstrapping functionality that is run at application startup and detects
@@ -50,9 +51,6 @@
private static LogProvider log = Logging.getLogProvider(Bootstrap.class);
- // The Web Beans manager
- private ManagerImpl manager;
-
/**
* Constructor
*
@@ -60,20 +58,10 @@
*/
public Bootstrap()
{
- this(ManagerImpl.instance());
+ JNDI.set(ManagerImpl.JNDI_KEY, ManagerImpl.instance());
}
/**
- * Constructor
- *
- * @param manager The Web Beans manager
- */
- protected Bootstrap(ManagerImpl manager)
- {
- this.manager = manager;
- }
-
- /**
* Register any beans defined by the provided classes with the manager
*
* @param classes The classes to register
@@ -93,7 +81,7 @@
public void registerBeans(Iterable<Class<?>> classes)
{
Set<AbstractBean<?, ?>> beans = createBeans(classes);
- manager.setBeans(beans);
+ ManagerImpl.instance().setBeans(beans);
}
/**
@@ -126,27 +114,27 @@
for (Class<?> clazz : classes)
{
AbstractClassBean<?> bean;
- if (manager.getMetaDataCache().getEjbMetaData(clazz).isEjb())
+ if (ManagerImpl.instance().getMetaDataCache().getEjbMetaData(clazz).isEjb())
{
- bean = createEnterpriseBean(clazz, manager);
+ bean = createEnterpriseBean(clazz);
}
else
{
- bean = createSimpleBean(clazz, manager);
+ bean = createSimpleBean(clazz);
}
beans.add(bean);
- manager.getResolver().addInjectionPoints(bean.getInjectionPoints());
+ ManagerImpl.instance().getResolver().addInjectionPoints(bean.getInjectionPoints());
for (AnnotatedMethod<Object> producerMethod : bean.getProducerMethods())
{
- ProducerMethodBean<?> producerMethodBean = createProducerMethodBean(producerMethod.getType(), producerMethod, manager, bean);
+ ProducerMethodBean<?> producerMethodBean = createProducerMethodBean(producerMethod.getType(), producerMethod, bean);
beans.add(producerMethodBean);
- manager.getResolver().addInjectionPoints(producerMethodBean.getInjectionPoints());
+ ManagerImpl.instance().getResolver().addInjectionPoints(producerMethodBean.getInjectionPoints());
}
for (AnnotatedField<Object> eventField : bean.getEventFields())
{
- EventBean<?> eventBean = createEventBean(eventField.getType(), eventField, manager);
+ EventBean<?> eventBean = createEventBean(eventField.getType(), eventField);
beans.add(eventBean);
- manager.getResolver().addInjectionPoints(eventBean.getInjectionPoints());
+ ManagerImpl.instance().getResolver().addInjectionPoints(eventBean.getInjectionPoints());
}
log.info("Web Bean: " + bean);
}
@@ -171,7 +159,7 @@
}
registerBeans(webBeanDiscovery.discoverWebBeanClasses());
log.info("Validing Web Bean injection points");
- manager.getResolver().resolveInjectionPoints();
+ ManagerImpl.instance().getResolver().resolveInjectionPoints();
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -42,8 +42,6 @@
// The HTTP session to use as backing map
private HttpSession session;
- // The Web Beans manager
- private ManagerImpl manager;
// The storage prefix to put before names
private String keyPrefix;
@@ -53,10 +51,9 @@
* @param manager The Web Beans manager
* @param keyPrefix The storage names prefix
*/
- public SessionBeanMap(ManagerImpl manager, String keyPrefix)
+ public SessionBeanMap(String keyPrefix)
{
super();
- this.manager = manager;
this.keyPrefix = keyPrefix;
log.trace("SessionBeanMap created with prefix " + keyPrefix);
}
@@ -94,7 +91,7 @@
*/
private String getBeanKey(Contextual<?> bean)
{
- return keyPrefix + manager.getBeans().indexOf(bean);
+ return keyPrefix + ManagerImpl.instance().getBeans().indexOf(bean);
}
/**
@@ -189,7 +186,7 @@
if (name.startsWith(keyPrefix))
{
String id = name.substring(keyPrefix.length());
- Contextual<?> bean = manager.getBeans().get(Integer.parseInt(id));
+ Contextual<?> bean = ManagerImpl.instance().getBeans().get(Integer.parseInt(id));
beans.add(bean);
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -38,7 +38,7 @@
{
super(SessionScoped.class);
// Replaces the BeanMap implementation with a session-based one
- beans.set(new SessionBeanMap(manager, getScopeType().getName() + "#"));
+ beans.set(new SessionBeanMap(getScopeType().getName() + "#"));
log.trace("Created session context");
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -21,8 +21,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
/**
- * The abstraction of a shared context with common beans but with a private
- * active state
+ * The abstraction of a shared context with common beans and active state state
*
* @author Nicklas Karlsson
*
@@ -31,14 +30,13 @@
public class SharedContext extends AbstractContext
{
private BeanMap beans;
- private ThreadLocal<AtomicBoolean> active;
+ private AtomicBoolean active;
public SharedContext(Class<? extends Annotation> scopeType)
{
super(scopeType);
beans = new SimpleBeanMap();
- active = new ThreadLocal<AtomicBoolean>();
- active.set(new AtomicBoolean(true));
+ active = new AtomicBoolean(true);
}
/**
@@ -47,7 +45,7 @@
@Override
protected AtomicBoolean getActive()
{
- return active.get();
+ return active;
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -48,7 +48,7 @@
// The event type
private Class<T> eventType;
// The Web Beans manager
- protected ManagerImpl manager;
+ protected static final ManagerImpl manager = ManagerImpl.instance();
/**
* Constructor
@@ -56,9 +56,8 @@
* @param manager The Web Beans manager
* @param bindingTypes The binding types
*/
- public EventImpl(ManagerImpl manager, Annotation... bindingTypes)
+ public EventImpl(Annotation... bindingTypes)
{
- this.manager = manager;
this.bindingTypes = checkBindingTypes(bindingTypes);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -134,8 +134,6 @@
// The map of registered observers for a give
private final RegisteredObserversMap registeredObservers;
- // The Web Beans manager
- private ManagerImpl manager;
// The current UserTransaction
UserTransaction userTransaction;
@@ -144,10 +142,9 @@
*
* @param manager The Web Beans manager
*/
- public EventManager(ManagerImpl manager)
+ public EventManager()
{
registeredObservers = new RegisteredObserversMap();
- this.manager = manager;
// TODO. Check where to *really* get this from
userTransaction = (UserTransaction) JNDI.lookup("java:/UserTransaction");
}
@@ -239,7 +236,7 @@
*/
private <T> void deferEvent(T event, Observer<T> observer)
{
- TransactionListener transactionListener = manager.getInstanceByType(TransactionListener.class);
+ TransactionListener transactionListener = ManagerImpl.instance().getInstanceByType(TransactionListener.class);
DeferredEventNotification<T> deferredEvent = new DeferredEventNotification<T>(event, observer);
transactionListener.registerSynhronization(deferredEvent);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -58,7 +58,6 @@
private final Class<T> eventType;
private TransactionObservationPhase transactionObservationPhase;
private boolean conditional;
- private ManagerImpl manager;
/**
* Creates an Observer which describes and encapsulates an observer method
@@ -72,9 +71,8 @@
* @param observer The observer method to notify
* @param eventType The type of event being observed
*/
- public ObserverImpl(ManagerImpl manager, final EventBean<T> eventBean, final AnnotatedMethod<Object> observer, final Class<T> eventType)
+ public ObserverImpl(final EventBean<T> eventBean, final AnnotatedMethod<Object> observer, final Class<T> eventType)
{
- this.manager = manager;
this.eventBean = eventBean;
this.observerMethod = observer;
this.eventType = eventType;
@@ -138,7 +136,7 @@
if (instance != null)
{
// TODO replace event parameter
- observerMethod.invoke(manager, instance);
+ observerMethod.invoke(instance);
}
}
@@ -154,7 +152,7 @@
protected Object getInstance(boolean conditional)
{
// Return the most specialized instance of the component
- return manager.getInstanceByType(eventBean.getType(), eventBean.getBindingTypes().toArray(new Annotation[0]));
+ return ManagerImpl.instance().getInstanceByType(eventBean.getType(), eventBean.getBindingTypes().toArray(new Annotation[0]));
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -21,8 +21,6 @@
import java.lang.reflect.Constructor;
import java.util.List;
-import org.jboss.webbeans.ManagerImpl;
-
/**
* Represents a Class Constructor
*
@@ -56,7 +54,7 @@
* @param manager The Web Beans manager
* @return The created instance
*/
- public T newInstance(ManagerImpl manager);
+ public T newInstance();
/**
* Gets the declaring class of the annotation
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -19,8 +19,6 @@
import java.lang.reflect.Field;
-import org.jboss.webbeans.ManagerImpl;
-
/**
* AnnotatedField provides a uniform access to the annotations on an annotated
* field
@@ -44,7 +42,7 @@
* @param instance The instance to inject
* @param manager The Web Beans manager
*/
- public void inject(Object instance, ManagerImpl manager);
+ public void inject(Object instance);
/**
* Gets an abstraction of the declaring class
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -21,8 +21,6 @@
import java.lang.reflect.Method;
import java.util.List;
-import org.jboss.webbeans.ManagerImpl;
-
/**
* AnnotatedType provides a uniform access to the annotations on an annotated
* class defined either in Java or XML
@@ -57,7 +55,7 @@
* @param instance The instance to invoke
* @return A reference to the instance
*/
- public T invoke(ManagerImpl manager, Object instance);
+ public T invoke(Object instance);
/**
* Invokes the method
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -17,7 +17,6 @@
package org.jboss.webbeans.introspector;
-import org.jboss.webbeans.ManagerImpl;
/**
* AnnotatedParameter provides a uniform access to a method parameter defined
@@ -35,6 +34,6 @@
* @param manager The Web Beans Manager
* @return The value
*/
- public T getValue(ManagerImpl manager);
+ public T getValue();
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -34,7 +34,6 @@
import javax.webbeans.ScopeType;
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedParameter;
@@ -205,13 +204,13 @@
* @return The object array of looked up values
*
*/
- protected static Object[] getParameterValues(List<AnnotatedParameter<Object>> parameters, ManagerImpl manager)
+ protected static Object[] getParameterValues(List<AnnotatedParameter<Object>> parameters)
{
Object[] parameterValues = new Object[parameters.size()];
Iterator<AnnotatedParameter<Object>> iterator = parameters.iterator();
for (int i = 0; i < parameterValues.length; i++)
{
- parameterValues[i] = iterator.next().getValue(manager);
+ parameterValues[i] = iterator.next().getValue();
}
return parameterValues;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -135,9 +135,9 @@
* @param manager The Web Beans manager
* @return The current value
*/
- public T getValue(ManagerImpl manager)
+ public T getValue()
{
- return manager.getInstanceByType(getType(), getMetaAnnotationsAsArray(BindingType.class));
+ return ManagerImpl.instance().getInstanceByType(getType(), getMetaAnnotationsAsArray(BindingType.class));
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -199,12 +199,12 @@
*
* @see org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(ManagerImpl)
*/
- public T newInstance(ManagerImpl manager)
+ public T newInstance()
{
try
{
// TODO: more details in the exceptions
- return getDelegate().newInstance(getParameterValues(parameters, manager));
+ return getDelegate().newInstance(getParameterValues(parameters));
}
catch (IllegalArgumentException e)
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -121,9 +121,9 @@
* @see org.jboss.webbeans.introspector.AnnotatedField#inject(Object,
* ManagerImpl)
*/
- public void inject(Object instance, ManagerImpl manager)
+ public void inject(Object instance)
{
- Reflections.setAndWrap(getDelegate(), instance, getValue(manager));
+ Reflections.setAndWrap(getDelegate(), instance, getValue());
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -236,9 +236,9 @@
* Object)
*/
@SuppressWarnings("unchecked")
- public T invoke(ManagerImpl manager, Object instance)
+ public T invoke(Object instance)
{
- return (T) Reflections.invokeAndWrap(getDelegate(), instance, getParameterValues(parameters, manager));
+ return (T) Reflections.invokeAndWrap(getDelegate(), instance, getParameterValues(parameters));
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -130,9 +130,9 @@
*
* @see org.jboss.webbeans.introspector.AnnotatedParameter
*/
- public T getValue(ManagerImpl manager)
+ public T getValue()
{
- return manager.getInstanceByType(getType(), getMetaAnnotationsAsArray(BindingType.class));
+ return ManagerImpl.instance().getInstanceByType(getType(), getMetaAnnotationsAsArray(BindingType.class));
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -19,7 +19,6 @@
import java.lang.reflect.Method;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bean.AbstractClassBean;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.EventBean;
@@ -45,9 +44,9 @@
* @param manager The Web Beans manager
* @return A Web Bean
*/
- public static <T> SimpleBean<T> createSimpleBean(Class<T> clazz, ManagerImpl manager)
+ public static <T> SimpleBean<T> createSimpleBean(Class<T> clazz)
{
- return new SimpleBean<T>(clazz, manager);
+ return new SimpleBean<T>(clazz);
}
/**
@@ -58,9 +57,9 @@
* @param manager The Web Beans manager
* @return A Web Bean
*/
- public static <T> XmlSimpleBean<T> createXmlSimpleBean(Class<T> clazz, ManagerImpl manager)
+ public static <T> XmlSimpleBean<T> createXmlSimpleBean(Class<T> clazz)
{
- return new XmlSimpleBean<T>(clazz, manager);
+ return new XmlSimpleBean<T>(clazz);
}
/**
@@ -71,9 +70,9 @@
* @param manager The Web Beans manager
* @return An Enterprise Web Bean
*/
- public static <T> EnterpriseBean<T> createEnterpriseBean(Class<T> clazz, ManagerImpl manager)
+ public static <T> EnterpriseBean<T> createEnterpriseBean(Class<T> clazz)
{
- return new EnterpriseBean<T>(clazz, manager);
+ return new EnterpriseBean<T>(clazz);
}
/**
@@ -84,9 +83,9 @@
* @param manager The Web Beans manager
* @return An Enterprise Web Bean
*/
- public static <T> XmlEnterpriseBean<T> createXmlEnterpriseBean(Class<T> clazz, ManagerImpl manager)
+ public static <T> XmlEnterpriseBean<T> createXmlEnterpriseBean(Class<T> clazz)
{
- return new XmlEnterpriseBean<T>(clazz, manager);
+ return new XmlEnterpriseBean<T>(clazz);
}
/**
@@ -99,9 +98,9 @@
* @param declaringBean The declaring bean abstraction
* @return A producer Web Bean
*/
- public static <T> ProducerMethodBean<T> createProducerMethodBean(Class<T> type, Method method, ManagerImpl manager, AbstractClassBean<?> declaringBean)
+ public static <T> ProducerMethodBean<T> createProducerMethodBean(Class<T> type, Method method, AbstractClassBean<?> declaringBean)
{
- return new ProducerMethodBean<T>(method, declaringBean, manager);
+ return new ProducerMethodBean<T>(method, declaringBean);
}
/**
@@ -113,9 +112,9 @@
* @param declaringBean The declaring bean abstraction
* @return A producer Web Bean
*/
- public static <T> ProducerMethodBean<T> createProducerMethodBean(Class<T> type, AnnotatedMethod<T> method, ManagerImpl manager, AbstractClassBean<?> declaringBean)
+ public static <T> ProducerMethodBean<T> createProducerMethodBean(Class<T> type, AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean)
{
- return new ProducerMethodBean<T>(method, declaringBean, manager);
+ return new ProducerMethodBean<T>(method, declaringBean);
}
/**
@@ -128,9 +127,9 @@
* @param declaringBean The declaring bean abstraction
* @return An event Web Bean
*/
- public static <T> EventBean<T> createEventBean(Class<T> type, AnnotatedField<T> field, ManagerImpl manager)
+ public static <T> EventBean<T> createEventBean(Class<T> type, AnnotatedField<T> field)
{
- return new EventBean<T>(field, manager);
+ return new EventBean<T>(field);
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -26,6 +26,7 @@
return (Future<T>) super.get(key);
}
+ @SuppressWarnings("unchecked")
public <T extends V> T getValue(K key)
{
Future<T> value = (Future<T>) map.get(key);
@@ -57,6 +58,7 @@
}
}
+ @SuppressWarnings("unchecked")
public <E> E putIfAbsent(K key, Callable<E> callable)
{
Future<E> value = (Future<E>) map.get(key);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/JNDI.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/JNDI.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/JNDI.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.util;
+
/**
* Provides JNDI access abstraction
*
@@ -35,7 +36,7 @@
{
return lookup(name, Object.class);
}
-
+
/**
* Typed JNDI lookup
*
@@ -48,5 +49,10 @@
{
return null;
}
-
+
+ public static void set(String key, Object value)
+ {
+ // TODO stub
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -430,6 +430,8 @@
}
catch (IllegalArgumentException e)
{
+ System.out.println(method.getDeclaringClass() + " " + instance.getClass());
+ e.printStackTrace();
throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
}
catch (IllegalAccessException e)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -18,9 +18,7 @@
package org.jboss.webbeans.util;
import java.beans.Introspector;
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
@@ -124,18 +122,4 @@
return buffer.toString();
}
- public static void main(String[] args)
- {
- Map map = new HashMap<String, Collection<?>>();
- Collection a = new ArrayList<String>();
- a.add("1");
- a.add("2");
- map.put("foo", a);
- Collection b = new ArrayList<String>();
- b.add("3");
- b.add("4");
- map.put("bar", b);
- System.out.println(mapToString("Header: ", map));
- }
-
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -29,11 +29,11 @@
private void setupGameGenerator() throws NoSuchMethodException
{
- SimpleBean<Game> gameBean = BeanFactory.createSimpleBean(Game.class, manager);
- SimpleBean<Generator> generatorBean = BeanFactory.createSimpleBean(Generator.class, manager);
+ SimpleBean<Game> gameBean = BeanFactory.createSimpleBean(Game.class);
+ SimpleBean<Generator> generatorBean = BeanFactory.createSimpleBean(Generator.class);
Method method = Generator.class.getDeclaredMethod("next");
method.setAccessible(true);
- ProducerMethodBean<Integer> nextBean = BeanFactory.createProducerMethodBean(int.class, method, manager, generatorBean);
+ ProducerMethodBean<Integer> nextBean = BeanFactory.createProducerMethodBean(int.class, method, generatorBean);
manager.addBean(gameBean);
manager.addBean(generatorBean);
@@ -68,10 +68,10 @@
private void setupTextTranslator()
{
- SimpleBean<SentenceParser> spBean = BeanFactory.createSimpleBean(SentenceParser.class, manager);
- SimpleBean<SentenceTranslator> stBean = BeanFactory.createSimpleBean(SentenceTranslator.class, manager);
- SimpleBean<MockSentenceTranslator> mstBean = BeanFactory.createSimpleBean(MockSentenceTranslator.class, manager);
- SimpleBean<TextTranslator> ttBean = BeanFactory.createSimpleBean(TextTranslator.class, manager);
+ SimpleBean<SentenceParser> spBean = BeanFactory.createSimpleBean(SentenceParser.class);
+ SimpleBean<SentenceTranslator> stBean = BeanFactory.createSimpleBean(SentenceTranslator.class);
+ SimpleBean<MockSentenceTranslator> mstBean = BeanFactory.createSimpleBean(MockSentenceTranslator.class);
+ SimpleBean<TextTranslator> ttBean = BeanFactory.createSimpleBean(TextTranslator.class);
manager.addBean(spBean);
manager.addBean(stBean);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -3,6 +3,7 @@
import javax.webbeans.Production;
import javax.webbeans.Standard;
+import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bootstrap.Bootstrap;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
@@ -21,7 +22,8 @@
public final void before()
{
manager = new MockManagerImpl();
- bootstrap = new MockBootstrap(manager);
+ ManagerImpl.setInstance(manager);
+ bootstrap = new MockBootstrap();
init();
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -31,7 +31,7 @@
@Test @SpecAssertion(section={"2.3.3", "2.3.1"})
public void testDefaultBindingTypeDeclaredInJava()
{
- SimpleBean<Order> order = createSimpleBean(Order.class, manager);
+ SimpleBean<Order> order = createSimpleBean(Order.class);
assert order.getBindingTypes().size() == 1;
order.getBindingTypes().iterator().next().annotationType().equals(Current.class);
}
@@ -58,7 +58,7 @@
@Test @SpecAssertion(section="2.3.3")
public void testBindingTypesDeclaredInJava()
{
- SimpleBean<Cat> cat = createSimpleBean(Cat.class, manager);
+ SimpleBean<Cat> cat = createSimpleBean(Cat.class);
assert cat.getBindingTypes().size() == 1;
assert Reflections.annotationSetMatches(cat.getBindingTypes(), Synchronous.class);
}
@@ -66,7 +66,7 @@
@Test @SpecAssertion(section="2.3.3")
public void testMultipleBindingTypes()
{
- SimpleBean<?> model = createSimpleBean(Cod.class, manager);
+ SimpleBean<?> model = createSimpleBean(Cod.class);
assert model.getBindingTypes().size() == 2;
}
@@ -111,7 +111,7 @@
@Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section={"2.3.4", "2.3.1"})
public void testDefaultBindingTypeDeclaredInXml()
{
- SimpleBean<?> model = createSimpleBean(Tuna.class, manager);
+ SimpleBean<?> model = createSimpleBean(Tuna.class);
assert model.getBindingTypes().size() == 1;
assert model.getBindingTypes().contains(new CurrentAnnotationLiteral());
assert false;
@@ -122,11 +122,11 @@
@Test(groups={"injection", "producerMethod"}) @SpecAssertion(section="2.3.5")
public void testFieldInjectedFromProducerMethod() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(createProducerMethodBean(Tarantula.class, method, manager, spiderProducer));
- Barn barn = createSimpleBean(Barn.class, manager).create();
+ manager.addBean(createProducerMethodBean(Tarantula.class, method, spiderProducer));
+ Barn barn = createSimpleBean(Barn.class).create();
assert barn.petSpider != null;
assert barn.petSpider instanceof DefangedTarantula;
}
@@ -146,12 +146,12 @@
@Test(groups={"injection", "producerMethod"})
public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(createProducerMethodBean(Tarantula.class, method, manager, spiderProducer));
+ manager.addBean(createProducerMethodBean(Tarantula.class, method, spiderProducer));
method = SpiderProducer.class.getMethod("produceSpiderFromInjection", Tarantula.class);
- ProducerMethodBean<Spider> spiderBean = createProducerMethodBean(Spider.class, method, manager, spiderProducer);
+ ProducerMethodBean<Spider> spiderBean = createProducerMethodBean(Spider.class, method, spiderProducer);
Spider spider = spiderBean.create();
assert spider != null;
assert spider instanceof DefangedTarantula;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -26,7 +26,7 @@
@SpecAssertion(section = { "4.4", "4.8" })
public void testReflectionsUsedForNormalScope()
{
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
Tuna tuna = manager.getInstance(tunaBean);
assert Reflections.isProxy(tuna);
@@ -36,7 +36,7 @@
@SpecAssertion(section = { "4.4", "4.8" })
public void testReflectionsNotUsedForPseudoScope()
{
- Bean<Fox> foxBean = BeanFactory.createSimpleBean(Fox.class, manager);
+ Bean<Fox> foxBean = BeanFactory.createSimpleBean(Fox.class);
Fox fox = manager.getInstance(foxBean);
assert !Reflections.isProxy(fox);
}
@@ -57,7 +57,7 @@
@SpecAssertion(section = "4.4")
public void testSimpleWebBeanReflectionsIsSerializable() throws IOException, ClassNotFoundException
{
- Bean<TunedTuna> tunaBean = BeanFactory.createSimpleBean(TunedTuna.class, manager);
+ Bean<TunedTuna> tunaBean = BeanFactory.createSimpleBean(TunedTuna.class);
manager.addBean(tunaBean);
TunedTuna tuna = manager.getInstance(tunaBean);
assert Reflections.isProxy(tuna);
@@ -71,7 +71,7 @@
@SpecAssertion(section = "4.4.1")
public void testInjectionPointWithUnproxyableTypeWhichResolvesToNormalScopedWebBean()
{
- Bean<FinalTuna> tunaBean = BeanFactory.createSimpleBean(FinalTuna.class, manager);
+ Bean<FinalTuna> tunaBean = BeanFactory.createSimpleBean(FinalTuna.class);
manager.addBean(tunaBean);
FinalTuna tuna = manager.getInstanceByType(FinalTuna.class);
assert false;
@@ -81,7 +81,7 @@
@SpecAssertion(section = "4.4.2")
public void testReflectionsInvocation()
{
- Bean<TunedTuna> tunaBean = BeanFactory.createSimpleBean(TunedTuna.class, manager);
+ Bean<TunedTuna> tunaBean = BeanFactory.createSimpleBean(TunedTuna.class);
manager.addBean(tunaBean);
TunedTuna tuna = manager.getInstance(tunaBean);
assert Reflections.isProxy(tuna);
@@ -90,7 +90,7 @@
@Test(groups = "Reflections", expectedExceptions=DefinitionException.class)
public void testGettingUnknownBeanFails() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
Tuna tuna = manager.getInstance(tunaBean);
assert false;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -29,41 +29,41 @@
@Test @SpecAssertion(section="2")
public void testApiTypesNonEmpty()
{
- Bean<?> model = createSimpleBean(RedSnapper.class, manager);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getTypes().size() > 0;
}
@Test @SpecAssertion(section="2")
public void testBindingTypesNonEmpty()
{
- Bean<?> model = createSimpleBean(RedSnapper.class, manager);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getBindingTypes().size() > 0;
}
@Test @SpecAssertion(section="2")
public void testHasScopeType()
{
- Bean<?> model = createSimpleBean(RedSnapper.class, manager);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="2")
public void testHasDeploymentType()
{
- Bean<?> model = createSimpleBean(RedSnapper.class, manager);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getDeploymentType().equals(Production.class);
}
@Test(groups="producerMethod") @SpecAssertion(section="4.2")
public void testIsNullable() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducerBean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducerBean = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducerBean);
Method method = SpiderProducer.class.getMethod("getWolfSpiderSize");
- Bean<Integer> bean = createProducerMethodBean(int.class, method, manager, spiderProducerBean);
+ Bean<Integer> bean = createProducerMethodBean(int.class, method, spiderProducerBean);
assert !bean.isNullable();
method = SpiderProducer.class.getMethod("makeASpider");
- Bean<Spider> spiderBean = createProducerMethodBean(Spider.class, method, manager, spiderProducerBean);
+ Bean<Spider> spiderBean = createProducerMethodBean(Spider.class, method, spiderProducerBean);
assert spiderBean.isNullable();
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -66,7 +66,7 @@
//annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
//AnnotatedClass<Tuna> annotatedItem = new SimpleAnnotatedClass<Tuna>(Tuna.class, annotations);
// TODO This should test a real class
- tuna = createSimpleBean(Tuna.class, manager);
+ tuna = createSimpleBean(Tuna.class);
om = new AnnotatedMethodImpl<Object>(AnObserver.class.getMethod("observe", new Class[] { Event.class }), new AnnotatedClassImpl<AnObserver>(AnObserver.class));
AnObserver observerInstance = new AnObserver();
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -25,8 +25,8 @@
@Test(groups={"contexts", "injection"}) @SpecAssertion(section="8.3")
public void testInstanceNotSharedBetweenInjectionPoints()
{
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class, manager);
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
FoxRun foxRun = foxRunBean.create();
assert !foxRun.fox.equals(foxRun.anotherFox);
@@ -41,10 +41,10 @@
@Test(groups={"contexts", "producerMethod"}) @SpecAssertion(section="8.3")
public void testInstanceUsedForProducerMethodNotShared() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBean<Tarantula> tarantulaBean = createProducerMethodBean(Tarantula.class, method, manager, spiderProducer);
+ ProducerMethodBean<Tarantula> tarantulaBean = createProducerMethodBean(Tarantula.class, method, spiderProducer);
Tarantula tarantula = tarantulaBean.create();
Tarantula tarantula2 = tarantulaBean.create();
assert tarantula != null;
@@ -61,7 +61,7 @@
@Test(groups="contexts") @SpecAssertion(section="8.3")
public void testContextGetWithCreateTrueReturnsNewInstance()
{
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
DependentContext context = new DependentContext();
context.setActive(true);
@@ -72,7 +72,7 @@
@Test(groups="contexts") @SpecAssertion(section="8.3")
public void testContextGetWithCreateFalseReturnsNull()
{
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
DependentContext context = new DependentContext();
context.setActive(true);
@@ -102,8 +102,8 @@
public void testContextIsActiveDuringBeanCreation()
{
// Slightly roundabout, but I can't see a better way to test atm
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class, manager);
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox != null;
@@ -118,8 +118,8 @@
@Test(groups={"contexts", "injection"}) @SpecAssertion(section="8.3")
public void testContextIsActiveDuringInjection()
{
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class, manager);
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox != null;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -25,7 +25,7 @@
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.5.1")
public void testNonBuiltInComponentUsesStandard()
{
- createSimpleBean(Gazelle.class, manager);
+ createSimpleBean(Gazelle.class);
}
@Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.5.2")
@@ -49,7 +49,7 @@
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.5.3")
public void testTooManyDeploymentTypes()
{
- createSimpleBean(BeanWithTooManyDeploymentTypes.class, manager);
+ createSimpleBean(BeanWithTooManyDeploymentTypes.class);
}
@Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.5.4")
@@ -87,7 +87,7 @@
@Test @SpecAssertion(section="2.5.5")
public void testHighestPrecedenceDeploymentTypeFromStereotype()
{
- Bean<?> bean = createSimpleBean(Rhinoceros.class, manager);
+ Bean<?> bean = createSimpleBean(Rhinoceros.class);
assert bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
}
@@ -107,7 +107,7 @@
{
manager.setEnabledDeploymentTypes(Standard.class, AnotherDeploymentType.class, HornedAnimalDeploymentType.class);
- Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class, manager);
+ Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class);
manager.addBean(bean);
manager.getInstanceByType(RedSnapper.class);
}
@@ -146,7 +146,7 @@
@Test @SpecAssertion(section="2.7.2")
public void testWebBeanDeploymentTypeOverridesStereotype()
{
- Bean<Reindeer> bean = createSimpleBean(Reindeer.class, manager);
+ Bean<Reindeer> bean = createSimpleBean(Reindeer.class);
assert bean.getDeploymentType().equals(Production.class);
}
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventManagerTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventManagerTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventManagerTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -36,7 +36,7 @@
@Test(groups = "observerMethod")
public void testAddObserver()
{
- EventManager eventManager = new EventManager(manager);
+ EventManager eventManager = new EventManager();
Observer<DangerCall> observer = new AnObserver<DangerCall>();
eventManager.addObserver(observer, DangerCall.class);
DangerCall event = new DangerCall();
@@ -61,7 +61,7 @@
@Test(groups = { "observerMethod" })
public void testRemoveObserver()
{
- EventManager eventManager = new EventManager(manager);
+ EventManager eventManager = new EventManager();
Observer<DangerCall> observer = new AnObserver<DangerCall>();
eventManager.addObserver(observer, DangerCall.class);
eventManager.removeObserver(observer, DangerCall.class);
@@ -166,7 +166,7 @@
// }
//
// };
- EventManager eventManager = new EventManager(manager);
+ EventManager eventManager = new EventManager();
Observer<DangerCall> observer = new AnObserver<DangerCall>();
try
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -4,24 +4,12 @@
import java.util.ArrayList;
import java.util.List;
-import javax.webbeans.DuplicateBindingTypeException;
-import javax.webbeans.Event;
import javax.webbeans.Observer;
import javax.webbeans.Standard;
-import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
-import org.jboss.webbeans.test.annotations.Synchronous;
-import org.jboss.webbeans.test.annotations.Tame;
-import org.jboss.webbeans.test.beans.DangerCall;
-import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.RiverFishStereotypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.TameAnnotationLiteral;
import org.jboss.webbeans.test.mock.MockManagerImpl;
-import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
/**
* Tests for the implementation of an Event component.
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InitializerMethodTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InitializerMethodTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InitializerMethodTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -23,7 +23,7 @@
@Test(expectedExceptions=DefinitionException.class, groups="initializerMethod") @SpecAssertion(section="3.7")
public void testStaticInitializerMethodNotAllowed()
{
- createSimpleBean(Dottrel.class, manager);
+ createSimpleBean(Dottrel.class);
}
@Test(groups={"stub", "initializerMethod", "servlet"}) @SpecAssertion(section="3.7")
@@ -65,10 +65,10 @@
@Test(groups={"initializerMethod"}) @SpecAssertion(section={"3.7", "5.3", "3.7.2", "3.7.3"})
public void testMultipleInitializerMethodsAreCalled()
{
- manager.addBean(createSimpleBean(Fox.class, manager));
- manager.addBean(createSimpleBean(Chicken.class, manager));
+ manager.addBean(createSimpleBean(Fox.class));
+ manager.addBean(createSimpleBean(Chicken.class));
- Bean<ChickenHutch> chickenHutchBean = createSimpleBean(ChickenHutch.class, manager);
+ Bean<ChickenHutch> chickenHutchBean = createSimpleBean(ChickenHutch.class);
ChickenHutch chickenHutch = chickenHutchBean.create();
assert chickenHutch.fox != null;
assert chickenHutch.chicken != null;
@@ -77,25 +77,25 @@
@Test(groups="initializerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section={"3.7.1", "3.4.2"})
public void testInitializerMethodAnnotatedProduces()
{
- createSimpleBean(Pheasant.class, manager);
+ createSimpleBean(Pheasant.class);
}
@Test(groups="initializerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.7.1")
public void testInitializerMethodAnnotatedDestructor()
{
- createSimpleBean(Shrike.class, manager);
+ createSimpleBean(Shrike.class);
}
@Test(groups="initializerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.7.1")
public void testInitializerMethodHasParameterAnnotatedDisposes()
{
- createSimpleBean(Capercaillie.class, manager);
+ createSimpleBean(Capercaillie.class);
}
@Test(groups="initializerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.7.1")
public void testInitializerMethodHasParameterAnnotatedObserves()
{
- createSimpleBean(Grouse.class, manager);
+ createSimpleBean(Grouse.class);
}
@Test(groups={"stub", "initializerMethod", "webbeansxml"}) @SpecAssertion(section="3.7.2")
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -32,10 +32,10 @@
@Test(groups={"injection", "producerMethod"}) @SpecAssertion(section="4.2")
public void testInjectionPerformsBoxingIfNecessary() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
- Bean<SpiderNest> spiderNestBean = createSimpleBean(SpiderNest.class, manager);
- manager.addBean(createProducerMethodBean(Integer.class, SpiderProducer.class.getMethod("getWolfSpiderSize"), manager, spiderProducer));
+ Bean<SpiderNest> spiderNestBean = createSimpleBean(SpiderNest.class);
+ manager.addBean(createProducerMethodBean(Integer.class, SpiderProducer.class.getMethod("getWolfSpiderSize"), spiderProducer));
SpiderNest spiderNest = spiderNestBean.create();
assert spiderNest.numberOfSpiders != null;
assert spiderNest.numberOfSpiders.equals(4);
@@ -44,17 +44,17 @@
@Test(groups={"injection", "producerMethod"}, expectedExceptions=NullableDependencyException.class) @SpecAssertion(section="4.2")
public void testPrimitiveInjectionPointResolvesToNullableWebBean() throws Exception
{
- Bean<FarmHouse> farmHouseBean = createSimpleBean(FarmHouse.class, manager);
- SimpleBean<FarmHouseProducer> farmHouseProducerBean = createSimpleBean(FarmHouseProducer.class, manager);
- manager.addBean(createProducerMethodBean(Integer.class, FarmHouseProducer.class.getMethod("getNumberOfBedrooms"), manager, farmHouseProducerBean));
+ Bean<FarmHouse> farmHouseBean = createSimpleBean(FarmHouse.class);
+ SimpleBean<FarmHouseProducer> farmHouseProducerBean = createSimpleBean(FarmHouseProducer.class);
+ manager.addBean(createProducerMethodBean(Integer.class, FarmHouseProducer.class.getMethod("getNumberOfBedrooms"), farmHouseProducerBean));
farmHouseBean.create();
}
@Test(groups={"injection", "clientProxy"}, expectedExceptions=ContextNotActiveException.class) @SpecAssertion(section="4.3")
public void testInvokeNormalInjectedWebBeanWhenContextNotActive()
{
- SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class, manager);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
TunaFarm tunaFarm = tunaFarmBean.create();
assert tunaFarm.tuna != null;
@@ -66,8 +66,8 @@
@Test(groups="injection") @SpecAssertion(section="4.3")
public void testInvokeDependentScopeWhenContextNotActive()
{
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class, manager);
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox.getName().equals("gavin");
@@ -76,8 +76,8 @@
@Test(groups="injection", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.6")
public void testInjectingStaticField()
{
- SimpleBean<BeanWithStaticBoundField> bean = createSimpleBean(BeanWithStaticBoundField.class, manager);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ SimpleBean<BeanWithStaticBoundField> bean = createSimpleBean(BeanWithStaticBoundField.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
BeanWithStaticBoundField instance = bean.create();
}
@@ -85,8 +85,8 @@
@Test(groups="injection",expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.6")
public void testInjectingFinalField()
{
- SimpleBean<BeanWithFinalBoundField> bean = createSimpleBean(BeanWithFinalBoundField.class, manager);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ SimpleBean<BeanWithFinalBoundField> bean = createSimpleBean(BeanWithFinalBoundField.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
BeanWithFinalBoundField instance = bean.create();
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -29,8 +29,8 @@
public void testNoWebBeansFound() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"), fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
@@ -41,9 +41,9 @@
public void testAmbiguousDependencies() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"), fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -54,13 +54,13 @@
@Test(groups={"resolution", "beanLifecycle"}) @SpecAssertion(section="4.10.1")
public void testGetInstanceByName()
{
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
- Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class, manager);
- Bean<Haddock> haddockBean = createSimpleBean(Haddock.class, manager);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(tunaBean);
manager.addBean(codBean);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -35,7 +35,7 @@
@Test(groups={"resolution", "beanLifecycle"}) @SpecAssertion(section="4.9")
public void testCurrentBindingTypeAssumed()
{
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
assert manager.getInstanceByType(Tuna.class) != null;
}
@@ -56,9 +56,9 @@
public void testAmbiguousDependencies() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"), fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -70,9 +70,9 @@
public void testUnsatisfiedDependencies() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"), fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -84,7 +84,7 @@
public void testUnproxyableDependencies() throws Exception
{
AnnotatedField<Plaice> plaiceField = new AnnotatedFieldImpl<Plaice>(PlaiceFarm.class.getDeclaredField("plaice"), fishFarmClass);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(plaiceBean);
manager.getInstanceByType(Plaice.class, new AnnotationLiteral<Whitefish>(){});
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/MyTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/MyTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/MyTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test;
+
+import javax.webbeans.Event;
+import javax.webbeans.Observable;
+import javax.webbeans.RequestScoped;
+
+@RequestScoped
+public class MyTest
+{
+ @Observable Event<Param> paramEvent;
+}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -24,7 +24,7 @@
@Test @SpecAssertion(section="2.6.1")
public void testNonDefaultNamed()
{
- SimpleBean<Moose> moose = createSimpleBean(Moose.class, manager);
+ SimpleBean<Moose> moose = createSimpleBean(Moose.class);
assert moose.getName().equals("aMoose");
}
@@ -80,7 +80,7 @@
@Test @SpecAssertion(section={"2.6.3", "3.2.7"})
public void testDefaultNamed()
{
- SimpleBean<Haddock> haddock = createSimpleBean(Haddock.class, manager);
+ SimpleBean<Haddock> haddock = createSimpleBean(Haddock.class);
assert haddock.getName() != null;
assert haddock.getName().equals("haddock");
}
@@ -108,7 +108,7 @@
@Test @SpecAssertion(section={"2.6.3", "2.7"})
public void testSterotypeDefaultsName()
{
- SimpleBean<RedSnapper> model = createSimpleBean(RedSnapper.class, manager);
+ SimpleBean<RedSnapper> model = createSimpleBean(RedSnapper.class);
assert model.getMergedStereotypes().isBeanNameDefaulted();
assert model.getName().equals("redSnapper");
}
@@ -116,14 +116,14 @@
@Test @SpecAssertion(section="2.6.4")
public void testNotNamedInJava()
{
- SimpleBean<SeaBass> model = createSimpleBean(SeaBass.class, manager);
+ SimpleBean<SeaBass> model = createSimpleBean(SeaBass.class);
assert model.getName() == null;
}
@Test @SpecAssertion(section="2.6.4")
public void testNotNamedInXml()
{
- SimpleBean<SeaBass> model = createSimpleBean(SeaBass.class, manager);
+ SimpleBean<SeaBass> model = createSimpleBean(SeaBass.class);
assert model.getName() == null;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -3,10 +3,15 @@
import java.lang.annotation.Annotation;
import java.util.Set;
+import javax.webbeans.Event;
import javax.webbeans.Observer;
import javax.webbeans.TypeLiteral;
+import org.jboss.webbeans.bean.EventBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.test.bindings.RoleBinding;
+import org.jboss.webbeans.util.BeanFactory;
import org.testng.annotations.Test;
/**
@@ -30,6 +35,17 @@
}
}
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void create() {
+ SimpleBean<MyTest> myTestBean = BeanFactory.createSimpleBean(MyTest.class);
+ for (AnnotatedField<Object> field : myTestBean.getEventFields()) {
+ EventBean eventBean = BeanFactory.createEventBean(field.getType(), field);
+ @SuppressWarnings("unused")
+ Event<Param> event = eventBean.create();
+ }
+ }
@Test(groups={"stub", "events"})
@SpecAssertion(section="7.1")
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -40,13 +40,13 @@
@Test(groups="contexts") @SpecAssertion(section="8.1")
public void testGetWithCreateFalseReturnsNull() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
assert context.get(tunaBean, false) == null;
}
@Test(groups="contexts") @SpecAssertion(section="8.1")
public void testGetWithCreateTrueReturnsBean() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
assert context.get(tunaBean, true) != null;
}
@@ -59,7 +59,7 @@
@Test(groups="contexts") @SpecAssertion(section="8.1")
public void testReturnsCorrectExistingBean() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
Tuna firstTuna = context.get(tunaBean, true);
Tuna secondTuna = context.get(tunaBean, false);
assert firstTuna == secondTuna;
@@ -67,10 +67,10 @@
@Test(groups={"contexts", "producerMethod"}) @SpecAssertion(section="8.1")
public void testProducerMethodReturningNullOK() throws SecurityException, NoSuchMethodException {
- SimpleBean<SpiderProducer> producer = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> producer = createSimpleBean(SpiderProducer.class);
manager.addBean(producer);
Method nullProducer = SpiderProducer.class.getMethod("produceShelob");
- ProducerMethodBean<Tarantula> shelobBean = createProducerMethodBean(Tarantula.class, nullProducer, manager, producer);
+ ProducerMethodBean<Tarantula> shelobBean = createProducerMethodBean(Tarantula.class, nullProducer, producer);
assert shelobBean.create() == null;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -63,7 +63,7 @@
//annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
//AnnotatedClass<Tuna> annotatedItem = new SimpleAnnotatedClass<Tuna>(Tuna.class, annotations);
- tuna = createSimpleBean(Tuna.class, manager);
+ tuna = createSimpleBean(Tuna.class);
om = new AnnotatedMethodImpl<Object>(AnObserver.class.getMethod("observe", new Class[] { SampleEvent.class }), new AnnotatedClassImpl<AnObserver>(AnObserver.class));
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/Param.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/Param.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/Param.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test;
+
+public class Param
+{
+
+}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -21,10 +21,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="5.6")
public void testProducerMethodBeanCreate() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBean<Tarantula> tarantulaBean = createProducerMethodBean(Tarantula.class, method, manager, spiderProducer);
+ ProducerMethodBean<Tarantula> tarantulaBean = createProducerMethodBean(Tarantula.class, method, spiderProducer);
Tarantula tarantula = tarantulaBean.create();
assert tarantula != null;
}
@@ -54,10 +54,10 @@
@Test(groups="producerMethod") @SpecAssertion(section={"3.4", "5.6", "8.3"})
public void testProducerMethodReturnsNullIsDependent() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("getNullSpider");
- ProducerMethodBean<Spider> spiderBean = createProducerMethodBean(Spider.class, method, manager, spiderProducer);
+ ProducerMethodBean<Spider> spiderBean = createProducerMethodBean(Spider.class, method, spiderProducer);
Spider spider = spiderBean.create();
assert spider == null;
}
@@ -65,10 +65,10 @@
@Test(groups="producerMethod", expectedExceptions=IllegalProductException.class) @SpecAssertion(section={"3.4", "5.6"})
public void testProducerMethodReturnsNullIsNotDependent() throws Exception
{
- SimpleBean<BrokenSpiderProducer> spiderProducer = createSimpleBean(BrokenSpiderProducer.class, manager);
+ SimpleBean<BrokenSpiderProducer> spiderProducer = createSimpleBean(BrokenSpiderProducer.class);
manager.addBean(spiderProducer);
Method method = BrokenSpiderProducer.class.getMethod("getRequestScopedSpider");
- createProducerMethodBean(Spider.class, method, manager, spiderProducer).create();
+ createProducerMethodBean(Spider.class, method, spiderProducer).create();
}
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -34,20 +34,20 @@
@Test(groups="producerMethod") @SpecAssertion(section="2.5.3")
public void testProducerMethodInheritsDeploymentTypeOfDeclaringWebBean() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- ProducerMethodBean<Tarantula> tarantulaModel = createProducerMethodBean(Tarantula.class, method, manager, bean);
+ ProducerMethodBean<Tarantula> tarantulaModel = createProducerMethodBean(Tarantula.class, method, bean);
tarantulaModel.getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testStaticMethod() throws Exception
{
- SimpleBean<BeanWithStaticProducerMethod> bean = createSimpleBean(BeanWithStaticProducerMethod.class, manager);
+ SimpleBean<BeanWithStaticProducerMethod> bean = createSimpleBean(BeanWithStaticProducerMethod.class);
manager.addBean(bean);
Method method = BeanWithStaticProducerMethod.class.getMethod("getString");
- createProducerMethodBean(String.class, method, manager, bean);
+ createProducerMethodBean(String.class, method, bean);
}
@Test(groups={"stub", "producerMethod", "enterpriseBeans", "stub"}, expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
@@ -59,28 +59,28 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4")
public void testParameterizedReturnType() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getFunnelWeaverSpider");
- createProducerMethodBean(FunnelWeaver.class, method, manager, bean);
+ createProducerMethodBean(FunnelWeaver.class, method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testParameterizedReturnTypeWithWildcard() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getAnotherFunnelWeaver");
- createProducerMethodBean(FunnelWeaver.class, method, manager, bean);
+ createProducerMethodBean(FunnelWeaver.class, method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testParameterizedReturnTypeWithTypeParameter() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getFunnelWeaver");
- createProducerMethodBean(FunnelWeaver.class, method, manager, bean);
+ createProducerMethodBean(FunnelWeaver.class, method, bean);
}
@Test(groups={"stub", "producerMethod", "deployment"}) @SpecAssertion(section="3.4")
@@ -92,10 +92,10 @@
@Test(groups="producerMethod") @SpecAssertion(section={"3.4", "2.3.1"})
public void testDefaultBindingType() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBean<Tarantula> tarantulaModel = createProducerMethodBean(Tarantula.class, method, manager, bean);
+ ProducerMethodBean<Tarantula> tarantulaModel = createProducerMethodBean(Tarantula.class, method, bean);
assert tarantulaModel.getBindingTypes().size() == 1;
assert tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Current.class);
}
@@ -103,10 +103,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForClassReturn() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBean<Tarantula> tarantulaModel = createProducerMethodBean(Tarantula.class, method, manager, bean);
+ ProducerMethodBean<Tarantula> tarantulaModel = createProducerMethodBean(Tarantula.class, method, bean);
assert tarantulaModel.getTypes().size() == 6;
assert tarantulaModel.getTypes().contains(Tarantula.class);
assert tarantulaModel.getTypes().contains(DeadlySpider.class);
@@ -119,10 +119,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForInterfaceReturn() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("makeASpider");
- ProducerMethodBean<Animal> animalModel = createProducerMethodBean(Animal.class, method, manager, bean);
+ ProducerMethodBean<Animal> animalModel = createProducerMethodBean(Animal.class, method, bean);
assert animalModel.getTypes().size() == 2;
assert animalModel.getTypes().contains(Animal.class);
assert animalModel.getTypes().contains(Object.class);
@@ -131,10 +131,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForPrimitiveReturn() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getWolfSpiderSize");
- ProducerMethodBean<Integer> intModel = createProducerMethodBean(int.class, method, manager, bean);
+ ProducerMethodBean<Integer> intModel = createProducerMethodBean(int.class, method, bean);
assert intModel.getTypes().size() == 2;
assert intModel.getTypes().contains(int.class);
assert intModel.getTypes().contains(Object.class);
@@ -143,10 +143,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForArrayTypeReturn() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getSpiders");
- ProducerMethodBean<Spider[]> spidersModel = createProducerMethodBean(Spider[].class, method, manager, bean);
+ ProducerMethodBean<Spider[]> spidersModel = createProducerMethodBean(Spider[].class, method, bean);
assert spidersModel.getTypes().size() == 2;
assert spidersModel.getTypes().contains(Spider[].class);
assert spidersModel.getTypes().contains(Object.class);
@@ -155,10 +155,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testBindingType() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- ProducerMethodBean<Tarantula> tarantulaModel = createProducerMethodBean(Tarantula.class, method, manager, bean);
+ ProducerMethodBean<Tarantula> tarantulaModel = createProducerMethodBean(Tarantula.class, method, bean);
assert tarantulaModel.getBindingTypes().size() == 1;
assert tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Tame.class);
}
@@ -166,10 +166,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testScopeType() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
- ProducerMethodBean<DaddyLongLegs> daddyLongLegsModel = createProducerMethodBean(DaddyLongLegs.class, method, manager, bean);
+ ProducerMethodBean<DaddyLongLegs> daddyLongLegsModel = createProducerMethodBean(DaddyLongLegs.class, method, bean);
assert daddyLongLegsModel.getScopeType().equals(RequestScoped.class);
// TODO Inherit scope from returned web bean?
@@ -178,58 +178,58 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testDeploymentType() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getLadybirdSpider");
- ProducerMethodBean<LadybirdSpider> ladybirdSpiderModel = createProducerMethodBean(LadybirdSpider.class, method, manager, bean);
+ ProducerMethodBean<LadybirdSpider> ladybirdSpiderModel = createProducerMethodBean(LadybirdSpider.class, method, bean);
assert ladybirdSpiderModel.getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testNamedMethod() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceBlackWidow");
- ProducerMethodBean<BlackWidow> blackWidowSpiderModel = createProducerMethodBean(BlackWidow.class, method, manager, bean);
+ ProducerMethodBean<BlackWidow> blackWidowSpiderModel = createProducerMethodBean(BlackWidow.class, method, bean);
assert blackWidowSpiderModel.getName().equals("blackWidow");
}
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testDefaultNamedMethod() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
- ProducerMethodBean<DaddyLongLegs> daddyLongLegsSpiderModel = createProducerMethodBean(DaddyLongLegs.class, method, manager, bean);
+ ProducerMethodBean<DaddyLongLegs> daddyLongLegsSpiderModel = createProducerMethodBean(DaddyLongLegs.class, method, bean);
assert daddyLongLegsSpiderModel.getName().equals("produceDaddyLongLegs");
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testProducerMethodAnnotatedDestructor() throws Exception
{
- SimpleBean<BrokenSpiderProducer> bean = createSimpleBean(BrokenSpiderProducer.class, manager);
+ SimpleBean<BrokenSpiderProducer> bean = createSimpleBean(BrokenSpiderProducer.class);
manager.addBean(bean);
Method method = BrokenSpiderProducer.class.getMethod("destroy");
- createProducerMethodBean(String.class, method, manager, bean);
+ createProducerMethodBean(String.class, method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testProducerMethodWithParameterAnnotatedDisposes() throws Exception
{
- SimpleBean<BrokenSpiderProducer> bean = createSimpleBean(BrokenSpiderProducer.class, manager);
+ SimpleBean<BrokenSpiderProducer> bean = createSimpleBean(BrokenSpiderProducer.class);
manager.addBean(bean);
Method method = BrokenSpiderProducer.class.getMethod("dispose", String.class);
- createProducerMethodBean(String.class, method, manager, bean);
+ createProducerMethodBean(String.class, method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
public void testProducerMethodWithParameterAnnotatedObserves() throws Exception
{
- SimpleBean<BrokenSpiderProducer> bean = createSimpleBean(BrokenSpiderProducer.class, manager);
+ SimpleBean<BrokenSpiderProducer> bean = createSimpleBean(BrokenSpiderProducer.class);
manager.addBean(bean);
Method method = BrokenSpiderProducer.class.getMethod("observe", String.class);
- createProducerMethodBean(String.class, method, manager, bean);
+ createProducerMethodBean(String.class, method, bean);
}
@Test(groups={"stub", "disposalMethod"}) @SpecAssertion(section="3.3.4")
@@ -295,10 +295,10 @@
@Test(groups="producerMethod") @SpecAssertion(section={"2.7.2", "3.4.2"})
public void testStereotype() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceWolfSpider");
- ProducerMethodBean<WolfSpider> wolfSpiderModel = createProducerMethodBean(WolfSpider.class, method, manager, bean);
+ ProducerMethodBean<WolfSpider> wolfSpiderModel = createProducerMethodBean(WolfSpider.class, method, bean);
assert wolfSpiderModel.getMergedStereotypes().getRequiredTypes().size() == 1;
assert wolfSpiderModel.getMergedStereotypes().getRequiredTypes().contains(Animal.class);
assert wolfSpiderModel.getScopeType().equals(RequestScoped.class);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByNameTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByNameTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByNameTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -39,13 +39,13 @@
public void testNamedBasedResolution()
{
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
- Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class, manager);
- Bean<Haddock> haddockBean = createSimpleBean(Haddock.class, manager);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(tunaBean);
manager.addBean(codBean);
@@ -70,8 +70,8 @@
@Test(groups="resolution") @SpecAssertion(section="4.10.1")
public void testNoWebBeansFound() throws Exception
{
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -64,7 +64,7 @@
public void testSingleApiTypeWithCurrent() throws Exception
{
AnnotatedField<Tuna> tunaField = new AnnotatedFieldImpl<Tuna>(FishFarm.class.getDeclaredField("tuna"), fishFarmClass);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
Set<Bean<Tuna>> possibleTargets = manager.resolveByType(tunaField);
assert possibleTargets.size() == 1;
@@ -87,9 +87,9 @@
public void testOneBindingType() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"), fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -104,9 +104,9 @@
{
AnnotatedField<Animal> whiteChunkyFishField = new AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"), fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
@@ -120,8 +120,8 @@
public void testMultipleApiTypeWithCurrent() throws Exception
{
AnnotatedField<Animal> animalField = new AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("animal"), fishFarmClass);
- Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class, manager);
- Bean<Haddock> haddockBean = createSimpleBean(Haddock.class, manager);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
manager.addBean(seaBassBean);
manager.addBean(haddockBean);
Set<Bean<Animal>> possibleTargets = manager.resolveByType(animalField);
@@ -133,10 +133,10 @@
@Test(groups="resolution") @SpecAssertion(section={"4.9.2", "4.9.4"})
public void testResolveByType() throws Exception
{
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class, manager);
- Bean<Haddock> haddockBean = createSimpleBean(Haddock.class, manager);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
manager.addBean(tunaBean);
manager.addBean(salmonBean);
@@ -158,9 +158,9 @@
@Test(groups="injection") @SpecAssertion(section="2.3.5")
public void testAllBindingTypesSpecifiedForResolutionMustAppearOnWebBean()
{
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
@@ -193,8 +193,8 @@
{
AnnotatedField<Farmer<ScottishFish>> scottishFishFarmerField = new AnnotatedFieldImpl<Farmer<ScottishFish>>(FishFarm.class.getDeclaredField("scottishFishFarmer"), fishFarmClass);
- Bean<ScottishFishFarmer> scottishFishFarmerBean = createSimpleBean(ScottishFishFarmer.class, manager);
- Bean<AnimalFarmer> farmerBean = createSimpleBean(AnimalFarmer.class, manager);
+ Bean<ScottishFishFarmer> scottishFishFarmerBean = createSimpleBean(ScottishFishFarmer.class);
+ Bean<AnimalFarmer> farmerBean = createSimpleBean(AnimalFarmer.class);
manager.addBean(scottishFishFarmerBean);
manager.addBean(farmerBean);
@@ -206,13 +206,13 @@
@Test(groups={"resolution", "producerMethod"}) @SpecAssertion(section="4.9.2")
public void testResolveByTypeWithArray() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducerBean = createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducerBean = createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducerBean);
Method method = SpiderProducer.class.getMethod("getSpiders");
- Bean<Spider[]> spidersModel = createProducerMethodBean(Spider[].class, method, manager, spiderProducerBean);
+ Bean<Spider[]> spidersModel = createProducerMethodBean(Spider[].class, method, spiderProducerBean);
manager.addBean(spidersModel);
method = SpiderProducer.class.getMethod("getStrings");
- Bean<String[]> stringModel = createProducerMethodBean(String[].class, method, manager, spiderProducerBean);
+ Bean<String[]> stringModel = createProducerMethodBean(String[].class, method, spiderProducerBean);
manager.addBean(stringModel);
assert manager.resolveByType(Spider[].class).size() == 1;
@@ -222,9 +222,9 @@
public void testOnlyHighestEnabledPreecedenceWebBeansResolved() throws Exception
{
AnnotatedField<Animal> whiteFishField = new AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("whiteFish"), fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(plaiceBean);
@@ -240,9 +240,9 @@
public void testResolveByTypeWithNonBindingMembers() throws Exception
{
AnnotatedField<Animal> veryExpensiveWhitefishField = new AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("veryExpensiveWhitefish"), fishFarmClass);
- Bean<Halibut> halibutBean = createSimpleBean(Halibut.class, manager);
- Bean<RoundWhitefish> roundWhiteFishBean = createSimpleBean(RoundWhitefish.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Halibut> halibutBean = createSimpleBean(Halibut.class);
+ Bean<RoundWhitefish> roundWhiteFishBean = createSimpleBean(RoundWhitefish.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(halibutBean);
manager.addBean(roundWhiteFishBean);
manager.addBean(soleBean);
@@ -270,9 +270,9 @@
public void testNoWebBeansFound() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"), fishFarmClass);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(plaiceBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -283,9 +283,9 @@
@Test(groups="resolution") @SpecAssertion(section="4.9.2")
public void testResolveObject() throws Exception
{
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(plaiceBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -23,7 +23,7 @@
@Test @SpecAssertion(section="2.4")
public void testScopeTypesAreExtensible()
{
- Bean<Mullet> mullet = createSimpleBean(Mullet.class, manager);
+ Bean<Mullet> mullet = createSimpleBean(Mullet.class);
assert mullet.getScopeType().equals(AnotherScopeType.class);
}
@@ -48,14 +48,14 @@
@Test @SpecAssertion(section="2.4.3")
public void testScopeDeclaredInJava()
{
- SimpleBean<SeaBass> trout = createSimpleBean(SeaBass.class, manager);
+ SimpleBean<SeaBass> trout = createSimpleBean(SeaBass.class);
assert trout.getScopeType().equals(RequestScoped.class);
}
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.4.3")
public void testTooManyScopesSpecifiedInJava()
{
- createSimpleBean(BeanWithTooManyScopeTypes.class, manager);
+ createSimpleBean(BeanWithTooManyScopeTypes.class);
}
@Test(expectedExceptions=DefinitionException.class, groups={"stub", "webbeansxml"})
@@ -105,7 +105,7 @@
@Test @SpecAssertion(section="2.4.5")
public void testDefaultScope()
{
- SimpleBean<Order> order = createSimpleBean(Order.class, manager);
+ SimpleBean<Order> order = createSimpleBean(Order.class);
assert order.getScopeType().equals(Dependent.class);
}
@@ -155,7 +155,7 @@
@Test @SpecAssertion(section="2.7.2")
public void testWebBeanScopeTypeOverridesStereotype()
{
- Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class, manager);
+ Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class);
assert bean.getScopeType().equals(RequestScoped.class);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -21,8 +21,8 @@
@Test(groups="beanConstruction") @SpecAssertion(section="3.1.3")
public void testInjectionOfParametersIntoBeanConstructor()
{
- Bean<FishPond> goldfishPondBean = createSimpleBean(FishPond.class, manager);
- Bean<Goldfish> goldfishBean = createSimpleBean(Goldfish.class, manager);
+ Bean<FishPond> goldfishPondBean = createSimpleBean(FishPond.class);
+ Bean<Goldfish> goldfishBean = createSimpleBean(Goldfish.class);
manager.addBean(goldfishBean);
manager.addBean(goldfishPondBean);
FishPond fishPond = goldfishPondBean.create();
@@ -39,7 +39,7 @@
@Test(groups="beanLifecycle") @SpecAssertion(section="5.3")
public void testCreateReturnsInstanceOfBean()
{
- Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class, manager);
+ Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class);
assert bean.create() instanceof RedSnapper;
}
@@ -76,8 +76,8 @@
@Test(groups={"beanLifecycle", "lifecycleCallbacks"}) @SpecAssertion(section="5.3")
public void testPostConstructPreDestroy() throws Exception
{
- Bean<FarmOffice> farmOfficeBean = createSimpleBean(FarmOffice.class, manager);
- Bean<Farm> farmBean = createSimpleBean(Farm.class, manager);
+ Bean<FarmOffice> farmOfficeBean = createSimpleBean(FarmOffice.class);
+ Bean<Farm> farmBean = createSimpleBean(Farm.class);
manager.addBean(farmOfficeBean);
manager.addBean(farmBean);
Farm farm = farmBean.create();
@@ -91,8 +91,8 @@
@Test(groups="injection") @SpecAssertion(section="5.3")
public void testCreateInjectsFieldsDeclaredInJava()
{
- SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class, manager);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
TunaFarm tunaFarm = tunaFarmBean.create();
assert tunaFarm.tuna != null;
@@ -101,8 +101,8 @@
@Test(groups="injection")
public void testFieldMissingBindingAnnotationsAreNotInjected()
{
- SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class, manager);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
TunaFarm tunaFarm = tunaFarmBean.create();
assert tunaFarm.notInjectedTuna != manager.getInstance(tunaBean);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -46,26 +46,26 @@
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2")
public void testAbstractClassDeclaredInJavaIsNotAllowed()
{
- createSimpleBean(Cow.class, manager);
+ createSimpleBean(Cow.class);
}
@Test(groups="innerClass") @SpecAssertion(section="3.2")
public void testStaticInnerClassDeclaredInJavaAllowed()
{
- createSimpleBean(StaticInnerBean.class, manager);
+ createSimpleBean(StaticInnerBean.class);
}
@Test(expectedExceptions=DefinitionException.class, groups="innerClass") @SpecAssertion(section="3.2")
public void testNonStaticInnerClassDeclaredInJavaNotAllowed()
{
- createSimpleBean(InnerBean.class, manager);
+ createSimpleBean(InnerBean.class);
}
@SuppressWarnings("unchecked")
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2")
public void testParameterizedClassDeclaredInJavaIsNotAllowed()
{
- createSimpleBean(ParameterizedBean.class, manager);
+ createSimpleBean(ParameterizedBean.class);
}
@Test(expectedExceptions=DefinitionException.class, groups={"stub", "interceptors", "decorators"}) @SpecAssertion(section="3.2")
@@ -83,7 +83,7 @@
@Test @SpecAssertion(section="3.2.2")
public void testApiTypes()
{
- Bean<Tarantula> bean = createSimpleBean(Tarantula.class, manager);
+ Bean<Tarantula> bean = createSimpleBean(Tarantula.class);
assert bean.getTypes().size() == 6;
assert bean.getTypes().contains(Tarantula.class);
assert bean.getTypes().contains(Spider.class);
@@ -150,7 +150,7 @@
@Test @SpecAssertion(section="3.2.5.1")
public void testInitializerAnnotatedConstructor()
{
- AnnotatedConstructor<Sheep> constructor = createSimpleBean(Sheep.class, manager).getConstructor();
+ AnnotatedConstructor<Sheep> constructor = createSimpleBean(Sheep.class).getConstructor();
assert constructor.getDeclaringClass().getType().equals(Sheep.class);
assert constructor.getParameters().size() == 2;
@@ -170,7 +170,7 @@
@Test @SpecAssertion(section="3.2.5.1")
public void testImplicitConstructorUsed()
{
- AnnotatedConstructor<Order> constructor = createSimpleBean(Order.class, manager).getConstructor();
+ AnnotatedConstructor<Order> constructor = createSimpleBean(Order.class).getConstructor();
assert constructor.getDeclaringClass().getType().equals(Order.class);
assert constructor.getParameters().size() == 0;
}
@@ -178,7 +178,7 @@
@Test @SpecAssertion(section="3.2.5.1")
public void testEmptyConstructorUsed()
{
- AnnotatedConstructor<Donkey> constructor = createSimpleBean(Donkey.class, manager).getConstructor();
+ AnnotatedConstructor<Donkey> constructor = createSimpleBean(Donkey.class).getConstructor();
assert constructor.getDeclaringClass().getType().equals(Donkey.class);
assert constructor.getParameters().size() == 0;
}
@@ -186,7 +186,7 @@
@Test @SpecAssertion(section="3.2.5.1")
public void testInitializerAnnotatedConstructorUsedOverEmptyConstuctor()
{
- AnnotatedConstructor<Turkey> constructor = createSimpleBean(Turkey.class, manager).getConstructor();
+ AnnotatedConstructor<Turkey> constructor = createSimpleBean(Turkey.class).getConstructor();
assert constructor.getParameters().size() == 2;
Map<Class<?>, Set<? extends Annotation>> map = new HashMap<Class<?>, Set<? extends Annotation>>();
for (AnnotatedParameter<Object> parameter : constructor.getParameters())
@@ -200,7 +200,7 @@
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.2.5.1")
public void testTooManyInitializerAnnotatedConstructor()
{
- createSimpleBean(Goose.class, manager);
+ createSimpleBean(Goose.class);
}
@Test(expectedExceptions=DefinitionException.class, groups={"stub", "disposalMethod"}) @SpecAssertion(section="3.2.5.1")
@@ -224,7 +224,7 @@
@Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="3.2.5.2")
public void testEmptyConstructorDeclaredInXmlUsed()
{
- AnnotatedConstructor<Donkey> constructor = createSimpleBean(Donkey.class, manager).getConstructor();
+ AnnotatedConstructor<Donkey> constructor = createSimpleBean(Donkey.class).getConstructor();
assert constructor.getParameters().size() == 0;
assert false;
}
@@ -244,7 +244,7 @@
@Test @SpecAssertion(section="3.2.5.3")
public void testBindingTypeAnnotatedConstructor()
{
- AnnotatedConstructor<Duck> constructor = createSimpleBean(Duck.class, manager).getConstructor();
+ AnnotatedConstructor<Duck> constructor = createSimpleBean(Duck.class).getConstructor();
assert constructor.getDeclaringClass().getType().equals(Duck.class);
assert constructor.getParameters().size() == 2;
Map<Class<?>, Set<? extends Annotation>> map = new HashMap<Class<?>, Set<? extends Annotation>>();
@@ -263,7 +263,7 @@
@Test(groups="specializationInherit") @SpecAssertion(section="3.2.6")
public void testSpecializedClassInheritsBindingTypes()
{
- SimpleBean<Tractor> bean = createSimpleBean(Tractor.class, manager);
+ SimpleBean<Tractor> bean = createSimpleBean(Tractor.class);
assert bean.getBindingTypes().size()==2;
assert bean.getBindingTypes().contains( new AnnotationLiteral<Motorized>() {} );
assert bean.getBindingTypes().contains( new AnnotationLiteral<HeavyDuty>() {} );
@@ -272,7 +272,7 @@
@Test(groups="specializationInherit") @SpecAssertion(section="3.2.6")
public void testSpecializedClassInheritsName()
{
- SimpleBean<Tractor> bean = createSimpleBean(Tractor.class, manager);
+ SimpleBean<Tractor> bean = createSimpleBean(Tractor.class);
assert bean.getName()!=null;
assert bean.getName().equals("plough");
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -144,7 +144,7 @@
@Test @SpecAssertion(section={"2.7.2", "2.7.4"})
public void testMultipleStereotypes()
{
- SimpleBean<HighlandCow> highlandCow = createSimpleBean(HighlandCow.class, manager);
+ SimpleBean<HighlandCow> highlandCow = createSimpleBean(HighlandCow.class);
assert highlandCow.getName() == null;
assert highlandCow.getBindingTypes().iterator().next().annotationType().equals(Tame.class);
assert highlandCow.getScopeType().equals(RequestScoped.class);
@@ -189,25 +189,25 @@
@Test@SpecAssertion(section="2.7.4")
public void testRequiredTypeIsImplemented()
{
- createSimpleBean(HighlandCow.class, manager);
+ createSimpleBean(HighlandCow.class);
}
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.4")
public void testRequiredTypeIsNotImplemented()
{
- createSimpleBean(Chair.class, manager);
+ createSimpleBean(Chair.class);
}
@Test @SpecAssertion(section="2.7.4")
public void testScopeIsSupported()
{
- createSimpleBean(Goldfish.class, manager);
+ createSimpleBean(Goldfish.class);
}
@Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.4")
public void testScopeIsNotSupported()
{
- createSimpleBean(Carp.class, manager);
+ createSimpleBean(Carp.class);
}
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -12,7 +12,7 @@
@Test @SpecAssertion(section="2.6.3")
public void testDefaultNamed()
{
- SimpleBean<Haddock> haddock = createSimpleBean(Haddock.class, manager);
+ SimpleBean<Haddock> haddock = createSimpleBean(Haddock.class);
assert haddock.getName() != null;
assert haddock.getName().equals("haddock");
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanDeclarationTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanDeclarationTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanDeclarationTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -32,84 +32,84 @@
@SpecAssertion(section = "3.3")
public void testStatelessWithDependentScopeOK()
{
- EnterpriseBean<Giraffe> giraffe = BeanFactory.createEnterpriseBean(Giraffe.class, manager);
+ EnterpriseBean<Giraffe> giraffe = BeanFactory.createEnterpriseBean(Giraffe.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testStatelessWithRequestScopeFails()
{
- EnterpriseBean<Beagle> beagle = BeanFactory.createEnterpriseBean(Beagle.class, manager);
+ EnterpriseBean<Beagle> beagle = BeanFactory.createEnterpriseBean(Beagle.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testStatelessWithConversationScopeFails()
{
- EnterpriseBean<Boxer> boxer = BeanFactory.createEnterpriseBean(Boxer.class, manager);
+ EnterpriseBean<Boxer> boxer = BeanFactory.createEnterpriseBean(Boxer.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testStatelessWithSessionScopeFails()
{
- EnterpriseBean<Bullmastiff> boxer = BeanFactory.createEnterpriseBean(Bullmastiff.class, manager);
+ EnterpriseBean<Bullmastiff> boxer = BeanFactory.createEnterpriseBean(Bullmastiff.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testStatelessWithApplicationScopeFails()
{
- EnterpriseBean<Dachshund> dachshund = BeanFactory.createEnterpriseBean(Dachshund.class, manager);
+ EnterpriseBean<Dachshund> dachshund = BeanFactory.createEnterpriseBean(Dachshund.class);
}
@Test
@SpecAssertion(section = "3.3")
public void testSingletonWithDependentScopeOK()
{
- EnterpriseBean<GreatDane> greatDane = BeanFactory.createEnterpriseBean(GreatDane.class, manager);
+ EnterpriseBean<GreatDane> greatDane = BeanFactory.createEnterpriseBean(GreatDane.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testSingletonWithRequestScopeFails()
{
- EnterpriseBean<Greyhound> greyhound = BeanFactory.createEnterpriseBean(Greyhound.class, manager);
+ EnterpriseBean<Greyhound> greyhound = BeanFactory.createEnterpriseBean(Greyhound.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testSingletonWithConversationScopeFails()
{
- EnterpriseBean<Husky> husky = BeanFactory.createEnterpriseBean(Husky.class, manager);
+ EnterpriseBean<Husky> husky = BeanFactory.createEnterpriseBean(Husky.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testSingletonWithSessionScopeFails()
{
- EnterpriseBean<IrishTerrier> irishTerrier = BeanFactory.createEnterpriseBean(IrishTerrier.class, manager);
+ EnterpriseBean<IrishTerrier> irishTerrier = BeanFactory.createEnterpriseBean(IrishTerrier.class);
}
@Test
@SpecAssertion(section = "3.3")
public void testSingletonWithApplicationScopeOK()
{
- EnterpriseBean<Laika> laika = BeanFactory.createEnterpriseBean(Laika.class, manager);
+ EnterpriseBean<Laika> laika = BeanFactory.createEnterpriseBean(Laika.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testEnterpriseBeanInterceptorFails()
{
- EnterpriseBean<Pug> pug = BeanFactory.createEnterpriseBean(Pug.class, manager);
+ EnterpriseBean<Pug> pug = BeanFactory.createEnterpriseBean(Pug.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testEnterpriseBeanDecoratorFails()
{
- EnterpriseBean<Pekingese> pekingese = BeanFactory.createEnterpriseBean(Pekingese.class, manager);
+ EnterpriseBean<Pekingese> pekingese = BeanFactory.createEnterpriseBean(Pekingese.class);
}
@Test(expectedExceptions = DefinitionException.class, groups = {"enterpriseBeans", "stub"})
@@ -172,7 +172,7 @@
@SpecAssertion(section = "3.3.2")
public void testObjectIsInAPITypes()
{
- EnterpriseBean<Laika> laika = BeanFactory.createEnterpriseBean(Laika.class, manager);
+ EnterpriseBean<Laika> laika = BeanFactory.createEnterpriseBean(Laika.class);
assert laika.getTypes().contains(Object.class);
}
@@ -201,7 +201,7 @@
@SpecAssertion(section = "3.3")
public void testMessageDrivenBeansNotOK()
{
- EnterpriseBean<Leopard> Leopard = BeanFactory.createEnterpriseBean(Leopard.class, manager);
+ EnterpriseBean<Leopard> Leopard = BeanFactory.createEnterpriseBean(Leopard.class);
}
@@ -209,7 +209,7 @@
@SpecAssertion(section = "3.3.7")
public void testDefaultName()
{
- EnterpriseBean<Pitbull> pitbull = BeanFactory.createEnterpriseBean(Pitbull.class, manager);
+ EnterpriseBean<Pitbull> pitbull = BeanFactory.createEnterpriseBean(Pitbull.class);
assert pitbull.getName().equals("pitbull");
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -35,7 +35,7 @@
@SpecAssertion(section = "3.3.5")
public void testStatelessEnterpriseBeansWithRemoveMethodsFails()
{
- EnterpriseBean<Armant> bean = BeanFactory.createEnterpriseBean(Armant.class, manager);
+ EnterpriseBean<Armant> bean = BeanFactory.createEnterpriseBean(Armant.class);
}
@Test(groups={"enterpriseBeans", "removeMethod", "lifecycle", "stub"})
@@ -43,7 +43,7 @@
public void testStatefulEnterpriseBeanRemoveMethodCalledWhenDestroyedByManager()
{
EnterpriseBeanRemoveMethodTest.tickle = false;
- EnterpriseBean<Toller> bena = BeanFactory.createEnterpriseBean(Toller.class, manager);
+ EnterpriseBean<Toller> bena = BeanFactory.createEnterpriseBean(Toller.class);
RequestContext context = (RequestContext) manager.getContext(RequestScoped.class);
Toller instance = context.get(bena, true);
context.destroy(manager);
@@ -54,21 +54,21 @@
@SpecAssertion(section = "3.3.5")
public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeDependentScoped()
{
- EnterpriseBean<Pumi> bean = BeanFactory.createEnterpriseBean(Pumi.class, manager);
+ EnterpriseBean<Pumi> bean = BeanFactory.createEnterpriseBean(Pumi.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"})
@SpecAssertion(section = "3.3.5")
public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeDependentScoped2()
{
- EnterpriseBean<WelshCorgie> bean = BeanFactory.createEnterpriseBean(WelshCorgie.class, manager);
+ EnterpriseBean<WelshCorgie> bean = BeanFactory.createEnterpriseBean(WelshCorgie.class);
}
@Test(groups={"enterpriseBeans", "removeMethod", "stub"}, expectedExceptions = UnremovedException.class)
@SpecAssertion(section = "3.3.5")
public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeRemovedByApplicationBeforeManager()
{
- EnterpriseBean<Toller> bean = BeanFactory.createEnterpriseBean(Toller.class, manager);
+ EnterpriseBean<Toller> bean = BeanFactory.createEnterpriseBean(Toller.class);
Toller instance = manager.getInstance(bean);
RequestContext context = (RequestContext) manager
.getContext(RequestScoped.class);
@@ -79,7 +79,7 @@
@SpecAssertion(section = "3.3.5")
public void testApplicationRemoveMethodCallRemovesInstanceFromContext()
{
- EnterpriseBean<Toller> bean = BeanFactory.createEnterpriseBean(Toller.class, manager);
+ EnterpriseBean<Toller> bean = BeanFactory.createEnterpriseBean(Toller.class);
RequestContext context = (RequestContext) manager.getContext(RequestScoped.class);
Toller instance = context.get(bean, true);
instance.bye();
@@ -91,7 +91,7 @@
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testEnterpriseBeanWithoutDestructorUsesNoArgsRemoveAnnotatedMethodAsRemoveMethod()
{
- EnterpriseBean<Toller> bean = BeanFactory.createEnterpriseBean(Toller.class, manager);
+ EnterpriseBean<Toller> bean = BeanFactory.createEnterpriseBean(Toller.class);
assert "bye".equals(bean.getRemoveMethod().getName());
}
@@ -99,7 +99,7 @@
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testEnterpriseBeanWithoutDestructorAndNoArgsRemoveAnnotatedMethodHasNoRemoveMethod()
{
- EnterpriseBean<Koirus> bean = BeanFactory.createEnterpriseBean(Koirus.class, manager);
+ EnterpriseBean<Koirus> bean = BeanFactory.createEnterpriseBean(Koirus.class);
assert bean.getRemoveMethod() == null;
}
@@ -107,49 +107,49 @@
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testMultipleDestructorAnnotatedMethodsFails()
{
- EnterpriseBean<Rottweiler> bean = BeanFactory.createEnterpriseBean(Rottweiler.class, manager);
+ EnterpriseBean<Rottweiler> bean = BeanFactory.createEnterpriseBean(Rottweiler.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"}, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testDestructorAnnotatedMethodNotRemoveAnnotatedFails()
{
- EnterpriseBean<RussellTerrier> bean = BeanFactory.createEnterpriseBean(RussellTerrier.class, manager);
+ EnterpriseBean<RussellTerrier> bean = BeanFactory.createEnterpriseBean(RussellTerrier.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"}, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testRemoveMethodIsInitializerFails()
{
- EnterpriseBean<Saluki> bean = BeanFactory.createEnterpriseBean(Saluki.class, manager);
+ EnterpriseBean<Saluki> bean = BeanFactory.createEnterpriseBean(Saluki.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"}, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testRemoveMethodIsProducerFails()
{
- EnterpriseBean<Spitz> bean = BeanFactory.createEnterpriseBean(Spitz.class, manager);
+ EnterpriseBean<Spitz> bean = BeanFactory.createEnterpriseBean(Spitz.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"}, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testRemoveMethodWithDisposesParameterFails()
{
- EnterpriseBean<GoldenRetriever> bean = BeanFactory.createEnterpriseBean(GoldenRetriever.class, manager);
+ EnterpriseBean<GoldenRetriever> bean = BeanFactory.createEnterpriseBean(GoldenRetriever.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"}, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testRemoveMethodWithObservesParameterFails()
{
- EnterpriseBean<JackRussellTerrier> bean = BeanFactory.createEnterpriseBean(JackRussellTerrier.class, manager);
+ EnterpriseBean<JackRussellTerrier> bean = BeanFactory.createEnterpriseBean(JackRussellTerrier.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"}, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testMultipleRemoveAnnotationsButNoDestructorFails()
{
- EnterpriseBean<Poodle> bean = BeanFactory.createEnterpriseBean(Poodle.class, manager);
+ EnterpriseBean<Poodle> bean = BeanFactory.createEnterpriseBean(Poodle.class);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanSpecializationTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanSpecializationTest.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanSpecializationTest.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -21,8 +21,8 @@
@SpecAssertion(section = "3.3.6")
public void testSpecializingBeanInheritsBindingTypes()
{
- EnterpriseBean<Hound> hound = BeanFactory.createEnterpriseBean(Hound.class, manager);
- EnterpriseBean<HoundOfBaskerville> houndOfBaskerville = BeanFactory.createEnterpriseBean(HoundOfBaskerville.class, manager);
+ EnterpriseBean<Hound> hound = BeanFactory.createEnterpriseBean(Hound.class);
+ EnterpriseBean<HoundOfBaskerville> houndOfBaskerville = BeanFactory.createEnterpriseBean(HoundOfBaskerville.class);
assert compareBindingTypesOK(hound, houndOfBaskerville);
}
@@ -45,7 +45,7 @@
@SpecAssertion(section = "3.3.6")
public void testSpecializingBeanInheritsNameIfAny()
{
- EnterpriseBean<HoundOfBaskerville> houndOfBaskerville = BeanFactory.createEnterpriseBean(HoundOfBaskerville.class, manager);
+ EnterpriseBean<HoundOfBaskerville> houndOfBaskerville = BeanFactory.createEnterpriseBean(HoundOfBaskerville.class);
assert houndOfBaskerville.getName().equals("Pongo");
}
@@ -82,7 +82,7 @@
@SpecAssertion(section = "3.3.6")
public void testAnnotationDefinedSpecializingEnterpriseBeanNotDirectlyExtendingAnnotationDefinedEnterpriseBeanFails()
{
- EnterpriseBean<GreaterDane> greaterDane = BeanFactory.createEnterpriseBean(GreaterDane.class, manager);
+ EnterpriseBean<GreaterDane> greaterDane = BeanFactory.createEnterpriseBean(GreaterDane.class);
}
@Test(expectedExceptions=DefinitionException.class, groups={"stub", "specialization", "enterpriseBeans"})
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -1,14 +1,13 @@
package org.jboss.webbeans.test.mock;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bootstrap.Bootstrap;
public class MockBootstrap extends Bootstrap
{
- public MockBootstrap(ManagerImpl manager)
+ public MockBootstrap()
{
- super(manager);
+ super();
}
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java 2008-12-05 11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java 2008-12-05 11:44:38 UTC (rev 411)
@@ -18,7 +18,7 @@
public MockObserverImpl(ManagerImpl manager, EventBean<T> beanModel, AnnotatedMethod<Object> observer, Class<T> eventType)
{
- super(manager, beanModel, observer, eventType);
+ super(beanModel, observer, eventType);
}
@Override
16 years
[webbeans-commits] Webbeans SVN: r410 - in ri/trunk/webbeans-ri: src/test/java/org/jboss/webbeans/test and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-05 06:10:40 -0500 (Fri, 05 Dec 2008)
New Revision: 410
Modified:
ri/trunk/webbeans-ri/pom.xml
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java
Log:
Remove embedded ejb3 for now - too many problems
Modified: ri/trunk/webbeans-ri/pom.xml
===================================================================
--- ri/trunk/webbeans-ri/pom.xml 2008-12-05 10:29:20 UTC (rev 409)
+++ ri/trunk/webbeans-ri/pom.xml 2008-12-05 11:10:40 UTC (rev 410)
@@ -25,11 +25,11 @@
<classifier>jdk15</classifier>
</dependency>
- <dependency>
+ <!-- <dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-embedded</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>-->
<dependency>
<groupId>javax.servlet</groupId>
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java 2008-12-05 10:29:20 UTC (rev 409)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java 2008-12-05 11:10:40 UTC (rev 410)
@@ -1,17 +1,10 @@
package org.jboss.webbeans.test;
-import java.net.URL;
-import java.util.Properties;
-import javax.ejb.EJBContainer;
-
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-
public abstract class AbstractEjbEmbeddableTest extends AbstractTest
{
- @AfterClass
+ /*@AfterClass
public void afterClass()
{
EJBContainer current = EJBContainer.getCurrentEJBContainer();
@@ -41,6 +34,6 @@
URL url = Thread.currentThread().getContextClassLoader().getResource(path);
String s = url.toString();
return s.substring(0, s.length() - path.length());
- }
+ }*/
}
16 years
[webbeans-commits] Webbeans SVN: r409 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: servlet and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-05 05:29:20 -0500 (Fri, 05 Dec 2008)
New Revision: 409
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansFilter.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java
Log:
Tidy up lifecycle
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05 09:50:51 UTC (rev 408)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05 10:29:20 UTC (rev 409)
@@ -453,6 +453,17 @@
}
return activeContexts.iterator().next();
}
+
+ /**
+ * Direct access to build in contexts for internal use
+ *
+ * @param scopeType
+ * @return
+ */
+ public Context getBuiltInContext(Class<? extends Annotation> scopeType)
+ {
+ return contextMap.getBuiltInContext(scopeType);
+ }
/**
* Returns an instance of a bean
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-12-05 09:50:51 UTC (rev 408)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-12-05 10:29:20 UTC (rev 409)
@@ -42,8 +42,6 @@
public class ServletLifecycle
{
private static LogProvider log = Logging.getLogProvider(ServletLifecycle.class);
- // Where to find the manager in JNDI
- private static final String MANAGER_JNDI_KEY = "java:comp/Manager";
// The servlet context
private static ServletContext servletContext;
@@ -94,7 +92,7 @@
*/
public static void beginRequest(HttpServletRequest request) {
ManagerImpl manager = ManagerImpl.instance();
- SessionContext sessionContext = (SessionContext) manager.getContext(SessionScoped.class);
+ SessionContext sessionContext = (SessionContext) manager.getBuiltInContext(SessionScoped.class);
sessionContext.setSession(request.getSession(true));
}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansFilter.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansFilter.java 2008-12-05 09:50:51 UTC (rev 408)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansFilter.java 2008-12-05 10:29:20 UTC (rev 409)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.servlet;
-
-import java.io.IOException;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * Filter for handling request-level events
- *
- * Delegates work to the ServletLifecycle
- *
- * @author Pete Muir
- * @author Nicklas Karlsson
- */
-public class WebBeansFilter implements Filter
-{
- /**
- * Called when the filter is initializes
- *
- * @param filterConfig The filter configuration
- * @throws ServletException When things go Wrong(tm)
- */
- public void init(FilterConfig filterConfig) throws ServletException
- {
- }
-
- /**
- * Executes the filter
- *
- * @param request The request
- * @param response The response
- * @param chain The filter chain
- *
- * @throws IOException When things go Wrong(tm)
- * @throws ServletException When things go Wrong(tm)
- */
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
- {
- try
- {
- ServletLifecycle.beginRequest((HttpServletRequest) request);
- chain.doFilter(request, response);
- }
- finally
- {
- ServletLifecycle.endRequest((HttpServletRequest) request);
- }
- }
-
- /**
- * Called when the filter is destroyed
- */
- public void destroy()
- {
- }
-}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java 2008-12-05 09:50:51 UTC (rev 408)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java 2008-12-05 10:29:20 UTC (rev 409)
@@ -19,6 +19,9 @@
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.ServletRequestListener;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
@@ -32,7 +35,7 @@
* @author Nicklas Karlsson
*
*/
-public class WebBeansListener implements ServletContextListener, HttpSessionListener
+public class WebBeansListener implements ServletContextListener, HttpSessionListener, ServletRequestListener
{
/**
@@ -75,4 +78,28 @@
ServletLifecycle.endApplication();
}
+ public void requestDestroyed(ServletRequestEvent sre)
+ {
+ if (sre.getServletRequest() instanceof HttpServletRequest)
+ {
+ ServletLifecycle.endRequest((HttpServletRequest) sre.getServletRequest());
+ }
+ else
+ {
+ throw new IllegalStateException("Non HTTP-Servlet lifecycle not defined");
+ }
+ }
+
+ public void requestInitialized(ServletRequestEvent sre)
+ {
+ if (sre.getServletRequest() instanceof HttpServletRequest)
+ {
+ ServletLifecycle.beginRequest((HttpServletRequest) sre.getServletRequest());
+ }
+ else
+ {
+ throw new IllegalStateException("Non HTTP-Servlet lifecycle not defined");
+ }
+ }
+
}
16 years
[webbeans-commits] Webbeans SVN: r408 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: bean and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-05 04:50:51 -0500 (Fri, 05 Dec 2008)
New Revision: 408
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Names.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedItemImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AnnotationModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/BindingTypeModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/StereotypeModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java
Log:
Better toString
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -664,7 +664,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append(Strings.collectionToString("Enabled deployment types: ", getEnabledDeploymentTypes()));
buffer.append(eventManager.toString() + "\n");
buffer.append(metaDataCache.toString() + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -92,7 +92,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("====================\n");
buffer.append("Metadata cache\n");
buffer.append("====================\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -79,7 +79,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Resolvable annotation item\n");
buffer.append(delegate().toString() + "\n");
return buffer.toString();
@@ -308,7 +308,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Resolver\n");
buffer.append(resolvedInjectionPoints.toString() + "\n");
buffer.append(Strings.collectionToString("Injection points: ", injectionPoints));
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -642,7 +642,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractBean:\n");
buffer.append("Name: " + name + "\n");
buffer.append("Type: " + type + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -274,7 +274,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractClassBean:\n");
buffer.append(super.toString() + "\n");
buffer.append("Annotated item: " + annotatedItem.toString() + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -36,6 +36,7 @@
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.util.Names;
/**
* An enterprise bean representation
@@ -339,7 +340,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
String ejbType = "";
if (getEjbMetaData().isMessageDriven())
{
@@ -361,7 +362,16 @@
{
ejbType = "unknown";
}
- buffer.append("Annotated " + getScopeType().getSimpleName().toLowerCase() + " " + ejbType + " enterprise bean '" + getName() + "' " + "[" + getType().getName() + "]\n");
+ buffer.append("Annotated " + Names.scopeTypeToString(getScopeType()) + ejbType);
+ if (getName() == null)
+ {
+ buffer.append(" unnamed enterprise bean");
+ }
+ else
+ {
+ buffer.append(" enterprise bean '" + getName() + "'");
+ }
+ buffer.append(" [" + getType().getName() + "]\n");
buffer.append(" EJB name: " + getEjbMetaData().getEjbName() + ", default JNDI name: " + getEjbMetaData().getDefaultJndiName() + ", EJB link JNDI name: " + getEjbMetaData().getEjbLinkJndiName() + "\n");
buffer.append(" API types " + getTypes() + ", binding types " + getBindingTypes() + "\n");
return buffer.toString();
@@ -369,7 +379,7 @@
public String toDetailedString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("EnterpriseBean:\n");
buffer.append(super.toString() + "\n");
buffer.append(ejbMetaData.toString() + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -161,7 +161,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Merged stereotypes:\n");
buffer.append("Bean name defaulted: " + beanNameDefaulted + "\n");
buffer.append("Possible deployment types: " + getPossibleDeploymentTypes().toString());
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -291,7 +291,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("ProducerMethodBean:\n");
buffer.append(super.toString() + "\n");
buffer.append("Location: " + location + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -33,6 +33,7 @@
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
/**
@@ -360,15 +361,24 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
- buffer.append("Annotated " + getScopeType().getSimpleName().toLowerCase() + " " + " simple bean '" + getName() + "' " + "[" + getType().getName() + "]\n");
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("Annotated " + Names.scopeTypeToString(getScopeType()));
+ if (getName() == null)
+ {
+ buffer.append("unnamed simple bean");
+ }
+ else
+ {
+ buffer.append("simple bean '" + getName() + "'");
+ }
+ buffer.append(" [" + getType().getName() + "]\n");
buffer.append(" API types " + getTypes() + ", binding types " + getBindingTypes() + "\n");
return buffer.toString();
}
public String toDetailedString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("SimpleBean\n");
buffer.append(super.toString() + "\n");
buffer.append("Location: " + location + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -51,7 +51,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("XmlEnterpriseBean\n");
buffer.append(super.toString() + "\n");
return buffer.toString();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -51,7 +51,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("XmlLSimpleBean\n");
buffer.append(super.toString() + "\n");
return buffer.toString();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -85,7 +85,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Proxy method handler\n");
buffer.append("Bean " + (bean == null ? "null" : bean.toString()) + "\n");
buffer.append("Bean index: " + beanIndex + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -167,7 +167,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Proxy pool\n");
buffer.append(pool.toString() + "\n");
return buffer.toString();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -151,7 +151,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractContext:\n");
buffer.append("Scope type: " + getScopeType().toString() + "\n");
buffer.append("Active: " + getActive().toString() + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -220,7 +220,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
List<Contextual<?>> beans = (List) keySet();
buffer.append("Bean -> bean instance mappings in HTTP session: " + beans.size() + "\n");
int i = 0;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -260,7 +260,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("EJB metadata model\n");
buffer.append("EJB name: " + ejbName + "\n");
buffer.append("EJB type: " + ejbType + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -261,7 +261,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Event manager\n");
buffer.append(registeredObservers.toString());
return buffer.toString();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -424,7 +424,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractAnnotatedItem:\n");
buffer.append(Strings.collectionToString("Annotations: ", getAnnotations()));
buffer.append(annotationMap == null ? "" : (annotationMap.toString() + "\n"));
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -163,7 +163,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractAnnotatedMember:\n");
buffer.append(super.toString() + "\n");
buffer.append("Final: " + isFinal() + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -116,7 +116,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractAnnotatedType:\n");
buffer.append(super.toString() + "\n");
buffer.append("Superclass: " + (superclass == null ? "" : superclass.toString()) + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -184,7 +184,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedConstructorImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append("Class: " + clazz.toString() + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -497,7 +497,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedConstructorImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append(Strings.collectionToString("Actual type arguments: ", Arrays.asList(getActualTypeArguments())));
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -276,7 +276,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedConstructorImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append(Strings.collectionToString("Actual type arguments: ", Arrays.asList(getActualTypeArguments())));
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -161,7 +161,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedFieldImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append(Strings.collectionToString("Actual type arguments: ", Arrays.asList(getActualTypeArguments())));
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedItemImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedItemImpl.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedItemImpl.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -153,7 +153,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedItemImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append(Strings.collectionToString("Actual type arguments: ", Arrays.asList(getActualTypeArguments())));
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -291,7 +291,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedMethodImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append(Strings.collectionToString("Actual type arguments: ", Arrays.asList(getActualTypeArguments())));
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -158,7 +158,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedParameterImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append("Type: " + type.toString() + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AnnotationModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AnnotationModel.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AnnotationModel.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -120,7 +120,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotationModel:\n");
buffer.append("Annotated annotation: " + getAnnotatedAnnotation().toString());
buffer.append("Valid: " + isValid());
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/BindingTypeModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/BindingTypeModel.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/BindingTypeModel.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -154,7 +154,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("BindingTypeModel:\n");
buffer.append(super.toString());
buffer.append("Hash code: " + hashCode);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -79,7 +79,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("ScopeModel:\n");
buffer.append(super.toString());
buffer.append("Normal: " + isNormal());
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/StereotypeModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/StereotypeModel.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/StereotypeModel.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -243,7 +243,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("StereotypeModel:\n");
buffer.append(super.toString());
buffer.append("Bean name defaulted: " + isBeanNameDefaulted());
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Names.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Names.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Names.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -0,0 +1,29 @@
+package org.jboss.webbeans.util;
+
+import java.lang.annotation.Annotation;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Utility class to produce friendly names e.g. for debugging
+ *
+ * @author Pete Muir
+ *
+ */
+public class Names
+{
+
+ private static Pattern CAPITAL_LETTERS = Pattern.compile("\\p{Upper}{1}\\p{Lower}*");
+
+ public static String scopeTypeToString(Class<? extends Annotation> scopeType)
+ {
+ String scopeName = scopeType.getSimpleName();
+ Matcher matcher = CAPITAL_LETTERS.matcher(scopeName);
+ StringBuilder result = new StringBuilder();
+ while (matcher.find())
+ {
+ result.append(matcher.group().toLowerCase() + " ");
+ }
+ return result.toString();
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Names.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java 2008-12-05 09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java 2008-12-05 09:50:51 UTC (rev 408)
@@ -79,7 +79,7 @@
*/
public static String mapToString(String header, Map<?, ?> map)
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
if (map == null)
{
buffer.append(header + "null\n");
@@ -109,7 +109,7 @@
public static String collectionToString(String header, Collection<?> collection)
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
if (collection == null)
{
buffer.append(header + "null\n");
16 years
[webbeans-commits] Webbeans SVN: r407 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-05 04:10:12 -0500 (Fri, 05 Dec 2008)
New Revision: 407
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java
Log:
Temporarily disable embedded until fixes make it to maven repo
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java 2008-12-04 20:36:41 UTC (rev 406)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java 2008-12-05 09:10:12 UTC (rev 407)
@@ -5,13 +5,12 @@
import javax.naming.NamingException;
import org.jboss.webbeans.examples.Translator;
-import org.testng.annotations.Test;
public class EnterpriseBeanTest extends AbstractEjbEmbeddableTest
{
- @Test(expectedExceptions=UnsupportedOperationException.class)
+ //(a)Test(expectedExceptions=UnsupportedOperationException.class)
public void test() throws NamingException
{
16 years
[webbeans-commits] Webbeans SVN: r406 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-04 15:36:41 -0500 (Thu, 04 Dec 2008)
New Revision: 406
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
Log:
less flooding from bean toStrings
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-04 20:03:14 UTC (rev 405)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-04 20:36:41 UTC (rev 406)
@@ -340,6 +340,36 @@
public String toString()
{
StringBuffer buffer = new StringBuffer();
+ String ejbType = "";
+ if (getEjbMetaData().isMessageDriven())
+ {
+ ejbType = "message driven";
+ }
+ else if (getEjbMetaData().isSingleton())
+ {
+ ejbType = "singleton";
+ }
+ else if (getEjbMetaData().isStateful())
+ {
+ ejbType = "stateful";
+ }
+ else if (getEjbMetaData().isStateless())
+ {
+ ejbType = "stateless";
+ }
+ else
+ {
+ ejbType = "unknown";
+ }
+ buffer.append("Annotated " + getScopeType().getSimpleName().toLowerCase() + " " + ejbType + " enterprise bean '" + getName() + "' " + "[" + getType().getName() + "]\n");
+ buffer.append(" EJB name: " + getEjbMetaData().getEjbName() + ", default JNDI name: " + getEjbMetaData().getDefaultJndiName() + ", EJB link JNDI name: " + getEjbMetaData().getEjbLinkJndiName() + "\n");
+ buffer.append(" API types " + getTypes() + ", binding types " + getBindingTypes() + "\n");
+ return buffer.toString();
+ }
+
+ public String toDetailedString()
+ {
+ StringBuffer buffer = new StringBuffer();
buffer.append("EnterpriseBean:\n");
buffer.append(super.toString() + "\n");
buffer.append(ejbMetaData.toString() + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-04 20:03:14 UTC (rev 405)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-04 20:36:41 UTC (rev 406)
@@ -361,6 +361,14 @@
public String toString()
{
StringBuffer buffer = new StringBuffer();
+ buffer.append("Annotated " + getScopeType().getSimpleName().toLowerCase() + " " + " simple bean '" + getName() + "' " + "[" + getType().getName() + "]\n");
+ buffer.append(" API types " + getTypes() + ", binding types " + getBindingTypes() + "\n");
+ return buffer.toString();
+ }
+
+ public String toDetailedString()
+ {
+ StringBuffer buffer = new StringBuffer();
buffer.append("SimpleBean\n");
buffer.append(super.toString() + "\n");
buffer.append("Location: " + location + "\n");
16 years
[webbeans-commits] Webbeans SVN: r405 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-04 15:03:14 -0500 (Thu, 04 Dec 2008)
New Revision: 405
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java
Log:
minor
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java 2008-12-04 20:01:15 UTC (rev 404)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java 2008-12-04 20:03:14 UTC (rev 405)
@@ -31,7 +31,10 @@
EJBContainer.createEJBContainer(properties);
}
- protected abstract String getTestClassesPath();
+ protected String getTestClassesPath()
+ {
+ return "org/jboss/webbeans/test";
+ }
private static String getURLToTestClasses(String path)
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java 2008-12-04 20:01:15 UTC (rev 404)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java 2008-12-04 20:03:14 UTC (rev 405)
@@ -11,12 +11,6 @@
public class EnterpriseBeanTest extends AbstractEjbEmbeddableTest
{
- @Override
- protected String getTestClassesPath()
- {
- return "org/jboss/webbeans/";
- }
-
@Test(expectedExceptions=UnsupportedOperationException.class)
public void test() throws NamingException
{
16 years
[webbeans-commits] Webbeans SVN: r404 - in ri/trunk: webbeans-api/.settings and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-04 15:01:15 -0500 (Thu, 04 Dec 2008)
New Revision: 404
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/MessageDriven.java
Modified:
ri/trunk/pom.xml
ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs
ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs
ri/trunk/webbeans-ri/pom.xml
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EJB.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java
Log:
add embeddedable ejb3.1 container for testing
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2008-12-04 17:58:45 UTC (rev 403)
+++ ri/trunk/pom.xml 2008-12-04 20:01:15 UTC (rev 404)
@@ -33,6 +33,10 @@
<developer>
<name>David Allen</name>
</developer>
+
+ <developer>
+ <name>Nicklas Karlsson</name>
+ </developer>
</developers>
<repositories>
@@ -42,8 +46,10 @@
<url>http://repository.jboss.org/maven2</url>
</repository>
<repository>
- <id>scannotation.sf.net</id>
- <url>http://scannotation.sourceforge.net/maven2/</url>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <url>http://snapshots.jboss.org/maven2</url>
+ <snapshots />
</repository>
<repository>
<id>google-maven-repository</id>
@@ -138,6 +144,12 @@
<artifactId>google-collections</artifactId>
<version>0.8</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-embedded</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs 2008-12-04 17:58:45 UTC (rev 403)
+++ ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs 2008-12-04 20:01:15 UTC (rev 404)
@@ -1,4 +1,4 @@
-#Thu Nov 20 14:21:45 EST 2008
+#Thu Dec 04 18:33:44 GMT 2008
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.5
Modified: ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs 2008-12-04 17:58:45 UTC (rev 403)
+++ ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs 2008-12-04 20:01:15 UTC (rev 404)
@@ -1,268 +1,5 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=3
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=800
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=space
-org.eclipse.jdt.core.formatter.tabulation.size=3
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+#Thu Dec 04 18:33:54 GMT 2008
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Modified: ri/trunk/webbeans-ri/pom.xml
===================================================================
--- ri/trunk/webbeans-ri/pom.xml 2008-12-04 17:58:45 UTC (rev 403)
+++ ri/trunk/webbeans-ri/pom.xml 2008-12-04 20:01:15 UTC (rev 404)
@@ -24,6 +24,12 @@
<scope>test</scope>
<classifier>jdk15</classifier>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-embedded</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>javax.servlet</groupId>
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-04 17:58:45 UTC (rev 403)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-04 20:01:15 UTC (rev 404)
@@ -70,7 +70,7 @@
protected void init()
{
super.init();
- ejbMetaData = new EjbMetaData<T>(getType());
+ ejbMetaData = ManagerImpl.instance().getMetaDataCache().getEjbMetaData(getType());
initRemoveMethod();
initInjectionPoints();
checkEnterpriseBeanTypeAllowed();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EJB.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EJB.java 2008-12-04 17:58:45 UTC (rev 403)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EJB.java 2008-12-04 20:01:15 UTC (rev 404)
@@ -37,6 +37,7 @@
public static final Class<? extends Annotation> STATELESS_ANNOTATION;
public static final Class<? extends Annotation> STATEFUL_ANNOTATION;
public static final Class<? extends Annotation> MESSAGE_DRIVEN_ANNOTATION;
+ public static final Class<? extends Annotation> FAKE_MESSAGE_DRIVEN_ANNOTATION;
public static final Class<? extends Annotation> SINGLETON_ANNOTATION;
public static final Class<? extends Annotation> REMOVE_ANNOTATION;
@@ -48,7 +49,9 @@
STATELESS_ANNOTATION = classForName("javax.ejb.Stateless");
STATEFUL_ANNOTATION = classForName("javax.ejb.Stateful");
MESSAGE_DRIVEN_ANNOTATION = classForName("javax.ejb.MessageDriven");
- // FIXME Faking singleton
+ // Fake MDB for tests
+ FAKE_MESSAGE_DRIVEN_ANNOTATION = classForName("org.jboss.webbeans.test.annotations.MessageDriven");
+ // FIXME Faking singleton for tests
SINGLETON_ANNOTATION = classForName("org.jboss.webbeans.test.annotations.Singleton");
// SINGLETON_ANNOTATION = classForName("javax.ejb.Singleton");
REMOVE_ANNOTATION = classForName("javax.ejb.Remove");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java 2008-12-04 17:58:45 UTC (rev 403)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java 2008-12-04 20:01:15 UTC (rev 404)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.ejb;
+import static org.jboss.webbeans.ejb.EJB.FAKE_MESSAGE_DRIVEN_ANNOTATION;
import static org.jboss.webbeans.ejb.EJB.MESSAGE_DRIVEN_ANNOTATION;
import static org.jboss.webbeans.ejb.EJB.REMOVE_ANNOTATION;
import static org.jboss.webbeans.ejb.EJB.SINGLETON_ANNOTATION;
@@ -127,7 +128,7 @@
destructorMethods.add(destructorMethod);
}
}
- else if (type.isAnnotationPresent(MESSAGE_DRIVEN_ANNOTATION))
+ else if (type.isAnnotationPresent(MESSAGE_DRIVEN_ANNOTATION) || type.isAnnotationPresent(FAKE_MESSAGE_DRIVEN_ANNOTATION))
{
this.ejbType = MESSAGE_DRIVEN;
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java 2008-12-04 20:01:15 UTC (rev 404)
@@ -0,0 +1,43 @@
+package org.jboss.webbeans.test;
+
+import java.net.URL;
+import java.util.Properties;
+
+import javax.ejb.EJBContainer;
+
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+
+public abstract class AbstractEjbEmbeddableTest extends AbstractTest
+{
+
+ @AfterClass
+ public void afterClass()
+ {
+ EJBContainer current = EJBContainer.getCurrentEJBContainer();
+ if(current != null)
+ {
+ current.close();
+ }
+ }
+
+ @BeforeClass
+ public void beforeClass()
+ {
+ Properties properties = new Properties();
+ String module = getURLToTestClasses(getTestClassesPath());
+ properties.setProperty(EJBContainer.EMBEDDABLE_MODULES_PROPERTY, module);
+
+ EJBContainer.createEJBContainer(properties);
+ }
+
+ protected abstract String getTestClassesPath();
+
+ private static String getURLToTestClasses(String path)
+ {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(path);
+ String s = url.toString();
+ return s.substring(0, s.length() - path.length());
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractEjbEmbeddableTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java 2008-12-04 20:01:15 UTC (rev 404)
@@ -0,0 +1,43 @@
+package org.jboss.webbeans.test;
+
+import javax.ejb.EJBException;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.webbeans.examples.Translator;
+import org.testng.annotations.Test;
+
+
+public class EnterpriseBeanTest extends AbstractEjbEmbeddableTest
+{
+
+ @Override
+ protected String getTestClassesPath()
+ {
+ return "org/jboss/webbeans/";
+ }
+
+ @Test(expectedExceptions=UnsupportedOperationException.class)
+ public void test() throws NamingException
+ {
+
+ InitialContext ctx = new InitialContext();
+ Translator translator = (Translator) ctx.lookup("SentenceTranslator/local");
+ try
+ {
+ translator.translate("foo");
+ }
+ catch (EJBException e)
+ {
+ if (e.getCausedByException() instanceof RuntimeException)
+ {
+ throw (RuntimeException) e.getCausedByException();
+ }
+ else
+ {
+ throw new RuntimeException(e.getCausedByException());
+ }
+ }
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/MessageDriven.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/MessageDriven.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/MessageDriven.java 2008-12-04 20:01:15 UTC (rev 404)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+(a)Retention(RetentionPolicy.RUNTIME)
+(a)Target(ElementType.TYPE)
+public @interface MessageDriven
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/MessageDriven.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java 2008-12-04 17:58:45 UTC (rev 403)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java 2008-12-04 20:01:15 UTC (rev 404)
@@ -1,8 +1,9 @@
package org.jboss.webbeans.test.beans;
-import javax.ejb.MessageDriven;
import javax.webbeans.Production;
+import org.jboss.webbeans.test.annotations.MessageDriven;
+
@Production
@MessageDriven
public class Leopard
16 years