[webbeans-commits] Webbeans SVN: r153 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: log and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-10-25 16:38:12 -0400 (Sat, 25 Oct 2008)
New Revision: 153
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/JDKProvider.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Log.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Log4JProvider.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/LogImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/LogProvider.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Logging.java
Log:
Moved over logging package from Seam
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/JDKProvider.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/JDKProvider.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/JDKProvider.java 2008-10-25 20:38:12 UTC (rev 153)
@@ -0,0 +1,135 @@
+package org.jboss.webbeans.log;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+class JDKProvider implements LogProvider
+{
+ private final Logger logger;
+ private final boolean isWrapped;
+
+ JDKProvider(String category, boolean wrapped)
+ {
+ this.logger = Logger.getLogger(category);
+ this.isWrapped = wrapped;
+ }
+
+ private void log(Level level, Object object, Throwable ex)
+ {
+
+ if (logger.isLoggable(level))
+ {
+ Throwable dummyException = new Throwable();
+ StackTraceElement locations[] = dummyException.getStackTrace();
+ String className = "unknown";
+ String methodName = "unknown";
+ int depth = isWrapped ? 3 : 2;
+ if (locations != null && locations.length > depth)
+ {
+ StackTraceElement caller = locations[depth];
+ className = caller.getClassName();
+ methodName = caller.getMethodName();
+ }
+ if (ex == null)
+ {
+ logger.logp(level, className, methodName, String.valueOf(object));
+ }
+ else
+ {
+ logger.logp(level, className, methodName, String.valueOf(object), ex);
+ }
+ }
+
+ }
+
+ public void debug(Object object, Throwable t)
+ {
+ log(Level.FINE, object, t);
+ }
+
+ public void debug(Object object)
+ {
+ log(Level.FINE, object, null);
+ }
+
+ public void error(Object object, Throwable t)
+ {
+ log(Level.SEVERE, object, t);
+ }
+
+ public void error(Object object)
+ {
+ log(Level.SEVERE, object, null);
+ }
+
+ public void fatal(Object object, Throwable t)
+ {
+ log(Level.SEVERE, object, t);
+ }
+
+ public void fatal(Object object)
+ {
+ log(Level.SEVERE, object, null);
+ }
+
+ public void info(Object object, Throwable t)
+ {
+ log(Level.INFO, object, t);
+ }
+
+ public void info(Object object)
+ {
+ log(Level.INFO, object, null);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return logger.isLoggable(Level.FINE);
+ }
+
+ public boolean isErrorEnabled()
+ {
+ return logger.isLoggable(Level.SEVERE);
+ }
+
+ public boolean isFatalEnabled()
+ {
+ return logger.isLoggable(Level.SEVERE);
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return logger.isLoggable(Level.INFO);
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return logger.isLoggable(Level.FINER);
+ }
+
+ public boolean isWarnEnabled()
+ {
+ return logger.isLoggable(Level.WARNING);
+ }
+
+ public void trace(Object object, Throwable t)
+ {
+ log(Level.FINER, object, t);
+ }
+
+ public void trace(Object object)
+ {
+ log(Level.FINER, object, null);
+ }
+
+ public void warn(Object object, Throwable t)
+ {
+ log(Level.WARNING, object, t);
+ }
+
+ public void warn(Object object)
+ {
+ log(Level.WARNING, object, null);
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Log.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Log.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Log.java 2008-10-25 20:38:12 UTC (rev 153)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.log;
+
+public interface Log
+{
+ public boolean isDebugEnabled();
+ public boolean isErrorEnabled();
+ public boolean isFatalEnabled();
+ public boolean isInfoEnabled();
+ public boolean isTraceEnabled();
+ public boolean isWarnEnabled();
+ public void trace(Object object, Object... params);
+ public void trace(Object object, Throwable t, Object... params);
+ public void debug(Object object, Object... params);
+ public void debug(Object object, Throwable t, Object... params);
+ public void info(Object object, Object... params);
+ public void info(Object object, Throwable t, Object... params);
+ public void warn(Object object, Object... params);
+ public void warn(Object object, Throwable t, Object... params);
+ public void error(Object object, Object... params);
+ public void error(Object object, Throwable t, Object... params);
+ public void fatal(Object object, Object... params);
+ public void fatal(Object object, Throwable t, Object... params);
+
+}
\ No newline at end of file
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Log4JProvider.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Log4JProvider.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Log4JProvider.java 2008-10-25 20:38:12 UTC (rev 153)
@@ -0,0 +1,130 @@
+package org.jboss.webbeans.log;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+final class Log4JProvider implements LogProvider
+{
+ private final Logger logger;
+ private final boolean isWrapped;
+
+ private static final String LOG_IMPL_FQCN = LogImpl.class.getName();
+ private static final String LOG_PROVIDER_FQCN = Log4JProvider.class.getName();
+
+ private static final Level TRACE;
+ static
+ {
+ Object trace;
+ try
+ {
+ trace = Level.class.getDeclaredField("TRACE").get(null);
+ }
+ catch (Exception e)
+ {
+ trace = Level.DEBUG;
+ }
+ TRACE = (Level) trace;
+ }
+
+ Log4JProvider(String category, boolean wrapped)
+ {
+ logger = Logger.getLogger(category);
+ isWrapped = wrapped;
+ }
+
+ private String getFQCN()
+ {
+ return isWrapped ? LOG_IMPL_FQCN : LOG_PROVIDER_FQCN;
+ }
+
+ public void debug(Object object)
+ {
+ logger.log(getFQCN(), Level.DEBUG, object, null);
+ }
+
+ public void debug(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), Level.DEBUG, object, t);
+ }
+
+ public void error(Object object)
+ {
+ logger.log(getFQCN(), Level.ERROR, object, null);
+ }
+
+ public void error(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), Level.ERROR, object, t);
+ }
+
+ public void fatal(Object object)
+ {
+ logger.log(getFQCN(), Level.FATAL, object, null);
+ }
+
+ public void fatal(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), Level.FATAL, object, t);
+ }
+
+ public void info(Object object)
+ {
+ logger.log(getFQCN(), Level.INFO, object, null);
+ }
+
+ public void info(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), Level.INFO, object, t);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return logger.isEnabledFor(Level.DEBUG);
+ }
+
+ public boolean isErrorEnabled()
+ {
+ return logger.isEnabledFor(Level.ERROR);
+ }
+
+ public boolean isFatalEnabled()
+ {
+ return logger.isEnabledFor(Level.FATAL);
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return logger.isEnabledFor(Level.INFO);
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return logger.isEnabledFor(TRACE);
+ }
+
+ public boolean isWarnEnabled()
+ {
+ return logger.isEnabledFor(Level.WARN);
+ }
+
+ public void trace(Object object)
+ {
+ logger.log(getFQCN(), TRACE, object, null);
+ }
+
+ public void trace(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), TRACE, object, t);
+ }
+
+ public void warn(Object object)
+ {
+ logger.log(getFQCN(), Level.WARN, object, null);
+ }
+
+ public void warn(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), Level.WARN, object, t);
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/LogImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/LogImpl.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/LogImpl.java 2008-10-25 20:38:12 UTC (rev 153)
@@ -0,0 +1,175 @@
+package org.jboss.webbeans.log;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+class LogImpl implements Log, Externalizable
+{
+ private transient LogProvider log;
+ private String category;
+
+ public LogImpl()
+ {
+ }
+
+ LogImpl(String category)
+ {
+ this.category = category;
+ this.log = Logging.getLogProvider(category, true);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return log.isDebugEnabled();
+ }
+
+ public boolean isErrorEnabled()
+ {
+ return log.isErrorEnabled();
+ }
+
+ public boolean isFatalEnabled()
+ {
+ return log.isFatalEnabled();
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return log.isInfoEnabled();
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return log.isTraceEnabled();
+ }
+
+ public boolean isWarnEnabled()
+ {
+ return log.isWarnEnabled();
+ }
+
+ public void trace(Object object, Object... params)
+ {
+ if (isTraceEnabled())
+ {
+ log.trace(interpolate(object, params));
+ }
+ }
+
+ public void trace(Object object, Throwable t, Object... params)
+ {
+ if (isTraceEnabled())
+ {
+ log.trace(interpolate(object, params), t);
+ }
+ }
+
+ public void debug(Object object, Object... params)
+ {
+ if (isDebugEnabled())
+ {
+ log.debug(interpolate(object, params));
+ }
+ }
+
+ public void debug(Object object, Throwable t, Object... params)
+ {
+ if (isDebugEnabled())
+ {
+ log.debug(interpolate(object, params), t);
+ }
+ }
+
+ public void info(Object object, Object... params)
+ {
+ if (isInfoEnabled())
+ {
+ log.info(interpolate(object, params));
+ }
+ }
+
+ public void info(Object object, Throwable t, Object... params)
+ {
+ if (isInfoEnabled())
+ {
+ log.info(interpolate(object, params), t);
+ }
+ }
+
+ public void warn(Object object, Object... params)
+ {
+ if (isWarnEnabled())
+ {
+ log.warn(interpolate(object, params));
+ }
+ }
+
+ public void warn(Object object, Throwable t, Object... params)
+ {
+ if (isWarnEnabled())
+ {
+ log.warn(interpolate(object, params), t);
+ }
+ }
+
+ public void error(Object object, Object... params)
+ {
+ if (isErrorEnabled())
+ {
+ log.error(interpolate(object, params));
+ }
+ }
+
+ public void error(Object object, Throwable t, Object... params)
+ {
+ if (isErrorEnabled())
+ {
+ log.error(interpolate(object, params), t);
+ }
+ }
+
+ public void fatal(Object object, Object... params)
+ {
+ if (isFatalEnabled())
+ {
+ log.fatal(interpolate(object, params));
+ }
+ }
+
+ public void fatal(Object object, Throwable t, Object... params)
+ {
+ if (isFatalEnabled())
+ {
+ log.fatal(interpolate(object, params), t);
+ }
+ }
+
+ private Object interpolate(Object object, Object... params)
+ {
+ if (object instanceof String)
+ {
+ return object;
+ // TODO: interpolation
+ // return Interpolator.instance().interpolate( (String) object, params
+ // );
+ }
+ else
+ {
+ return object;
+ }
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ category = (String) in.readObject();
+ log = Logging.getLogProvider(category, true);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ out.writeObject(category);
+ }
+
+}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/LogProvider.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/LogProvider.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/LogProvider.java 2008-10-25 20:38:12 UTC (rev 153)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.log;
+
+public interface LogProvider
+{
+ public void trace(Object object);
+ public void trace(Object object, Throwable t);
+ public void debug(Object object);
+ public void debug(Object object, Throwable t);
+ public void info(Object object);
+ public void info(Object object, Throwable t);
+ public void warn(Object object);
+ public void warn(Object object, Throwable t);
+ public void error(Object object);
+ public void error(Object object, Throwable t);
+ public void fatal(Object object);
+ public void fatal(Object object, Throwable t);
+ public boolean isTraceEnabled();
+ public boolean isDebugEnabled();
+ public boolean isInfoEnabled();
+ public boolean isWarnEnabled();
+ public boolean isErrorEnabled();
+ public boolean isFatalEnabled();
+}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Logging.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Logging.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/log/Logging.java 2008-10-25 20:38:12 UTC (rev 153)
@@ -0,0 +1,42 @@
+package org.jboss.webbeans.log;
+
+public class Logging
+{
+ private static final boolean isLog4JAvailable;
+
+ static
+ {
+ boolean available;
+ try
+ {
+ Class.forName("org.apache.log4j.Logger");
+ available = true;
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ available = false;
+ }
+ isLog4JAvailable = available;
+ }
+
+ public static Log getLog(String category)
+ {
+ return new LogImpl(category);
+ }
+
+ public static Log getLog(Class clazz)
+ {
+ return new LogImpl(clazz.getName());
+ }
+
+ static LogProvider getLogProvider(String category, boolean wrapped)
+ {
+ return isLog4JAvailable ? new Log4JProvider(category, wrapped) : new JDKProvider(category, wrapped);
+ }
+
+ public static LogProvider getLogProvider(Class clazz)
+ {
+ return getLogProvider(clazz.getName(), false);
+ }
+
+}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r152 - in ri/trunk/webbeans-ri: src/test/java/org/jboss/webbeans/test and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-25 15:29:44 -0400 (Sat, 25 Oct 2008)
New Revision: 152
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BeanDeploymentTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBeanModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionBeanLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionBeanModelTest.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/RemoteBeanLifecycleTest.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/beans/
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Animal.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Antelope.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Baboon.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BeanWithTooManyScopeTypes.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Bear.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BlackWidow.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Carp.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cat.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Chair.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cheetah.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Chicken.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cod.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cougar.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cow.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DaddyLongLegs.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DangerCall.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DeadlyAnimal.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DeadlySpider.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DefangedTarantula.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Donkey.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Duck.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Elephant.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Farmer.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FishFarm.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Giraffe.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goat.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goldfish.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goose.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Gorilla.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Haddock.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Horse.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/LadybirdSpider.java
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/Lion.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Moose.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Orangutan.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Order.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Panther.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Plaice.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Puma.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Salmon.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ScottishFish.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ScottishFishFarmer.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SeaBass.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Sheep.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Sole.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Spider.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SpiderProducer.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/TameOrangutan.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tarantula.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tiger.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/TrapdoorSpider.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tuna.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Turkey.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithFinalProducerMethod.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithStaticProducerMethod.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithTooManyDeploymentTypes.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Carp.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Chimpanzee.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gibbon.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OuterBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Pig.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/PlaiceFarm.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ComponentDeploymentTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Carp.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Chimpanzee.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/ComponentWithFinalProducerMethod.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/ComponentWithStaticProducerMethod.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/ComponentWithTooManyDeploymentTypes.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gibbon.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OuterComponent.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Pig.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Animal.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Antelope.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Baboon.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Bear.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/BlackWidow.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Carp.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cat.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Chair.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cheetah.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Chicken.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cod.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ComponentWithTooManyScopeTypes.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cougar.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cow.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DaddyLongLegs.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DangerCall.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DeadlyAnimal.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DeadlySpider.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DefangedTarantula.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Donkey.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Duck.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Elephant.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Farmer.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Giraffe.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goat.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goldfish.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goose.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Gorilla.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Haddock.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Horse.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/LadybirdSpider.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Leopard.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Lion.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Moose.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Orangutan.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Order.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Panther.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Puma.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Salmon.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFish.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFishFarmer.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/SeaBass.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sheep.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sole.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Spider.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/SpiderProducer.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/TameOrangutan.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tarantula.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tiger.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/TrapdoorSpider.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tuna.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Turkey.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/
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/ClassAnnotatedItemTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.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/EjbMetaDataTest.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/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/NameBasedResolutionTest.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/ScopeTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnimalOrderStereotype.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnimalStereotype.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/FishStereotype.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/HornedMammalStereotype.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/MammalStereotype.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/RequestScopedAnimalStereotype.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/RiverFishStereotype.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java
ri/trunk/webbeans-ri/testng.xml
Log:
Replace all instances of component with bean
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BeanDeploymentTest.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ComponentDeploymentTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BeanDeploymentTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BeanDeploymentTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,108 @@
+package org.jboss.webbeans.test;
+
+import org.testng.annotations.Test;
+
+@SpecVersion("20080605")
+public class BeanDeploymentTest
+{
+
+
+ @Test(groups="specialization") @SpecAssertion(section="3.1.4")
+ public void testOnlySpecializedSimpleBeanDeployed()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.1.4")
+ public void testSpecializedSimpleBeanExtends()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.1.4")
+ public void testSpecializedSimpleBeanHasSameBindingAnnotations()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.1.4")
+ public void testSpecializedSimpleBeanHasSameName()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.2.4")
+ public void testOnlySpecializedEnterpriseBeanDeployed()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.2.4")
+ public void testSpecializedEnterpriseBeanExtends()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.2.4")
+ public void testSpecializedEnterpriseBeanHasSameBindingAnnotations()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.2.4")
+ public void testSpecializedEnterpriseBeanHasSameName()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.2.4")
+ public void testSpecializedEnterpriseBeanAllLocalInterfaces()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.2.4")
+ public void testSpecializedEnterpriseBeanSupportsBeanClassLocalView()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.3.3")
+ public void testOnlySpecializedProducerMethodBeanDeployed()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.3.3")
+ public void testSpecializedProducerMethodBeanDirectlyOverrides()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.3.3")
+ public void testSpecializedProducerMethodBeanHasSameBindingAnnotations()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.3.3")
+ public void testSpecializedProducerMethodBeanHasSameName()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BeanDeploymentTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -14,10 +14,10 @@
import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.Asynchronous;
import org.jboss.webbeans.test.annotations.Synchronous;
+import org.jboss.webbeans.test.beans.Antelope;
+import org.jboss.webbeans.test.beans.Cat;
+import org.jboss.webbeans.test.beans.Order;
import org.jboss.webbeans.test.bindings.AsynchronousAnnotationLiteral;
-import org.jboss.webbeans.test.components.Antelope;
-import org.jboss.webbeans.test.components.Cat;
-import org.jboss.webbeans.test.components.Order;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.Test;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClassAnnotatedItemTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClassAnnotatedItemTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClassAnnotatedItemTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -10,8 +10,8 @@
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.test.components.Antelope;
-import org.jboss.webbeans.test.components.Order;
+import org.jboss.webbeans.test.beans.Antelope;
+import org.jboss.webbeans.test.beans.Order;
import org.testng.annotations.Test;
public class ClassAnnotatedItemTest
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ComponentDeploymentTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ComponentDeploymentTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ComponentDeploymentTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,108 +0,0 @@
-package org.jboss.webbeans.test;
-
-import org.testng.annotations.Test;
-
-@SpecVersion("20080605")
-public class ComponentDeploymentTest
-{
-
-
- @Test(groups="specialization") @SpecAssertion(section="3.1.4")
- public void testOnlySpecializedSimpleComponentDeployed()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.1.4")
- public void testSpecializedSimpleComponentExtends()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.1.4")
- public void testSpecializedSimpleComponentHasSameBindingAnnotations()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.1.4")
- public void testSpecializedSimpleComponentHasSameName()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.2.4")
- public void testOnlySpecializedEnterpriseComponentDeployed()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.2.4")
- public void testSpecializedEnterpriseComponentExtends()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.2.4")
- public void testSpecializedEnterpriseComponentHasSameBindingAnnotations()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.2.4")
- public void testSpecializedEnterpriseComponentHasSameName()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.2.4")
- public void testSpecializedEnterpriseComponentAllLocalInterfaces()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.2.4")
- public void testSpecializedEnterpriseComponentSupportsBeanClassLocalView()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.3.3")
- public void testOnlySpecializedProducerMethodComponentDeployed()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.3.3")
- public void testSpecializedProducerMethodComponentDirectlyOverrides()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.3.3")
- public void testSpecializedProducerMethodComponentHasSameBindingAnnotations()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.3.3")
- public void testSpecializedProducerMethodComponentHasSameName()
- {
- // TODO Placeholder
- assert false;
- }
-
-}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -8,14 +8,14 @@
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.Synchronous;
-import org.jboss.webbeans.test.components.Chicken;
-import org.jboss.webbeans.test.components.Donkey;
-import org.jboss.webbeans.test.components.Duck;
-import org.jboss.webbeans.test.components.Goat;
-import org.jboss.webbeans.test.components.Goose;
-import org.jboss.webbeans.test.components.Order;
-import org.jboss.webbeans.test.components.Sheep;
-import org.jboss.webbeans.test.components.Turkey;
+import org.jboss.webbeans.test.beans.Chicken;
+import org.jboss.webbeans.test.beans.Donkey;
+import org.jboss.webbeans.test.beans.Duck;
+import org.jboss.webbeans.test.beans.Goat;
+import org.jboss.webbeans.test.beans.Goose;
+import org.jboss.webbeans.test.beans.Order;
+import org.jboss.webbeans.test.beans.Sheep;
+import org.jboss.webbeans.test.beans.Turkey;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.Test;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -9,7 +9,7 @@
import org.jboss.webbeans.BeanImpl;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
-import org.jboss.webbeans.test.components.Tuna;
+import org.jboss.webbeans.test.beans.Tuna;
import org.jboss.webbeans.test.util.Util;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
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-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -18,8 +18,8 @@
import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.Asynchronous;
+import org.jboss.webbeans.test.beans.Tuna;
import org.jboss.webbeans.test.bindings.AsynchronousAnnotationLiteral;
-import org.jboss.webbeans.test.components.Tuna;
import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.test.mock.MockObserverImpl;
import org.testng.annotations.Test;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EjbMetaDataTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EjbMetaDataTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EjbMetaDataTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,9 +1,9 @@
package org.jboss.webbeans.test;
import org.jboss.webbeans.ejb.EjbMetaData;
-import org.jboss.webbeans.test.components.Leopard;
-import org.jboss.webbeans.test.components.Lion;
-import org.jboss.webbeans.test.components.Tiger;
+import org.jboss.webbeans.test.beans.Leopard;
+import org.jboss.webbeans.test.beans.Lion;
+import org.jboss.webbeans.test.beans.Tiger;
import org.testng.annotations.Test;
public class EjbMetaDataTest
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanLifecycleTest.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentLifecycleTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanLifecycleTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanLifecycleTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test;
+
+import org.testng.annotations.Test;
+
+public class EnterpriseBeanLifecycleTest
+{
+
+ @Test(groups="beanLifecycle") @SpecAssertion(section="3.2.3")
+ public void testInjectonOfParametersIntoRemoveMethod()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.2.4")
+ public void testSpecializedBeanAlwaysUsed()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanLifecycleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java (from rev 150, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,178 @@
+package org.jboss.webbeans.test;
+
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.webbeans.Current;
+import javax.webbeans.Dependent;
+
+import org.jboss.webbeans.introspector.AnnotatedType;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.bean.AbstractEnterpriseBeanModel;
+import org.jboss.webbeans.model.bean.EnterpriseBeanModel;
+import org.jboss.webbeans.test.annotations.Synchronous;
+import org.jboss.webbeans.test.beans.Bear;
+import org.jboss.webbeans.test.beans.Cheetah;
+import org.jboss.webbeans.test.beans.Cougar;
+import org.jboss.webbeans.test.beans.Elephant;
+import org.jboss.webbeans.test.beans.Giraffe;
+import org.jboss.webbeans.test.beans.Leopard;
+import org.jboss.webbeans.test.beans.Lion;
+import org.jboss.webbeans.test.beans.Panther;
+import org.jboss.webbeans.test.beans.Puma;
+import org.jboss.webbeans.test.beans.Tiger;
+import org.jboss.webbeans.util.Reflections;
+import org.testng.annotations.Test;
+
+public class EnterpriseBeanModelTest extends AbstractTest
+{
+
+ @Test @SpecAssertion(section="2.7.2")
+ public void testSingleStereotype()
+ {
+ assert false;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testStateless()
+ {
+ EnterpriseBeanModel<Lion> lion = new EnterpriseBeanModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class), getEmptyAnnotatedItem(Lion.class), manager);
+ assert lion.getScopeType().equals(Dependent.class);
+ Reflections.annotationSetMatches(lion.getBindingTypes(), Current.class);
+ assert lion.getName().equals("lion");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testStatelessDefinedInXml()
+ {
+ Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ AnnotatedType annotatedItem = new SimpleAnnotatedType(Giraffe.class, annotations);
+
+ EnterpriseBeanModel<Giraffe> giraffe = new EnterpriseBeanModel<Giraffe>(new SimpleAnnotatedType(Giraffe.class), annotatedItem, manager);
+ assert giraffe.getScopeType().equals(Dependent.class);
+ Reflections.annotationSetMatches(giraffe.getBindingTypes(), Current.class);
+ }
+
+ @Test
+ public void testStatelessWithRequestScope()
+ {
+ boolean exception = false;
+ try
+ {
+ new EnterpriseBeanModel<Bear>(new SimpleAnnotatedType<Bear>(Bear.class), getEmptyAnnotatedItem(Bear.class), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+ }
+
+ @Test(groups="ejb3")
+ public void testSingleton()
+ {
+ assert false;
+ }
+
+ @Test(groups="ejb3")
+ public void testSingletonWithRequestScope()
+ {
+ assert false;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testStateful()
+ {
+
+ AbstractEnterpriseBeanModel<Tiger> tiger = new EnterpriseBeanModel<Tiger>(new SimpleAnnotatedType(Tiger.class), getEmptyAnnotatedItem(Tiger.class), manager);
+ Reflections.annotationSetMatches(tiger.getBindingTypes(), Synchronous.class);
+ assert tiger.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
+ assert tiger.getName() == null;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testMultipleRemoveMethodsWithDestroys()
+ {
+
+ AbstractEnterpriseBeanModel<Elephant> elephant = new EnterpriseBeanModel<Elephant>(new SimpleAnnotatedType(Elephant.class), getEmptyAnnotatedItem(Elephant.class), manager);
+ assert elephant.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove2");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testMultipleRemoveMethodsWithoutDestroys()
+ {
+ boolean exception = false;
+ try
+ {
+ new EnterpriseBeanModel<Puma>(new SimpleAnnotatedType(Puma.class), getEmptyAnnotatedItem(Puma.class), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testMultipleRemoveMethodsWithMultipleDestroys()
+ {
+ boolean exception = false;
+ try
+ {
+ new EnterpriseBeanModel<Cougar>(new SimpleAnnotatedType(Cougar.class), getEmptyAnnotatedItem(Cougar.class), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testNonStatefulEnterpriseBeanWithDestroys()
+ {
+ boolean exception = false;
+ try
+ {
+ new EnterpriseBeanModel<Cheetah>(new SimpleAnnotatedType(Cheetah.class), getEmptyAnnotatedItem(Cheetah.class), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testRemoveMethodWithDefaultBinding()
+ {
+
+ AbstractEnterpriseBeanModel<Panther> panther = new EnterpriseBeanModel<Panther>(new SimpleAnnotatedType<Panther>(Panther.class), getEmptyAnnotatedItem(Panther.class), manager);
+
+ assert panther.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
+ assert panther.getRemoveMethod().getParameters().size() == 1;
+ assert panther.getRemoveMethod().getParameters().get(0).getType().equals(String.class);
+ assert panther.getRemoveMethod().getParameters().get(0).getBindingTypes().size() == 1;
+ assert Reflections.annotationSetMatches(panther.getRemoveMethod().getParameters().get(0).getBindingTypes(), Current.class);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testMessageDriven()
+ {
+ AbstractEnterpriseBeanModel<Leopard> leopard = new EnterpriseBeanModel<Leopard>(new SimpleAnnotatedType(Leopard.class), getEmptyAnnotatedItem(Leopard.class), manager);
+ Reflections.annotationSetMatches(leopard.getBindingTypes(), Current.class);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentLifecycleTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentLifecycleTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,22 +0,0 @@
-package org.jboss.webbeans.test;
-
-import org.testng.annotations.Test;
-
-public class EnterpriseComponentLifecycleTest
-{
-
- @Test(groups="componentLifecycle") @SpecAssertion(section="3.2.3")
- public void testInjectonOfParametersIntoRemoveMethod()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.2.4")
- public void testSpecializedComponentAlwaysUsed()
- {
- // TODO Placeholder
- assert false;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,182 +0,0 @@
-package org.jboss.webbeans.test;
-
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
-
-import java.lang.annotation.Annotation;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.webbeans.Current;
-import javax.webbeans.Dependent;
-
-import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.bean.AbstractEnterpriseBeanModel;
-import org.jboss.webbeans.model.bean.EnterpriseBeanModel;
-import org.jboss.webbeans.test.annotations.Synchronous;
-import org.jboss.webbeans.test.components.Bear;
-import org.jboss.webbeans.test.components.Cheetah;
-import org.jboss.webbeans.test.components.Cougar;
-import org.jboss.webbeans.test.components.Elephant;
-import org.jboss.webbeans.test.components.Giraffe;
-import org.jboss.webbeans.test.components.Leopard;
-import org.jboss.webbeans.test.components.Lion;
-import org.jboss.webbeans.test.components.Panther;
-import org.jboss.webbeans.test.components.Puma;
-import org.jboss.webbeans.test.components.Tiger;
-import org.jboss.webbeans.util.Reflections;
-import org.testng.annotations.Test;
-
-public class EnterpriseComponentModelTest extends AbstractTest
-{
-
- @Test @SpecAssertion(section="2.7.2")
- public void testSingleStereotype()
- {
- assert false;
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testStateless()
- {
- EnterpriseBeanModel<Lion> lion = new EnterpriseBeanModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class), getEmptyAnnotatedItem(Lion.class), manager);
- assert lion.getScopeType().equals(Dependent.class);
- Reflections.annotationSetMatches(lion.getBindingTypes(), Current.class);
- assert lion.getName().equals("lion");
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testStatelessDefinedInXml()
- {
- Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- AnnotatedType annotatedItem = new SimpleAnnotatedType(Giraffe.class, annotations);
-
- EnterpriseBeanModel<Giraffe> giraffe = new EnterpriseBeanModel<Giraffe>(new SimpleAnnotatedType(Giraffe.class), annotatedItem, manager);
- assert giraffe.getScopeType().equals(Dependent.class);
- Reflections.annotationSetMatches(giraffe.getBindingTypes(), Current.class);
- }
-
- @Test
- public void testStatelessWithRequestScope()
- {
- boolean exception = false;
- try
- {
- new EnterpriseBeanModel<Bear>(new SimpleAnnotatedType<Bear>(Bear.class), getEmptyAnnotatedItem(Bear.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
- }
-
- // TODO Need EJB3.1 @Test
- public void testSingleton()
- {
- //ComponentMetaModel<Lion> lion = new ComponentMetaModel<Lion>(new ClassAnnotatedItem(Lion.class), getEmptyAnnotatedItem(), manager);
- //assert lion.getComponentType().equals(ComponentType.ENTERPRISE);
- //assert lion.getScopeType().annotationType().equals(ApplicationScoped.class);
- }
-
- // TODO Need EJB3.1 @Test
- public void testSingletonWithRequestScope()
- {
- //ComponentMetaModel<Lion> lion = new ComponentMetaModel<Lion>(new ClassAnnotatedItem(Lion.class), getEmptyAnnotatedItem(), manager);
- //assert lion.getComponentType().equals(ComponentType.ENTERPRISE);
- //assert lion.getScopeType().annotationType().equals(ApplicationScoped.class);
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testStateful()
- {
-
- AbstractEnterpriseBeanModel<Tiger> tiger = new EnterpriseBeanModel<Tiger>(new SimpleAnnotatedType(Tiger.class), getEmptyAnnotatedItem(Tiger.class), manager);
- Reflections.annotationSetMatches(tiger.getBindingTypes(), Synchronous.class);
- assert tiger.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
- assert tiger.getName() == null;
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testMultipleRemoveMethodsWithDestroys()
- {
-
- AbstractEnterpriseBeanModel<Elephant> elephant = new EnterpriseBeanModel<Elephant>(new SimpleAnnotatedType(Elephant.class), getEmptyAnnotatedItem(Elephant.class), manager);
- assert elephant.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove2");
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testMultipleRemoveMethodsWithoutDestroys()
- {
- boolean exception = false;
- try
- {
- new EnterpriseBeanModel<Puma>(new SimpleAnnotatedType(Puma.class), getEmptyAnnotatedItem(Puma.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testMultipleRemoveMethodsWithMultipleDestroys()
- {
- boolean exception = false;
- try
- {
- new EnterpriseBeanModel<Cougar>(new SimpleAnnotatedType(Cougar.class), getEmptyAnnotatedItem(Cougar.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testNonStatefulEnterpriseComponentWithDestroys()
- {
- boolean exception = false;
- try
- {
- new EnterpriseBeanModel<Cheetah>(new SimpleAnnotatedType(Cheetah.class), getEmptyAnnotatedItem(Cheetah.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testRemoveMethodWithDefaultBinding()
- {
-
- AbstractEnterpriseBeanModel<Panther> panther = new EnterpriseBeanModel<Panther>(new SimpleAnnotatedType<Panther>(Panther.class), getEmptyAnnotatedItem(Panther.class), manager);
-
- assert panther.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
- assert panther.getRemoveMethod().getParameters().size() == 1;
- assert panther.getRemoveMethod().getParameters().get(0).getType().equals(String.class);
- assert panther.getRemoveMethod().getParameters().get(0).getBindingTypes().size() == 1;
- assert Reflections.annotationSetMatches(panther.getRemoveMethod().getParameters().get(0).getBindingTypes(), Current.class);
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testMessageDriven()
- {
- AbstractEnterpriseBeanModel<Leopard> leopard = new EnterpriseBeanModel<Leopard>(new SimpleAnnotatedType(Leopard.class), getEmptyAnnotatedItem(Leopard.class), manager);
- Reflections.annotationSetMatches(leopard.getBindingTypes(), Current.class);
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBeanModelTest.java (from rev 150, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBeanModelTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBeanModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,97 @@
+package org.jboss.webbeans.test;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Event;
+import javax.webbeans.Standard;
+
+import org.jboss.webbeans.event.EventImpl;
+import org.jboss.webbeans.injectable.BeanConstructor;
+import org.jboss.webbeans.introspector.SimpleAnnotatedField;
+import org.jboss.webbeans.model.bean.EventBeanModel;
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
+import org.jboss.webbeans.test.beans.DangerCall;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * Unit tests for the bean model used only for the container supplied
+ * Event bean.
+ *
+ * @author David Allen
+ *
+ */
+public class EventBeanModelTest
+{
+ private MockManagerImpl manager = null;
+ private EventBeanModel<EventImpl<DangerCall>> eventBeanModel = null;
+ EventImpl<DangerCall> eventModelField = null;
+
+ @BeforeMethod
+ public void before() throws Exception
+ {
+ List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ enabledDeploymentTypes.add(Standard.class);
+ enabledDeploymentTypes.add(AnotherDeploymentType.class);
+ manager = new MockManagerImpl(enabledDeploymentTypes);
+ Field eventModelField = this.getClass().getDeclaredField("eventModelField");
+ eventBeanModel = new EventBeanModel<EventImpl<DangerCall>>(
+ new SimpleAnnotatedField<EventImpl<DangerCall>>(eventModelField),
+ new SimpleAnnotatedField<EventImpl<DangerCall>>(eventModelField),
+ manager);
+
+ }
+
+ /**
+ * The name should always be null since this type of bean is not allowed to have a name.
+ */
+ @Test(groups = "eventbus")
+ public void testName()
+ {
+ assert eventBeanModel.getName() == null;
+ }
+
+ /**
+ * The scope type should always be @Dependent
+ */
+ @Test(groups = "eventbus")
+ public void testScopeType()
+ {
+ assert eventBeanModel.getScopeType().equals(Dependent.class);
+ }
+
+ /**
+ * The deployment type should always be @Standard
+ */
+ @Test(groups = "eventbus")
+ public void testDeploymentType()
+ {
+ assert eventBeanModel.getDeploymentType().equals(Standard.class);
+ }
+
+ @Test(groups = "eventbus")
+ public void testApiTypes()
+ {
+ Set<Class<?>> apis = eventBeanModel.getApiTypes();
+ assert apis.size() >= 1;
+ for (Class<?> api : apis)
+ {
+ api.equals(Event.class);
+ }
+ }
+
+ @Test(groups = "eventbus")
+ public void testConstructor()
+ {
+ BeanConstructor<EventImpl<DangerCall>> constructor = eventBeanModel.getConstructor();
+ assert constructor != null;
+ Event<DangerCall> event = constructor.invoke(manager);
+ assert event != null;
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBeanModelTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,97 +0,0 @@
-package org.jboss.webbeans.test;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import javax.webbeans.Dependent;
-import javax.webbeans.Event;
-import javax.webbeans.Standard;
-
-import org.jboss.webbeans.event.EventImpl;
-import org.jboss.webbeans.injectable.BeanConstructor;
-import org.jboss.webbeans.introspector.SimpleAnnotatedField;
-import org.jboss.webbeans.model.bean.EventBeanModel;
-import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
-import org.jboss.webbeans.test.components.DangerCall;
-import org.jboss.webbeans.test.mock.MockManagerImpl;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the component model used only for the container supplied
- * Event component.
- *
- * @author David Allen
- *
- */
-public class EventComponentModelTest
-{
- private MockManagerImpl manager = null;
- private EventBeanModel<EventImpl<DangerCall>> eventBeanModel = null;
- EventImpl<DangerCall> eventModelField = null;
-
- @BeforeMethod
- public void before() throws Exception
- {
- List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
- enabledDeploymentTypes.add(Standard.class);
- enabledDeploymentTypes.add(AnotherDeploymentType.class);
- manager = new MockManagerImpl(enabledDeploymentTypes);
- Field eventModelField = this.getClass().getDeclaredField("eventModelField");
- eventBeanModel = new EventBeanModel<EventImpl<DangerCall>>(
- new SimpleAnnotatedField<EventImpl<DangerCall>>(eventModelField),
- new SimpleAnnotatedField<EventImpl<DangerCall>>(eventModelField),
- manager);
-
- }
-
- /**
- * The name should always be null since this type of component is not allowed to have a name.
- */
- @Test(groups = "eventbus")
- public void testName()
- {
- assert eventBeanModel.getName() == null;
- }
-
- /**
- * The scope type should always be @Dependent
- */
- @Test(groups = "eventbus")
- public void testScopeType()
- {
- assert eventBeanModel.getScopeType().equals(Dependent.class);
- }
-
- /**
- * The deployment type should always be @Standard
- */
- @Test(groups = "eventbus")
- public void testDeploymentType()
- {
- assert eventBeanModel.getDeploymentType().equals(Standard.class);
- }
-
- @Test(groups = "eventbus")
- public void testApiTypes()
- {
- Set<Class<?>> apis = eventBeanModel.getApiTypes();
- assert apis.size() >= 1;
- for (Class<?> api : apis)
- {
- api.equals(Event.class);
- }
- }
-
- @Test(groups = "eventbus")
- public void testConstructor()
- {
- BeanConstructor<EventImpl<DangerCall>> constructor = eventBeanModel.getConstructor();
- assert constructor != null;
- Event<DangerCall> event = constructor.invoke(manager);
- assert event != null;
- }
-}
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-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -13,18 +13,18 @@
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.AnimalStereotypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
import org.jboss.webbeans.test.bindings.TameAnnotationLiteral;
-import org.jboss.webbeans.test.components.DangerCall;
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.
+ * Tests for the implementation of an Event bean
*
* @author David Allen
*
@@ -55,10 +55,10 @@
// Create a test annotation for the event and use it to construct the
// event object
Annotation[] annotations = new Annotation[] { new AnimalStereotypeAnnotationLiteral() };
- EventImpl<DangerCall> eventComponent = new EventImpl<DangerCall>();
- eventComponent.setEventBindings(annotations);
- eventComponent.setManager(manager);
- eventComponent.fire(anEvent, new TameAnnotationLiteral(),
+ EventImpl<DangerCall> eventBean = new EventImpl<DangerCall>();
+ eventBean.setEventBindings(annotations);
+ eventBean.setManager(manager);
+ eventBean.fire(anEvent, new TameAnnotationLiteral(),
new SynchronousAnnotationLiteral());
assert anEvent.equals(manager.getEvent());
assert Reflections.annotationSetMatches(manager.getEventBindings(),
@@ -69,7 +69,7 @@
boolean duplicateDetected = false;
try
{
- eventComponent.fire(anEvent, new TameAnnotationLiteral(),
+ eventBean.fire(anEvent, new TameAnnotationLiteral(),
new TameAnnotationLiteral());
} catch (DuplicateBindingTypeException e)
{
@@ -81,7 +81,7 @@
boolean nonBindingTypeDetected = false;
try
{
- eventComponent.fire(anEvent, new FishStereotypeAnnotationLiteral());
+ eventBean.fire(anEvent, new FishStereotypeAnnotationLiteral());
}
catch (IllegalArgumentException e)
{
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-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -11,11 +11,11 @@
import org.jboss.webbeans.injectable.InjectableField;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
-import org.jboss.webbeans.test.components.Cod;
-import org.jboss.webbeans.test.components.FishFarm;
-import org.jboss.webbeans.test.components.Salmon;
-import org.jboss.webbeans.test.components.ScottishFish;
-import org.jboss.webbeans.test.components.Sole;
+import org.jboss.webbeans.test.beans.Cod;
+import org.jboss.webbeans.test.beans.FishFarm;
+import org.jboss.webbeans.test.beans.Salmon;
+import org.jboss.webbeans.test.beans.ScottishFish;
+import org.jboss.webbeans.test.beans.Sole;
import org.testng.annotations.Test;
public class InstantiationByNameTest extends AbstractTest
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-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -15,14 +15,14 @@
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.Whitefish;
-import org.jboss.webbeans.test.components.Cod;
-import org.jboss.webbeans.test.components.FishFarm;
-import org.jboss.webbeans.test.components.Plaice;
-import org.jboss.webbeans.test.components.Salmon;
-import org.jboss.webbeans.test.components.ScottishFish;
-import org.jboss.webbeans.test.components.Sole;
-import org.jboss.webbeans.test.components.Tuna;
-import org.jboss.webbeans.test.components.broken.PlaiceFarm;
+import org.jboss.webbeans.test.beans.Cod;
+import org.jboss.webbeans.test.beans.FishFarm;
+import org.jboss.webbeans.test.beans.Plaice;
+import org.jboss.webbeans.test.beans.Salmon;
+import org.jboss.webbeans.test.beans.ScottishFish;
+import org.jboss.webbeans.test.beans.Sole;
+import org.jboss.webbeans.test.beans.Tuna;
+import org.jboss.webbeans.test.beans.broken.PlaiceFarm;
import org.testng.annotations.Test;
public class InstantiationByTypeTest extends AbstractTest
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -7,13 +7,13 @@
import org.jboss.webbeans.BeanImpl;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
-import org.jboss.webbeans.test.components.Cod;
-import org.jboss.webbeans.test.components.Haddock;
-import org.jboss.webbeans.test.components.Plaice;
-import org.jboss.webbeans.test.components.Salmon;
-import org.jboss.webbeans.test.components.SeaBass;
-import org.jboss.webbeans.test.components.Sole;
-import org.jboss.webbeans.test.components.Tuna;
+import org.jboss.webbeans.test.beans.Cod;
+import org.jboss.webbeans.test.beans.Haddock;
+import org.jboss.webbeans.test.beans.Plaice;
+import org.jboss.webbeans.test.beans.Salmon;
+import org.jboss.webbeans.test.beans.SeaBass;
+import org.jboss.webbeans.test.beans.Sole;
+import org.jboss.webbeans.test.beans.Tuna;
import org.testng.annotations.Test;
public class NameBasedResolutionTest extends AbstractTest
{
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-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -18,8 +18,8 @@
import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.Asynchronous;
+import org.jboss.webbeans.test.beans.Tuna;
import org.jboss.webbeans.test.bindings.AsynchronousAnnotationLiteral;
-import org.jboss.webbeans.test.components.Tuna;
import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.test.mock.MockObserverImpl;
import org.testng.annotations.BeforeMethod;
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionBeanLifecycleTest.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentLifecycleTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionBeanLifecycleTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionBeanLifecycleTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,29 @@
+package org.jboss.webbeans.test;
+
+import org.testng.annotations.Test;
+
+public class ProducerExpressionBeanLifecycleTest
+{
+
+ @Test(groups={"beanLifecycle", "producerExpression"}) @SpecAssertion(section="3.4")
+ public void testNonDependentProducerExpressionThatReturnsNull()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups={"beanLifecycle", "producerExpression"}) @SpecAssertion(section="3.4")
+ public void testDependentProducerExpressionThatReturnsNull()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups={"beanLifecycle", "producerExpression"}) @SpecAssertion(section="3.4")
+ public void testProducerExpressionHasValidRuntimeApiType()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionBeanLifecycleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionBeanModelTest.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentModelTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionBeanModelTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionBeanModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,33 @@
+package org.jboss.webbeans.test;
+
+import org.testng.annotations.Test;
+
+public class ProducerExpressionBeanModelTest extends AbstractTest
+{
+
+ @Test(groups="producerExpression") @SpecAssertion(section="3.4")
+ public void testApiTypes()
+ {
+ assert false;
+ }
+
+ @Test(groups="producerExpression") @SpecAssertion(section="3.4")
+ public void testFinalProducerExpression()
+ {
+ assert false;
+ }
+
+ @Test(groups="producerExpression") @SpecAssertion(section="3.4")
+ public void testFinalDependentProducerExpression()
+ {
+ assert false;
+ }
+
+ @Test(groups="producerExpression") @SpecAssertion(section="3.4.2")
+ public void testProducerExpressionCannotHaveDefaultName()
+ {
+ assert false;
+ }
+
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionBeanModelTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentLifecycleTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentLifecycleTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,29 +0,0 @@
-package org.jboss.webbeans.test;
-
-import org.testng.annotations.Test;
-
-public class ProducerExpressionComponentLifecycleTest
-{
-
- @Test(groups={"componentLifecycle", "producerExpression"}) @SpecAssertion(section="3.4")
- public void testNonDependentProducerExpressionThatReturnsNull()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups={"componentLifecycle", "producerExpression"}) @SpecAssertion(section="3.4")
- public void testDependentProducerExpressionThatReturnsNull()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups={"componentLifecycle", "producerExpression"}) @SpecAssertion(section="3.4")
- public void testProducerExpressionHasValidRuntimeApiType()
- {
- // TODO Placeholder
- assert false;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentModelTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,33 +0,0 @@
-package org.jboss.webbeans.test;
-
-import org.testng.annotations.Test;
-
-public class ProducerExpressionComponentModelTest extends AbstractTest
-{
-
- @Test(groups="producerExpression") @SpecAssertion(section="3.4")
- public void testApiTypes()
- {
- assert false;
- }
-
- @Test(groups="producerExpression") @SpecAssertion(section="3.4")
- public void testFinalProducerExpression()
- {
- assert false;
- }
-
- @Test(groups="producerExpression") @SpecAssertion(section="3.4")
- public void testFinalDependentProducerExpression()
- {
- assert false;
- }
-
- @Test(groups="producerExpression") @SpecAssertion(section="3.4.2")
- public void testProducerExpressionCannotHaveDefaultName()
- {
- assert false;
- }
-
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentLifecycleTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,43 @@
+package org.jboss.webbeans.test;
+
+import org.testng.annotations.Test;
+
+public class ProducerMethodBeanLifecycleTest
+{
+
+ @Test(groups="beanLifecycle") @SpecAssertion(section="3.3")
+ public void testNonDependentProducerMethodThatReturnsNull()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="beanLifecycle") @SpecAssertion(section="3.3")
+ public void testDependentProducerMethodThatReturnsNull()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.3.3")
+ public void testSpecializedBeanAlwaysUsed()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups={"disposalMethod", "beanLifecycle"}) @SpecAssertion(section="3.3.4")
+ public void testDisposalMethodCalled()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups={"disposalMethod", "beanLifecycle"}) @SpecAssertion(section="3.3.4")
+ public void testDisposalMethodHasParametersInjected()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java (from rev 150, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,216 @@
+package org.jboss.webbeans.test;
+
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
+import java.lang.reflect.Method;
+
+import javax.webbeans.Current;
+import javax.webbeans.Dependent;
+
+import org.jboss.webbeans.introspector.SimpleAnnotatedMethod;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.bean.ProducerMethodBeanModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
+import org.jboss.webbeans.test.annotations.Tame;
+import org.jboss.webbeans.test.beans.Animal;
+import org.jboss.webbeans.test.beans.BlackWidow;
+import org.jboss.webbeans.test.beans.DaddyLongLegs;
+import org.jboss.webbeans.test.beans.DeadlyAnimal;
+import org.jboss.webbeans.test.beans.DeadlySpider;
+import org.jboss.webbeans.test.beans.LadybirdSpider;
+import org.jboss.webbeans.test.beans.Spider;
+import org.jboss.webbeans.test.beans.SpiderProducer;
+import org.jboss.webbeans.test.beans.Tarantula;
+import org.jboss.webbeans.test.beans.TrapdoorSpider;
+import org.jboss.webbeans.test.beans.broken.BeanWithFinalProducerMethod;
+import org.jboss.webbeans.test.beans.broken.BeanWithStaticProducerMethod;
+import org.testng.annotations.Test;
+
+public class ProducerMethodBeanModelTest extends AbstractTest
+{
+
+ @Test @SpecAssertion(section="3.3")
+ public void testStaticMethod() throws SecurityException, NoSuchMethodException
+ {
+ SimpleBeanModel<BeanWithStaticProducerMethod> model = new SimpleBeanModel<BeanWithStaticProducerMethod>(new SimpleAnnotatedType<BeanWithStaticProducerMethod>(BeanWithStaticProducerMethod.class), getEmptyAnnotatedItem(BeanWithStaticProducerMethod.class), manager);
+ manager.getModelManager().addBeanModel(model);
+ Method method = BeanWithStaticProducerMethod.class.getMethod("getString");
+ boolean exception = false;
+ try
+ {
+ new ProducerMethodBeanModel<String>(new SimpleAnnotatedMethod<String>(method), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+ }
+
+ @Test @SpecAssertion(section="3.3")
+ public void testApiTypes() throws SecurityException, NoSuchMethodException
+ {
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(model);
+ Method method = SpiderProducer.class.getMethod("produceTarantula");
+ ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
+ assert tarantulaModel.getApiTypes().contains(Tarantula.class);
+ assert tarantulaModel.getApiTypes().contains(DeadlySpider.class);
+ assert tarantulaModel.getApiTypes().contains(Spider.class);
+ assert tarantulaModel.getApiTypes().contains(Animal.class);
+ assert tarantulaModel.getApiTypes().contains(DeadlyAnimal.class);
+ assert !tarantulaModel.getApiTypes().contains(Object.class);
+ }
+
+ @Test @SpecAssertion(section="3.3.1")
+ public void testDefaultBindingType() throws SecurityException, NoSuchMethodException
+ {
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(model);
+ Method method = SpiderProducer.class.getMethod("produceTarantula");
+ ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
+ assert tarantulaModel.getBindingTypes().size() == 1;
+ assert tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Current.class);
+ }
+
+ @Test
+ public void testBindingType() throws SecurityException, NoSuchMethodException
+ {
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(model);
+ Method method = SpiderProducer.class.getMethod("produceTameTarantula");
+ ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
+ assert tarantulaModel.getBindingTypes().size() == 1;
+ assert tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Tame.class);
+ }
+
+ @Test @SpecAssertion(section="3.3")
+ public void testFinalMethod() throws SecurityException, NoSuchMethodException
+ {
+ SimpleBeanModel<BeanWithFinalProducerMethod> model = new SimpleBeanModel<BeanWithFinalProducerMethod>(new SimpleAnnotatedType<BeanWithFinalProducerMethod>(BeanWithFinalProducerMethod.class), getEmptyAnnotatedItem(BeanWithFinalProducerMethod.class), manager);
+ manager.getModelManager().addBeanModel(model);
+ Method method = BeanWithFinalProducerMethod.class.getMethod("getString");
+ boolean exception = false;
+ try
+ {
+ new ProducerMethodBeanModel<String>(new SimpleAnnotatedMethod<String>(method), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+ }
+
+ @Test @SpecAssertion(section="3.3")
+ public void testFinalMethodWithDependentScope() throws SecurityException, NoSuchMethodException
+ {
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(model);
+ Method method = SpiderProducer.class.getMethod("produceTrapdoorSpider");
+ ProducerMethodBeanModel<TrapdoorSpider> trapdoorSpiderModel = new ProducerMethodBeanModel<TrapdoorSpider>(new SimpleAnnotatedMethod<TrapdoorSpider>(method), manager);
+ assert trapdoorSpiderModel.getScopeType().equals(Dependent.class);
+ }
+
+ @Test @SpecAssertion(section="3.3.6")
+ public void testNamedMethod() throws SecurityException, NoSuchMethodException
+ {
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(model);
+ Method method = SpiderProducer.class.getMethod("produceBlackWidow");
+ ProducerMethodBeanModel<BlackWidow> blackWidowSpiderModel = new ProducerMethodBeanModel<BlackWidow>(new SimpleAnnotatedMethod<BlackWidow>(method), manager);
+ assert blackWidowSpiderModel.getName().equals("blackWidow");
+ }
+
+ @Test @SpecAssertion(section="3.3.6")
+ public void testDefaultNamedMethod() throws SecurityException, NoSuchMethodException
+ {
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(model);
+ Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
+ ProducerMethodBeanModel<DaddyLongLegs> daddyLongLegsSpiderModel = new ProducerMethodBeanModel<DaddyLongLegs>(new SimpleAnnotatedMethod<DaddyLongLegs>(method), manager);
+ assert daddyLongLegsSpiderModel.getName().equals("produceDaddyLongLegs");
+ }
+
+ @Test @SpecAssertion(section="3.3.6")
+ public void testDefaultNamedJavaBeanMethod() throws SecurityException, NoSuchMethodException
+ {
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(model);
+ Method method = SpiderProducer.class.getMethod("getLadybirdSpider");
+ ProducerMethodBeanModel<LadybirdSpider> ladybirdSpiderModel = new ProducerMethodBeanModel<LadybirdSpider>(new SimpleAnnotatedMethod<LadybirdSpider>(method), manager);
+ assert ladybirdSpiderModel.getName().equals("ladybirdSpider");
+ }
+
+ @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
+ public void testDisposalMethodNonStatic()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
+ public void testDisposalMethodMethodDeclaredOnWebBeanImplementationClass()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
+ public void testDisposalMethodBindingAnnotations()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
+ public void testDisposalMethodDefaultBindingAnnotations()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
+ public void testDisposalMethodDoesNotResolveToProducerMethod()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="disposalMethod") @SpecAssertion(section="3.3.5")
+ public void testDisposalMethodDeclaredOnEnabledBean()
+ {
+ // TODO Placeholder
+ // TODO Move this
+
+ assert false;
+ }
+
+ @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
+ public void testBeanCanDeclareMultipleDisposalMethods()
+ {
+ // TODO move this
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="disposalMethod") @SpecAssertion(section="3.3.5")
+ public void testProducerMethodHasNoMoreThanOneDisposalMethod()
+ {
+ // TODO move this
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test @SpecAssertion(section="2.7.2")
+ public void testSingleStereotype()
+ {
+ assert false;
+ }
+
+ @Test @SpecAssertion(section="2.7.2")
+ public void testStereotypeOnNonProducerMethod()
+ {
+ assert false;
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentLifecycleTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentLifecycleTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,43 +0,0 @@
-package org.jboss.webbeans.test;
-
-import org.testng.annotations.Test;
-
-public class ProducerMethodComponentLifecycleTest
-{
-
- @Test(groups="componentLifecycle") @SpecAssertion(section="3.3")
- public void testNonDependentProducerMethodThatReturnsNull()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="componentLifecycle") @SpecAssertion(section="3.3")
- public void testDependentProducerMethodThatReturnsNull()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.3.3")
- public void testSpecializedComponentAlwaysUsed()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups={"disposalMethod", "componentLifecycle"}) @SpecAssertion(section="3.3.4")
- public void testDisposalMethodCalled()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups={"disposalMethod", "componentLifecycle"}) @SpecAssertion(section="3.3.4")
- public void testDisposalMethodHasParametersInjected()
- {
- // TODO Placeholder
- assert false;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,216 +0,0 @@
-package org.jboss.webbeans.test;
-
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
-
-import java.lang.reflect.Method;
-
-import javax.webbeans.Current;
-import javax.webbeans.Dependent;
-
-import org.jboss.webbeans.introspector.SimpleAnnotatedMethod;
-import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.bean.ProducerMethodBeanModel;
-import org.jboss.webbeans.model.bean.SimpleBeanModel;
-import org.jboss.webbeans.test.annotations.Tame;
-import org.jboss.webbeans.test.components.Animal;
-import org.jboss.webbeans.test.components.BlackWidow;
-import org.jboss.webbeans.test.components.DaddyLongLegs;
-import org.jboss.webbeans.test.components.DeadlyAnimal;
-import org.jboss.webbeans.test.components.DeadlySpider;
-import org.jboss.webbeans.test.components.LadybirdSpider;
-import org.jboss.webbeans.test.components.Spider;
-import org.jboss.webbeans.test.components.SpiderProducer;
-import org.jboss.webbeans.test.components.Tarantula;
-import org.jboss.webbeans.test.components.TrapdoorSpider;
-import org.jboss.webbeans.test.components.broken.ComponentWithFinalProducerMethod;
-import org.jboss.webbeans.test.components.broken.ComponentWithStaticProducerMethod;
-import org.testng.annotations.Test;
-
-public class ProducerMethodComponentModelTest extends AbstractTest
-{
-
- @Test @SpecAssertion(section="3.3")
- public void testStaticMethod() throws SecurityException, NoSuchMethodException
- {
- SimpleBeanModel<ComponentWithStaticProducerMethod> componentModel = new SimpleBeanModel<ComponentWithStaticProducerMethod>(new SimpleAnnotatedType<ComponentWithStaticProducerMethod>(ComponentWithStaticProducerMethod.class), getEmptyAnnotatedItem(ComponentWithStaticProducerMethod.class), manager);
- manager.getModelManager().addBeanModel(componentModel);
- Method method = ComponentWithStaticProducerMethod.class.getMethod("getString");
- boolean exception = false;
- try
- {
- new ProducerMethodBeanModel<String>(new SimpleAnnotatedMethod<String>(method), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
- }
-
- @Test @SpecAssertion(section="3.3")
- public void testApiTypes() throws SecurityException, NoSuchMethodException
- {
- SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addBeanModel(componentModel);
- Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
- assert tarantulaModel.getApiTypes().contains(Tarantula.class);
- assert tarantulaModel.getApiTypes().contains(DeadlySpider.class);
- assert tarantulaModel.getApiTypes().contains(Spider.class);
- assert tarantulaModel.getApiTypes().contains(Animal.class);
- assert tarantulaModel.getApiTypes().contains(DeadlyAnimal.class);
- assert !tarantulaModel.getApiTypes().contains(Object.class);
- }
-
- @Test @SpecAssertion(section="3.3.1")
- public void testDefaultBindingType() throws SecurityException, NoSuchMethodException
- {
- SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addBeanModel(componentModel);
- Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
- assert tarantulaModel.getBindingTypes().size() == 1;
- assert tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Current.class);
- }
-
- @Test
- public void testBindingType() throws SecurityException, NoSuchMethodException
- {
- SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addBeanModel(componentModel);
- Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
- assert tarantulaModel.getBindingTypes().size() == 1;
- assert tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Tame.class);
- }
-
- @Test @SpecAssertion(section="3.3")
- public void testFinalMethod() throws SecurityException, NoSuchMethodException
- {
- SimpleBeanModel<ComponentWithFinalProducerMethod> componentModel = new SimpleBeanModel<ComponentWithFinalProducerMethod>(new SimpleAnnotatedType<ComponentWithFinalProducerMethod>(ComponentWithFinalProducerMethod.class), getEmptyAnnotatedItem(ComponentWithFinalProducerMethod.class), manager);
- manager.getModelManager().addBeanModel(componentModel);
- Method method = ComponentWithFinalProducerMethod.class.getMethod("getString");
- boolean exception = false;
- try
- {
- new ProducerMethodBeanModel<String>(new SimpleAnnotatedMethod<String>(method), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
- }
-
- @Test @SpecAssertion(section="3.3")
- public void testFinalMethodWithDependentScope() throws SecurityException, NoSuchMethodException
- {
- SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addBeanModel(componentModel);
- Method method = SpiderProducer.class.getMethod("produceTrapdoorSpider");
- ProducerMethodBeanModel<TrapdoorSpider> trapdoorSpiderModel = new ProducerMethodBeanModel<TrapdoorSpider>(new SimpleAnnotatedMethod<TrapdoorSpider>(method), manager);
- assert trapdoorSpiderModel.getScopeType().equals(Dependent.class);
- }
-
- @Test @SpecAssertion(section="3.3.6")
- public void testNamedMethod() throws SecurityException, NoSuchMethodException
- {
- SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addBeanModel(componentModel);
- Method method = SpiderProducer.class.getMethod("produceBlackWidow");
- ProducerMethodBeanModel<BlackWidow> blackWidowSpiderModel = new ProducerMethodBeanModel<BlackWidow>(new SimpleAnnotatedMethod<BlackWidow>(method), manager);
- assert blackWidowSpiderModel.getName().equals("blackWidow");
- }
-
- @Test @SpecAssertion(section="3.3.6")
- public void testDefaultNamedMethod() throws SecurityException, NoSuchMethodException
- {
- SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addBeanModel(componentModel);
- Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
- ProducerMethodBeanModel<DaddyLongLegs> daddyLongLegsSpiderModel = new ProducerMethodBeanModel<DaddyLongLegs>(new SimpleAnnotatedMethod<DaddyLongLegs>(method), manager);
- assert daddyLongLegsSpiderModel.getName().equals("produceDaddyLongLegs");
- }
-
- @Test @SpecAssertion(section="3.3.6")
- public void testDefaultNamedJavaBeanMethod() throws SecurityException, NoSuchMethodException
- {
- SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addBeanModel(componentModel);
- Method method = SpiderProducer.class.getMethod("getLadybirdSpider");
- ProducerMethodBeanModel<LadybirdSpider> ladybirdSpiderModel = new ProducerMethodBeanModel<LadybirdSpider>(new SimpleAnnotatedMethod<LadybirdSpider>(method), manager);
- assert ladybirdSpiderModel.getName().equals("ladybirdSpider");
- }
-
- @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
- public void testDisposalMethodNonStatic()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
- public void testDisposalMethodMethodDeclaredOnWebBeanImplementationClass()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
- public void testDisposalMethodBindingAnnotations()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
- public void testDisposalMethodDefaultBindingAnnotations()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
- public void testDisposalMethodDoesNotResolveToProducerMethod()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="disposalMethod") @SpecAssertion(section="3.3.5")
- public void testDisposalMethodDeclaredOnEnabledComponent()
- {
- // TODO Placeholder
- // TODO Move this
-
- assert false;
- }
-
- @Test(groups="disposalMethod") @SpecAssertion(section="3.3.4")
- public void testComponentCanDeclareMultipleDisposalMethods()
- {
- // TODO move this
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="disposalMethod") @SpecAssertion(section="3.3.5")
- public void testProducerMethodHasNoMoreThanOneDisposalMethod()
- {
- // TODO move this
- // TODO Placeholder
- assert false;
- }
-
- @Test @SpecAssertion(section="2.7.2")
- public void testSingleStereotype()
- {
- assert false;
- }
-
- @Test @SpecAssertion(section="2.7.2")
- public void testStereotypeOnNonProducerMethod()
- {
- assert false;
- }
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteBeanLifecycleTest.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentLifecycleTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteBeanLifecycleTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteBeanLifecycleTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test;
+
+import org.testng.annotations.Test;
+
+public class RemoteBeanLifecycleTest
+{
+
+ @Test(groups="beanLifecycle") @SpecAssertion(section="3.5.3")
+ public void testRemoveMethodCalledCausesContainerToRemoveInstance()
+ {
+ assert false;
+ }
+
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteBeanLifecycleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentLifecycleTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentLifecycleTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,15 +0,0 @@
-package org.jboss.webbeans.test;
-
-import org.testng.annotations.Test;
-
-public class RemoteComponentLifecycleTest
-{
-
- @Test(groups="componentLifecycle") @SpecAssertion(section="3.5.3")
- public void testRemoveMethodCalledCausesContainerToRemoveInstance()
- {
- assert false;
- }
-
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentModelTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,93 +0,0 @@
-package org.jboss.webbeans.test;
-
-
-public class RemoteComponentModelTest
-{
-
- /*private ManagerImpl container;
- private AnnotatedType<?> emptyAnnotatedItem;
-
- @BeforeMethod
- public void before()
- {
- emptyAnnotatedItem = new SimpleAnnotatedType(null, new HashMap<Class<? extends Annotation>, Annotation>());
- container = new MockContainerImpl(null);
- }
-
- @Test @SpecAssertion(section="2.7.2")
- public void testSingleStereotype()
- {
- assert false;
- }
-
- @Test @SpecAssertion(section="3.5")
- public void testApiTypes() throws SecurityException, NoSuchMethodException
- {
- RemoteComponentModel<Baboon> baboonModel = new RemoteComponentModel<Baboon>(new SimpleAnnotatedType<Baboon>(Baboon.class), emptyAnnotatedItem, container);
- assert baboonModel.getApiTypes().contains(Baboon.class);
- assert baboonModel.getApiTypes().contains(Animal.class);
- }
-
- @Test @SpecAssertion(section="3.5.4")
- public void testDefaultName() throws SecurityException, NoSuchMethodException
- {
- RemoteComponentModel<TameOrangutan> tameApeModel = new RemoteComponentModel<TameOrangutan>(new SimpleAnnotatedType<TameOrangutan>(TameOrangutan.class), emptyAnnotatedItem, container);
- assert tameApeModel.getName().equals("tameOrangutan");
- }
-
- @Test @SpecAssertion(section="3.5.1")
- public void testDefaultBindingType() throws SecurityException, NoSuchMethodException
- {
- RemoteComponentModel<Baboon> baboonModel = new RemoteComponentModel<Baboon>(new SimpleAnnotatedType<Baboon>(Baboon.class), emptyAnnotatedItem, container);
- assert baboonModel.getBindingTypes().size() == 1;
- assert baboonModel.getBindingTypes().iterator().next().annotationType().equals(Current.class);
- }
-
- @Test
- public void testBindingType() throws SecurityException, NoSuchMethodException
- {
- RemoteComponentModel<TameOrangutan> tameOrangutanModel = new RemoteComponentModel<TameOrangutan>(new SimpleAnnotatedType<TameOrangutan>(TameOrangutan.class), emptyAnnotatedItem, container);
- assert tameOrangutanModel.getBindingTypes().size() == 1;
- assert tameOrangutanModel.getBindingTypes().iterator().next().annotationType().equals(Tame.class);
- }
-
- @Test(groups="remoteComponentInXml") @SpecAssertion(section="3.5.2")
- public void testRemoteComponentDeclaredInXml()
- {
- assert false;
- }
-
- @Test @SpecAssertion(section="3.5.3")
- public void testSFSBMustHaveRemoveMethod()
- {
- // TODO How do we check this?
- }
-
- @Test(expectedExceptions=RuntimeException.class) @SpecAssertion(section="3.5.3")
- public void testRemoveMethodCannotHaveParameters()
- {
- RemoteComponentModel<Chimpanzee> chimpanzeeModel = new RemoteComponentModel<Chimpanzee>(new SimpleAnnotatedType<Chimpanzee>(Chimpanzee.class), emptyAnnotatedItem, container);
- }
-
- @Test(expectedExceptions=RuntimeException.class) @SpecAssertion(section="3.5.3")
- public void testCannotHaveMultipleRemoveMethods()
- {
- RemoteComponentModel<Gibbon> gibbonModel = new RemoteComponentModel<Gibbon>(new SimpleAnnotatedType<Gibbon>(Gibbon.class), emptyAnnotatedItem, container);
- }
-
- @Test @SpecAssertion(section="3.5.3")
- public void testRemoveMethod()
- {
- RemoteComponentModel<TameOrangutan> tameOrangutanModel = new RemoteComponentModel<TameOrangutan>(new SimpleAnnotatedType<TameOrangutan>(TameOrangutan.class), emptyAnnotatedItem, container);
- assert tameOrangutanModel.getRemoveMethod().getMethod().getName().equals("removeOrangutan");
- RemoteComponentModel<Orangutan> orangutanModel = new RemoteComponentModel<Orangutan>(new SimpleAnnotatedType<Orangutan>(Orangutan.class), emptyAnnotatedItem, container);
- assert orangutanModel.getRemoveMethod().getMethod().getName().equals("removeOrangutan");
- }
-
- @Test @SpecAssertion(section="2.7.2")
- public void testStereotypeOnOtherInterface()
- {
- assert false;
- }*/
-
-}
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-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -19,14 +19,14 @@
import org.jboss.webbeans.test.annotations.AnimalStereotype;
import org.jboss.webbeans.test.annotations.FishStereotype;
import org.jboss.webbeans.test.annotations.RiverFishStereotype;
+import org.jboss.webbeans.test.beans.Antelope;
+import org.jboss.webbeans.test.beans.BeanWithTooManyScopeTypes;
+import org.jboss.webbeans.test.beans.Haddock;
+import org.jboss.webbeans.test.beans.Order;
+import org.jboss.webbeans.test.beans.SeaBass;
import org.jboss.webbeans.test.bindings.AnimalStereotypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.RiverFishStereotypeAnnotationLiteral;
-import org.jboss.webbeans.test.components.Antelope;
-import org.jboss.webbeans.test.components.ComponentWithTooManyScopeTypes;
-import org.jboss.webbeans.test.components.Haddock;
-import org.jboss.webbeans.test.components.Order;
-import org.jboss.webbeans.test.components.SeaBass;
import org.testng.annotations.Test;
public class ScopeTypeTest extends AbstractTest
@@ -69,7 +69,7 @@
boolean exception = false;
try
{
- new SimpleBeanModel<ComponentWithTooManyScopeTypes>(new SimpleAnnotatedType<ComponentWithTooManyScopeTypes>(ComponentWithTooManyScopeTypes.class), getEmptyAnnotatedItem(ComponentWithTooManyScopeTypes.class), manager);
+ new SimpleBeanModel<BeanWithTooManyScopeTypes>(new SimpleAnnotatedType<BeanWithTooManyScopeTypes>(BeanWithTooManyScopeTypes.class), getEmptyAnnotatedItem(BeanWithTooManyScopeTypes.class), manager);
}
catch (Exception e)
{
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentLifecycleTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test;
+
+import org.testng.annotations.Test;
+
+public class SimpleBeanLifecycleTest
+{
+
+ @Test(groups="beanLifecycle") @SpecAssertion(section="3.1.3")
+ public void testInjectionOfParametersIntoBeanConstructor()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups="specialization") @SpecAssertion(section="3.1.4")
+ public void testSpecializedBeanAlwaysUsed()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java (from rev 150, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,356 @@
+package org.jboss.webbeans.test;
+
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.webbeans.AnnotationLiteral;
+import javax.webbeans.Current;
+import javax.webbeans.Dependent;
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
+import org.jboss.webbeans.bindings.DependentAnnotationLiteral;
+import org.jboss.webbeans.introspector.AnnotatedType;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
+import org.jboss.webbeans.test.annotations.FishStereotype;
+import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
+import org.jboss.webbeans.test.annotations.HornedMammalStereotype;
+import org.jboss.webbeans.test.annotations.Synchronous;
+import org.jboss.webbeans.test.beans.Antelope;
+import org.jboss.webbeans.test.beans.Chair;
+import org.jboss.webbeans.test.beans.Cow;
+import org.jboss.webbeans.test.beans.Goldfish;
+import org.jboss.webbeans.test.beans.Gorilla;
+import org.jboss.webbeans.test.beans.Haddock;
+import org.jboss.webbeans.test.beans.Horse;
+import org.jboss.webbeans.test.beans.Moose;
+import org.jboss.webbeans.test.beans.Order;
+import org.jboss.webbeans.test.beans.SeaBass;
+import org.jboss.webbeans.test.beans.Tuna;
+import org.jboss.webbeans.test.beans.broken.BeanWithTooManyDeploymentTypes;
+import org.jboss.webbeans.test.beans.broken.Carp;
+import org.jboss.webbeans.test.beans.broken.Pig;
+import org.jboss.webbeans.test.beans.broken.OuterBean.InnerBean;
+import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
+import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
+import org.jboss.webbeans.test.bindings.HornedMamalStereotypeAnnotationLiteral;
+import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
+import org.jboss.webbeans.util.Reflections;
+import org.testng.annotations.Test;
+
+@SpecVersion("20080925")
+public class SimpleBeanModelTest extends AbstractTest
+{
+
+ private abstract class NamedAnnotationLiteral extends AnnotationLiteral<Named> implements Named {}
+
+ // **** TESTS FOR DEPLOYMENT TYPE **** //
+
+ @Test @SpecAssertion(section="2.5.3")
+ public void testTooManyDeploymentTypes()
+ {
+ boolean exception = false;
+ try
+ {
+ new SimpleBeanModel<BeanWithTooManyDeploymentTypes>(new SimpleAnnotatedType<BeanWithTooManyDeploymentTypes>(BeanWithTooManyDeploymentTypes.class), getEmptyAnnotatedItem(BeanWithTooManyDeploymentTypes.class), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+ }
+
+ @Test @SpecAssertion(section="2.5.4")
+ public void testXmlDeploymentTypeOverridesJava()
+ {
+ Map<Class<? extends Annotation>, Annotation> xmlDefinedDeploymentTypeAnnotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ xmlDefinedDeploymentTypeAnnotations.put(AnotherDeploymentType.class, new AnotherDeploymentTypeAnnotationLiteral());
+ AnnotatedType<BeanWithTooManyDeploymentTypes> xmlDefinedDeploymentTypeAnnotatedItem = new SimpleAnnotatedType<BeanWithTooManyDeploymentTypes>(BeanWithTooManyDeploymentTypes.class, xmlDefinedDeploymentTypeAnnotations);
+
+ SimpleBeanModel<BeanWithTooManyDeploymentTypes> model = new SimpleBeanModel<BeanWithTooManyDeploymentTypes>(new SimpleAnnotatedType<BeanWithTooManyDeploymentTypes>(BeanWithTooManyDeploymentTypes.class), xmlDefinedDeploymentTypeAnnotatedItem, manager);
+ assert model.getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
+ @Test @SpecAssertion(section="2.5.5")
+ public void testXmlDefaultDeploymentType()
+ {
+ AnnotatedType<Antelope> antelopeAnnotatedItem = new SimpleAnnotatedType<Antelope>(Antelope.class, new HashMap<Class<? extends Annotation>, Annotation>());
+ SimpleBeanModel<Antelope> antelope = new SimpleBeanModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), antelopeAnnotatedItem, manager);
+ assert antelope.getDeploymentType().equals(Production.class);
+ }
+
+ @Test @SpecAssertion(section="2.5.4")
+ public void testXmlRespectsJavaDeploymentType()
+ {
+ AnnotatedType<Tuna> annotatedItem = new SimpleAnnotatedType<Tuna>(Tuna.class, new HashMap<Class<? extends Annotation>, Annotation>());
+ SimpleBeanModel<Tuna> tuna = new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
+ assert tuna.getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
+ @Test @SpecAssertion(section="2.5.7")
+ public void testDeploymentTypePrecedenceSelection()
+ {
+ Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ annotations.put(HornedMammalStereotype.class, new HornedMamalStereotypeAnnotationLiteral());
+ AnnotatedType<Moose> annotatedItem = new SimpleAnnotatedType<Moose>(Moose.class, annotations);
+
+ SimpleBeanModel<Moose> moose = new SimpleBeanModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), annotatedItem, manager);
+ assert moose.getDeploymentType().equals(HornedAnimalDeploymentType.class);
+
+ }
+
+ @Test @SpecAssertion(section="2.7.2")
+ public void testDeploymentTypeSpecifiedAndStereotyped()
+ {
+ Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
+ AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ assert trout.getScopeType().equals(RequestScoped.class);
+ }
+
+ // **** TESTS FOR SCOPES **** //
+
+
+
+ // **** TESTS FOR BEAN NAME **** /
+
+ @Test @SpecAssertion(section="2.6.1")
+ public void testDefaultNamed()
+ {
+ SimpleBeanModel<Haddock> haddock = new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), manager);
+ assert haddock.getName() != null;
+ assert haddock.getName().equals("haddock");
+ }
+
+ @Test @SpecAssertion(section="2.6.2")
+ public void testDefaultXmlNamed()
+ {
+ Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ annotations.put(Named.class, new NamedAnnotationLiteral() {
+
+ public String value()
+ {
+ return "";
+ }
+
+ });
+ AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+
+ assert trout.getName() != null;
+ assert trout.getName().equals("seaBass");
+ }
+
+ @Test @SpecAssertion(section="2.6.2")
+ public void testNonDefaultXmlNamed()
+ {
+ Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ annotations.put(Named.class, new NamedAnnotationLiteral(){
+
+ public String value()
+ {
+ return "aTrout";
+ }
+
+ });
+ AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+
+ assert trout.getName().equals("aTrout");
+ }
+
+ @Test @SpecAssertion(section="2.6.4")
+ public void testNotNamed()
+ {
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), manager);
+ assert trout.getName() == null;
+ }
+
+ @Test @SpecAssertion(section="2.6.1")
+ public void testNonDefaultNamed()
+ {
+ SimpleBeanModel<Moose> moose = new SimpleBeanModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), getEmptyAnnotatedItem(Moose.class), manager);
+ assert moose.getName().equals("aMoose");
+ }
+
+
+ // **** TESTS FOR STEREOTYPES **** //
+
+ @SuppressWarnings("unchecked")
+ @Test @SpecAssertion(section="2.7.3")
+ public void testStereotypeDeclaredInXmlAndJava()
+ {
+ Map<Class<? extends Annotation>, Annotation> orderXmlAnnotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ orderXmlAnnotations.put(Current.class, new CurrentAnnotationLiteral());
+ orderXmlAnnotations.put(Synchronous.class, new SynchronousAnnotationLiteral());
+ orderXmlAnnotations.put(Named.class, new NamedAnnotationLiteral (){
+
+ public String value()
+ {
+ return "currentSynchronousOrder";
+ }
+
+ });
+ AnnotatedType currentSynchronousOrderAnnotatedItem = new SimpleAnnotatedType(Order.class, orderXmlAnnotations);
+
+ SimpleBeanModel<Order> order = new SimpleBeanModel<Order>(new SimpleAnnotatedType(Order.class), currentSynchronousOrderAnnotatedItem, manager);
+ assert Production.class.equals(order.getDeploymentType());
+ assert "currentSynchronousOrder".equals(order.getName());
+ assert order.getBindingTypes().size() == 2;
+ assert Reflections.annotationSetMatches(order.getBindingTypes(), Current.class, Synchronous.class);
+ assert order.getScopeType().equals(Dependent.class);
+ }
+
+ @Test @SpecAssertion(section="2.7.2")
+ public void testSingleStereotype()
+ {
+ SimpleBeanModel<Gorilla> gorilla = new SimpleBeanModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedItem(Gorilla.class), manager);
+ assert gorilla.getName() == null;
+ assert gorilla.getDeploymentType().equals(Production.class);
+ assert gorilla.getBindingTypes().iterator().next().annotationType().equals(Current.class);
+ assert gorilla.getScopeType().equals(RequestScoped.class);
+ }
+
+ @Test @SpecAssertion(section="2.7.4")
+ public void testRequiredTypeIsImplemented()
+ {
+ try
+ {
+ new SimpleBeanModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedItem(Gorilla.class), manager);
+ }
+ catch (Exception e)
+ {
+ assert false;
+ }
+
+ }
+
+ @Test(expectedExceptions=Exception.class) @SpecAssertion(section="2.7.4")
+ public void testRequiredTypeIsNotImplemented()
+ {
+ new SimpleBeanModel<Chair>(new SimpleAnnotatedType<Chair>(Chair.class), getEmptyAnnotatedItem(Chair.class), manager);
+ }
+
+ @Test @SpecAssertion(section="2.7.4")
+ public void testScopeIsSupported()
+ {
+ try
+ {
+ new SimpleBeanModel<Goldfish>(new SimpleAnnotatedType<Goldfish>(Goldfish.class), getEmptyAnnotatedItem(Goldfish.class), manager);
+ }
+ catch (Exception e)
+ {
+ assert false;
+ }
+
+ }
+
+ @Test(expectedExceptions=Exception.class) @SpecAssertion(section="2.7.4")
+ public void testScopeIsNotSupported()
+ {
+ new SimpleBeanModel<Carp>(new SimpleAnnotatedType<Carp>(Carp.class), getEmptyAnnotatedItem(Carp.class), manager);
+ }
+
+ @Test @SpecAssertion(section="2.7.2")
+ public void testMultipleStereotypes()
+ {
+ assert false;
+ }
+
+ //*** BEAN CLASS CHECKS ****//
+
+ @Test
+ public void testAbstractClassIsNotAllowed()
+ {
+ boolean exception = false;
+ try
+ {
+ new SimpleBeanModel<Cow>(new SimpleAnnotatedType<Cow>(Cow.class), getEmptyAnnotatedItem(Cow.class), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+ }
+
+ @Test
+ public void testInnerClassIsNotAllowed()
+ {
+ boolean exception = false;
+ try
+ {
+ new SimpleBeanModel<InnerBean>(new SimpleAnnotatedType<InnerBean>(InnerBean.class), getEmptyAnnotatedItem(InnerBean.class), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+ }
+
+ @Test
+ public void testFinalClassMustBeDependentScoped()
+ {
+ boolean exception = false;
+ try
+ {
+ new SimpleBeanModel<Horse>(new SimpleAnnotatedType<Horse>(Horse.class), getEmptyAnnotatedItem(Horse.class), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+
+ Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ annotations.put(Dependent.class, new DependentAnnotationLiteral());
+ AnnotatedType<Horse> annotatedItem = new SimpleAnnotatedType<Horse>(Horse.class, annotations);
+ try
+ {
+ new SimpleBeanModel<Horse>(new SimpleAnnotatedType<Horse>(Horse.class), annotatedItem, manager);
+ }
+ catch (Exception e)
+ {
+ assert false;
+ }
+ }
+
+ @Test
+ public void testClassWithFinalMethodMustBeDependentScoped()
+ {
+ boolean exception = false;
+ try
+ {
+ new SimpleBeanModel<Pig>(new SimpleAnnotatedType<Pig>(Pig.class), getEmptyAnnotatedItem(Pig.class), manager);
+ }
+ catch (Exception e)
+ {
+ exception = true;
+ }
+ assert exception;
+
+ Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ annotations.put(Dependent.class, new DependentAnnotationLiteral());
+ AnnotatedType<Pig> annotatedItem = new SimpleAnnotatedType<Pig>(Pig.class, annotations);
+ try
+ {
+ new SimpleBeanModel<Pig>(new SimpleAnnotatedType<Pig>(Pig.class), annotatedItem, manager);
+ }
+ catch (Exception e)
+ {
+ assert false;
+ }
+ }
+
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentLifecycleTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentLifecycleTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,22 +0,0 @@
-package org.jboss.webbeans.test;
-
-import org.testng.annotations.Test;
-
-public class SimpleComponentLifecycleTest
-{
-
- @Test(groups="componentLifecycle") @SpecAssertion(section="3.1.3")
- public void testInjectionOfParametersIntoComponentConstructor()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups="specialization") @SpecAssertion(section="3.1.4")
- public void testSpecializedComponentAlwaysUsed()
- {
- // TODO Placeholder
- assert false;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,356 +0,0 @@
-package org.jboss.webbeans.test;
-
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
-
-import java.lang.annotation.Annotation;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.webbeans.AnnotationLiteral;
-import javax.webbeans.Current;
-import javax.webbeans.Dependent;
-import javax.webbeans.Named;
-import javax.webbeans.Production;
-import javax.webbeans.RequestScoped;
-
-import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
-import org.jboss.webbeans.bindings.DependentAnnotationLiteral;
-import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.bean.SimpleBeanModel;
-import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
-import org.jboss.webbeans.test.annotations.FishStereotype;
-import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
-import org.jboss.webbeans.test.annotations.HornedMammalStereotype;
-import org.jboss.webbeans.test.annotations.Synchronous;
-import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.HornedMamalStereotypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
-import org.jboss.webbeans.test.components.Antelope;
-import org.jboss.webbeans.test.components.Chair;
-import org.jboss.webbeans.test.components.Cow;
-import org.jboss.webbeans.test.components.Goldfish;
-import org.jboss.webbeans.test.components.Gorilla;
-import org.jboss.webbeans.test.components.Haddock;
-import org.jboss.webbeans.test.components.Horse;
-import org.jboss.webbeans.test.components.Moose;
-import org.jboss.webbeans.test.components.Order;
-import org.jboss.webbeans.test.components.SeaBass;
-import org.jboss.webbeans.test.components.Tuna;
-import org.jboss.webbeans.test.components.broken.Carp;
-import org.jboss.webbeans.test.components.broken.ComponentWithTooManyDeploymentTypes;
-import org.jboss.webbeans.test.components.broken.Pig;
-import org.jboss.webbeans.test.components.broken.OuterComponent.InnerComponent;
-import org.jboss.webbeans.util.Reflections;
-import org.testng.annotations.Test;
-
-@SpecVersion("20080925")
-public class SimpleComponentModelTest extends AbstractTest
-{
-
- private abstract class NamedAnnotationLiteral extends AnnotationLiteral<Named> implements Named {}
-
- // **** TESTS FOR DEPLOYMENT TYPE **** //
-
- @Test @SpecAssertion(section="2.5.3")
- public void testTooManyDeploymentTypes()
- {
- boolean exception = false;
- try
- {
- new SimpleBeanModel<ComponentWithTooManyDeploymentTypes>(new SimpleAnnotatedType<ComponentWithTooManyDeploymentTypes>(ComponentWithTooManyDeploymentTypes.class), getEmptyAnnotatedItem(ComponentWithTooManyDeploymentTypes.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
- }
-
- @Test @SpecAssertion(section="2.5.4")
- public void testXmlDeploymentTypeOverridesJava()
- {
- Map<Class<? extends Annotation>, Annotation> xmlDefinedDeploymentTypeAnnotations = new HashMap<Class<? extends Annotation>, Annotation>();
- xmlDefinedDeploymentTypeAnnotations.put(AnotherDeploymentType.class, new AnotherDeploymentTypeAnnotationLiteral());
- AnnotatedType<ComponentWithTooManyDeploymentTypes> xmlDefinedDeploymentTypeAnnotatedItem = new SimpleAnnotatedType<ComponentWithTooManyDeploymentTypes>(ComponentWithTooManyDeploymentTypes.class, xmlDefinedDeploymentTypeAnnotations);
-
- SimpleBeanModel<ComponentWithTooManyDeploymentTypes> component = new SimpleBeanModel<ComponentWithTooManyDeploymentTypes>(new SimpleAnnotatedType<ComponentWithTooManyDeploymentTypes>(ComponentWithTooManyDeploymentTypes.class), xmlDefinedDeploymentTypeAnnotatedItem, manager);
- assert component.getDeploymentType().equals(AnotherDeploymentType.class);
- }
-
- @Test @SpecAssertion(section="2.5.5")
- public void testXmlDefaultDeploymentType()
- {
- AnnotatedType<Antelope> antelopeAnnotatedItem = new SimpleAnnotatedType<Antelope>(Antelope.class, new HashMap<Class<? extends Annotation>, Annotation>());
- SimpleBeanModel<Antelope> antelope = new SimpleBeanModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), antelopeAnnotatedItem, manager);
- assert antelope.getDeploymentType().equals(Production.class);
- }
-
- @Test @SpecAssertion(section="2.5.4")
- public void testXmlRespectsJavaDeploymentType()
- {
- AnnotatedType<Tuna> annotatedItem = new SimpleAnnotatedType<Tuna>(Tuna.class, new HashMap<Class<? extends Annotation>, Annotation>());
- SimpleBeanModel<Tuna> tuna = new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
- assert tuna.getDeploymentType().equals(AnotherDeploymentType.class);
- }
-
- @Test @SpecAssertion(section="2.5.7")
- public void testDeploymentTypePrecedenceSelection()
- {
- Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- annotations.put(HornedMammalStereotype.class, new HornedMamalStereotypeAnnotationLiteral());
- AnnotatedType<Moose> annotatedItem = new SimpleAnnotatedType<Moose>(Moose.class, annotations);
-
- SimpleBeanModel<Moose> moose = new SimpleBeanModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), annotatedItem, manager);
- assert moose.getDeploymentType().equals(HornedAnimalDeploymentType.class);
-
- }
-
- @Test @SpecAssertion(section="2.7.2")
- public void testDeploymentTypeSpecifiedAndStereotyped()
- {
- Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
- AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
- assert trout.getScopeType().equals(RequestScoped.class);
- }
-
- // **** TESTS FOR SCOPES **** //
-
-
-
- // **** TESTS FOR COMPONENT NAME **** /
-
- @Test @SpecAssertion(section="2.6.1")
- public void testDefaultNamed()
- {
- SimpleBeanModel<Haddock> haddock = new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), manager);
- assert haddock.getName() != null;
- assert haddock.getName().equals("haddock");
- }
-
- @Test @SpecAssertion(section="2.6.2")
- public void testDefaultXmlNamed()
- {
- Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- annotations.put(Named.class, new NamedAnnotationLiteral() {
-
- public String value()
- {
- return "";
- }
-
- });
- AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
-
- assert trout.getName() != null;
- assert trout.getName().equals("seaBass");
- }
-
- @Test @SpecAssertion(section="2.6.2")
- public void testNonDefaultXmlNamed()
- {
- Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- annotations.put(Named.class, new NamedAnnotationLiteral(){
-
- public String value()
- {
- return "aTrout";
- }
-
- });
- AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
-
- assert trout.getName().equals("aTrout");
- }
-
- @Test @SpecAssertion(section="2.6.4")
- public void testNotNamed()
- {
- SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), manager);
- assert trout.getName() == null;
- }
-
- @Test @SpecAssertion(section="2.6.1")
- public void testNonDefaultNamed()
- {
- SimpleBeanModel<Moose> moose = new SimpleBeanModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), getEmptyAnnotatedItem(Moose.class), manager);
- assert moose.getName().equals("aMoose");
- }
-
-
- // **** TESTS FOR STEREOTYPES **** //
-
- @SuppressWarnings("unchecked")
- @Test @SpecAssertion(section="2.7.3")
- public void testStereotypeDeclaredInXmlAndJava()
- {
- Map<Class<? extends Annotation>, Annotation> orderXmlAnnotations = new HashMap<Class<? extends Annotation>, Annotation>();
- orderXmlAnnotations.put(Current.class, new CurrentAnnotationLiteral());
- orderXmlAnnotations.put(Synchronous.class, new SynchronousAnnotationLiteral());
- orderXmlAnnotations.put(Named.class, new NamedAnnotationLiteral (){
-
- public String value()
- {
- return "currentSynchronousOrder";
- }
-
- });
- AnnotatedType currentSynchronousOrderAnnotatedItem = new SimpleAnnotatedType(Order.class, orderXmlAnnotations);
-
- SimpleBeanModel<Order> order = new SimpleBeanModel<Order>(new SimpleAnnotatedType(Order.class), currentSynchronousOrderAnnotatedItem, manager);
- assert Production.class.equals(order.getDeploymentType());
- assert "currentSynchronousOrder".equals(order.getName());
- assert order.getBindingTypes().size() == 2;
- assert Reflections.annotationSetMatches(order.getBindingTypes(), Current.class, Synchronous.class);
- assert order.getScopeType().equals(Dependent.class);
- }
-
- @Test @SpecAssertion(section="2.7.2")
- public void testSingleStereotype()
- {
- SimpleBeanModel<Gorilla> gorilla = new SimpleBeanModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedItem(Gorilla.class), manager);
- assert gorilla.getName() == null;
- assert gorilla.getDeploymentType().equals(Production.class);
- assert gorilla.getBindingTypes().iterator().next().annotationType().equals(Current.class);
- assert gorilla.getScopeType().equals(RequestScoped.class);
- }
-
- @Test @SpecAssertion(section="2.7.4")
- public void testRequiredTypeIsImplemented()
- {
- try
- {
- new SimpleBeanModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedItem(Gorilla.class), manager);
- }
- catch (Exception e)
- {
- assert false;
- }
-
- }
-
- @Test(expectedExceptions=Exception.class) @SpecAssertion(section="2.7.4")
- public void testRequiredTypeIsNotImplemented()
- {
- new SimpleBeanModel<Chair>(new SimpleAnnotatedType<Chair>(Chair.class), getEmptyAnnotatedItem(Chair.class), manager);
- }
-
- @Test @SpecAssertion(section="2.7.4")
- public void testScopeIsSupported()
- {
- try
- {
- new SimpleBeanModel<Goldfish>(new SimpleAnnotatedType<Goldfish>(Goldfish.class), getEmptyAnnotatedItem(Goldfish.class), manager);
- }
- catch (Exception e)
- {
- assert false;
- }
-
- }
-
- @Test(expectedExceptions=Exception.class) @SpecAssertion(section="2.7.4")
- public void testScopeIsNotSupported()
- {
- new SimpleBeanModel<Carp>(new SimpleAnnotatedType<Carp>(Carp.class), getEmptyAnnotatedItem(Carp.class), manager);
- }
-
- @Test @SpecAssertion(section="2.7.2")
- public void testMultipleStereotypes()
- {
- assert false;
- }
-
- //*** COMPONENT CLASS CHECKS ****//
-
- @Test
- public void testAbstractClassIsNotAllowed()
- {
- boolean exception = false;
- try
- {
- new SimpleBeanModel<Cow>(new SimpleAnnotatedType<Cow>(Cow.class), getEmptyAnnotatedItem(Cow.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
- }
-
- @Test
- public void testInnerClassIsNotAllowed()
- {
- boolean exception = false;
- try
- {
- new SimpleBeanModel<InnerComponent>(new SimpleAnnotatedType<InnerComponent>(InnerComponent.class), getEmptyAnnotatedItem(InnerComponent.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
- }
-
- @Test
- public void testFinalClassMustBeDependentScoped()
- {
- boolean exception = false;
- try
- {
- new SimpleBeanModel<Horse>(new SimpleAnnotatedType<Horse>(Horse.class), getEmptyAnnotatedItem(Horse.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
-
- Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- annotations.put(Dependent.class, new DependentAnnotationLiteral());
- AnnotatedType<Horse> annotatedItem = new SimpleAnnotatedType<Horse>(Horse.class, annotations);
- try
- {
- new SimpleBeanModel<Horse>(new SimpleAnnotatedType<Horse>(Horse.class), annotatedItem, manager);
- }
- catch (Exception e)
- {
- assert false;
- }
- }
-
- @Test
- public void testClassWithFinalMethodMustBeDependentScoped()
- {
- boolean exception = false;
- try
- {
- new SimpleBeanModel<Pig>(new SimpleAnnotatedType<Pig>(Pig.class), getEmptyAnnotatedItem(Pig.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
-
- Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- annotations.put(Dependent.class, new DependentAnnotationLiteral());
- AnnotatedType<Pig> annotatedItem = new SimpleAnnotatedType<Pig>(Pig.class, annotations);
- try
- {
- new SimpleBeanModel<Pig>(new SimpleAnnotatedType<Pig>(Pig.class), annotatedItem, manager);
- }
- catch (Exception e)
- {
- assert false;
- }
- }
-
-
-}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -14,8 +14,8 @@
import org.jboss.webbeans.test.annotations.broken.StereotypeWithNonEmptyNamed;
import org.jboss.webbeans.test.annotations.broken.StereotypeWithTooManyDeploymentTypes;
import org.jboss.webbeans.test.annotations.broken.StereotypeWithTooManyScopeTypes;
-import org.jboss.webbeans.test.components.Animal;
-import org.jboss.webbeans.test.components.Order;
+import org.jboss.webbeans.test.beans.Animal;
+import org.jboss.webbeans.test.beans.Order;
import org.testng.annotations.Test;
@SpecVersion("20080925")
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -17,19 +17,19 @@
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.Whitefish;
+import org.jboss.webbeans.test.beans.Animal;
+import org.jboss.webbeans.test.beans.Cod;
+import org.jboss.webbeans.test.beans.Farmer;
+import org.jboss.webbeans.test.beans.FishFarm;
+import org.jboss.webbeans.test.beans.Haddock;
+import org.jboss.webbeans.test.beans.Plaice;
+import org.jboss.webbeans.test.beans.Salmon;
+import org.jboss.webbeans.test.beans.ScottishFish;
+import org.jboss.webbeans.test.beans.ScottishFishFarmer;
+import org.jboss.webbeans.test.beans.SeaBass;
+import org.jboss.webbeans.test.beans.Sole;
+import org.jboss.webbeans.test.beans.Tuna;
import org.jboss.webbeans.test.bindings.ChunkyAnnotationLiteral;
-import org.jboss.webbeans.test.components.Animal;
-import org.jboss.webbeans.test.components.Cod;
-import org.jboss.webbeans.test.components.Farmer;
-import org.jboss.webbeans.test.components.FishFarm;
-import org.jboss.webbeans.test.components.Haddock;
-import org.jboss.webbeans.test.components.Plaice;
-import org.jboss.webbeans.test.components.Salmon;
-import org.jboss.webbeans.test.components.ScottishFish;
-import org.jboss.webbeans.test.components.ScottishFishFarmer;
-import org.jboss.webbeans.test.components.SeaBass;
-import org.jboss.webbeans.test.components.Sole;
-import org.jboss.webbeans.test.components.Tuna;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.Test;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnimalOrderStereotype.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnimalOrderStereotype.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnimalOrderStereotype.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -8,8 +8,8 @@
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.test.components.Animal;
-import org.jboss.webbeans.test.components.Order;
+import org.jboss.webbeans.test.beans.Animal;
+import org.jboss.webbeans.test.beans.Order;
@Stereotype(requiredTypes={Animal.class, Order.class})
@Target( { TYPE })
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnimalStereotype.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnimalStereotype.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnimalStereotype.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -9,7 +9,7 @@
import javax.webbeans.RequestScoped;
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.test.components.Animal;
+import org.jboss.webbeans.test.beans.Animal;
@Stereotype(requiredTypes=Animal.class)
@Target( { TYPE })
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/FishStereotype.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/FishStereotype.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/FishStereotype.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -9,7 +9,7 @@
import javax.webbeans.ApplicationScoped;
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.test.components.Animal;
+import org.jboss.webbeans.test.beans.Animal;
@Stereotype(requiredTypes=Animal.class)
@Target( { TYPE })
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/HornedMammalStereotype.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/HornedMammalStereotype.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/HornedMammalStereotype.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -8,7 +8,7 @@
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.test.components.Animal;
+import org.jboss.webbeans.test.beans.Animal;
@Stereotype(requiredTypes=Animal.class)
@Target( { TYPE })
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/MammalStereotype.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/MammalStereotype.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/MammalStereotype.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -8,7 +8,7 @@
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.test.components.Animal;
+import org.jboss.webbeans.test.beans.Animal;
@Stereotype(requiredTypes=Animal.class)
@Target( { TYPE })
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/RequestScopedAnimalStereotype.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/RequestScopedAnimalStereotype.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/RequestScopedAnimalStereotype.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -9,7 +9,7 @@
import javax.webbeans.RequestScoped;
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.test.components.Animal;
+import org.jboss.webbeans.test.beans.Animal;
@Stereotype(requiredTypes=Animal.class, supportedScopes=RequestScoped.class)
@Target( { TYPE })
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/RiverFishStereotype.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/RiverFishStereotype.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/RiverFishStereotype.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -9,7 +9,7 @@
import javax.webbeans.ApplicationScoped;
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.test.components.Animal;
+import org.jboss.webbeans.test.beans.Animal;
@Stereotype(requiredTypes=Animal.class)
@Target( { TYPE })
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Animal.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Animal.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Animal.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Animal.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public interface Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Animal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Antelope.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Antelope.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Antelope.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Antelope.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public class Antelope implements Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Antelope.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Baboon.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Baboon.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Baboon.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Baboon.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Remote;
+import javax.webbeans.Production;
+
+@Remote
+@Production
+// TODO @BoundTo("/beans/baboon")
+public interface Baboon extends Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Baboon.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BeanWithTooManyScopeTypes.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ComponentWithTooManyScopeTypes.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BeanWithTooManyScopeTypes.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BeanWithTooManyScopeTypes.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.ConversationScoped;
+import javax.webbeans.RequestScoped;
+
+@RequestScoped
+@ConversationScoped
+public class BeanWithTooManyScopeTypes
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BeanWithTooManyScopeTypes.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Bear.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Bear.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Bear.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Bear.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Stateless;
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+@Production
+@RequestScoped
+@Stateless
+public class Bear
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Bear.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BlackWidow.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/BlackWidow.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BlackWidow.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BlackWidow.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public class BlackWidow extends Spider implements DeadlySpider
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/BlackWidow.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Carp.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Carp.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Carp.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Carp.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.test.beans;
+
+import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
+import org.jboss.webbeans.test.beans.Animal;
+
+@RequestScopedAnimalStereotype
+public class Carp implements Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Carp.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cat.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cat.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cat.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cat.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Synchronous;
+
+@Production
+@Synchronous
+public class Cat
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cat.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Chair.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Chair.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Chair.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Chair.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import org.jboss.webbeans.test.annotations.AnimalStereotype;
+
+@AnimalStereotype
+public class Chair
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Chair.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cheetah.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cheetah.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cheetah.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cheetah.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Remove;
+import javax.webbeans.Destructor;
+import javax.webbeans.Production;
+
+@Production
+public class Cheetah
+{
+
+ @Remove @Destructor
+ public void remove()
+ {
+
+ }
+
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cheetah.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Chicken.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Chicken.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Chicken.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Chicken.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.Production;
+
+@Production
+public class Chicken
+{
+
+ @Initializer
+ public Chicken(String foo)
+ {
+ }
+
+ @Initializer
+ public Chicken(String foo, Double bar)
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Chicken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cod.java (from rev 144, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cod.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cod.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cod.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Chunky;
+import org.jboss.webbeans.test.annotations.Whitefish;
+
+@Production
+@Whitefish
+@Chunky(realChunky=true)
+@Named("whitefish")
+public class Cod implements ScottishFish
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cougar.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cougar.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cougar.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cougar.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,31 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Destructor;
+import javax.webbeans.Production;
+
+@Production
+@Stateful
+public class Cougar
+{
+
+ @Remove
+ public void remove()
+ {
+
+ }
+
+ @Remove @Destructor
+ public void remove1()
+ {
+
+ }
+
+ @Remove @Destructor
+ public void remove2()
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cougar.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cow.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cow.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cow.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cow.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+@Production
+public abstract class Cow
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Cow.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DaddyLongLegs.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DaddyLongLegs.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DaddyLongLegs.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DaddyLongLegs.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public class DaddyLongLegs extends Spider
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DaddyLongLegs.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DangerCall.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DangerCall.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DangerCall.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DangerCall.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+@Production
+public class DangerCall
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DangerCall.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DeadlyAnimal.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DeadlyAnimal.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DeadlyAnimal.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DeadlyAnimal.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public interface DeadlyAnimal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DeadlyAnimal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DeadlySpider.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DeadlySpider.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DeadlySpider.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DeadlySpider.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public interface DeadlySpider extends DeadlyAnimal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DeadlySpider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DefangedTarantula.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DefangedTarantula.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DefangedTarantula.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DefangedTarantula.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public class DefangedTarantula extends Tarantula
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/DefangedTarantula.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Donkey.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Donkey.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Donkey.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Donkey.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+@Production
+public class Donkey
+{
+
+ public Donkey(String foo)
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Donkey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Duck.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Duck.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Duck.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Duck.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Synchronous;
+
+@Production
+public class Duck
+{
+
+ public Duck(String foo)
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+ public Duck(String foo, @Synchronous Integer bar)
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Duck.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Elephant.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Elephant.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Elephant.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Elephant.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,25 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Destructor;
+import javax.webbeans.Production;
+
+@Production
+@Stateful
+public class Elephant
+{
+
+ @Remove
+ public void remove1()
+ {
+
+ }
+
+ @Remove @Destructor
+ public void remove2()
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Elephant.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Farmer.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Farmer.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Farmer.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Farmer.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+@Production
+public class Farmer<T>
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Farmer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FishFarm.java (from rev 144, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FishFarm.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FishFarm.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,37 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Current;
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Chunky;
+import org.jboss.webbeans.test.annotations.Whitefish;
+
+@Production
+public class FishFarm
+{
+
+ @SuppressWarnings("unused")
+ @Current
+ private Tuna tuna;
+
+ @SuppressWarnings("unused")
+ @Current
+ private Animal animal;
+
+ @SuppressWarnings("unused")
+ @Whitefish
+ private ScottishFish whiteScottishFish;
+
+ @SuppressWarnings("unused")
+ @Whitefish
+ private Animal whiteFish;
+
+ @SuppressWarnings("unused")
+ @Whitefish @Chunky(realChunky=true)
+ private Animal realChunkyWhiteFish;
+
+ @SuppressWarnings("unused")
+ @Current
+ private Farmer<ScottishFish> scottishFishFarmer;
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FishFarm.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Giraffe.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Giraffe.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Giraffe.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Giraffe.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class Giraffe
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Giraffe.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goat.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goat.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goat.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goat.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Asynchronous;
+import org.jboss.webbeans.test.annotations.Synchronous;
+
+@Production
+public class Goat
+{
+
+ public Goat(@Synchronous String foo)
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+ public Goat(@Asynchronous String foo, String bar)
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goat.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goldfish.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goldfish.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goldfish.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goldfish.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
+
+@RequestScopedAnimalStereotype
+@RequestScoped
+@Production
+public class Goldfish implements Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goldfish.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goose.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goose.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goose.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goose.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Synchronous;
+
+@Production
+public class Goose
+{
+
+ public Goose(@Synchronous String foo)
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Initializer
+ public Goose(String foo, String bar)
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Goose.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Gorilla.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Gorilla.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Gorilla.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Gorilla.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.AnimalStereotype;
+
+@AnimalStereotype
+@Production
+public class Gorilla implements Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Gorilla.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Haddock.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Haddock.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Haddock.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Haddock.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Whitefish;
+
+@Production
+@Named
+public class Haddock implements Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Haddock.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Horse.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Horse.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Horse.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Horse.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+@Production
+@RequestScoped
+public final class Horse
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Horse.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/LadybirdSpider.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/LadybirdSpider.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/LadybirdSpider.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/LadybirdSpider.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public class LadybirdSpider extends Spider
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/LadybirdSpider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Leopard.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.MessageDriven;
+import javax.webbeans.Production;
+
+@Production
+@MessageDriven
+public class Leopard
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Leopard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Lion.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Lion.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Lion.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Lion.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Stateless;
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+
+@Production
+@Stateless
+@Named
+public class Lion
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Lion.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Moose.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Moose.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Moose.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Moose.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Named;
+
+import org.jboss.webbeans.test.annotations.MammalStereotype;
+
+@MammalStereotype
+@Named("aMoose")
+public class Moose implements Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Moose.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Orangutan.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Orangutan.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Orangutan.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Orangutan.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Remote;
+import javax.webbeans.Destructor;
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+
+@Remote
+@Production
+//TODO @BoundTo("/beans/orangutan")
+@Named
+public interface Orangutan extends Animal
+{
+
+ @Destructor
+ public void removeOrangutan();
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Orangutan.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Order.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Order.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Order.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Order.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+@Production
+public class Order
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Order.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Panther.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Panther.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Panther.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Panther.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Production;
+
+@Production
+@Stateful
+public class Panther
+{
+
+ @Remove
+ public void remove(String foo)
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Panther.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Plaice.java (from rev 148, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Plaice.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Plaice.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Named;
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
+import org.jboss.webbeans.test.annotations.Whitefish;
+
+@AnotherDeploymentType
+@Whitefish
+@Named("whitefish")
+@RequestScoped
+public final class Plaice implements Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Plaice.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Puma.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Puma.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Puma.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Puma.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Stateful;
+import javax.webbeans.Production;
+
+@Stateful
+@Production
+public class Puma
+{
+
+ public void remove1()
+ {
+
+ }
+
+ public void remove2()
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Puma.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Salmon.java (from rev 144, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Salmon.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Salmon.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Salmon.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+
+@Production
+@Named
+public class Salmon implements ScottishFish
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Salmon.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ScottishFish.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFish.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ScottishFish.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ScottishFish.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public interface ScottishFish extends Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ScottishFish.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ScottishFishFarmer.java (from rev 144, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFishFarmer.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ScottishFishFarmer.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ScottishFishFarmer.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+@Production
+public class ScottishFishFarmer extends Farmer<ScottishFish>
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/ScottishFishFarmer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SeaBass.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/SeaBass.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SeaBass.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SeaBass.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+@Production
+@RequestScoped
+public class SeaBass implements Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SeaBass.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Sheep.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sheep.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Sheep.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Sheep.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Initializer;
+import javax.webbeans.Production;
+
+@Production
+public class Sheep
+{
+
+
+ public Sheep(String foo)
+ {
+
+ }
+
+ @Initializer
+ public Sheep(String foo, Double bar)
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Sheep.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Sole.java (from rev 144, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sole.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Sole.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Sole.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Whitefish;
+
+@Production
+@Whitefish
+@Named("whitefish")
+public class Sole implements ScottishFish
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Sole.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Spider.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Spider.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Spider.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Spider.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public class Spider implements Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Spider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SpiderProducer.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/SpiderProducer.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SpiderProducer.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SpiderProducer.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,44 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Named;
+import javax.webbeans.Produces;
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Tame;
+
+@Production
+public class SpiderProducer
+{
+
+ @Produces @Tame public Tarantula produceTameTarantula()
+ {
+ return new DefangedTarantula();
+ }
+
+ @Produces public Tarantula produceTarantula()
+ {
+ return new Tarantula();
+ }
+
+ @Produces @Dependent public final TrapdoorSpider produceTrapdoorSpider()
+ {
+ return new TrapdoorSpider();
+ }
+
+ @Produces @Named("blackWidow") public BlackWidow produceBlackWidow()
+ {
+ return new BlackWidow();
+ }
+
+ @Produces @Named public DaddyLongLegs produceDaddyLongLegs()
+ {
+ return new DaddyLongLegs();
+ }
+
+ @Produces @Named public LadybirdSpider getLadybirdSpider()
+ {
+ return new LadybirdSpider();
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SpiderProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/TameOrangutan.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/TameOrangutan.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/TameOrangutan.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/TameOrangutan.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Remote;
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Tame;
+
+@Remote
+@Production
+// TODO @BoundTo("/beans/tame/orangutan")
+@Tame
+@Named
+public interface TameOrangutan extends Orangutan
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/TameOrangutan.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tarantula.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tarantula.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tarantula.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tarantula.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public class Tarantula extends Spider implements DeadlySpider
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tarantula.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tiger.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tiger.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tiger.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tiger.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Synchronous;
+
+@Production
+@Stateful
+@Synchronous
+public class Tiger
+{
+
+ @Remove
+ public void remove()
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tiger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/TrapdoorSpider.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/TrapdoorSpider.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/TrapdoorSpider.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/TrapdoorSpider.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.beans;
+
+public class TrapdoorSpider
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/TrapdoorSpider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tuna.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tuna.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tuna.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tuna.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
+
+@AnotherDeploymentType
+public class Tuna
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Tuna.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Turkey.java (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Turkey.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Turkey.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Turkey.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Production;
+
+@Production
+public class Turkey
+{
+
+ public Turkey(String foo)
+ {
+
+ }
+
+ public Turkey(String foo, Integer bar)
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Turkey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken (from rev 140, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken)
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithFinalProducerMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithFinalProducerMethod.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithFinalProducerMethod.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import javax.webbeans.Produces;
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+@Production
+public class BeanWithFinalProducerMethod
+{
+
+ @Produces @RequestScoped public final String getString()
+ {
+ return "Pete";
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithFinalProducerMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithStaticProducerMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithStaticProducerMethod.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithStaticProducerMethod.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import javax.webbeans.Produces;
+import javax.webbeans.Production;
+
+@Production
+public class BeanWithStaticProducerMethod
+{
+
+ @Produces public static String getString()
+ {
+ return "Pete";
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithStaticProducerMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithTooManyDeploymentTypes.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithTooManyDeploymentTypes.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithTooManyDeploymentTypes.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
+
+@Production
+@AnotherDeploymentType
+public class BeanWithTooManyDeploymentTypes
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/BeanWithTooManyDeploymentTypes.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Carp.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Carp.java 2008-10-24 12:42:57 UTC (rev 140)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Carp.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,10 +0,0 @@
-package org.jboss.webbeans.test.components.broken;
-
-import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
-import org.jboss.webbeans.test.components.Animal;
-
-@RequestScopedAnimalStereotype
-public class Carp implements Animal
-{
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Carp.java (from rev 151, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Carp.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Carp.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Carp.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
+import org.jboss.webbeans.test.beans.Animal;
+
+@RequestScopedAnimalStereotype
+public class Carp implements Animal
+{
+
+}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Chimpanzee.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Chimpanzee.java 2008-10-24 12:42:57 UTC (rev 140)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Chimpanzee.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.test.components.broken;
-
-import javax.ejb.Remote;
-import javax.webbeans.Destructor;
-import javax.webbeans.Production;
-
-@Remote
-// TODO @BoundTo("/beans/Chimpanzee")
-@Production
-public interface Chimpanzee
-{
-
- @Destructor
- public void remove(String foo);
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Chimpanzee.java (from rev 151, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Chimpanzee.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Chimpanzee.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Chimpanzee.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import javax.ejb.Remote;
+import javax.webbeans.Destructor;
+import javax.webbeans.Production;
+
+@Remote
+// TODO @BoundTo("/beans/Chimpanzee")
+@Production
+public interface Chimpanzee
+{
+
+ @Destructor
+ public void remove(String foo);
+
+}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/ComponentWithFinalProducerMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/ComponentWithFinalProducerMethod.java 2008-10-24 12:42:57 UTC (rev 140)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/ComponentWithFinalProducerMethod.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.test.components.broken;
-
-import javax.webbeans.Produces;
-import javax.webbeans.Production;
-import javax.webbeans.RequestScoped;
-
-@Production
-public class ComponentWithFinalProducerMethod
-{
-
- @Produces @RequestScoped public final String getString()
- {
- return "Pete";
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/ComponentWithStaticProducerMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/ComponentWithStaticProducerMethod.java 2008-10-24 12:42:57 UTC (rev 140)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/ComponentWithStaticProducerMethod.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,15 +0,0 @@
-package org.jboss.webbeans.test.components.broken;
-
-import javax.webbeans.Produces;
-import javax.webbeans.Production;
-
-@Production
-public class ComponentWithStaticProducerMethod
-{
-
- @Produces public static String getString()
- {
- return "Pete";
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/ComponentWithTooManyDeploymentTypes.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/ComponentWithTooManyDeploymentTypes.java 2008-10-24 12:42:57 UTC (rev 140)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/ComponentWithTooManyDeploymentTypes.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,12 +0,0 @@
-package org.jboss.webbeans.test.components.broken;
-
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
-
-@Production
-@AnotherDeploymentType
-public class ComponentWithTooManyDeploymentTypes
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gibbon.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Gibbon.java 2008-10-24 12:42:57 UTC (rev 140)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gibbon.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,19 +0,0 @@
-package org.jboss.webbeans.test.components.broken;
-
-import javax.ejb.Remote;
-import javax.webbeans.Destructor;
-import javax.webbeans.Production;
-
-@Remote
-// TODO @BoundTo("/beans/Chimpanzee")
-@Production
-public interface Gibbon
-{
-
- @Destructor
- public void remove();
-
- @Destructor
- public void removeAgain();
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gibbon.java (from rev 151, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Gibbon.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gibbon.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gibbon.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import javax.ejb.Remote;
+import javax.webbeans.Destructor;
+import javax.webbeans.Production;
+
+@Remote
+// TODO @BoundTo("/beans/Chimpanzee")
+@Production
+public interface Gibbon
+{
+
+ @Destructor
+ public void remove();
+
+ @Destructor
+ public void removeAgain();
+
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OuterBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OuterBean.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OuterBean.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import javax.webbeans.Production;
+
+public class OuterBean
+{
+
+ @Production
+ public class InnerBean
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OuterBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OuterComponent.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/OuterComponent.java 2008-10-24 12:42:57 UTC (rev 140)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/OuterComponent.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,14 +0,0 @@
-package org.jboss.webbeans.test.components.broken;
-
-import javax.webbeans.Production;
-
-public class OuterComponent
-{
-
- @Production
- public class InnerComponent
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Pig.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Pig.java 2008-10-24 12:42:57 UTC (rev 140)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Pig.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.test.components.broken;
-
-import javax.webbeans.Production;
-import javax.webbeans.RequestScoped;
-
-@Production
-@RequestScoped
-public class Pig
-{
-
- public final void washPig()
- {
-
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Pig.java (from rev 151, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Pig.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Pig.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Pig.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+@Production
+@RequestScoped
+public class Pig
+{
+
+ public final void washPig()
+ {
+
+ }
+
+}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/PlaiceFarm.java (from rev 151, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/PlaiceFarm.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/PlaiceFarm.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/PlaiceFarm.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Whitefish;
+import org.jboss.webbeans.test.beans.Plaice;
+
+@Production
+public class PlaiceFarm
+{
+
+ @SuppressWarnings("unused")
+ @Whitefish
+ private Plaice plaice;
+
+}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Animal.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Animal.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Animal.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public interface Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Antelope.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Antelope.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Antelope.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public class Antelope implements Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Baboon.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Baboon.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Baboon.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,12 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Remote;
-import javax.webbeans.Production;
-
-@Remote
-@Production
-// TODO @BoundTo("/beans/baboon")
-public interface Baboon extends Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Bear.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Bear.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Bear.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,13 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Stateless;
-import javax.webbeans.Production;
-import javax.webbeans.RequestScoped;
-
-@Production
-@RequestScoped
-@Stateless
-public class Bear
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/BlackWidow.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/BlackWidow.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/BlackWidow.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public class BlackWidow extends Spider implements DeadlySpider
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Carp.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Carp.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Carp.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,10 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
-import org.jboss.webbeans.test.components.Animal;
-
-@RequestScopedAnimalStereotype
-public class Carp implements Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cat.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cat.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cat.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,12 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Synchronous;
-
-@Production
-@Synchronous
-public class Cat
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Chair.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Chair.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Chair.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import org.jboss.webbeans.test.annotations.AnimalStereotype;
-
-@AnimalStereotype
-public class Chair
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cheetah.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cheetah.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cheetah.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,18 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Remove;
-import javax.webbeans.Destructor;
-import javax.webbeans.Production;
-
-@Production
-public class Cheetah
-{
-
- @Remove @Destructor
- public void remove()
- {
-
- }
-
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Chicken.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Chicken.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Chicken.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,21 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Initializer;
-import javax.webbeans.Production;
-
-@Production
-public class Chicken
-{
-
- @Initializer
- public Chicken(String foo)
- {
- }
-
- @Initializer
- public Chicken(String foo, Double bar)
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cod.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cod.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cod.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Named;
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Chunky;
-import org.jboss.webbeans.test.annotations.Whitefish;
-
-@Production
-@Whitefish
-@Chunky(realChunky=true)
-@Named("whitefish")
-public class Cod implements ScottishFish
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ComponentWithTooManyScopeTypes.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ComponentWithTooManyScopeTypes.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ComponentWithTooManyScopeTypes.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,11 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.ConversationScoped;
-import javax.webbeans.RequestScoped;
-
-@RequestScoped
-@ConversationScoped
-public class ComponentWithTooManyScopeTypes
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cougar.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cougar.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cougar.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,31 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.webbeans.Destructor;
-import javax.webbeans.Production;
-
-@Production
-@Stateful
-public class Cougar
-{
-
- @Remove
- public void remove()
- {
-
- }
-
- @Remove @Destructor
- public void remove1()
- {
-
- }
-
- @Remove @Destructor
- public void remove2()
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cow.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cow.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cow.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-@Production
-public abstract class Cow
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DaddyLongLegs.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DaddyLongLegs.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DaddyLongLegs.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public class DaddyLongLegs extends Spider
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DangerCall.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DangerCall.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DangerCall.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-@Production
-public class DangerCall
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DeadlyAnimal.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DeadlyAnimal.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DeadlyAnimal.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public interface DeadlyAnimal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DeadlySpider.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DeadlySpider.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DeadlySpider.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public interface DeadlySpider extends DeadlyAnimal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DefangedTarantula.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DefangedTarantula.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DefangedTarantula.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public class DefangedTarantula extends Tarantula
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Donkey.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Donkey.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Donkey.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,14 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-@Production
-public class Donkey
-{
-
- public Donkey(String foo)
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Duck.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Duck.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Duck.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,21 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Synchronous;
-
-@Production
-public class Duck
-{
-
- public Duck(String foo)
- {
- // TODO Auto-generated constructor stub
- }
-
- public Duck(String foo, @Synchronous Integer bar)
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Elephant.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Elephant.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Elephant.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,25 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.webbeans.Destructor;
-import javax.webbeans.Production;
-
-@Production
-@Stateful
-public class Elephant
-{
-
- @Remove
- public void remove1()
- {
-
- }
-
- @Remove @Destructor
- public void remove2()
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Farmer.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Farmer.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Farmer.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-@Production
-public class Farmer<T>
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,37 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Current;
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Chunky;
-import org.jboss.webbeans.test.annotations.Whitefish;
-
-@Production
-public class FishFarm
-{
-
- @SuppressWarnings("unused")
- @Current
- private Tuna tuna;
-
- @SuppressWarnings("unused")
- @Current
- private Animal animal;
-
- @SuppressWarnings("unused")
- @Whitefish
- private ScottishFish whiteScottishFish;
-
- @SuppressWarnings("unused")
- @Whitefish
- private Animal whiteFish;
-
- @SuppressWarnings("unused")
- @Whitefish @Chunky(realChunky=true)
- private Animal realChunkyWhiteFish;
-
- @SuppressWarnings("unused")
- @Current
- private Farmer<ScottishFish> scottishFishFarmer;
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Giraffe.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Giraffe.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Giraffe.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Stateless;
-
-@Stateless
-public class Giraffe
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goat.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goat.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goat.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,23 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Asynchronous;
-import org.jboss.webbeans.test.annotations.Synchronous;
-
-@Production
-public class Goat
-{
-
- public Goat(@Synchronous String foo)
- {
- // TODO Auto-generated constructor stub
- }
-
- public Goat(@Asynchronous String foo, String bar)
- {
- // TODO Auto-generated constructor stub
- }
-
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goldfish.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goldfish.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goldfish.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,14 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-import javax.webbeans.RequestScoped;
-
-import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
-
-@RequestScopedAnimalStereotype
-@RequestScoped
-@Production
-public class Goldfish implements Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goose.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goose.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Goose.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,24 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Initializer;
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Synchronous;
-
-@Production
-public class Goose
-{
-
- public Goose(@Synchronous String foo)
- {
- // TODO Auto-generated constructor stub
- }
-
- @Initializer
- public Goose(String foo, String bar)
- {
- // TODO Auto-generated constructor stub
- }
-
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Gorilla.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Gorilla.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Gorilla.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,12 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.AnimalStereotype;
-
-@AnimalStereotype
-@Production
-public class Gorilla implements Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Haddock.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Haddock.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Haddock.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,13 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Named;
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Whitefish;
-
-@Production
-@Named
-public class Haddock implements Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Horse.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Horse.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Horse.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,11 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-import javax.webbeans.RequestScoped;
-
-@Production
-@RequestScoped
-public final class Horse
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/LadybirdSpider.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/LadybirdSpider.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/LadybirdSpider.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public class LadybirdSpider extends Spider
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Leopard.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Leopard.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Leopard.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,11 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.MessageDriven;
-import javax.webbeans.Production;
-
-@Production
-@MessageDriven
-public class Leopard
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Lion.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Lion.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Lion.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,13 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Stateless;
-import javax.webbeans.Named;
-import javax.webbeans.Production;
-
-@Production
-@Stateless
-@Named
-public class Lion
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Moose.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Moose.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Moose.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,12 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Named;
-
-import org.jboss.webbeans.test.annotations.MammalStereotype;
-
-@MammalStereotype
-@Named("aMoose")
-public class Moose implements Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Orangutan.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Orangutan.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Orangutan.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,18 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Remote;
-import javax.webbeans.Destructor;
-import javax.webbeans.Named;
-import javax.webbeans.Production;
-
-@Remote
-@Production
-//TODO @BoundTo("/beans/orangutan")
-@Named
-public interface Orangutan extends Animal
-{
-
- @Destructor
- public void removeOrangutan();
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Order.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Order.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Order.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-@Production
-public class Order
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Panther.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Panther.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Panther.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,18 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.webbeans.Production;
-
-@Production
-@Stateful
-public class Panther
-{
-
- @Remove
- public void remove(String foo)
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Named;
-import javax.webbeans.RequestScoped;
-
-import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
-import org.jboss.webbeans.test.annotations.Whitefish;
-
-@AnotherDeploymentType
-@Whitefish
-@Named("whitefish")
-@RequestScoped
-public final class Plaice implements Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Puma.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Puma.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Puma.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,21 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Stateful;
-import javax.webbeans.Production;
-
-@Stateful
-@Production
-public class Puma
-{
-
- public void remove1()
- {
-
- }
-
- public void remove2()
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Salmon.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Salmon.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Salmon.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,11 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Named;
-import javax.webbeans.Production;
-
-@Production
-@Named
-public class Salmon implements ScottishFish
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFish.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFish.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFish.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public interface ScottishFish extends Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFishFarmer.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFishFarmer.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFishFarmer.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-@Production
-public class ScottishFishFarmer extends Farmer<ScottishFish>
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/SeaBass.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/SeaBass.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/SeaBass.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,11 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-import javax.webbeans.RequestScoped;
-
-@Production
-@RequestScoped
-public class SeaBass implements Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sheep.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sheep.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sheep.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,22 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Initializer;
-import javax.webbeans.Production;
-
-@Production
-public class Sheep
-{
-
-
- public Sheep(String foo)
- {
-
- }
-
- @Initializer
- public Sheep(String foo, Double bar)
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sole.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sole.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sole.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,14 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Named;
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Whitefish;
-
-@Production
-@Whitefish
-@Named("whitefish")
-public class Sole implements ScottishFish
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Spider.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Spider.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Spider.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public class Spider implements Animal
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/SpiderProducer.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/SpiderProducer.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/SpiderProducer.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,44 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Dependent;
-import javax.webbeans.Named;
-import javax.webbeans.Produces;
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Tame;
-
-@Production
-public class SpiderProducer
-{
-
- @Produces @Tame public Tarantula produceTameTarantula()
- {
- return new DefangedTarantula();
- }
-
- @Produces public Tarantula produceTarantula()
- {
- return new Tarantula();
- }
-
- @Produces @Dependent public final TrapdoorSpider produceTrapdoorSpider()
- {
- return new TrapdoorSpider();
- }
-
- @Produces @Named("blackWidow") public BlackWidow produceBlackWidow()
- {
- return new BlackWidow();
- }
-
- @Produces @Named public DaddyLongLegs produceDaddyLongLegs()
- {
- return new DaddyLongLegs();
- }
-
- @Produces @Named public LadybirdSpider getLadybirdSpider()
- {
- return new LadybirdSpider();
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/TameOrangutan.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/TameOrangutan.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/TameOrangutan.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,17 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Remote;
-import javax.webbeans.Named;
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Tame;
-
-@Remote
-@Production
-// TODO @BoundTo("/beans/tame/orangutan")
-@Tame
-@Named
-public interface TameOrangutan extends Orangutan
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tarantula.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tarantula.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tarantula.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public class Tarantula extends Spider implements DeadlySpider
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tiger.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tiger.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tiger.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,21 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.webbeans.Production;
-
-import org.jboss.webbeans.test.annotations.Synchronous;
-
-@Production
-@Stateful
-@Synchronous
-public class Tiger
-{
-
- @Remove
- public void remove()
- {
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/TrapdoorSpider.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/TrapdoorSpider.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/TrapdoorSpider.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-public class TrapdoorSpider
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tuna.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tuna.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Tuna.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
-
-@AnotherDeploymentType
-public class Tuna
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Turkey.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Turkey.java 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Turkey.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -1,19 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-
-@Production
-public class Turkey
-{
-
- public Turkey(String foo)
- {
-
- }
-
- public Turkey(String foo, Integer bar)
- {
-
- }
-
-}
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-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java 2008-10-25 19:29:44 UTC (rev 152)
@@ -17,10 +17,10 @@
- public MockObserverImpl(BeanModel<?, ?> componentModel,
+ public MockObserverImpl(BeanModel<?, ?> beanModel,
InjectableMethod<?> observer, Class<T> eventType)
{
- super(componentModel, observer, eventType);
+ super(beanModel, observer, eventType);
}
@Override
Modified: ri/trunk/webbeans-ri/testng.xml
===================================================================
--- ri/trunk/webbeans-ri/testng.xml 2008-10-25 19:25:45 UTC (rev 151)
+++ ri/trunk/webbeans-ri/testng.xml 2008-10-25 19:29:44 UTC (rev 152)
@@ -6,14 +6,14 @@
<groups>
<run>
<exclude name="specialization" />
- <exclude name="componentLifecycle" />
+ <exclude name="beanLifecycle" />
<exclude name="deployment" />
<exclude name="disposalMethod" />
<exclude name="producerExpression" />
- <exclude name="remoteComponentInXml" />
<exclude name="eventbus" />
<exclude name="injection" />
<exclude name="contexts" />
+ <exclude name="ejb3" />
</run>
</groups>
<packages>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r151 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-10-25 15:25:45 -0400 (Sat, 25 Oct 2008)
New Revision: 151
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java
Log:
Minor. Some more context tests.
Bean creation through Util
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java 2008-10-25 19:12:52 UTC (rev 150)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java 2008-10-25 19:25:45 UTC (rev 151)
@@ -1,7 +1,5 @@
package org.jboss.webbeans.test;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
-
import javax.webbeans.ContextNotActiveException;
import javax.webbeans.RequestScoped;
import javax.webbeans.manager.Bean;
@@ -12,6 +10,7 @@
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.components.Tuna;
+import org.jboss.webbeans.test.util.Util;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -34,13 +33,13 @@
@Test(groups="contexts") @SpecAssertion(section="8.1")
public void testGetWithCreateFalseReturnsNull() {
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Bean<Tuna> tunaBean = Util.createSimpleWebBean(Tuna.class, manager);
assert context.get(tunaBean, false) == null;
}
@Test(groups="contexts") @SpecAssertion(section="8.1")
public void testGetWithCreateTrueReturnsBean() {
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Bean<Tuna> tunaBean = Util.createSimpleWebBean(Tuna.class, manager);
assert context.get(tunaBean, true) != null;
}
@@ -50,5 +49,26 @@
context.get(null, false);
assert true;
}
+
+ @Test(groups="contexts") @SpecAssertion(section="8.1")
+ public void testReturnsCorrectExistingBean() {
+ Bean<Tuna> tunaBean = Util.createSimpleWebBean(Tuna.class, manager);
+ Tuna firstTuna = context.get(tunaBean, true);
+ Tuna secondTuna = context.get(tunaBean, false);
+ assert firstTuna == secondTuna;
+ }
+ @Test(groups="contexts") @SpecAssertion(section="8.1")
+ public void testProducerMethodReturningNullOK() {
+ // TODO
+ assert false;
+ }
+
+ @Test(groups="contexts")
+ public void testRemoveBean() {
+ Bean<Tuna> tunaBean = Util.createSimpleWebBean(Tuna.class, manager);
+ Tuna firstTuna = context.get(tunaBean, true);
+ ((BasicContext)context).remove(manager, tunaBean);
+ assert context.get(tunaBean, false) == null;
+ }
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r150 - in ri/trunk/webbeans-ri/src: main/java/org/jboss/webbeans/event and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-25 15:12:52 -0400 (Sat, 25 Oct 2008)
New Revision: 150
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/BeanConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractBeanModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractClassBeanModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractEnterpriseBeanModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractProducerBeanModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/BeanModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/EnterpriseBeanModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/EventBeanModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/ProducerExpressionBeanModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/ProducerMethodBeanModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/SimpleBeanModel.java
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/ComponentConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractEnterpriseComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractProducerComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EnterpriseComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/RemoteComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.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/ObserverImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/EnterpriseConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/JMSConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/MethodConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypesModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/StereotypeModel.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/ConstructorModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.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/EnterpriseComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.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/NameBasedResolutionTest.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/ProducerMethodComponentModelTest.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/SimpleComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java
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/util/Util.java
Log:
Replace all instances of component with bean
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -7,6 +7,7 @@
import javax.webbeans.manager.Bean;
import javax.webbeans.manager.Context;
import javax.webbeans.manager.Manager;
+
import org.jboss.webbeans.util.MapWrapper;
/**
@@ -64,7 +65,7 @@
return null;
}
- // TODO should component creation be synchronized?
+ // TODO should bean creation be synchronized?
instance = bean.create();
@@ -89,7 +90,7 @@
else
{
// TODO is this the correct exception to throw? See section 9.1 of spec
- throw new RuntimeException("Component " + bean.getName() + " cannot be removed as it " + "does not exist in [" + scopeType + "] context.");
+ throw new RuntimeException("Bean " + bean.getName() + " cannot be removed as it " + "does not exist in [" + scopeType + "] context.");
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -5,27 +5,27 @@
import javax.webbeans.manager.Bean;
-import org.jboss.webbeans.model.AbstractComponentModel;
+import org.jboss.webbeans.model.bean.BeanModel;
public class BeanImpl<T> extends Bean<T>
{
-public static final String LOGGER_NAME = "componentMetaModel";
+ public static final String LOGGER_NAME = "bean";
- private AbstractComponentModel<T, ?> model;
+ private BeanModel<T, ?> beanModel;
private ManagerImpl manager;
- public BeanImpl(AbstractComponentModel<T, ?> model, ManagerImpl manager)
+ public BeanImpl(BeanModel<T, ?> model, ManagerImpl manager)
{
super(manager);
- this.model = model;
+ this.beanModel = model;
}
@Override
public T create()
{
- return model.getConstructor().invoke(manager);
+ return beanModel.getConstructor().invoke(manager);
}
@Override
@@ -38,31 +38,31 @@
@Override
public Set<Annotation> getBindingTypes()
{
- return model.getBindingTypes();
+ return beanModel.getBindingTypes();
}
@Override
public Class<? extends Annotation> getDeploymentType()
{
- return model.getDeploymentType();
+ return beanModel.getDeploymentType();
}
@Override
public String getName()
{
- return model.getName();
+ return beanModel.getName();
}
@Override
public Class<? extends Annotation> getScopeType()
{
- return model.getScopeType();
+ return beanModel.getScopeType();
}
@Override
public Set<Class<?>> getTypes()
{
- return model.getApiTypes();
+ return beanModel.getApiTypes();
}
@Override
@@ -82,12 +82,12 @@
@Override
public String toString()
{
- return model.toString();
+ return beanModel.toString();
}
- public AbstractComponentModel<T, ?> getModel()
+ public BeanModel<T, ?> getModel()
{
- return model;
+ return beanModel;
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -4,9 +4,9 @@
import java.util.HashMap;
import java.util.Map;
-import org.jboss.webbeans.model.AbstractComponentModel;
import org.jboss.webbeans.model.ScopeModel;
import org.jboss.webbeans.model.StereotypeModel;
+import org.jboss.webbeans.model.bean.BeanModel;
import org.jboss.webbeans.util.MapWrapper;
public class ModelManager
@@ -29,7 +29,7 @@
private Map<Class<? extends Annotation>, StereotypeModel<?>> stereotypes = new HashMap<Class<? extends Annotation>, StereotypeModel<?>>();
- private Map<Class<?>, AbstractComponentModel<?, ?>> componentModels = new HashMap<Class<?>, AbstractComponentModel<?,?>>();
+ private Map<Class<?>, BeanModel<?, ?>> beanModels = new HashMap<Class<?>, BeanModel<?,?>>();
private ScopeModelMap scopes = new ScopeModelMap();
@@ -44,14 +44,14 @@
return stereotypes.get(annotationType);
}
- public void addComponentModel(AbstractComponentModel<?, ?> componentModel)
+ public void addBeanModel(BeanModel<?, ?> beanModel)
{
- componentModels.put(componentModel.getType(), componentModel);
+ beanModels.put(beanModel.getType(), beanModel);
}
- public AbstractComponentModel<?, ?> getComponentModel(Class<?> clazz)
+ public BeanModel<?, ?> getBeanModel(Class<?> clazz)
{
- return componentModels.get(clazz);
+ return beanModels.get(clazz);
}
public <T extends Annotation> ScopeModel<T> getScopeModel(Class<T> scopeType)
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-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -116,7 +116,7 @@
private Collection<? extends Annotation> getBindingTypes()
{
- // Get the binding types directly from the model for the component
+ // Get the binding types directly from the model for the bean
return this.eventBindings;
}
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-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -9,7 +9,7 @@
import org.jboss.webbeans.injectable.InjectableMethod;
import org.jboss.webbeans.injectable.InjectableParameter;
import org.jboss.webbeans.injectable.InjectableParameterWrapper;
-import org.jboss.webbeans.model.AbstractComponentModel;
+import org.jboss.webbeans.model.bean.BeanModel;
/**
* <p>
@@ -31,21 +31,21 @@
public class ObserverImpl<T> implements Observer<T>
{
- private final AbstractComponentModel<?, ?> componentModel;
+ private final BeanModel<?, ?> beanModel;
private final InjectableMethod<? extends Object> observerMethod;
private final Class<T> eventType;
/**
* Creates an Observer which describes and encapsulates an observer method (7.3).
*
- * @param componentModel The model for the component which defines the
+ * @param beanModel The model for the bean which defines the
* observer method
* @param observer The observer method to notify
* @param eventType The type of event being observed
*/
- public ObserverImpl(AbstractComponentModel<?, ?> componentModel, InjectableMethod<?> observer, Class<T> eventType)
+ public ObserverImpl(BeanModel<?, ?> beanModel, InjectableMethod<?> observer, Class<T> eventType)
{
- this.componentModel = componentModel;
+ this.beanModel = beanModel;
this.observerMethod = observer;
this.eventType = eventType;
}
@@ -68,7 +68,7 @@
*/
public void notify(final T event)
{
- // Get the most specialized instance of the component
+ // Get the most specialized instance of the bean
Object instance = null /*getInstance(manager)*/;
if (instance != null)
{
@@ -104,7 +104,7 @@
*/
protected Object getInstance(Manager manager)
{
- // Return the most specialized instance of the component
- return manager.getInstanceByType(componentModel.getType(), componentModel.getBindingTypes().toArray(new Annotation[0]));
+ // Return the most specialized instance of the bean
+ return manager.getInstanceByType(beanModel.getType(), beanModel.getBindingTypes().toArray(new Annotation[0]));
}
}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/BeanConstructor.java (from rev 140, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/ComponentConstructor.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/BeanConstructor.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/BeanConstructor.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.injectable;
+
+import org.jboss.webbeans.ManagerImpl;
+
+public interface BeanConstructor<T>
+{
+
+ public T invoke(ManagerImpl manager);
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/BeanConstructor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/ComponentConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/ComponentConstructor.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/ComponentConstructor.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,10 +0,0 @@
-package org.jboss.webbeans.injectable;
-
-import org.jboss.webbeans.ManagerImpl;
-
-public interface ComponentConstructor<T>
-{
-
- public T invoke(ManagerImpl manager);
-
-}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/EnterpriseConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/EnterpriseConstructor.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/EnterpriseConstructor.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -4,7 +4,7 @@
import org.jboss.webbeans.ejb.EjbMetaData;
-public class EnterpriseConstructor<T> implements ComponentConstructor<T>
+public class EnterpriseConstructor<T> implements BeanConstructor<T>
{
private EjbMetaData<T> ejbMetaData;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/JMSConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/JMSConstructor.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/JMSConstructor.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -3,7 +3,7 @@
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.util.JNDI;
-public class JMSConstructor<T> implements ComponentConstructor<T>
+public class JMSConstructor<T> implements BeanConstructor<T>
{
Class<? extends T> type;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/MethodConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/MethodConstructor.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/MethodConstructor.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -5,7 +5,7 @@
import org.jboss.webbeans.ManagerImpl;
public class MethodConstructor<T> extends InjectableMethod<T> implements
- ComponentConstructor<T>
+ BeanConstructor<T>
{
public MethodConstructor(Method method)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleConstructor.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleConstructor.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -9,10 +9,10 @@
import org.jboss.webbeans.introspector.SimpleAnnotatedConstructor;
import org.jboss.webbeans.util.LoggerUtil;
-public class SimpleConstructor<T> extends Unit<T, Constructor<T>> implements ComponentConstructor<T>
+public class SimpleConstructor<T> extends Unit<T, Constructor<T>> implements BeanConstructor<T>
{
- public static final String LOGGER_NAME = "componentConstructor";
+ public static final String LOGGER_NAME = "beanConstructor";
private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,149 +0,0 @@
-package org.jboss.webbeans.model;
-
-import java.util.logging.Logger;
-
-import javax.webbeans.BindingType;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.util.LoggerUtil;
-import org.jboss.webbeans.util.Reflections;
-import org.jboss.webbeans.util.Strings;
-
-
-
-/**
- * Web Beans Component meta model
- *
- * @author Pete Muir
- *
- */
-public abstract class AbstractClassComponentModel<T> extends AbstractComponentModel<T, Class<T>>
-{
-
- private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
-
- private AnnotatedType<T> annotatedItem;
- private AnnotatedType<T> xmlAnnotatedItem;
-
- /**
- *
- * @param annotatedItem Annotations read from java classes
- * @param xmlAnnotatedItem Annotations read from XML
- * @param manager
- */
- public AbstractClassComponentModel(AnnotatedType<T> annotatedItem, AnnotatedType<T> xmlAnnotatedItem)
- {
- if (annotatedItem == null)
- {
- throw new NullPointerException("annotatedItem must not be null. If the component is declared just in XML, pass in an empty annotatedItem");
- }
-
- if (xmlAnnotatedItem == null)
- {
- throw new NullPointerException("xmlAnnotatedItem must not be null. If the component is declared just in Java, pass in an empty xmlAnnotatedItem");
- }
- this.annotatedItem = annotatedItem;
- this.xmlAnnotatedItem = xmlAnnotatedItem;
- }
-
- @Override
- protected void init(ManagerImpl container)
- {
- super.init(container);
- checkRequiredTypesImplemented();
- checkScopeAllowed();
- // TODO This is too high
- checkComponentImplementation();
- // TODO Interceptors
- }
-
- @Override
- protected AnnotatedType<T> getAnnotatedItem()
- {
- return annotatedItem;
- }
-
- @Override
- protected AnnotatedType<T> getXmlAnnotatedItem()
- {
- return xmlAnnotatedItem;
- }
-
- protected void initType()
- {
- if (getAnnotatedItem().getDelegate() != null && getXmlAnnotatedItem().getDelegate() != null && !getAnnotatedItem().getDelegate().equals(getXmlAnnotatedItem().getDelegate()))
- {
- throw new IllegalArgumentException("Cannot build a component which specifies different classes in XML and Java");
- }
- else if (getXmlAnnotatedItem().getDelegate() != null)
- {
- log.finest("Component type specified in XML");
- this.type = getXmlAnnotatedItem().getDelegate();
- }
- else if (getAnnotatedItem().getDelegate() != null)
- {
- log.finest("Component type specified in Java");
- this.type = getAnnotatedItem().getDelegate();
- }
- else
- {
- throw new IllegalArgumentException("Cannot build a component which doesn't specify a type");
- }
- }
-
- @Override
- protected void initInjectionPoints()
- {
- super.initInjectionPoints();
- annotatedItem.getMetaAnnotatedFields(BindingType.class);
- }
-
- @Override
- protected String getDefaultName()
- {
- String name = Strings.decapitalize(getType().getSimpleName());
- log.finest("Default name of " + type + " is " + name );
- return name;
- }
-
- /**
- * Check that the types required by the stereotypes on the component are implemented
- */
- protected void checkRequiredTypesImplemented()
- {
- for (Class<?> requiredType : getMergedStereotypes().getRequiredTypes())
- {
- log.finest("Checking if required type " + requiredType + " is implemented");
- if (!requiredType.isAssignableFrom(type))
- {
- throw new RuntimeException("Required type " + requiredType + " isn't implemented on " + type);
- }
- }
- }
-
- /**
- * Check that the scope type is allowed by the stereotypes on the component and the component type
- * @param type
- */
- protected void checkScopeAllowed()
- {
- log.finest("Checking if " + getScopeType() + " is allowed for " + type);
- if (getMergedStereotypes().getSupportedScopes().size() > 0)
- {
- if (!getMergedStereotypes().getSupportedScopes().contains(getScopeType()))
- {
- throw new RuntimeException("Scope " + getScopeType() + " is not an allowed by the stereotype for " + type);
- }
- }
- }
-
- protected void checkComponentImplementation()
- {
- if (Reflections.isAbstract(getType()))
- {
- throw new RuntimeException("Web Bean implementation class " + type + " cannot be declared abstract");
- }
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,332 +0,0 @@
-package org.jboss.webbeans.model;
-
-import java.lang.annotation.Annotation;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import javax.webbeans.BindingType;
-import javax.webbeans.Dependent;
-import javax.webbeans.DeploymentType;
-import javax.webbeans.Named;
-import javax.webbeans.Production;
-import javax.webbeans.ScopeType;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
-import org.jboss.webbeans.injectable.ComponentConstructor;
-import org.jboss.webbeans.injectable.Injectable;
-import org.jboss.webbeans.injectable.InjectableMethod;
-import org.jboss.webbeans.injectable.InjectableParameter;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.util.LoggerUtil;
-
-public abstract class AbstractComponentModel<T, E>
-{
-
- public static final String LOGGER_NAME = "componentModel";
-
- private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
-
- private Set<Annotation> bindingTypes;
- protected String name;
- protected Class<? extends Annotation> scopeType;
- private MergedStereotypesModel<T, E> mergedStereotypes;
- protected Class<? extends Annotation> deploymentType;
- protected Class<? extends T> type;
- protected InjectableMethod<?> removeMethod;
- private Set<Class<?>> apiTypes;
- protected Set<Injectable<?, ?>> injectionPoints;
-
- protected void init(ManagerImpl container)
- {
- mergedStereotypes = new MergedStereotypesModel<T, E>(getAnnotatedItem(), getXmlAnnotatedItem(), container);
- initType();
- log.fine("Building Web Bean component metadata for " + getType());
- initBindingTypes();
- initName();
- initDeploymentType(container);
- checkDeploymentType();
- initScopeType();
- initApiTypes();
- }
-
- protected void initInjectionPoints()
- {
- injectionPoints = new HashSet<Injectable<?,?>>();
- if (removeMethod != null)
- {
- for (InjectableParameter<?> injectable : removeMethod.getParameters())
- {
- injectionPoints.add(injectable);
- }
- }
- }
-
- protected abstract void initType();
-
- protected void initApiTypes()
- {
- apiTypes = getTypeHierachy(getType());
- }
-
- protected Set<Class<?>> getTypeHierachy(Class<?> clazz)
- {
- Set<Class<?>> classes = new HashSet<Class<?>>();
- if (!(clazz == null || clazz == Object.class))
- {
- classes.add(clazz);
- classes.addAll(getTypeHierachy(clazz.getSuperclass()));
- for (Class<?> c : clazz.getInterfaces())
- {
- classes.addAll(getTypeHierachy(c));
- }
- }
- return classes;
- }
-
- protected abstract AnnotatedItem<T, E> getAnnotatedItem();
-
- protected abstract AnnotatedItem<T, E> getXmlAnnotatedItem();
-
- protected void initBindingTypes()
- {
- Set<Annotation> xmlBindingTypes = getXmlAnnotatedItem().getAnnotations(BindingType.class);
- if (xmlBindingTypes.size() > 0)
- {
- // TODO support producer expression default binding type
- log.finest("Using binding types " + xmlBindingTypes + " specified in XML");
- this.bindingTypes= xmlBindingTypes;
- return;
- }
- else
- {
- Set<Annotation> bindingTypes = getAnnotatedItem().getAnnotations(BindingType.class);
-
- if (bindingTypes.size() == 0)
- {
- log.finest("Adding default @Current binding type");
- bindingTypes.add(new CurrentAnnotationLiteral());
- }
- else
- {
- log.finest("Using binding types " + bindingTypes + " specified by annotations");
- }
- this.bindingTypes = bindingTypes;
- return;
- }
- }
-
- /**
- * Return the scope of the component
- */
- protected void initScopeType()
- {
- Set<Annotation> xmlScopes = getXmlAnnotatedItem().getAnnotations(ScopeType.class);
- if (xmlScopes.size() > 1)
- {
- throw new RuntimeException("At most one scope may be specified in XML");
- }
-
- if (xmlScopes.size() == 1)
- {
- this.scopeType = xmlScopes.iterator().next().annotationType();
- log.finest("Scope " + scopeType + " specified in XML");
- return;
- }
-
- Set<Annotation> scopes = getAnnotatedItem().getAnnotations(ScopeType.class);
- if (scopes.size() > 1)
- {
- throw new RuntimeException("At most one scope may be specified");
- }
-
- if (scopes.size() == 1)
- {
- this.scopeType = scopes.iterator().next().annotationType();
- log.finest("Scope " + scopeType + " specified b annotation");
- return;
- }
-
- if (getMergedStereotypes().getPossibleScopeTypes().size() == 1)
- {
- this.scopeType = getMergedStereotypes().getPossibleScopeTypes().iterator().next().annotationType();
- log.finest("Scope " + scopeType + " specified by stereotype");
- return;
- }
- else if (getMergedStereotypes().getPossibleScopeTypes().size() > 1)
- {
- throw new RuntimeException("All stereotypes must specify the same scope OR a scope must be specified on the component");
- }
- this.scopeType = Dependent.class;
- log.finest("Using default @Dependent scope");
- }
-
- protected void initName()
- {
- boolean componentNameDefaulted = false;
- if (getXmlAnnotatedItem().isAnnotationPresent(Named.class))
- {
- String xmlName = getXmlAnnotatedItem().getAnnotation(Named.class).value();
- if ("".equals(xmlName))
- {
- log.finest("Using default name (specified in XML)");
- componentNameDefaulted = true;
- }
- else
- {
- log.finest("Using name " + xmlName + " specified in XML");
- this.name = xmlName;
- return;
- }
- }
- else if (getAnnotatedItem().isAnnotationPresent(Named.class))
- {
- String javaName = getAnnotatedItem().getAnnotation(Named.class).value();
- if ("".equals(javaName))
- {
- log.finest("Using default name (specified by annotations)");
- componentNameDefaulted = true;
- }
- else
- {
- log.finest("Using name " + javaName + " specified in XML");
- this.name = javaName;
- return;
- }
- }
- if (componentNameDefaulted || getMergedStereotypes().isComponentNameDefaulted())
- {
- this.name = getDefaultName();
- return;
- }
- }
-
- protected void initDeploymentType(ManagerImpl container)
- {
- Set<Annotation> xmlDeploymentTypes = getXmlAnnotatedItem().getAnnotations(DeploymentType.class);
-
- if (xmlDeploymentTypes.size() > 1)
- {
- throw new RuntimeException("At most one deployment type may be specified (" + xmlDeploymentTypes + " are specified)");
- }
-
- if (xmlDeploymentTypes.size() == 1)
- {
- this.deploymentType = xmlDeploymentTypes.iterator().next().annotationType();
- log.finest("Deployment type " + deploymentType + " specified in XML");
- return;
- }
-
-
- Set<Annotation> deploymentTypes = getAnnotatedItem().getAnnotations(DeploymentType.class);
-
- if (deploymentTypes.size() > 1)
- {
- throw new RuntimeException("At most one deployment type may be specified (" + deploymentTypes + " are specified) on " + getAnnotatedItem().getDelegate());
- }
- if (deploymentTypes.size() == 1)
- {
- this.deploymentType = deploymentTypes.iterator().next().annotationType();
- log.finest("Deployment type " + deploymentType + " specified by annotation");
- return;
- }
-
- if (getMergedStereotypes().getPossibleDeploymentTypes().size() > 0)
- {
- this.deploymentType = getDeploymentType(container.getEnabledDeploymentTypes(), getMergedStereotypes().getPossibleDeploymentTypes());
- log.finest("Deployment type " + deploymentType + " specified by stereotype");
- return;
- }
-
- if (getXmlAnnotatedItem().getDelegate() != null)
- {
- this.deploymentType = Production.class;
- log.finest("Using default @Production deployment type");
- return;
- }
- }
-
- protected void checkDeploymentType()
- {
- if (deploymentType == null)
- {
- throw new RuntimeException("type: " + getType() + " must specify a deployment type");
- }
- }
-
- public static Class<? extends Annotation> getDeploymentType(List<Class<? extends Annotation>> enabledDeploymentTypes, Map<Class<? extends Annotation>, Annotation> possibleDeploymentTypes)
- {
- for (int i = (enabledDeploymentTypes.size() - 1); i > 0; i--)
- {
- if (possibleDeploymentTypes.containsKey((enabledDeploymentTypes.get(i))))
- {
- return enabledDeploymentTypes.get(i);
- }
- }
- return null;
- }
-
- protected MergedStereotypesModel<T, E> getMergedStereotypes()
- {
- return mergedStereotypes;
- }
-
- protected abstract String getDefaultName();
-
- public Set<Annotation> getBindingTypes()
- {
- return bindingTypes;
- }
-
- public Class<? extends Annotation> getScopeType()
- {
- return scopeType;
- }
-
- public Class<? extends T> getType()
- {
- return type;
- }
-
- public Set<Class<?>> getApiTypes()
- {
- return apiTypes;
- }
-
- public abstract ComponentConstructor<T> getConstructor();
-
- /**
- * Convenience method that return's the component's "location" for logging
- * and exception throwing
- */
- public abstract String getLocation();
-
- public Class<? extends Annotation> getDeploymentType()
- {
- return deploymentType;
- }
-
- public String getName()
- {
- return name;
- }
-
- public InjectableMethod<?> getRemoveMethod()
- {
- return removeMethod;
- }
-
- public Set<Injectable<?, ?>> getInjectionPoints()
- {
- return injectionPoints;
- }
-
- public boolean isAssignableFrom(AnnotatedItem<?, ?> annotatedItem)
- {
- return this.getAnnotatedItem().isAssignableFrom(annotatedItem);
- }
-
-}
\ No newline at end of file
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractEnterpriseComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractEnterpriseComponentModel.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractEnterpriseComponentModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,52 +0,0 @@
-package org.jboss.webbeans.model;
-
-import javax.webbeans.ApplicationScoped;
-import javax.webbeans.Dependent;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.ejb.EjbMetaData;
-import org.jboss.webbeans.introspector.AnnotatedType;
-
-public abstract class AbstractEnterpriseComponentModel<T> extends
- AbstractClassComponentModel<T>
-{
-
- private EjbMetaData<T> ejbMetaData;
-
- public AbstractEnterpriseComponentModel(AnnotatedType<T> annotatedItem,
- AnnotatedType<T> xmlAnnotatedItem)
- {
- super(annotatedItem, xmlAnnotatedItem);
-
- }
-
- @Override
- protected void init(ManagerImpl container)
- {
- super.init(container);
- ejbMetaData = container.getEjbManager().getEjbMetaData(getType());
- checkEnterpriseScopeAllowed();
- }
-
- protected EjbMetaData<T> getEjbMetaData()
- {
- return ejbMetaData;
- }
-
- /**
- * Check that the scope type is allowed by the stereotypes on the component and the component type
- * @param type
- */
- protected void checkEnterpriseScopeAllowed()
- {
- if (getEjbMetaData().isStateless() && !getScopeType().equals(Dependent.class))
- {
- throw new RuntimeException("Scope " + getScopeType() + " is not allowed on stateless enterpise bean components for " + getType() + ". Only @Dependent is allowed on stateless enterprise bean components");
- }
- if (getEjbMetaData().isSingleton() && (!getScopeType().equals(Dependent.class) || !getScopeType().equals(ApplicationScoped.class)))
- {
- throw new RuntimeException("Scope " + getScopeType() + " is not allowed on singleton enterpise bean components for " + getType() + ". Only @Dependent or @ApplicationScoped is allowed on singleton enterprise bean components");
- }
- }
-
-}
\ No newline at end of file
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractProducerComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractProducerComponentModel.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractProducerComponentModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,10 +0,0 @@
-package org.jboss.webbeans.model;
-
-import java.lang.reflect.Method;
-
-public abstract class AbstractProducerComponentModel<T> extends
- AbstractComponentModel<T, Method>
-{
-
-
-}
\ No newline at end of file
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EnterpriseComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EnterpriseComponentModel.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EnterpriseComponentModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,121 +0,0 @@
-package org.jboss.webbeans.model;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.webbeans.Destructor;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.injectable.ComponentConstructor;
-import org.jboss.webbeans.injectable.EnterpriseConstructor;
-import org.jboss.webbeans.injectable.InjectableMethod;
-import org.jboss.webbeans.injectable.InjectableParameter;
-import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.util.Reflections;
-
-public class EnterpriseComponentModel<T> extends AbstractEnterpriseComponentModel<T>
-{
-
- private EnterpriseConstructor<T> constructor;
-
- private String location;
-
- public EnterpriseComponentModel(AnnotatedType<T> annotatedItem,
- AnnotatedType<T> xmlAnnotatedItem, ManagerImpl container)
- {
- super(annotatedItem, xmlAnnotatedItem);
- init(container);
- }
-
- @Override
- protected void init(ManagerImpl container)
- {
- super.init(container);
- this.constructor = new EnterpriseConstructor<T>(getEjbMetaData());
- initRemoveMethod(container);
- initInjectionPoints();
- }
-
- @Override
- protected void initInjectionPoints()
- {
- super.initInjectionPoints();
- if (removeMethod != null)
- {
- for (InjectableParameter<?> injectable : removeMethod.getParameters())
- {
- injectionPoints.add(injectable);
- }
- }
- }
-
- public ComponentConstructor<T> getConstructor()
- {
- return constructor;
- }
-
- @Override
- public String toString()
- {
- return "EnterpriseComponentModel[" + getType().getName() + "]";
- }
-
- @Override
- public String getLocation()
- {
- if (location == null)
- {
- location = "type: Enterprise Component; declaring class: " + getType() +";";
- }
- return location;
- }
-
-// TODO loggigng
- protected void initRemoveMethod(ManagerImpl container)
- {
- if (getEjbMetaData().isStateful())
- {
- if (getEjbMetaData().getRemoveMethods().size() == 1)
- {
- super.removeMethod = new InjectableMethod<Object>(getEjbMetaData().getRemoveMethods().get(0));
- }
- else if (getEjbMetaData().getRemoveMethods().size() > 1)
- {
- List<Method> possibleRemoveMethods = new ArrayList<Method>();
- for (Method removeMethod : getEjbMetaData().getRemoveMethods())
- {
- if (removeMethod.isAnnotationPresent(Destructor.class))
- {
- possibleRemoveMethods.add(removeMethod);
- }
- }
- if (possibleRemoveMethods.size() == 1)
- {
- super.removeMethod = new InjectableMethod<Object>(possibleRemoveMethods.get(0));
- }
- else if (possibleRemoveMethods.size() > 1)
- {
- throw new RuntimeException("Multiple remove methods are annotated @Destroys for " + getType());
- }
- else if (possibleRemoveMethods.size() == 0)
- {
- throw new RuntimeException("Multiple remove methods are declared, and none are annotated @Destroys for " + getType());
- }
- }
- else if (getEjbMetaData().getRemoveMethods().size() == 0)
- {
- throw new RuntimeException("Stateful enterprise bean component has no remove methods declared for " + getType());
- }
- }
- else
- {
- List<Method> destroysMethods = Reflections.getMethods(getType(), Destructor.class);
- if (destroysMethods.size() > 0)
- {
- throw new RuntimeException("Only stateful enterprise bean components can have methods annotated @Destroys; " + getType() + " is not a stateful enterprise bean component");
- }
- }
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,146 +0,0 @@
-package org.jboss.webbeans.model;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.util.logging.Logger;
-
-import javax.webbeans.Dependent;
-import javax.webbeans.Standard;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.injectable.ComponentConstructor;
-import org.jboss.webbeans.injectable.SimpleConstructor;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.SimpleAnnotatedField;
-import org.jboss.webbeans.util.LoggerUtil;
-
-/**
- * Web Beans component meta model for the container instantiated, injectable,
- * observable events (Section 7.4).
- *
- * @author David Allen
- *
- */
-public class EventComponentModel<T> extends AbstractComponentModel<T, Field>
-{
- private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
-
- private String location;
- private SimpleAnnotatedField<T> annotatedItem;
- private SimpleAnnotatedField<T> xmlAnnotatedItem;
- private ComponentConstructor<T> constructor;
-
- public EventComponentModel(SimpleAnnotatedField<T> annotatedItem, SimpleAnnotatedField<T> xmlAnnotatedItem, ManagerImpl manager)
- {
- this.annotatedItem = annotatedItem;
- this.xmlAnnotatedItem = xmlAnnotatedItem;
- this.init(manager);
- }
-
- @Override
- protected void init(ManagerImpl container)
- {
- super.init(container);
- this.initConstructor();
- }
-
- /**
- * Initializes the constructor field of this class.
- */
- protected void initConstructor()
- {
- // There should only be one constructor for the event implementation used here
- // TODO Probably don't need to use reflection as this is a container supplied class
- Constructor<T> classConstructor = this.annotatedItem.getType().getConstructors()[0];
- constructor = new SimpleConstructor<T>(classConstructor);
- }
-
- @Override
- public ComponentConstructor<T> getConstructor()
- {
- return constructor;
- }
-
- @Override
- public String getLocation()
- {
- if (location == null)
- {
- location = "type: Event Component;";
- }
- return location;
- }
-
- @Override
- public String toString()
- {
- return "EventComponentModel[" + getType().getName() + "]";
- }
-
- /* (non-Javadoc)
- * @see org.jboss.webbeans.model.AbstractClassComponentModel#initType()
- */
- @Override
- protected void initType()
- {
- if (getXmlAnnotatedItem().getDelegate() != null)
- {
- log.finest("Component type specified in XML");
- this.type = xmlAnnotatedItem.getType();
- } else if (getAnnotatedItem().getDelegate() != null)
- {
- log.finest("Component type specified in Java");
- this.type = annotatedItem.getType();
- }
- }
-
- @Override
- protected AnnotatedItem<T, Field> getAnnotatedItem()
- {
- return this.annotatedItem;
- }
-
- @Override
- protected String getDefaultName()
- {
- // No name per 7.4
- return null;
- }
-
- @Override
- protected AnnotatedItem<T, Field> getXmlAnnotatedItem()
- {
- return this.xmlAnnotatedItem;
- }
-
- /* (non-Javadoc)
- * @see org.jboss.webbeans.model.AbstractComponentModel#initDeploymentType(org.jboss.webbeans.ManagerImpl)
- */
- @Override
- protected void initDeploymentType(ManagerImpl container)
- {
- // This is always @Standard per 7.4
- this.deploymentType = Standard.class;
- }
-
- /* (non-Javadoc)
- * @see org.jboss.webbeans.model.AbstractComponentModel#initName()
- */
- @Override
- protected void initName()
- {
- // No name per 7.4
- this.name = null;
- }
-
- /* (non-Javadoc)
- * @see org.jboss.webbeans.model.AbstractComponentModel#initScopeType()
- */
- @Override
- protected void initScopeType()
- {
- // This is always @Dependent per 7.4
- this.scopeType = Dependent.class;
- }
-
-}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypesModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypesModel.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypesModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -12,7 +12,7 @@
import org.jboss.webbeans.introspector.AnnotatedItem;
/**
- * Meta model for the merged stereotype for a component
+ * Meta model for the merged stereotype for a bean
* @author pmuir
*
*/
@@ -21,7 +21,7 @@
private Map<Class<? extends Annotation>, Annotation> possibleDeploymentTypes;
private Set<Annotation> possibleScopeTypes;
- private boolean componentNameDefaulted;
+ private boolean beanNameDefaulted;
private Set<Class<?>> requiredTypes;
private Set<Class<? extends Annotation>> supportedScopes;
@@ -55,9 +55,9 @@
}
requiredTypes.addAll(stereotype.getRequiredTypes());
supportedScopes.addAll(stereotype.getSupportedScopes());
- if (stereotype.isComponentNameDefaulted())
+ if (stereotype.isBeanNameDefaulted())
{
- componentNameDefaulted = true;
+ beanNameDefaulted = true;
}
}
}
@@ -72,9 +72,9 @@
return possibleScopeTypes;
}
- public boolean isComponentNameDefaulted()
+ public boolean isBeanNameDefaulted()
{
- return componentNameDefaulted;
+ return beanNameDefaulted;
}
public Set<Class<?>> getRequiredTypes()
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,90 +0,0 @@
-package org.jboss.webbeans.model;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.HashMap;
-
-import javax.webbeans.Dependent;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.injectable.ComponentConstructor;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
-
-public class ProducerExpressionComponent<T> extends AbstractProducerComponentModel<T>
-{
-
- private AnnotatedItem<T, Method> xmlAnnotatedItem;
- private AnnotatedItem<T, Method> annotatedItem = new SimpleAnnotatedItem<T, Method>(new HashMap<Class<? extends Annotation>, Annotation>());
- private String location;
-
- public ProducerExpressionComponent(AnnotatedItem<T, Method> xmlAnnotatedMethod, ManagerImpl container)
- {
- this.xmlAnnotatedItem = xmlAnnotatedMethod;
- init(container);
- }
-
- protected void checkApiType()
- {
- if (!getScopeType().equals(Dependent.class))
- {
- if (Modifier.isFinal(getType().getModifiers()))
- {
- throw new RuntimeException(getLocation() + "Final producer method must have @Dependent scope");
- }
- }
-
- }
-
- @Override
- protected void init(ManagerImpl container)
- {
- super.init(container);
- initInjectionPoints();
- }
-
-
- @Override
- protected AnnotatedItem<T, Method> getAnnotatedItem()
- {
- return annotatedItem;
- }
-
- @Override
- public ComponentConstructor<T> getConstructor()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- protected String getDefaultName()
- {
- throw new RuntimeException(getLocation() + " Cannot set a default name on producer expressions");
- }
-
- @Override
- public String getLocation()
- {
- if (location == null)
- {
- location = "type: Producer Expression; declaring document: TODO;";
- }
- return location;
- }
-
- @Override
- protected AnnotatedItem<T, Method> getXmlAnnotatedItem()
- {
- return xmlAnnotatedItem;
- }
-
- @Override
- protected void initType()
- {
- // TODO Auto-generated method stub
-
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,204 +0,0 @@
-package org.jboss.webbeans.model;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.HashMap;
-import java.util.Set;
-
-import javax.webbeans.Dependent;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.injectable.ComponentConstructor;
-import org.jboss.webbeans.injectable.InjectableMethod;
-import org.jboss.webbeans.injectable.InjectableParameter;
-import org.jboss.webbeans.injectable.MethodConstructor;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
-import org.jboss.webbeans.util.Reflections;
-
-public class ProducerMethodComponentModel<T> extends AbstractProducerComponentModel<T>
-{
-
- private MethodConstructor<T> constructor;
-
- private AnnotatedItem<T, Method> xmlAnnotatedItem = new SimpleAnnotatedItem<T, Method>(new HashMap<Class<? extends Annotation>, Annotation>());
- private AnnotatedMethod<T> annotatedMethod;
-
- private AbstractComponentModel<?, ?> declaringComponent;
-
- // Cached values
- private String location;
- private Type declaredComponentType;
-
- public ProducerMethodComponentModel(AnnotatedMethod<T> annotatedMethod, ManagerImpl container)
- {
- this.annotatedMethod = annotatedMethod;
- init(container);
- }
-
- @Override
- protected void init(ManagerImpl manager)
- {
- super.init(manager);
- checkProducerMethod();
- this.constructor = new MethodConstructor<T>(getAnnotatedItem().getDelegate());
- initRemoveMethod(manager);
- initInjectionPoints();
- }
-
- @Override
- protected void initInjectionPoints()
- {
- super.initInjectionPoints();
- for (InjectableParameter<?> injectable : constructor.getParameters())
- {
- injectionPoints.add(injectable);
- }
- if (removeMethod != null)
- {
- for (InjectableParameter<?> injectable : removeMethod.getParameters())
- {
- injectionPoints.add(injectable);
- }
- }
- }
-
- @Override
- protected void initDeploymentType(ManagerImpl container)
- {
- super.initDeploymentType(container);
- if (getDeploymentType() == null)
- {
- if (getDeclaringComponent() == null)
- {
- initDeclaringComponent(container);
- }
- deploymentType = declaringComponent.getDeploymentType();
- }
- }
-
- protected void initDeclaringComponent(ManagerImpl container)
- {
- declaringComponent = container.getModelManager().getComponentModel(getAnnotatedItem().getDelegate().getDeclaringClass());
- }
-
- @Override
- public ComponentConstructor<T> getConstructor()
- {
- return constructor;
- }
-
- protected void checkProducerMethod()
- {
- if (Modifier.isStatic(getAnnotatedItem().getDelegate().getModifiers()))
- {
- throw new RuntimeException("Producer method cannot be static " + annotatedMethod);
- }
- // TODO Check if declaring class is a WB component
- if (!getScopeType().equals(Dependent.class) && Modifier.isFinal(getAnnotatedItem().getDelegate().getModifiers()))
- {
- throw new RuntimeException("Final producer method must have @Dependent scope " + annotatedMethod);
- }
- }
-
- protected void initRemoveMethod(ManagerImpl container)
- {
- Set<Method> disposalMethods = container.resolveDisposalMethods(getType(), getBindingTypes().toArray(new Annotation[0]));
- if (disposalMethods.size() == 1)
- {
- removeMethod = new InjectableMethod<Object>(disposalMethods.iterator().next());
- }
- else if (disposalMethods.size() > 1)
- {
- // TODO List out found disposal methods
- throw new RuntimeException(getLocation() + "Cannot declare multiple disposal methods for this producer method");
- }
- }
-
- @Override
- public String toString()
- {
- return "ProducerMethodComponentModel[" + getType().getName() + "]";
- }
-
- @Override
- protected AnnotatedMethod<T> getAnnotatedItem()
- {
- return annotatedMethod;
- }
-
- @Override
- protected String getDefaultName()
- {
- String propertyName = Reflections.getPropertyName(getAnnotatedItem().getDelegate());
- if (propertyName != null)
- {
- return propertyName;
- }
- else
- {
- return getAnnotatedItem().getDelegate().getName();
- }
- }
-
- @Override
- protected AnnotatedItem<T, Method> getXmlAnnotatedItem()
- {
- return xmlAnnotatedItem;
- }
-
- @Override
- protected void initType()
- {
- try
- {
- this.type = annotatedMethod.getType();
- }
- catch (ClassCastException e)
- {
- throw new RuntimeException(getLocation() + " Cannot cast producer method return type " + annotatedMethod.getAnnotatedMethod().getReturnType() + " to component type " + (getDeclaredComponentType() == null ? " unknown " : getDeclaredComponentType()), e);
- }
- }
-
- private Type getDeclaredComponentType()
- {
- if (declaredComponentType == null)
- {
- Type type = getClass();
- if (type instanceof ParameterizedType)
- {
- ParameterizedType parameterizedType = (ParameterizedType) type;
- if (parameterizedType.getActualTypeArguments().length == 1)
- {
- declaredComponentType = parameterizedType.getActualTypeArguments()[0];
- }
- }
- }
- return declaredComponentType;
- }
-
- @Override
- public String getLocation()
- {
- if (location == null)
- {
- location = "type: Producer Method; declaring class: " + annotatedMethod.getAnnotatedMethod().getDeclaringClass() +"; producer method: " + annotatedMethod.getAnnotatedMethod().toString() + ";";
- }
- return location;
- }
-
- public InjectableMethod<?> getDisposalMethod()
- {
- return removeMethod;
- }
-
- public AbstractComponentModel<?, ?> getDeclaringComponent()
- {
- return declaringComponent;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/RemoteComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/RemoteComponentModel.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/RemoteComponentModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,129 +0,0 @@
-package org.jboss.webbeans.model;
-
-import org.jboss.webbeans.injectable.ComponentConstructor;
-import org.jboss.webbeans.introspector.AnnotatedType;
-
-public class RemoteComponentModel<T> extends AbstractEnterpriseComponentModel<T>
-{
-
- public RemoteComponentModel(AnnotatedType<T> annotatedItem,
- AnnotatedType<T> xmlAnnotatedItem)
- {
- super(annotatedItem, xmlAnnotatedItem);
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public ComponentConstructor<T> getConstructor()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String getLocation()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*private EnterpriseConstructor<T> constructor;
- private String boundTo;
- private String location;
-
- public RemoteComponentModel(AnnotatedType annotatedItem,
- AnnotatedType xmlAnnotatedItem, ManagerImpl container)
- {
- super(annotatedItem, xmlAnnotatedItem);
- init(container);
- }
-
- @Override
- protected void init(ManagerImpl container)
- {
- super.init(container);
- // TODO initialize constructor
- initBoundTo();
- initRemoveMethod();
- }
-
- protected void initRemoveMethod()
- {
- Set<Method> destroyMethods = new HashSet<Method>();
- for (Method method : getAnnotatedItem().getDelegate().getMethods())
- {
- if (method.isAnnotationPresent(Destroys.class))
- {
- destroyMethods.add(method);
- }
- }
- if (destroyMethods.size() == 1)
- {
- Method destroyMethod = destroyMethods.iterator().next();
- if (destroyMethod.getParameterTypes().length > 0)
- {
- throw new RuntimeException(getLocation() + " The method annotated @Destroys cannot take any parameters");
- }
- else
- {
- removeMethod = new InjectableMethod(destroyMethod);
- }
- }
- else if (destroyMethods.size() > 1)
- {
- // TODO Enumerate the destroy methods
- throw new RuntimeException(getLocation() + " There can only be a maximum of one method declared @Destorys");
- }
-
- }
-
- @Override
- protected void checkComponentImplementation()
- {
- // No - op for remote components
- // TODO THis is wrong probably
- }
-
- protected void initBoundTo()
- {
- if (getXmlAnnotatedItem().isAnnotationPresent(BoundTo.class))
- {
- this.boundTo = getXmlAnnotatedItem().getAnnotation(BoundTo.class).value();
- return;
- }
- if (getAnnotatedItem().isAnnotationPresent(BoundTo.class))
- {
- this.boundTo = getAnnotatedItem().getAnnotation(BoundTo.class).value();
- return;
- }
- throw new RuntimeException("Remote component doesn't specify @BoundTo or <bound-to /> for " + getType());
- }
-
- public ComponentConstructor<T> getConstructor()
- {
- return constructor;
- }
-
-
- public String getBoundTo()
- {
- return boundTo;
- }
-
- @Override
- public String toString()
- {
- return "RemoteComponentModel[" + getType().getName() + "]";
- }
-
- @Override
- public String getLocation()
- {
- if (location == null)
- {
- location = "type: Remote Enterprise Component; declaring class: " + getType() +";";
- }
- return location;
- }*/
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -1,147 +0,0 @@
-package org.jboss.webbeans.model;
-
-import java.lang.reflect.Constructor;
-import java.util.List;
-import java.util.logging.Logger;
-
-import javax.webbeans.BindingType;
-import javax.webbeans.Initializer;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.injectable.InjectableParameter;
-import org.jboss.webbeans.injectable.SimpleConstructor;
-import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.util.LoggerUtil;
-import org.jboss.webbeans.util.Reflections;
-
-public class SimpleComponentModel<T> extends AbstractClassComponentModel<T>
-{
-
- private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
-
- private SimpleConstructor<T> constructor;
-
- private String location;
-
- /**
- *
- * @param annotatedItem Annotations read from java classes
- * @param xmlAnnotatedItem Annotations read from XML
- * @param container
- */
- public SimpleComponentModel(AnnotatedType<T> annotatedItem, AnnotatedType<T> xmlAnnotatedItem, ManagerImpl container)
- {
- super(annotatedItem, xmlAnnotatedItem);
- init(container);
- }
-
- @Override
- protected void init(ManagerImpl container)
- {
- super.init(container);
- initConstructor();
- checkType(getType());
- initInjectionPoints();
- // TODO Interceptors
- }
-
- @Override
- protected void initInjectionPoints()
- {
- super.initInjectionPoints();
- for (InjectableParameter<?> injectable : constructor.getParameters())
- {
- injectionPoints.add(injectable);
- }
- }
-
- public static void checkType(Class<?> type)
- {
- if (type.isMemberClass())
- {
- throw new RuntimeException("Simple Web Bean " + type + " cannot be an inner class");
- }
- }
-
- protected void initConstructor()
- {
- if (getType().getConstructors().length == 1)
- {
- Constructor<T> constructor = (Constructor<T>) getType().getConstructors()[0];
- log.finest("Exactly one constructor (" + constructor +") defined, using it as the component constructor for " + getType());
- this.constructor = new SimpleConstructor<T>(constructor);
- return;
- }
-
- if (getType().getConstructors().length > 1)
- {
- List<Constructor<T>> initializerAnnotatedConstructors = Reflections.getConstructors(getType(), Initializer.class);
- List<Constructor<T>> bindingTypeAnnotatedConstructors = Reflections.getConstructorsForMetaAnnotatedParameter(getType(), BindingType.class);
- log.finest("Found " + initializerAnnotatedConstructors + " constructors annotated with @Initializer for " + getType());
- log.finest("Found " + bindingTypeAnnotatedConstructors + " with parameters annotated with binding types for " + getType());
- if ((initializerAnnotatedConstructors.size() + bindingTypeAnnotatedConstructors.size()) > 1)
- {
- if (initializerAnnotatedConstructors.size() > 1)
- {
- throw new RuntimeException("Cannot have more than one constructor annotated with @Initializer for " + getType());
- }
-
- else if (bindingTypeAnnotatedConstructors.size() > 1)
- {
- throw new RuntimeException("Cannot have more than one constructor with binding types specified on constructor parameters for " + getType());
- }
- else
- {
- throw new RuntimeException("Specify a constructor either annotated with @Initializer or with parameters annotated with binding types for " + getType());
- }
- }
- else if (initializerAnnotatedConstructors.size() == 1)
- {
- Constructor<T> constructor = initializerAnnotatedConstructors.get(0);
- log.finest("Exactly one constructor (" + constructor +") annotated with @Initializer defined, using it as the component constructor for " + getType());
- this.constructor = new SimpleConstructor<T>(constructor);
- return;
- }
- else if (bindingTypeAnnotatedConstructors.size() == 1)
- {
- Constructor<T> constructor = bindingTypeAnnotatedConstructors.get(0);
- log.finest("Exactly one constructor (" + constructor +") with parameters annotated with binding types defined, using it as the component constructor for " + getType());
- this.constructor = new SimpleConstructor<T>(constructor);
- return;
- }
- }
-
- if (getType().getConstructors().length == 0)
- {
- Constructor<T> constructor = (Constructor<T>) Reflections.getConstructor(getType());
- log.finest("No constructor defined, using implicit no arguement constructor for " + getType());
- this.constructor = new SimpleConstructor<T>(constructor);
- return;
- }
-
- throw new RuntimeException("Cannot determine constructor to use for " + getType());
- }
-
- public SimpleConstructor<T> getConstructor()
- {
- return constructor;
- }
-
-
- @Override
- public String toString()
- {
- return "SimpleWebBean[" + getAnnotatedItem().toString() + "]";
- }
-
- @Override
- public String getLocation()
- {
- if (location == null)
- {
- location = "type: Simple Component; declaring class: " + getType() +";";
- }
- return location;
- }
-
-}
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-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/StereotypeModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -26,7 +26,7 @@
private Class<? extends Annotation> stereotypeClass;
private Annotation defaultDeploymentType;
private Annotation defaultScopeType;
- private boolean componentNameDefaulted;
+ private boolean beanNameDefaulted;
private Set<Class<? extends Annotation>> supportedScopes;
private Set<Class<?>> requiredTypes;
private Set<Annotation> interceptorBindings;
@@ -37,7 +37,7 @@
Stereotype stereotype = annotatedClass.getAnnotation(Stereotype.class);
initDefaultDeploymentType(annotatedClass);
initDefaultScopeType(annotatedClass);
- initComponentNameDefaulted(annotatedClass);
+ initBeanNameDefaulted(annotatedClass);
initSupportedScopes(annotatedClass, stereotype);
initRequiredTypes(annotatedClass, stereotype);
initInterceptorBindings(annotatedClass);
@@ -90,7 +90,7 @@
}
}
- private void initComponentNameDefaulted(AnnotatedType<T> annotatedElement)
+ private void initBeanNameDefaulted(AnnotatedType<T> annotatedElement)
{
if (annotatedElement.isAnnotationPresent(Named.class))
{
@@ -98,7 +98,7 @@
{
throw new RuntimeException("Cannot specify a value for a @Named stereotype " + annotatedElement);
}
- componentNameDefaulted = true;
+ beanNameDefaulted = true;
}
}
@@ -156,12 +156,12 @@
}
/**
- * Returns true if the stereotype specifies the component name should be
+ * Returns true if the stereotype specifies the bean name should be
* defaulted
*/
- public boolean isComponentNameDefaulted()
+ public boolean isBeanNameDefaulted()
{
- return componentNameDefaulted;
+ return beanNameDefaulted;
}
/**
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractBeanModel.java (from rev 144, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractBeanModel.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractBeanModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,362 @@
+package org.jboss.webbeans.model.bean;
+
+import java.lang.annotation.Annotation;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import javax.webbeans.BindingType;
+import javax.webbeans.Dependent;
+import javax.webbeans.DeploymentType;
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+import javax.webbeans.ScopeType;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
+import org.jboss.webbeans.injectable.BeanConstructor;
+import org.jboss.webbeans.injectable.Injectable;
+import org.jboss.webbeans.injectable.InjectableMethod;
+import org.jboss.webbeans.injectable.InjectableParameter;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.model.MergedStereotypesModel;
+import org.jboss.webbeans.util.LoggerUtil;
+
+public abstract class AbstractBeanModel<T, E> implements BeanModel<T, E>
+{
+
+ public static final String LOGGER_NAME = "beanModel";
+
+ private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
+
+ private Set<Annotation> bindingTypes;
+ protected String name;
+ protected Class<? extends Annotation> scopeType;
+ private MergedStereotypesModel<T, E> mergedStereotypes;
+ protected Class<? extends Annotation> deploymentType;
+ protected Class<? extends T> type;
+ protected InjectableMethod<?> removeMethod;
+ private Set<Class<?>> apiTypes;
+ protected Set<Injectable<?, ?>> injectionPoints;
+
+ protected void init(ManagerImpl container)
+ {
+ mergedStereotypes = new MergedStereotypesModel<T, E>(getAnnotatedItem(), getXmlAnnotatedItem(), container);
+ initType();
+ log.fine("Building Web Bean bean metadata for " + getType());
+ initBindingTypes();
+ initName();
+ initDeploymentType(container);
+ checkDeploymentType();
+ initScopeType();
+ initApiTypes();
+ }
+
+ protected void initInjectionPoints()
+ {
+ injectionPoints = new HashSet<Injectable<?,?>>();
+ if (removeMethod != null)
+ {
+ for (InjectableParameter<?> injectable : removeMethod.getParameters())
+ {
+ injectionPoints.add(injectable);
+ }
+ }
+ }
+
+ protected abstract void initType();
+
+ protected void initApiTypes()
+ {
+ apiTypes = getTypeHierachy(getType());
+ }
+
+ protected Set<Class<?>> getTypeHierachy(Class<?> clazz)
+ {
+ Set<Class<?>> classes = new HashSet<Class<?>>();
+ if (!(clazz == null || clazz == Object.class))
+ {
+ classes.add(clazz);
+ classes.addAll(getTypeHierachy(clazz.getSuperclass()));
+ for (Class<?> c : clazz.getInterfaces())
+ {
+ classes.addAll(getTypeHierachy(c));
+ }
+ }
+ return classes;
+ }
+
+ protected abstract AnnotatedItem<T, E> getAnnotatedItem();
+
+ protected abstract AnnotatedItem<T, E> getXmlAnnotatedItem();
+
+ protected void initBindingTypes()
+ {
+ Set<Annotation> xmlBindingTypes = getXmlAnnotatedItem().getAnnotations(BindingType.class);
+ if (xmlBindingTypes.size() > 0)
+ {
+ // TODO support producer expression default binding type
+ log.finest("Using binding types " + xmlBindingTypes + " specified in XML");
+ this.bindingTypes= xmlBindingTypes;
+ return;
+ }
+ else
+ {
+ Set<Annotation> bindingTypes = getAnnotatedItem().getAnnotations(BindingType.class);
+
+ if (bindingTypes.size() == 0)
+ {
+ log.finest("Adding default @Current binding type");
+ bindingTypes.add(new CurrentAnnotationLiteral());
+ }
+ else
+ {
+ log.finest("Using binding types " + bindingTypes + " specified by annotations");
+ }
+ this.bindingTypes = bindingTypes;
+ return;
+ }
+ }
+
+ /**
+ * Return the scope of the bean
+ */
+ protected void initScopeType()
+ {
+ Set<Annotation> xmlScopes = getXmlAnnotatedItem().getAnnotations(ScopeType.class);
+ if (xmlScopes.size() > 1)
+ {
+ throw new RuntimeException("At most one scope may be specified in XML");
+ }
+
+ if (xmlScopes.size() == 1)
+ {
+ this.scopeType = xmlScopes.iterator().next().annotationType();
+ log.finest("Scope " + scopeType + " specified in XML");
+ return;
+ }
+
+ Set<Annotation> scopes = getAnnotatedItem().getAnnotations(ScopeType.class);
+ if (scopes.size() > 1)
+ {
+ throw new RuntimeException("At most one scope may be specified");
+ }
+
+ if (scopes.size() == 1)
+ {
+ this.scopeType = scopes.iterator().next().annotationType();
+ log.finest("Scope " + scopeType + " specified b annotation");
+ return;
+ }
+
+ if (getMergedStereotypes().getPossibleScopeTypes().size() == 1)
+ {
+ this.scopeType = getMergedStereotypes().getPossibleScopeTypes().iterator().next().annotationType();
+ log.finest("Scope " + scopeType + " specified by stereotype");
+ return;
+ }
+ else if (getMergedStereotypes().getPossibleScopeTypes().size() > 1)
+ {
+ throw new RuntimeException("All stereotypes must specify the same scope OR a scope must be specified on the bean");
+ }
+ this.scopeType = Dependent.class;
+ log.finest("Using default @Dependent scope");
+ }
+
+ protected void initName()
+ {
+ boolean beanNameDefaulted = false;
+ if (getXmlAnnotatedItem().isAnnotationPresent(Named.class))
+ {
+ String xmlName = getXmlAnnotatedItem().getAnnotation(Named.class).value();
+ if ("".equals(xmlName))
+ {
+ log.finest("Using default name (specified in XML)");
+ beanNameDefaulted = true;
+ }
+ else
+ {
+ log.finest("Using name " + xmlName + " specified in XML");
+ this.name = xmlName;
+ return;
+ }
+ }
+ else if (getAnnotatedItem().isAnnotationPresent(Named.class))
+ {
+ String javaName = getAnnotatedItem().getAnnotation(Named.class).value();
+ if ("".equals(javaName))
+ {
+ log.finest("Using default name (specified by annotations)");
+ beanNameDefaulted = true;
+ }
+ else
+ {
+ log.finest("Using name " + javaName + " specified in XML");
+ this.name = javaName;
+ return;
+ }
+ }
+ if (beanNameDefaulted || getMergedStereotypes().isBeanNameDefaulted())
+ {
+ this.name = getDefaultName();
+ return;
+ }
+ }
+
+ protected void initDeploymentType(ManagerImpl container)
+ {
+ Set<Annotation> xmlDeploymentTypes = getXmlAnnotatedItem().getAnnotations(DeploymentType.class);
+
+ if (xmlDeploymentTypes.size() > 1)
+ {
+ throw new RuntimeException("At most one deployment type may be specified (" + xmlDeploymentTypes + " are specified)");
+ }
+
+ if (xmlDeploymentTypes.size() == 1)
+ {
+ this.deploymentType = xmlDeploymentTypes.iterator().next().annotationType();
+ log.finest("Deployment type " + deploymentType + " specified in XML");
+ return;
+ }
+
+
+ Set<Annotation> deploymentTypes = getAnnotatedItem().getAnnotations(DeploymentType.class);
+
+ if (deploymentTypes.size() > 1)
+ {
+ throw new RuntimeException("At most one deployment type may be specified (" + deploymentTypes + " are specified) on " + getAnnotatedItem().getDelegate());
+ }
+ if (deploymentTypes.size() == 1)
+ {
+ this.deploymentType = deploymentTypes.iterator().next().annotationType();
+ log.finest("Deployment type " + deploymentType + " specified by annotation");
+ return;
+ }
+
+ if (getMergedStereotypes().getPossibleDeploymentTypes().size() > 0)
+ {
+ this.deploymentType = getDeploymentType(container.getEnabledDeploymentTypes(), getMergedStereotypes().getPossibleDeploymentTypes());
+ log.finest("Deployment type " + deploymentType + " specified by stereotype");
+ return;
+ }
+
+ if (getXmlAnnotatedItem().getDelegate() != null)
+ {
+ this.deploymentType = Production.class;
+ log.finest("Using default @Production deployment type");
+ return;
+ }
+ }
+
+ protected void checkDeploymentType()
+ {
+ if (deploymentType == null)
+ {
+ throw new RuntimeException("type: " + getType() + " must specify a deployment type");
+ }
+ }
+
+ public static Class<? extends Annotation> getDeploymentType(List<Class<? extends Annotation>> enabledDeploymentTypes, Map<Class<? extends Annotation>, Annotation> possibleDeploymentTypes)
+ {
+ for (int i = (enabledDeploymentTypes.size() - 1); i > 0; i--)
+ {
+ if (possibleDeploymentTypes.containsKey((enabledDeploymentTypes.get(i))))
+ {
+ return enabledDeploymentTypes.get(i);
+ }
+ }
+ return null;
+ }
+
+ protected MergedStereotypesModel<T, E> getMergedStereotypes()
+ {
+ return mergedStereotypes;
+ }
+
+ protected abstract String getDefaultName();
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#getBindingTypes()
+ */
+ public Set<Annotation> getBindingTypes()
+ {
+ return bindingTypes;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#getScopeType()
+ */
+ public Class<? extends Annotation> getScopeType()
+ {
+ return scopeType;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#getType()
+ */
+ public Class<? extends T> getType()
+ {
+ return type;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#getApiTypes()
+ */
+ public Set<Class<?>> getApiTypes()
+ {
+ return apiTypes;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#getConstructor()
+ */
+ public abstract BeanConstructor<T> getConstructor();
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#getLocation()
+ */
+ public abstract String getLocation();
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#getDeploymentType()
+ */
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return deploymentType;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#getName()
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#getRemoveMethod()
+ */
+ public InjectableMethod<?> getRemoveMethod()
+ {
+ return removeMethod;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#getInjectionPoints()
+ */
+ public Set<Injectable<?, ?>> getInjectionPoints()
+ {
+ return injectionPoints;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.Model#isAssignableFrom(org.jboss.webbeans.introspector.AnnotatedItem)
+ */
+ public boolean isAssignableFrom(AnnotatedItem<?, ?> annotatedItem)
+ {
+ return this.getAnnotatedItem().isAssignableFrom(annotatedItem);
+ }
+
+}
\ No newline at end of file
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractClassBeanModel.java (from rev 148, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractClassBeanModel.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractClassBeanModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,149 @@
+package org.jboss.webbeans.model.bean;
+
+import java.util.logging.Logger;
+
+import javax.webbeans.BindingType;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.introspector.AnnotatedType;
+import org.jboss.webbeans.util.LoggerUtil;
+import org.jboss.webbeans.util.Reflections;
+import org.jboss.webbeans.util.Strings;
+
+
+
+/**
+ * Web Beans Bean meta model
+ *
+ * @author Pete Muir
+ *
+ */
+public abstract class AbstractClassBeanModel<T> extends AbstractBeanModel<T, Class<T>>
+{
+
+ private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
+
+ private AnnotatedType<T> annotatedItem;
+ private AnnotatedType<T> xmlAnnotatedItem;
+
+ /**
+ *
+ * @param annotatedItem Annotations read from java classes
+ * @param xmlAnnotatedItem Annotations read from XML
+ * @param manager
+ */
+ public AbstractClassBeanModel(AnnotatedType<T> annotatedItem, AnnotatedType<T> xmlAnnotatedItem)
+ {
+ if (annotatedItem == null)
+ {
+ throw new NullPointerException("annotatedItem must not be null. If the bean is declared just in XML, pass in an empty annotatedItem");
+ }
+
+ if (xmlAnnotatedItem == null)
+ {
+ throw new NullPointerException("xmlAnnotatedItem must not be null. If the bean is declared just in Java, pass in an empty xmlAnnotatedItem");
+ }
+ this.annotatedItem = annotatedItem;
+ this.xmlAnnotatedItem = xmlAnnotatedItem;
+ }
+
+ @Override
+ protected void init(ManagerImpl container)
+ {
+ super.init(container);
+ checkRequiredTypesImplemented();
+ checkScopeAllowed();
+ // TODO This is too high
+ checkBeanImplementation();
+ // TODO Interceptors
+ }
+
+ @Override
+ protected AnnotatedType<T> getAnnotatedItem()
+ {
+ return annotatedItem;
+ }
+
+ @Override
+ protected AnnotatedType<T> getXmlAnnotatedItem()
+ {
+ return xmlAnnotatedItem;
+ }
+
+ protected void initType()
+ {
+ if (getAnnotatedItem().getDelegate() != null && getXmlAnnotatedItem().getDelegate() != null && !getAnnotatedItem().getDelegate().equals(getXmlAnnotatedItem().getDelegate()))
+ {
+ throw new IllegalArgumentException("Cannot build a bean which specifies different classes in XML and Java");
+ }
+ else if (getXmlAnnotatedItem().getDelegate() != null)
+ {
+ log.finest("Bean type specified in XML");
+ this.type = getXmlAnnotatedItem().getDelegate();
+ }
+ else if (getAnnotatedItem().getDelegate() != null)
+ {
+ log.finest("Bean type specified in Java");
+ this.type = getAnnotatedItem().getDelegate();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot build a bean which doesn't specify a type");
+ }
+ }
+
+ @Override
+ protected void initInjectionPoints()
+ {
+ super.initInjectionPoints();
+ annotatedItem.getMetaAnnotatedFields(BindingType.class);
+ }
+
+ @Override
+ protected String getDefaultName()
+ {
+ String name = Strings.decapitalize(getType().getSimpleName());
+ log.finest("Default name of " + type + " is " + name );
+ return name;
+ }
+
+ /**
+ * Check that the types required by the stereotypes on the bean are implemented
+ */
+ protected void checkRequiredTypesImplemented()
+ {
+ for (Class<?> requiredType : getMergedStereotypes().getRequiredTypes())
+ {
+ log.finest("Checking if required type " + requiredType + " is implemented");
+ if (!requiredType.isAssignableFrom(type))
+ {
+ throw new RuntimeException("Required type " + requiredType + " isn't implemented on " + type);
+ }
+ }
+ }
+
+ /**
+ * Check that the scope type is allowed by the stereotypes on the bean and the bean type
+ * @param type
+ */
+ protected void checkScopeAllowed()
+ {
+ log.finest("Checking if " + getScopeType() + " is allowed for " + type);
+ if (getMergedStereotypes().getSupportedScopes().size() > 0)
+ {
+ if (!getMergedStereotypes().getSupportedScopes().contains(getScopeType()))
+ {
+ throw new RuntimeException("Scope " + getScopeType() + " is not an allowed by the stereotype for " + type);
+ }
+ }
+ }
+
+ protected void checkBeanImplementation()
+ {
+ if (Reflections.isAbstract(getType()))
+ {
+ throw new RuntimeException("Web Bean implementation class " + type + " cannot be declared abstract");
+ }
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractClassBeanModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractEnterpriseBeanModel.java (from rev 140, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractEnterpriseComponentModel.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractEnterpriseBeanModel.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractEnterpriseBeanModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,52 @@
+package org.jboss.webbeans.model.bean;
+
+import javax.webbeans.ApplicationScoped;
+import javax.webbeans.Dependent;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.ejb.EjbMetaData;
+import org.jboss.webbeans.introspector.AnnotatedType;
+
+public abstract class AbstractEnterpriseBeanModel<T> extends
+ AbstractClassBeanModel<T>
+{
+
+ private EjbMetaData<T> ejbMetaData;
+
+ public AbstractEnterpriseBeanModel(AnnotatedType<T> annotatedItem,
+ AnnotatedType<T> xmlAnnotatedItem)
+ {
+ super(annotatedItem, xmlAnnotatedItem);
+
+ }
+
+ @Override
+ protected void init(ManagerImpl container)
+ {
+ super.init(container);
+ ejbMetaData = container.getEjbManager().getEjbMetaData(getType());
+ checkEnterpriseScopeAllowed();
+ }
+
+ protected EjbMetaData<T> getEjbMetaData()
+ {
+ return ejbMetaData;
+ }
+
+ /**
+ * Check that the scope type is allowed by the stereotypes on the bean and the bean type
+ * @param type
+ */
+ protected void checkEnterpriseScopeAllowed()
+ {
+ if (getEjbMetaData().isStateless() && !getScopeType().equals(Dependent.class))
+ {
+ throw new RuntimeException("Scope " + getScopeType() + " is not allowed on stateless enterpise beans for " + getType() + ". Only @Dependent is allowed on stateless enterprise beans");
+ }
+ if (getEjbMetaData().isSingleton() && (!getScopeType().equals(Dependent.class) || !getScopeType().equals(ApplicationScoped.class)))
+ {
+ throw new RuntimeException("Scope " + getScopeType() + " is not allowed on singleton enterpise beans for " + getType() + ". Only @Dependent or @ApplicationScoped is allowed on singleton enterprise beans");
+ }
+ }
+
+}
\ No newline at end of file
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractProducerBeanModel.java (from rev 140, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractProducerComponentModel.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractProducerBeanModel.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractProducerBeanModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.model.bean;
+
+import java.lang.reflect.Method;
+
+public abstract class AbstractProducerBeanModel<T> extends
+ AbstractBeanModel<T, Method>
+{
+
+
+}
\ No newline at end of file
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractProducerBeanModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/BeanModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/BeanModel.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/BeanModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,40 @@
+package org.jboss.webbeans.model.bean;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import org.jboss.webbeans.injectable.BeanConstructor;
+import org.jboss.webbeans.injectable.Injectable;
+import org.jboss.webbeans.injectable.InjectableMethod;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+
+public interface BeanModel<T, E>
+{
+
+ public Set<Annotation> getBindingTypes();
+
+ public Class<? extends Annotation> getScopeType();
+
+ public Class<? extends T> getType();
+
+ public Set<Class<?>> getApiTypes();
+
+ public BeanConstructor<T> getConstructor();
+
+ /**
+ * Convenience method that return's the bean's "location" for logging
+ * and exception throwing
+ */
+ public String getLocation();
+
+ public Class<? extends Annotation> getDeploymentType();
+
+ public String getName();
+
+ public InjectableMethod<?> getRemoveMethod();
+
+ public Set<Injectable<?, ?>> getInjectionPoints();
+
+ public boolean isAssignableFrom(AnnotatedItem<?, ?> annotatedItem);
+
+}
\ No newline at end of file
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/BeanModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/EnterpriseBeanModel.java (from rev 140, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EnterpriseComponentModel.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/EnterpriseBeanModel.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/EnterpriseBeanModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,121 @@
+package org.jboss.webbeans.model.bean;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.webbeans.Destructor;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.injectable.BeanConstructor;
+import org.jboss.webbeans.injectable.EnterpriseConstructor;
+import org.jboss.webbeans.injectable.InjectableMethod;
+import org.jboss.webbeans.injectable.InjectableParameter;
+import org.jboss.webbeans.introspector.AnnotatedType;
+import org.jboss.webbeans.util.Reflections;
+
+public class EnterpriseBeanModel<T> extends AbstractEnterpriseBeanModel<T>
+{
+
+ private EnterpriseConstructor<T> constructor;
+
+ private String location;
+
+ public EnterpriseBeanModel(AnnotatedType<T> annotatedItem,
+ AnnotatedType<T> xmlAnnotatedItem, ManagerImpl container)
+ {
+ super(annotatedItem, xmlAnnotatedItem);
+ init(container);
+ }
+
+ @Override
+ protected void init(ManagerImpl container)
+ {
+ super.init(container);
+ this.constructor = new EnterpriseConstructor<T>(getEjbMetaData());
+ initRemoveMethod(container);
+ initInjectionPoints();
+ }
+
+ @Override
+ protected void initInjectionPoints()
+ {
+ super.initInjectionPoints();
+ if (removeMethod != null)
+ {
+ for (InjectableParameter<?> injectable : removeMethod.getParameters())
+ {
+ injectionPoints.add(injectable);
+ }
+ }
+ }
+
+ public BeanConstructor<T> getConstructor()
+ {
+ return constructor;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "EnterpriseBean[" + getType().getName() + "]";
+ }
+
+ @Override
+ public String getLocation()
+ {
+ if (location == null)
+ {
+ location = "type: Enterprise Bean; declaring class: " + getType() +";";
+ }
+ return location;
+ }
+
+// TODO loggigng
+ protected void initRemoveMethod(ManagerImpl container)
+ {
+ if (getEjbMetaData().isStateful())
+ {
+ if (getEjbMetaData().getRemoveMethods().size() == 1)
+ {
+ super.removeMethod = new InjectableMethod<Object>(getEjbMetaData().getRemoveMethods().get(0));
+ }
+ else if (getEjbMetaData().getRemoveMethods().size() > 1)
+ {
+ List<Method> possibleRemoveMethods = new ArrayList<Method>();
+ for (Method removeMethod : getEjbMetaData().getRemoveMethods())
+ {
+ if (removeMethod.isAnnotationPresent(Destructor.class))
+ {
+ possibleRemoveMethods.add(removeMethod);
+ }
+ }
+ if (possibleRemoveMethods.size() == 1)
+ {
+ super.removeMethod = new InjectableMethod<Object>(possibleRemoveMethods.get(0));
+ }
+ else if (possibleRemoveMethods.size() > 1)
+ {
+ throw new RuntimeException("Multiple remove methods are annotated @Destroys for " + getType());
+ }
+ else if (possibleRemoveMethods.size() == 0)
+ {
+ throw new RuntimeException("Multiple remove methods are declared, and none are annotated @Destroys for " + getType());
+ }
+ }
+ else if (getEjbMetaData().getRemoveMethods().size() == 0)
+ {
+ throw new RuntimeException("Stateful enterprise bean bean has no remove methods declared for " + getType());
+ }
+ }
+ else
+ {
+ List<Method> destroysMethods = Reflections.getMethods(getType(), Destructor.class);
+ if (destroysMethods.size() > 0)
+ {
+ throw new RuntimeException("Only stateful enterprise beans can have methods annotated @Destroys; " + getType() + " is not a stateful enterprise bean");
+ }
+ }
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/EnterpriseBeanModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/EventBeanModel.java (from rev 140, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/EventBeanModel.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/EventBeanModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,134 @@
+package org.jboss.webbeans.model.bean;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.util.logging.Logger;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Standard;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.injectable.BeanConstructor;
+import org.jboss.webbeans.injectable.SimpleConstructor;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.SimpleAnnotatedField;
+import org.jboss.webbeans.util.LoggerUtil;
+
+/**
+ * Web Beans bean meta model for the container instantiated, injectable,
+ * observable events (Section 7.4).
+ *
+ * @author David Allen
+ *
+ */
+public class EventBeanModel<T> extends AbstractBeanModel<T, Field>
+{
+ private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
+
+ private String location;
+ private SimpleAnnotatedField<T> annotatedItem;
+ private SimpleAnnotatedField<T> xmlAnnotatedItem;
+ private BeanConstructor<T> constructor;
+
+ public EventBeanModel(SimpleAnnotatedField<T> annotatedItem, SimpleAnnotatedField<T> xmlAnnotatedItem, ManagerImpl manager)
+ {
+ this.annotatedItem = annotatedItem;
+ this.xmlAnnotatedItem = xmlAnnotatedItem;
+ this.init(manager);
+ }
+
+ @Override
+ protected void init(ManagerImpl container)
+ {
+ super.init(container);
+ this.initConstructor();
+ }
+
+ /**
+ * Initializes the constructor field of this class.
+ */
+ protected void initConstructor()
+ {
+ // There should only be one constructor for the event implementation used here
+ // TODO Probably don't need to use reflection as this is a container supplied class
+ Constructor<T> classConstructor = this.annotatedItem.getType().getConstructors()[0];
+ constructor = new SimpleConstructor<T>(classConstructor);
+ }
+
+ @Override
+ public BeanConstructor<T> getConstructor()
+ {
+ return constructor;
+ }
+
+ @Override
+ public String getLocation()
+ {
+ if (location == null)
+ {
+ location = "type: Event Bean;";
+ }
+ return location;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "EventBean[" + getType().getName() + "]";
+ }
+
+ @Override
+ protected void initType()
+ {
+ if (getXmlAnnotatedItem().getDelegate() != null)
+ {
+ log.finest("Bean type specified in XML");
+ this.type = xmlAnnotatedItem.getType();
+ } else if (getAnnotatedItem().getDelegate() != null)
+ {
+ log.finest("Bean type specified in Java");
+ this.type = annotatedItem.getType();
+ }
+ }
+
+ @Override
+ protected AnnotatedItem<T, Field> getAnnotatedItem()
+ {
+ return this.annotatedItem;
+ }
+
+ @Override
+ protected String getDefaultName()
+ {
+ // No name per 7.4
+ return null;
+ }
+
+ @Override
+ protected AnnotatedItem<T, Field> getXmlAnnotatedItem()
+ {
+ return this.xmlAnnotatedItem;
+ }
+
+ @Override
+ protected void initDeploymentType(ManagerImpl container)
+ {
+ // This is always @Standard per 7.4
+ this.deploymentType = Standard.class;
+ }
+
+ @Override
+ protected void initName()
+ {
+ // No name per 7.4
+ this.name = null;
+ }
+
+ @Override
+ protected void initScopeType()
+ {
+ // This is always @Dependent per 7.4
+ this.scopeType = Dependent.class;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/EventBeanModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/ProducerExpressionBeanModel.java (from rev 140, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/ProducerExpressionBeanModel.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/ProducerExpressionBeanModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,90 @@
+package org.jboss.webbeans.model.bean;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
+
+import javax.webbeans.Dependent;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.injectable.BeanConstructor;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
+
+public class ProducerExpressionBeanModel<T> extends AbstractProducerBeanModel<T>
+{
+
+ private AnnotatedItem<T, Method> xmlAnnotatedItem;
+ private AnnotatedItem<T, Method> annotatedItem = new SimpleAnnotatedItem<T, Method>(new HashMap<Class<? extends Annotation>, Annotation>());
+ private String location;
+
+ public ProducerExpressionBeanModel(AnnotatedItem<T, Method> xmlAnnotatedMethod, ManagerImpl container)
+ {
+ this.xmlAnnotatedItem = xmlAnnotatedMethod;
+ init(container);
+ }
+
+ protected void checkApiType()
+ {
+ if (!getScopeType().equals(Dependent.class))
+ {
+ if (Modifier.isFinal(getType().getModifiers()))
+ {
+ throw new RuntimeException(getLocation() + "Final producer method must have @Dependent scope");
+ }
+ }
+
+ }
+
+ @Override
+ protected void init(ManagerImpl container)
+ {
+ super.init(container);
+ initInjectionPoints();
+ }
+
+
+ @Override
+ protected AnnotatedItem<T, Method> getAnnotatedItem()
+ {
+ return annotatedItem;
+ }
+
+ @Override
+ public BeanConstructor<T> getConstructor()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected String getDefaultName()
+ {
+ throw new RuntimeException(getLocation() + " Cannot set a default name on producer expressions");
+ }
+
+ @Override
+ public String getLocation()
+ {
+ if (location == null)
+ {
+ location = "type: Producer Expression; declaring document: TODO;";
+ }
+ return location;
+ }
+
+ @Override
+ protected AnnotatedItem<T, Method> getXmlAnnotatedItem()
+ {
+ return xmlAnnotatedItem;
+ }
+
+ @Override
+ protected void initType()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/ProducerExpressionBeanModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/ProducerMethodBeanModel.java (from rev 140, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/ProducerMethodBeanModel.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/ProducerMethodBeanModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,204 @@
+package org.jboss.webbeans.model.bean;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Set;
+
+import javax.webbeans.Dependent;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.injectable.BeanConstructor;
+import org.jboss.webbeans.injectable.InjectableMethod;
+import org.jboss.webbeans.injectable.InjectableParameter;
+import org.jboss.webbeans.injectable.MethodConstructor;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
+import org.jboss.webbeans.util.Reflections;
+
+public class ProducerMethodBeanModel<T> extends AbstractProducerBeanModel<T>
+{
+
+ private MethodConstructor<T> constructor;
+
+ private AnnotatedItem<T, Method> xmlAnnotatedItem = new SimpleAnnotatedItem<T, Method>(new HashMap<Class<? extends Annotation>, Annotation>());
+ private AnnotatedMethod<T> annotatedMethod;
+
+ private BeanModel<?, ?> declaringBean;
+
+ // Cached values
+ private String location;
+ private Type declaredBeanType;
+
+ public ProducerMethodBeanModel(AnnotatedMethod<T> annotatedMethod, ManagerImpl container)
+ {
+ this.annotatedMethod = annotatedMethod;
+ init(container);
+ }
+
+ @Override
+ protected void init(ManagerImpl manager)
+ {
+ super.init(manager);
+ checkProducerMethod();
+ this.constructor = new MethodConstructor<T>(getAnnotatedItem().getDelegate());
+ initRemoveMethod(manager);
+ initInjectionPoints();
+ }
+
+ @Override
+ protected void initInjectionPoints()
+ {
+ super.initInjectionPoints();
+ for (InjectableParameter<?> injectable : constructor.getParameters())
+ {
+ injectionPoints.add(injectable);
+ }
+ if (removeMethod != null)
+ {
+ for (InjectableParameter<?> injectable : removeMethod.getParameters())
+ {
+ injectionPoints.add(injectable);
+ }
+ }
+ }
+
+ @Override
+ protected void initDeploymentType(ManagerImpl container)
+ {
+ super.initDeploymentType(container);
+ if (getDeploymentType() == null)
+ {
+ if (getDeclaringBean() == null)
+ {
+ initDeclaringBean(container);
+ }
+ deploymentType = declaringBean.getDeploymentType();
+ }
+ }
+
+ protected void initDeclaringBean(ManagerImpl container)
+ {
+ declaringBean = container.getModelManager().getBeanModel(getAnnotatedItem().getDelegate().getDeclaringClass());
+ }
+
+ @Override
+ public BeanConstructor<T> getConstructor()
+ {
+ return constructor;
+ }
+
+ protected void checkProducerMethod()
+ {
+ if (Modifier.isStatic(getAnnotatedItem().getDelegate().getModifiers()))
+ {
+ throw new RuntimeException("Producer method cannot be static " + annotatedMethod);
+ }
+ // TODO Check if declaring class is a WB bean
+ if (!getScopeType().equals(Dependent.class) && Modifier.isFinal(getAnnotatedItem().getDelegate().getModifiers()))
+ {
+ throw new RuntimeException("Final producer method must have @Dependent scope " + annotatedMethod);
+ }
+ }
+
+ protected void initRemoveMethod(ManagerImpl container)
+ {
+ Set<Method> disposalMethods = container.resolveDisposalMethods(getType(), getBindingTypes().toArray(new Annotation[0]));
+ if (disposalMethods.size() == 1)
+ {
+ removeMethod = new InjectableMethod<Object>(disposalMethods.iterator().next());
+ }
+ else if (disposalMethods.size() > 1)
+ {
+ // TODO List out found disposal methods
+ throw new RuntimeException(getLocation() + "Cannot declare multiple disposal methods for this producer method");
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ return "ProducerMethodBean[" + getType().getName() + "]";
+ }
+
+ @Override
+ protected AnnotatedMethod<T> getAnnotatedItem()
+ {
+ return annotatedMethod;
+ }
+
+ @Override
+ protected String getDefaultName()
+ {
+ String propertyName = Reflections.getPropertyName(getAnnotatedItem().getDelegate());
+ if (propertyName != null)
+ {
+ return propertyName;
+ }
+ else
+ {
+ return getAnnotatedItem().getDelegate().getName();
+ }
+ }
+
+ @Override
+ protected AnnotatedItem<T, Method> getXmlAnnotatedItem()
+ {
+ return xmlAnnotatedItem;
+ }
+
+ @Override
+ protected void initType()
+ {
+ try
+ {
+ this.type = annotatedMethod.getType();
+ }
+ catch (ClassCastException e)
+ {
+ throw new RuntimeException(getLocation() + " Cannot cast producer method return type " + annotatedMethod.getAnnotatedMethod().getReturnType() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
+ }
+ }
+
+ private Type getDeclaredBeanType()
+ {
+ if (declaredBeanType == null)
+ {
+ Type type = getClass();
+ if (type instanceof ParameterizedType)
+ {
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ if (parameterizedType.getActualTypeArguments().length == 1)
+ {
+ declaredBeanType = parameterizedType.getActualTypeArguments()[0];
+ }
+ }
+ }
+ return declaredBeanType;
+ }
+
+ @Override
+ public String getLocation()
+ {
+ if (location == null)
+ {
+ location = "type: Producer Method; declaring class: " + annotatedMethod.getAnnotatedMethod().getDeclaringClass() +"; producer method: " + annotatedMethod.getAnnotatedMethod().toString() + ";";
+ }
+ return location;
+ }
+
+ public InjectableMethod<?> getDisposalMethod()
+ {
+ return removeMethod;
+ }
+
+ public BeanModel<?, ?> getDeclaringBean()
+ {
+ return declaringBean;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/ProducerMethodBeanModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/SimpleBeanModel.java (from rev 144, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/SimpleBeanModel.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/SimpleBeanModel.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -0,0 +1,147 @@
+package org.jboss.webbeans.model.bean;
+
+import java.lang.reflect.Constructor;
+import java.util.List;
+import java.util.logging.Logger;
+
+import javax.webbeans.BindingType;
+import javax.webbeans.Initializer;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.injectable.InjectableParameter;
+import org.jboss.webbeans.injectable.SimpleConstructor;
+import org.jboss.webbeans.introspector.AnnotatedType;
+import org.jboss.webbeans.util.LoggerUtil;
+import org.jboss.webbeans.util.Reflections;
+
+public class SimpleBeanModel<T> extends AbstractClassBeanModel<T>
+{
+
+ private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
+
+ private SimpleConstructor<T> constructor;
+
+ private String location;
+
+ /**
+ *
+ * @param annotatedItem Annotations read from java classes
+ * @param xmlAnnotatedItem Annotations read from XML
+ * @param container
+ */
+ public SimpleBeanModel(AnnotatedType<T> annotatedItem, AnnotatedType<T> xmlAnnotatedItem, ManagerImpl container)
+ {
+ super(annotatedItem, xmlAnnotatedItem);
+ init(container);
+ }
+
+ @Override
+ protected void init(ManagerImpl container)
+ {
+ super.init(container);
+ initConstructor();
+ checkType(getType());
+ initInjectionPoints();
+ // TODO Interceptors
+ }
+
+ @Override
+ protected void initInjectionPoints()
+ {
+ super.initInjectionPoints();
+ for (InjectableParameter<?> injectable : constructor.getParameters())
+ {
+ injectionPoints.add(injectable);
+ }
+ }
+
+ public static void checkType(Class<?> type)
+ {
+ if (type.isMemberClass())
+ {
+ throw new RuntimeException("Simple Web Bean " + type + " cannot be an inner class");
+ }
+ }
+
+ protected void initConstructor()
+ {
+ if (getType().getConstructors().length == 1)
+ {
+ Constructor<T> constructor = (Constructor<T>) getType().getConstructors()[0];
+ log.finest("Exactly one constructor (" + constructor +") defined, using it as the bean constructor for " + getType());
+ this.constructor = new SimpleConstructor<T>(constructor);
+ return;
+ }
+
+ if (getType().getConstructors().length > 1)
+ {
+ List<Constructor<T>> initializerAnnotatedConstructors = Reflections.getConstructors(getType(), Initializer.class);
+ List<Constructor<T>> bindingTypeAnnotatedConstructors = Reflections.getConstructorsForMetaAnnotatedParameter(getType(), BindingType.class);
+ log.finest("Found " + initializerAnnotatedConstructors + " constructors annotated with @Initializer for " + getType());
+ log.finest("Found " + bindingTypeAnnotatedConstructors + " with parameters annotated with binding types for " + getType());
+ if ((initializerAnnotatedConstructors.size() + bindingTypeAnnotatedConstructors.size()) > 1)
+ {
+ if (initializerAnnotatedConstructors.size() > 1)
+ {
+ throw new RuntimeException("Cannot have more than one constructor annotated with @Initializer for " + getType());
+ }
+
+ else if (bindingTypeAnnotatedConstructors.size() > 1)
+ {
+ throw new RuntimeException("Cannot have more than one constructor with binding types specified on constructor parameters for " + getType());
+ }
+ else
+ {
+ throw new RuntimeException("Specify a constructor either annotated with @Initializer or with parameters annotated with binding types for " + getType());
+ }
+ }
+ else if (initializerAnnotatedConstructors.size() == 1)
+ {
+ Constructor<T> constructor = initializerAnnotatedConstructors.get(0);
+ log.finest("Exactly one constructor (" + constructor +") annotated with @Initializer defined, using it as the bean constructor for " + getType());
+ this.constructor = new SimpleConstructor<T>(constructor);
+ return;
+ }
+ else if (bindingTypeAnnotatedConstructors.size() == 1)
+ {
+ Constructor<T> constructor = bindingTypeAnnotatedConstructors.get(0);
+ log.finest("Exactly one constructor (" + constructor +") with parameters annotated with binding types defined, using it as the bean constructor for " + getType());
+ this.constructor = new SimpleConstructor<T>(constructor);
+ return;
+ }
+ }
+
+ if (getType().getConstructors().length == 0)
+ {
+ Constructor<T> constructor = (Constructor<T>) Reflections.getConstructor(getType());
+ log.finest("No constructor defined, using implicit no arguement constructor for " + getType());
+ this.constructor = new SimpleConstructor<T>(constructor);
+ return;
+ }
+
+ throw new RuntimeException("Cannot determine constructor to use for " + getType());
+ }
+
+ public SimpleConstructor<T> getConstructor()
+ {
+ return constructor;
+ }
+
+
+ @Override
+ public String toString()
+ {
+ return "SimpleWebBean[" + getAnnotatedItem().toString() + "]";
+ }
+
+ @Override
+ public String getLocation()
+ {
+ if (location == null)
+ {
+ location = "type: Simple Bean; declaring class: " + getType() +";";
+ }
+ return location;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/SimpleBeanModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -11,7 +11,7 @@
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.Asynchronous;
import org.jboss.webbeans.test.annotations.Synchronous;
import org.jboss.webbeans.test.bindings.AsynchronousAnnotationLiteral;
@@ -28,7 +28,7 @@
@Test @SpecAssertion(section={"2.3.3", "2.3.1"})
public void testDefaultBindingTypeDeclaredInJava()
{
- SimpleComponentModel<Order> order = createSimpleModel(Order.class, manager);
+ SimpleBeanModel<Order> order = createSimpleModel(Order.class, manager);
assert order.getBindingTypes().size() == 1;
order.getBindingTypes().iterator().next().annotationType().equals(Current.class);
}
@@ -61,7 +61,7 @@
@Test @SpecAssertion(section="2.3.3")
public void testBindingTypesDeclaredInJava()
{
- SimpleComponentModel<Cat> cat = createSimpleModel(Cat.class, manager);
+ SimpleBeanModel<Cat> cat = createSimpleModel(Cat.class, manager);
assert cat.getBindingTypes().size() == 1;
assert Reflections.annotationSetMatches(cat.getBindingTypes(), Synchronous.class);
}
@@ -80,7 +80,7 @@
annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
AnnotatedType annotatedItem = new SimpleAnnotatedType(Antelope.class, annotations);
- SimpleComponentModel<Antelope> antelope = new SimpleComponentModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), annotatedItem, manager);
+ SimpleBeanModel<Antelope> antelope = new SimpleBeanModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), annotatedItem, manager);
assert Reflections.annotationSetMatches(antelope.getBindingTypes(), Asynchronous.class);
}
@@ -92,7 +92,7 @@
annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
AnnotatedType annotatedItem = new SimpleAnnotatedType(Cat.class, annotations);
- SimpleComponentModel<Cat> cat = new SimpleComponentModel<Cat>(new SimpleAnnotatedType(Cat.class), annotatedItem, manager);
+ SimpleBeanModel<Cat> cat = new SimpleBeanModel<Cat>(new SimpleAnnotatedType(Cat.class), annotatedItem, manager);
assert cat.getBindingTypes().size() == 1;
assert Reflections.annotationSetMatches(cat.getBindingTypes(), Asynchronous.class);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -6,7 +6,7 @@
import org.jboss.webbeans.injectable.SimpleConstructor;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.Synchronous;
import org.jboss.webbeans.test.components.Chicken;
import org.jboss.webbeans.test.components.Donkey;
@@ -26,7 +26,7 @@
@Test
public void testImplicitConstructor()
{
- SimpleConstructor<Order> constructor = new SimpleComponentModel<Order>(new SimpleAnnotatedType<Order>(Order.class), getEmptyAnnotatedItem(Order.class), manager).getConstructor();
+ SimpleConstructor<Order> constructor = new SimpleBeanModel<Order>(new SimpleAnnotatedType<Order>(Order.class), getEmptyAnnotatedItem(Order.class), manager).getConstructor();
assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Order.class);
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 0;
assert constructor.getParameters().size() == 0;
@@ -36,7 +36,7 @@
@Test
public void testSingleConstructor()
{
- SimpleConstructor<Donkey> constructor = new SimpleComponentModel<Donkey>(new SimpleAnnotatedType<Donkey>(Donkey.class), getEmptyAnnotatedItem(Donkey.class), manager).getConstructor();
+ SimpleConstructor<Donkey> constructor = new SimpleBeanModel<Donkey>(new SimpleAnnotatedType<Donkey>(Donkey.class), getEmptyAnnotatedItem(Donkey.class), manager).getConstructor();
assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Donkey.class);
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 1;
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[0].equals(String.class);
@@ -50,7 +50,7 @@
@Test
public void testInitializerAnnotatedConstructor()
{
- SimpleConstructor<Sheep> constructor = new SimpleComponentModel<Sheep>(new SimpleAnnotatedType<Sheep>(Sheep.class), getEmptyAnnotatedItem(Sheep.class), manager).getConstructor();
+ SimpleConstructor<Sheep> constructor = new SimpleBeanModel<Sheep>(new SimpleAnnotatedType<Sheep>(Sheep.class), getEmptyAnnotatedItem(Sheep.class), manager).getConstructor();
assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Sheep.class);
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 2;
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[0].equals(String.class);
@@ -68,7 +68,7 @@
@Test
public void testBindingTypeAnnotatedConstructor()
{
- SimpleConstructor<Duck> constructor = new SimpleComponentModel<Duck>(new SimpleAnnotatedType<Duck>(Duck.class), getEmptyAnnotatedItem(Duck.class), manager).getConstructor();
+ SimpleConstructor<Duck> constructor = new SimpleBeanModel<Duck>(new SimpleAnnotatedType<Duck>(Duck.class), getEmptyAnnotatedItem(Duck.class), manager).getConstructor();
assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Duck.class);
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 2;
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[0].equals(String.class);
@@ -88,7 +88,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Chicken>(new SimpleAnnotatedType<Chicken>(Chicken.class), getEmptyAnnotatedItem(Chicken.class), manager);
+ new SimpleBeanModel<Chicken>(new SimpleAnnotatedType<Chicken>(Chicken.class), getEmptyAnnotatedItem(Chicken.class), manager);
}
catch (Exception e)
{
@@ -104,7 +104,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Turkey>(new SimpleAnnotatedType<Turkey>(Turkey.class), getEmptyAnnotatedItem(Turkey.class), manager);
+ new SimpleBeanModel<Turkey>(new SimpleAnnotatedType<Turkey>(Turkey.class), getEmptyAnnotatedItem(Turkey.class), manager);
}
catch (Exception e)
{
@@ -120,7 +120,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Goat>(new SimpleAnnotatedType<Goat>(Goat.class), getEmptyAnnotatedItem(Goat.class), manager);
+ new SimpleBeanModel<Goat>(new SimpleAnnotatedType<Goat>(Goat.class), getEmptyAnnotatedItem(Goat.class), manager);
}
catch (Exception e)
{
@@ -136,7 +136,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Goose>(new SimpleAnnotatedType<Goose>(Goose.class), getEmptyAnnotatedItem(Goose.class), manager);
+ new SimpleBeanModel<Goose>(new SimpleAnnotatedType<Goose>(Goose.class), getEmptyAnnotatedItem(Goose.class), manager);
}
catch (Exception e)
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -10,7 +10,7 @@
import org.jboss.webbeans.BasicContext;
import org.jboss.webbeans.BeanImpl;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.components.Tuna;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -34,13 +34,13 @@
@Test(groups="contexts") @SpecAssertion(section="8.1")
public void testGetWithCreateFalseReturnsNull() {
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
assert context.get(tunaBean, false) == null;
}
@Test(groups="contexts") @SpecAssertion(section="8.1")
public void testGetWithCreateTrueReturnsBean() {
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
assert context.get(tunaBean, true) != null;
}
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-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -15,7 +15,7 @@
import org.jboss.webbeans.injectable.InjectableMethod;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.Asynchronous;
import org.jboss.webbeans.test.bindings.AsynchronousAnnotationLiteral;
@@ -62,7 +62,7 @@
// invoked which in turn invokes the observer. Here the mock observer
// is used to keep track of the event being fired.
ManagerImpl manager;
- SimpleComponentModel<Tuna> tuna;
+ SimpleBeanModel<Tuna> tuna;
InjectableMethod<Object> om;
List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
enabledDeploymentTypes.add(Standard.class);
@@ -73,7 +73,7 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
AnnotatedType<Tuna> annotatedItem = new SimpleAnnotatedType<Tuna>(Tuna.class, annotations);
- tuna = new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
+ tuna = new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
om = new InjectableMethod<Object>(AnObserver.class.getMethod("observe", new Class[] { Event.class }));
AnObserver observerInstance = new AnObserver();
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -11,8 +11,8 @@
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.AbstractEnterpriseComponentModel;
-import org.jboss.webbeans.model.EnterpriseComponentModel;
+import org.jboss.webbeans.model.bean.AbstractEnterpriseBeanModel;
+import org.jboss.webbeans.model.bean.EnterpriseBeanModel;
import org.jboss.webbeans.test.annotations.Synchronous;
import org.jboss.webbeans.test.components.Bear;
import org.jboss.webbeans.test.components.Cheetah;
@@ -40,7 +40,7 @@
@Test
public void testStateless()
{
- EnterpriseComponentModel<Lion> lion = new EnterpriseComponentModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class), getEmptyAnnotatedItem(Lion.class), manager);
+ EnterpriseBeanModel<Lion> lion = new EnterpriseBeanModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class), getEmptyAnnotatedItem(Lion.class), manager);
assert lion.getScopeType().equals(Dependent.class);
Reflections.annotationSetMatches(lion.getBindingTypes(), Current.class);
assert lion.getName().equals("lion");
@@ -53,7 +53,7 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
AnnotatedType annotatedItem = new SimpleAnnotatedType(Giraffe.class, annotations);
- EnterpriseComponentModel<Giraffe> giraffe = new EnterpriseComponentModel<Giraffe>(new SimpleAnnotatedType(Giraffe.class), annotatedItem, manager);
+ EnterpriseBeanModel<Giraffe> giraffe = new EnterpriseBeanModel<Giraffe>(new SimpleAnnotatedType(Giraffe.class), annotatedItem, manager);
assert giraffe.getScopeType().equals(Dependent.class);
Reflections.annotationSetMatches(giraffe.getBindingTypes(), Current.class);
}
@@ -64,7 +64,7 @@
boolean exception = false;
try
{
- new EnterpriseComponentModel<Bear>(new SimpleAnnotatedType<Bear>(Bear.class), getEmptyAnnotatedItem(Bear.class), manager);
+ new EnterpriseBeanModel<Bear>(new SimpleAnnotatedType<Bear>(Bear.class), getEmptyAnnotatedItem(Bear.class), manager);
}
catch (Exception e)
{
@@ -94,7 +94,7 @@
public void testStateful()
{
- AbstractEnterpriseComponentModel<Tiger> tiger = new EnterpriseComponentModel<Tiger>(new SimpleAnnotatedType(Tiger.class), getEmptyAnnotatedItem(Tiger.class), manager);
+ AbstractEnterpriseBeanModel<Tiger> tiger = new EnterpriseBeanModel<Tiger>(new SimpleAnnotatedType(Tiger.class), getEmptyAnnotatedItem(Tiger.class), manager);
Reflections.annotationSetMatches(tiger.getBindingTypes(), Synchronous.class);
assert tiger.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
assert tiger.getName() == null;
@@ -105,7 +105,7 @@
public void testMultipleRemoveMethodsWithDestroys()
{
- AbstractEnterpriseComponentModel<Elephant> elephant = new EnterpriseComponentModel<Elephant>(new SimpleAnnotatedType(Elephant.class), getEmptyAnnotatedItem(Elephant.class), manager);
+ AbstractEnterpriseBeanModel<Elephant> elephant = new EnterpriseBeanModel<Elephant>(new SimpleAnnotatedType(Elephant.class), getEmptyAnnotatedItem(Elephant.class), manager);
assert elephant.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove2");
}
@@ -116,7 +116,7 @@
boolean exception = false;
try
{
- new EnterpriseComponentModel<Puma>(new SimpleAnnotatedType(Puma.class), getEmptyAnnotatedItem(Puma.class), manager);
+ new EnterpriseBeanModel<Puma>(new SimpleAnnotatedType(Puma.class), getEmptyAnnotatedItem(Puma.class), manager);
}
catch (Exception e)
{
@@ -132,7 +132,7 @@
boolean exception = false;
try
{
- new EnterpriseComponentModel<Cougar>(new SimpleAnnotatedType(Cougar.class), getEmptyAnnotatedItem(Cougar.class), manager);
+ new EnterpriseBeanModel<Cougar>(new SimpleAnnotatedType(Cougar.class), getEmptyAnnotatedItem(Cougar.class), manager);
}
catch (Exception e)
{
@@ -148,7 +148,7 @@
boolean exception = false;
try
{
- new EnterpriseComponentModel<Cheetah>(new SimpleAnnotatedType(Cheetah.class), getEmptyAnnotatedItem(Cheetah.class), manager);
+ new EnterpriseBeanModel<Cheetah>(new SimpleAnnotatedType(Cheetah.class), getEmptyAnnotatedItem(Cheetah.class), manager);
}
catch (Exception e)
{
@@ -162,7 +162,7 @@
public void testRemoveMethodWithDefaultBinding()
{
- AbstractEnterpriseComponentModel<Panther> panther = new EnterpriseComponentModel<Panther>(new SimpleAnnotatedType<Panther>(Panther.class), getEmptyAnnotatedItem(Panther.class), manager);
+ AbstractEnterpriseBeanModel<Panther> panther = new EnterpriseBeanModel<Panther>(new SimpleAnnotatedType<Panther>(Panther.class), getEmptyAnnotatedItem(Panther.class), manager);
assert panther.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
assert panther.getRemoveMethod().getParameters().size() == 1;
@@ -175,7 +175,7 @@
@Test
public void testMessageDriven()
{
- AbstractEnterpriseComponentModel<Leopard> leopard = new EnterpriseComponentModel<Leopard>(new SimpleAnnotatedType(Leopard.class), getEmptyAnnotatedItem(Leopard.class), manager);
+ AbstractEnterpriseBeanModel<Leopard> leopard = new EnterpriseBeanModel<Leopard>(new SimpleAnnotatedType(Leopard.class), getEmptyAnnotatedItem(Leopard.class), manager);
Reflections.annotationSetMatches(leopard.getBindingTypes(), Current.class);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -11,9 +11,9 @@
import javax.webbeans.Standard;
import org.jboss.webbeans.event.EventImpl;
-import org.jboss.webbeans.injectable.ComponentConstructor;
+import org.jboss.webbeans.injectable.BeanConstructor;
import org.jboss.webbeans.introspector.SimpleAnnotatedField;
-import org.jboss.webbeans.model.EventComponentModel;
+import org.jboss.webbeans.model.bean.EventBeanModel;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.components.DangerCall;
import org.jboss.webbeans.test.mock.MockManagerImpl;
@@ -30,7 +30,7 @@
public class EventComponentModelTest
{
private MockManagerImpl manager = null;
- private EventComponentModel<EventImpl<DangerCall>> eventComponentModel = null;
+ private EventBeanModel<EventImpl<DangerCall>> eventBeanModel = null;
EventImpl<DangerCall> eventModelField = null;
@BeforeMethod
@@ -41,7 +41,7 @@
enabledDeploymentTypes.add(AnotherDeploymentType.class);
manager = new MockManagerImpl(enabledDeploymentTypes);
Field eventModelField = this.getClass().getDeclaredField("eventModelField");
- eventComponentModel = new EventComponentModel<EventImpl<DangerCall>>(
+ eventBeanModel = new EventBeanModel<EventImpl<DangerCall>>(
new SimpleAnnotatedField<EventImpl<DangerCall>>(eventModelField),
new SimpleAnnotatedField<EventImpl<DangerCall>>(eventModelField),
manager);
@@ -54,7 +54,7 @@
@Test(groups = "eventbus")
public void testName()
{
- assert eventComponentModel.getName() == null;
+ assert eventBeanModel.getName() == null;
}
/**
@@ -63,7 +63,7 @@
@Test(groups = "eventbus")
public void testScopeType()
{
- assert eventComponentModel.getScopeType().equals(Dependent.class);
+ assert eventBeanModel.getScopeType().equals(Dependent.class);
}
/**
@@ -72,13 +72,13 @@
@Test(groups = "eventbus")
public void testDeploymentType()
{
- assert eventComponentModel.getDeploymentType().equals(Standard.class);
+ assert eventBeanModel.getDeploymentType().equals(Standard.class);
}
@Test(groups = "eventbus")
public void testApiTypes()
{
- Set<Class<?>> apis = eventComponentModel.getApiTypes();
+ Set<Class<?>> apis = eventBeanModel.getApiTypes();
assert apis.size() >= 1;
for (Class<?> api : apis)
{
@@ -89,7 +89,7 @@
@Test(groups = "eventbus")
public void testConstructor()
{
- ComponentConstructor<EventImpl<DangerCall>> constructor = eventComponentModel.getConstructor();
+ BeanConstructor<EventImpl<DangerCall>> constructor = eventBeanModel.getConstructor();
assert constructor != null;
Event<DangerCall> event = constructor.invoke(manager);
assert event != null;
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-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -10,7 +10,7 @@
import org.jboss.webbeans.ResolutionManager;
import org.jboss.webbeans.injectable.InjectableField;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.components.Cod;
import org.jboss.webbeans.test.components.FishFarm;
import org.jboss.webbeans.test.components.Salmon;
@@ -25,9 +25,9 @@
public void testAmbiguousDependencies() throws Exception
{
InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
manager.addBean(plaiceBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -42,8 +42,8 @@
public void testUnsatisfiedDependencies() throws Exception
{
InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
manager.addBean(codBean);
manager.addBean(salmonBean);
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-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -13,7 +13,7 @@
import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
import org.jboss.webbeans.injectable.InjectableField;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.Whitefish;
import org.jboss.webbeans.test.components.Cod;
import org.jboss.webbeans.test.components.FishFarm;
@@ -32,9 +32,9 @@
public void testAmbiguousDependencies() throws Exception
{
InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
manager.addBean(plaiceBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -49,9 +49,9 @@
public void testUnsatisfiedDependencies() throws Exception
{
InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
manager.addBean(plaiceBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -66,7 +66,7 @@
public void testUnproxyableDependencies() throws Exception
{
InjectableField<Plaice> plaiceField = new InjectableField<Plaice>(PlaiceFarm.class.getDeclaredField("plaice"));
- Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleComponentModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
+ Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleBeanModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
manager.addBean(plaiceBean);
ResolutionManager resolutionManager = manager.getResolutionManager();
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -6,7 +6,7 @@
import org.jboss.webbeans.BeanImpl;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.components.Cod;
import org.jboss.webbeans.test.components.Haddock;
import org.jboss.webbeans.test.components.Plaice;
@@ -21,13 +21,13 @@
@Test
public void testNamedBasedResolution()
{
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
- Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
- Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
- Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleComponentModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
+ Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
+ Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleBeanModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
manager.addBean(tunaBean);
manager.addBean(codBean);
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-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -15,7 +15,7 @@
import org.jboss.webbeans.injectable.InjectableMethod;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.Asynchronous;
import org.jboss.webbeans.test.bindings.AsynchronousAnnotationLiteral;
@@ -35,7 +35,7 @@
public class ObserverTest
{
private ManagerImpl manager;
- private SimpleComponentModel<Tuna> tuna;
+ private SimpleBeanModel<Tuna> tuna;
private InjectableMethod<?> om;
public class Event
@@ -66,7 +66,7 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
AnnotatedType<Tuna> annotatedItem = new SimpleAnnotatedType<Tuna>(Tuna.class, annotations);
- tuna = new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
+ tuna = new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
om = new InjectableMethod<Object>(AnObserver.class.getMethod("observe", new Class[] { Event.class }));
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -9,8 +9,8 @@
import org.jboss.webbeans.introspector.SimpleAnnotatedMethod;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.ProducerMethodComponentModel;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.ProducerMethodBeanModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.Tame;
import org.jboss.webbeans.test.components.Animal;
import org.jboss.webbeans.test.components.BlackWidow;
@@ -32,13 +32,13 @@
@Test @SpecAssertion(section="3.3")
public void testStaticMethod() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<ComponentWithStaticProducerMethod> componentModel = new SimpleComponentModel<ComponentWithStaticProducerMethod>(new SimpleAnnotatedType<ComponentWithStaticProducerMethod>(ComponentWithStaticProducerMethod.class), getEmptyAnnotatedItem(ComponentWithStaticProducerMethod.class), manager);
- manager.getModelManager().addComponentModel(componentModel);
+ SimpleBeanModel<ComponentWithStaticProducerMethod> componentModel = new SimpleBeanModel<ComponentWithStaticProducerMethod>(new SimpleAnnotatedType<ComponentWithStaticProducerMethod>(ComponentWithStaticProducerMethod.class), getEmptyAnnotatedItem(ComponentWithStaticProducerMethod.class), manager);
+ manager.getModelManager().addBeanModel(componentModel);
Method method = ComponentWithStaticProducerMethod.class.getMethod("getString");
boolean exception = false;
try
{
- new ProducerMethodComponentModel<String>(new SimpleAnnotatedMethod<String>(method), manager);
+ new ProducerMethodBeanModel<String>(new SimpleAnnotatedMethod<String>(method), manager);
}
catch (Exception e)
{
@@ -50,10 +50,10 @@
@Test @SpecAssertion(section="3.3")
public void testApiTypes() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addComponentModel(componentModel);
+ SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodComponentModel<Tarantula> tarantulaModel = new ProducerMethodComponentModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
+ ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
assert tarantulaModel.getApiTypes().contains(Tarantula.class);
assert tarantulaModel.getApiTypes().contains(DeadlySpider.class);
assert tarantulaModel.getApiTypes().contains(Spider.class);
@@ -65,10 +65,10 @@
@Test @SpecAssertion(section="3.3.1")
public void testDefaultBindingType() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addComponentModel(componentModel);
+ SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodComponentModel<Tarantula> tarantulaModel = new ProducerMethodComponentModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
+ ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
assert tarantulaModel.getBindingTypes().size() == 1;
assert tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Current.class);
}
@@ -76,10 +76,10 @@
@Test
public void testBindingType() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addComponentModel(componentModel);
+ SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- ProducerMethodComponentModel<Tarantula> tarantulaModel = new ProducerMethodComponentModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
+ ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
assert tarantulaModel.getBindingTypes().size() == 1;
assert tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Tame.class);
}
@@ -87,13 +87,13 @@
@Test @SpecAssertion(section="3.3")
public void testFinalMethod() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<ComponentWithFinalProducerMethod> componentModel = new SimpleComponentModel<ComponentWithFinalProducerMethod>(new SimpleAnnotatedType<ComponentWithFinalProducerMethod>(ComponentWithFinalProducerMethod.class), getEmptyAnnotatedItem(ComponentWithFinalProducerMethod.class), manager);
- manager.getModelManager().addComponentModel(componentModel);
+ SimpleBeanModel<ComponentWithFinalProducerMethod> componentModel = new SimpleBeanModel<ComponentWithFinalProducerMethod>(new SimpleAnnotatedType<ComponentWithFinalProducerMethod>(ComponentWithFinalProducerMethod.class), getEmptyAnnotatedItem(ComponentWithFinalProducerMethod.class), manager);
+ manager.getModelManager().addBeanModel(componentModel);
Method method = ComponentWithFinalProducerMethod.class.getMethod("getString");
boolean exception = false;
try
{
- new ProducerMethodComponentModel<String>(new SimpleAnnotatedMethod<String>(method), manager);
+ new ProducerMethodBeanModel<String>(new SimpleAnnotatedMethod<String>(method), manager);
}
catch (Exception e)
{
@@ -105,40 +105,40 @@
@Test @SpecAssertion(section="3.3")
public void testFinalMethodWithDependentScope() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addComponentModel(componentModel);
+ SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceTrapdoorSpider");
- ProducerMethodComponentModel<TrapdoorSpider> trapdoorSpiderModel = new ProducerMethodComponentModel<TrapdoorSpider>(new SimpleAnnotatedMethod<TrapdoorSpider>(method), manager);
+ ProducerMethodBeanModel<TrapdoorSpider> trapdoorSpiderModel = new ProducerMethodBeanModel<TrapdoorSpider>(new SimpleAnnotatedMethod<TrapdoorSpider>(method), manager);
assert trapdoorSpiderModel.getScopeType().equals(Dependent.class);
}
@Test @SpecAssertion(section="3.3.6")
public void testNamedMethod() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addComponentModel(componentModel);
+ SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceBlackWidow");
- ProducerMethodComponentModel<BlackWidow> blackWidowSpiderModel = new ProducerMethodComponentModel<BlackWidow>(new SimpleAnnotatedMethod<BlackWidow>(method), manager);
+ ProducerMethodBeanModel<BlackWidow> blackWidowSpiderModel = new ProducerMethodBeanModel<BlackWidow>(new SimpleAnnotatedMethod<BlackWidow>(method), manager);
assert blackWidowSpiderModel.getName().equals("blackWidow");
}
@Test @SpecAssertion(section="3.3.6")
public void testDefaultNamedMethod() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addComponentModel(componentModel);
+ SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
- ProducerMethodComponentModel<DaddyLongLegs> daddyLongLegsSpiderModel = new ProducerMethodComponentModel<DaddyLongLegs>(new SimpleAnnotatedMethod<DaddyLongLegs>(method), manager);
+ ProducerMethodBeanModel<DaddyLongLegs> daddyLongLegsSpiderModel = new ProducerMethodBeanModel<DaddyLongLegs>(new SimpleAnnotatedMethod<DaddyLongLegs>(method), manager);
assert daddyLongLegsSpiderModel.getName().equals("produceDaddyLongLegs");
}
@Test @SpecAssertion(section="3.3.6")
public void testDefaultNamedJavaBeanMethod() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
- manager.getModelManager().addComponentModel(componentModel);
+ SimpleBeanModel<SpiderProducer> componentModel = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(componentModel);
Method method = SpiderProducer.class.getMethod("getLadybirdSpider");
- ProducerMethodComponentModel<LadybirdSpider> ladybirdSpiderModel = new ProducerMethodComponentModel<LadybirdSpider>(new SimpleAnnotatedMethod<LadybirdSpider>(method), manager);
+ ProducerMethodBeanModel<LadybirdSpider> ladybirdSpiderModel = new ProducerMethodBeanModel<LadybirdSpider>(new SimpleAnnotatedMethod<LadybirdSpider>(method), manager);
assert ladybirdSpiderModel.getName().equals("ladybirdSpider");
}
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-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -15,7 +15,7 @@
import org.jboss.webbeans.bindings.RequestScopedAnnotationLiteral;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.AnimalStereotype;
import org.jboss.webbeans.test.annotations.FishStereotype;
import org.jboss.webbeans.test.annotations.RiverFishStereotype;
@@ -59,7 +59,7 @@
@Test @SpecAssertion(section="2.4.3")
public void testScopeDeclaredInJava()
{
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), manager);
assert trout.getScopeType().equals(RequestScoped.class);
}
@@ -69,7 +69,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<ComponentWithTooManyScopeTypes>(new SimpleAnnotatedType<ComponentWithTooManyScopeTypes>(ComponentWithTooManyScopeTypes.class), getEmptyAnnotatedItem(ComponentWithTooManyScopeTypes.class), manager);
+ new SimpleBeanModel<ComponentWithTooManyScopeTypes>(new SimpleAnnotatedType<ComponentWithTooManyScopeTypes>(ComponentWithTooManyScopeTypes.class), getEmptyAnnotatedItem(ComponentWithTooManyScopeTypes.class), manager);
}
catch (Exception e)
{
@@ -88,7 +88,7 @@
annotations.put(RequestScoped.class, new RequestScopedAnnotationLiteral());
annotations.put(ConversationScoped.class, new ConversationScopedAnnotationLiteral());
AnnotatedType<Antelope> antelopeAnnotatedItem = new SimpleAnnotatedType<Antelope>(Antelope.class, annotations);
- new SimpleComponentModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), antelopeAnnotatedItem, manager);
+ new SimpleBeanModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), antelopeAnnotatedItem, manager);
}
catch (Exception e)
{
@@ -104,7 +104,7 @@
annotations.put(RequestScoped.class, new RequestScopedAnnotationLiteral());
AnnotatedType<Order> annotatedItem = new SimpleAnnotatedType<Order>(Order.class, annotations);
- SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType<Order>(Order.class), annotatedItem, manager);
+ SimpleBeanModel<Order> order = new SimpleBeanModel<Order>(new SimpleAnnotatedType<Order>(Order.class), annotatedItem, manager);
assert order.getScopeType().equals(RequestScoped.class);
}
@@ -114,7 +114,7 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
assert trout.getScopeType().equals(RequestScoped.class);
}
@@ -124,14 +124,14 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(ConversationScoped.class, new ConversationScopedAnnotationLiteral());
AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
assert trout.getScopeType().equals(ConversationScoped.class);
}
@Test @SpecAssertion(section="2.4.5")
public void testDefaultScope()
{
- SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType<Order>(Order.class), getEmptyAnnotatedItem(Order.class), manager);
+ SimpleBeanModel<Order> order = new SimpleBeanModel<Order>(new SimpleAnnotatedType<Order>(Order.class), getEmptyAnnotatedItem(Order.class), manager);
assert order.getScopeType().equals(Dependent.class);
}
@@ -141,7 +141,7 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
assert trout.getScopeType().equals(RequestScoped.class);
}
@@ -156,7 +156,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), annotatedItem, manager);
+ new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), annotatedItem, manager);
}
catch (Exception e)
{
@@ -173,7 +173,7 @@
annotations.put(AnimalStereotype.class, new AnimalStereotypeAnnotationLiteral());
AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
assert trout.getScopeType().equals(RequestScoped.class);
}
@@ -185,7 +185,7 @@
annotations.put(RiverFishStereotype.class, new RiverFishStereotypeAnnotationLiteral());
AnnotatedType<Haddock> annotatedItem = new SimpleAnnotatedType<Haddock>(Haddock.class, annotations);
- SimpleComponentModel<Haddock> haddock = new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), annotatedItem, manager);
+ SimpleBeanModel<Haddock> haddock = new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), annotatedItem, manager);
assert haddock.getScopeType().equals(ApplicationScoped.class);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -17,7 +17,7 @@
import org.jboss.webbeans.bindings.DependentAnnotationLiteral;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.FishStereotype;
import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
@@ -59,7 +59,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<ComponentWithTooManyDeploymentTypes>(new SimpleAnnotatedType<ComponentWithTooManyDeploymentTypes>(ComponentWithTooManyDeploymentTypes.class), getEmptyAnnotatedItem(ComponentWithTooManyDeploymentTypes.class), manager);
+ new SimpleBeanModel<ComponentWithTooManyDeploymentTypes>(new SimpleAnnotatedType<ComponentWithTooManyDeploymentTypes>(ComponentWithTooManyDeploymentTypes.class), getEmptyAnnotatedItem(ComponentWithTooManyDeploymentTypes.class), manager);
}
catch (Exception e)
{
@@ -75,7 +75,7 @@
xmlDefinedDeploymentTypeAnnotations.put(AnotherDeploymentType.class, new AnotherDeploymentTypeAnnotationLiteral());
AnnotatedType<ComponentWithTooManyDeploymentTypes> xmlDefinedDeploymentTypeAnnotatedItem = new SimpleAnnotatedType<ComponentWithTooManyDeploymentTypes>(ComponentWithTooManyDeploymentTypes.class, xmlDefinedDeploymentTypeAnnotations);
- SimpleComponentModel<ComponentWithTooManyDeploymentTypes> component = new SimpleComponentModel<ComponentWithTooManyDeploymentTypes>(new SimpleAnnotatedType<ComponentWithTooManyDeploymentTypes>(ComponentWithTooManyDeploymentTypes.class), xmlDefinedDeploymentTypeAnnotatedItem, manager);
+ SimpleBeanModel<ComponentWithTooManyDeploymentTypes> component = new SimpleBeanModel<ComponentWithTooManyDeploymentTypes>(new SimpleAnnotatedType<ComponentWithTooManyDeploymentTypes>(ComponentWithTooManyDeploymentTypes.class), xmlDefinedDeploymentTypeAnnotatedItem, manager);
assert component.getDeploymentType().equals(AnotherDeploymentType.class);
}
@@ -83,7 +83,7 @@
public void testXmlDefaultDeploymentType()
{
AnnotatedType<Antelope> antelopeAnnotatedItem = new SimpleAnnotatedType<Antelope>(Antelope.class, new HashMap<Class<? extends Annotation>, Annotation>());
- SimpleComponentModel<Antelope> antelope = new SimpleComponentModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), antelopeAnnotatedItem, manager);
+ SimpleBeanModel<Antelope> antelope = new SimpleBeanModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), antelopeAnnotatedItem, manager);
assert antelope.getDeploymentType().equals(Production.class);
}
@@ -91,7 +91,7 @@
public void testXmlRespectsJavaDeploymentType()
{
AnnotatedType<Tuna> annotatedItem = new SimpleAnnotatedType<Tuna>(Tuna.class, new HashMap<Class<? extends Annotation>, Annotation>());
- SimpleComponentModel<Tuna> tuna = new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
+ SimpleBeanModel<Tuna> tuna = new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
assert tuna.getDeploymentType().equals(AnotherDeploymentType.class);
}
@@ -102,7 +102,7 @@
annotations.put(HornedMammalStereotype.class, new HornedMamalStereotypeAnnotationLiteral());
AnnotatedType<Moose> annotatedItem = new SimpleAnnotatedType<Moose>(Moose.class, annotations);
- SimpleComponentModel<Moose> moose = new SimpleComponentModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), annotatedItem, manager);
+ SimpleBeanModel<Moose> moose = new SimpleBeanModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), annotatedItem, manager);
assert moose.getDeploymentType().equals(HornedAnimalDeploymentType.class);
}
@@ -113,7 +113,7 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
assert trout.getScopeType().equals(RequestScoped.class);
}
@@ -126,7 +126,7 @@
@Test @SpecAssertion(section="2.6.1")
public void testDefaultNamed()
{
- SimpleComponentModel<Haddock> haddock = new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), manager);
+ SimpleBeanModel<Haddock> haddock = new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), manager);
assert haddock.getName() != null;
assert haddock.getName().equals("haddock");
}
@@ -144,7 +144,7 @@
});
AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
assert trout.getName() != null;
assert trout.getName().equals("seaBass");
@@ -163,7 +163,7 @@
});
AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
assert trout.getName().equals("aTrout");
}
@@ -171,14 +171,14 @@
@Test @SpecAssertion(section="2.6.4")
public void testNotNamed()
{
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), manager);
assert trout.getName() == null;
}
@Test @SpecAssertion(section="2.6.1")
public void testNonDefaultNamed()
{
- SimpleComponentModel<Moose> moose = new SimpleComponentModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), getEmptyAnnotatedItem(Moose.class), manager);
+ SimpleBeanModel<Moose> moose = new SimpleBeanModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), getEmptyAnnotatedItem(Moose.class), manager);
assert moose.getName().equals("aMoose");
}
@@ -202,7 +202,7 @@
});
AnnotatedType currentSynchronousOrderAnnotatedItem = new SimpleAnnotatedType(Order.class, orderXmlAnnotations);
- SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType(Order.class), currentSynchronousOrderAnnotatedItem, manager);
+ SimpleBeanModel<Order> order = new SimpleBeanModel<Order>(new SimpleAnnotatedType(Order.class), currentSynchronousOrderAnnotatedItem, manager);
assert Production.class.equals(order.getDeploymentType());
assert "currentSynchronousOrder".equals(order.getName());
assert order.getBindingTypes().size() == 2;
@@ -213,7 +213,7 @@
@Test @SpecAssertion(section="2.7.2")
public void testSingleStereotype()
{
- SimpleComponentModel<Gorilla> gorilla = new SimpleComponentModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedItem(Gorilla.class), manager);
+ SimpleBeanModel<Gorilla> gorilla = new SimpleBeanModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedItem(Gorilla.class), manager);
assert gorilla.getName() == null;
assert gorilla.getDeploymentType().equals(Production.class);
assert gorilla.getBindingTypes().iterator().next().annotationType().equals(Current.class);
@@ -225,7 +225,7 @@
{
try
{
- new SimpleComponentModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedItem(Gorilla.class), manager);
+ new SimpleBeanModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedItem(Gorilla.class), manager);
}
catch (Exception e)
{
@@ -237,7 +237,7 @@
@Test(expectedExceptions=Exception.class) @SpecAssertion(section="2.7.4")
public void testRequiredTypeIsNotImplemented()
{
- new SimpleComponentModel<Chair>(new SimpleAnnotatedType<Chair>(Chair.class), getEmptyAnnotatedItem(Chair.class), manager);
+ new SimpleBeanModel<Chair>(new SimpleAnnotatedType<Chair>(Chair.class), getEmptyAnnotatedItem(Chair.class), manager);
}
@Test @SpecAssertion(section="2.7.4")
@@ -245,7 +245,7 @@
{
try
{
- new SimpleComponentModel<Goldfish>(new SimpleAnnotatedType<Goldfish>(Goldfish.class), getEmptyAnnotatedItem(Goldfish.class), manager);
+ new SimpleBeanModel<Goldfish>(new SimpleAnnotatedType<Goldfish>(Goldfish.class), getEmptyAnnotatedItem(Goldfish.class), manager);
}
catch (Exception e)
{
@@ -257,7 +257,7 @@
@Test(expectedExceptions=Exception.class) @SpecAssertion(section="2.7.4")
public void testScopeIsNotSupported()
{
- new SimpleComponentModel<Carp>(new SimpleAnnotatedType<Carp>(Carp.class), getEmptyAnnotatedItem(Carp.class), manager);
+ new SimpleBeanModel<Carp>(new SimpleAnnotatedType<Carp>(Carp.class), getEmptyAnnotatedItem(Carp.class), manager);
}
@Test @SpecAssertion(section="2.7.2")
@@ -274,7 +274,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Cow>(new SimpleAnnotatedType<Cow>(Cow.class), getEmptyAnnotatedItem(Cow.class), manager);
+ new SimpleBeanModel<Cow>(new SimpleAnnotatedType<Cow>(Cow.class), getEmptyAnnotatedItem(Cow.class), manager);
}
catch (Exception e)
{
@@ -289,7 +289,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<InnerComponent>(new SimpleAnnotatedType<InnerComponent>(InnerComponent.class), getEmptyAnnotatedItem(InnerComponent.class), manager);
+ new SimpleBeanModel<InnerComponent>(new SimpleAnnotatedType<InnerComponent>(InnerComponent.class), getEmptyAnnotatedItem(InnerComponent.class), manager);
}
catch (Exception e)
{
@@ -304,7 +304,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Horse>(new SimpleAnnotatedType<Horse>(Horse.class), getEmptyAnnotatedItem(Horse.class), manager);
+ new SimpleBeanModel<Horse>(new SimpleAnnotatedType<Horse>(Horse.class), getEmptyAnnotatedItem(Horse.class), manager);
}
catch (Exception e)
{
@@ -317,7 +317,7 @@
AnnotatedType<Horse> annotatedItem = new SimpleAnnotatedType<Horse>(Horse.class, annotations);
try
{
- new SimpleComponentModel<Horse>(new SimpleAnnotatedType<Horse>(Horse.class), annotatedItem, manager);
+ new SimpleBeanModel<Horse>(new SimpleAnnotatedType<Horse>(Horse.class), annotatedItem, manager);
}
catch (Exception e)
{
@@ -331,7 +331,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Pig>(new SimpleAnnotatedType<Pig>(Pig.class), getEmptyAnnotatedItem(Pig.class), manager);
+ new SimpleBeanModel<Pig>(new SimpleAnnotatedType<Pig>(Pig.class), getEmptyAnnotatedItem(Pig.class), manager);
}
catch (Exception e)
{
@@ -344,7 +344,7 @@
AnnotatedType<Pig> annotatedItem = new SimpleAnnotatedType<Pig>(Pig.class, annotations);
try
{
- new SimpleComponentModel<Pig>(new SimpleAnnotatedType<Pig>(Pig.class), annotatedItem, manager);
+ new SimpleBeanModel<Pig>(new SimpleAnnotatedType<Pig>(Pig.class), annotatedItem, manager);
}
catch (Exception e)
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -49,7 +49,7 @@
assert animalStereotype.getRequiredTypes().size() == 1;
assert animalStereotype.getRequiredTypes().contains(Animal.class);
assert animalStereotype.getSupportedScopes().size() == 0;
- assert !animalStereotype.isComponentNameDefaulted();
+ assert !animalStereotype.isBeanNameDefaulted();
assert animalStereotype.getDefaultDeploymentType() == null;
}
@@ -63,7 +63,7 @@
Class<?> [] requiredTypes = {Animal.class, Order.class};
assert animalStereotype.getRequiredTypes().containsAll(Arrays.asList(requiredTypes));
assert animalStereotype.getSupportedScopes().size() == 0;
- assert !animalStereotype.isComponentNameDefaulted();
+ assert !animalStereotype.isBeanNameDefaulted();
assert animalStereotype.getDefaultDeploymentType() == null;
}
@@ -77,7 +77,7 @@
assert Animal.class.equals(animalStereotype.getRequiredTypes().iterator().next());
assert animalStereotype.getSupportedScopes().size() == 1;
assert animalStereotype.getSupportedScopes().contains(RequestScoped.class);
- assert !animalStereotype.isComponentNameDefaulted();
+ assert !animalStereotype.isBeanNameDefaulted();
assert animalStereotype.getDefaultDeploymentType() == null;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -15,7 +15,7 @@
import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
import org.jboss.webbeans.injectable.InjectableField;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.Whitefish;
import org.jboss.webbeans.test.bindings.ChunkyAnnotationLiteral;
import org.jboss.webbeans.test.components.Animal;
@@ -51,7 +51,7 @@
public void testSingleApiTypeWithCurrent() throws Exception
{
InjectableField<Tuna> tunaField = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
Set<Bean<?>> beans = new HashSet<Bean<?>>();
beans.add(tunaBean);
Set<Bean<?>> possibleTargets = tunaField.getMatchingBeans(beans);
@@ -63,9 +63,9 @@
public void testOneBindingType() throws Exception
{
InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
Set<Bean<?>> beans = new HashSet<Bean<?>>();
beans.add(codBean);
beans.add(salmonBean);
@@ -80,9 +80,9 @@
public void testABindingType() throws Exception
{
InjectableField<Animal> whiteChunkyFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"));
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
Set<Bean<?>> beans = new HashSet<Bean<?>>();
beans.add(codBean);
beans.add(salmonBean);
@@ -96,8 +96,8 @@
public void testMultipleApiTypeWithCurrent() throws Exception
{
InjectableField<Animal> animalField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("animal"));
- Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
- Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
+ Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
+ Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
Set<Bean<?>> beans = new HashSet<Bean<?>>();
beans.add(seaBassBean);
beans.add(haddockBean);
@@ -115,12 +115,12 @@
InjectableField<ScottishFish> scottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
InjectableField<Tuna> tunaField = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
- Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
- Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
+ Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
manager.addBean(tunaBean);
manager.addBean(codBean);
@@ -174,8 +174,8 @@
{
InjectableField<Farmer<ScottishFish>> scottishFishFarmerField = new InjectableField<Farmer<ScottishFish>>(FishFarm.class.getDeclaredField("scottishFishFarmer"));
- Bean<ScottishFishFarmer> scottishFishFarmerBean = new BeanImpl<ScottishFishFarmer>(new SimpleComponentModel<ScottishFishFarmer>(new SimpleAnnotatedType<ScottishFishFarmer>(ScottishFishFarmer.class), getEmptyAnnotatedItem(ScottishFishFarmer.class), super.manager), manager);
- Bean<Farmer> farmerBean = new BeanImpl<Farmer>(new SimpleComponentModel<Farmer>(new SimpleAnnotatedType<Farmer>(Farmer.class), getEmptyAnnotatedItem(Farmer.class), super.manager), manager);
+ Bean<ScottishFishFarmer> scottishFishFarmerBean = new BeanImpl<ScottishFishFarmer>(new SimpleBeanModel<ScottishFishFarmer>(new SimpleAnnotatedType<ScottishFishFarmer>(ScottishFishFarmer.class), getEmptyAnnotatedItem(ScottishFishFarmer.class), super.manager), manager);
+ Bean<Farmer> farmerBean = new BeanImpl<Farmer>(new SimpleBeanModel<Farmer>(new SimpleAnnotatedType<Farmer>(Farmer.class), getEmptyAnnotatedItem(Farmer.class), super.manager), manager);
manager.addBean(scottishFishFarmerBean);
manager.addBean(farmerBean);
@@ -192,9 +192,9 @@
{
InjectableField<Animal> whiteFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("whiteFish"));
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
- Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleComponentModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleBeanModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
manager.addBean(plaiceBean);
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-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -4,7 +4,7 @@
import org.jboss.webbeans.event.ObserverImpl;
import org.jboss.webbeans.injectable.InjectableMethod;
-import org.jboss.webbeans.model.AbstractComponentModel;
+import org.jboss.webbeans.model.bean.BeanModel;
/**
* An implementation used for unit testing only.
@@ -17,7 +17,7 @@
- public MockObserverImpl(AbstractComponentModel<?, ?> componentModel,
+ public MockObserverImpl(BeanModel<?, ?> componentModel,
InjectableMethod<?> observer, Class<T> eventType)
{
super(componentModel, observer, eventType);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java 2008-10-25 18:49:56 UTC (rev 149)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java 2008-10-25 19:12:52 UTC (rev 150)
@@ -7,7 +7,7 @@
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
public class Util
@@ -17,9 +17,9 @@
return new BeanImpl<T>(createSimpleModel(clazz, manager), manager);
}
- public static <T> SimpleComponentModel<T> createSimpleModel(Class<T> clazz, ManagerImpl manager)
+ public static <T> SimpleBeanModel<T> createSimpleModel(Class<T> clazz, ManagerImpl manager)
{
- return new SimpleComponentModel<T>(new SimpleAnnotatedType<T>(clazz), getEmptyAnnotatedItem(clazz), manager);
+ return new SimpleBeanModel<T>(new SimpleAnnotatedType<T>(clazz), getEmptyAnnotatedItem(clazz), manager);
}
public static <T> AnnotatedType<T> getEmptyAnnotatedItem(Class<T> type)
15 years, 10 months
[webbeans-commits] Webbeans SVN: r149 - in ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test: util and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-25 14:49:56 -0400 (Sat, 25 Oct 2008)
New Revision: 149
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/BindingTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.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/NameBasedResolutionTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.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/SimpleComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java
Log:
Add utility classes for creating simple models and simple beans
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-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -2,14 +2,12 @@
import java.lang.annotation.Annotation;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import javax.webbeans.Production;
import javax.webbeans.Standard;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.StereotypeModel;
import org.jboss.webbeans.test.annotations.AnimalStereotype;
@@ -52,10 +50,5 @@
container.getModelManager().addStereotype(new StereotypeModel<RiverFishStereotype>(new SimpleAnnotatedType<RiverFishStereotype>(RiverFishStereotype.class)));
container.getModelManager().addStereotype(new StereotypeModel<RequestScopedAnimalStereotype>(new SimpleAnnotatedType<RequestScopedAnimalStereotype>(RequestScopedAnimalStereotype.class)));
}
-
- protected static <T> AnnotatedType<T> getEmptyAnnotatedItem(Class<T> type)
- {
- return new SimpleAnnotatedType<T>(type, new HashMap<Class<? extends Annotation>, Annotation>());
- }
}
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-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,8 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.createSimpleModel;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.Map;
@@ -25,7 +28,7 @@
@Test @SpecAssertion(section={"2.3.3", "2.3.1"})
public void testDefaultBindingTypeDeclaredInJava()
{
- SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType(Order.class), getEmptyAnnotatedItem(Order.class), manager);
+ SimpleComponentModel<Order> order = createSimpleModel(Order.class, manager);
assert order.getBindingTypes().size() == 1;
order.getBindingTypes().iterator().next().annotationType().equals(Current.class);
}
@@ -58,7 +61,7 @@
@Test @SpecAssertion(section="2.3.3")
public void testBindingTypesDeclaredInJava()
{
- SimpleComponentModel<Cat> cat = new SimpleComponentModel<Cat>(new SimpleAnnotatedType(Cat.class), getEmptyAnnotatedItem(Cat.class), manager);
+ SimpleComponentModel<Cat> cat = createSimpleModel(Cat.class, manager);
assert cat.getBindingTypes().size() == 1;
assert Reflections.annotationSetMatches(cat.getBindingTypes(), Synchronous.class);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
import javax.webbeans.Current;
import org.jboss.webbeans.injectable.SimpleConstructor;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java 2008-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
import javax.webbeans.ContextNotActiveException;
import javax.webbeans.RequestScoped;
import javax.webbeans.manager.Bean;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.Map;
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-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
import javax.webbeans.AmbiguousDependencyException;
import javax.webbeans.UnsatisfiedDependencyException;
import javax.webbeans.manager.Bean;
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-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
import javax.webbeans.AmbiguousDependencyException;
import javax.webbeans.AnnotationLiteral;
import javax.webbeans.UnproxyableDependencyException;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
import javax.webbeans.manager.Bean;
import org.jboss.webbeans.BeanImpl;
@@ -13,7 +15,6 @@
import org.jboss.webbeans.test.components.Sole;
import org.jboss.webbeans.test.components.Tuna;
import org.testng.annotations.Test;
-
public class NameBasedResolutionTest extends AbstractTest
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java 2008-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
import java.lang.reflect.Method;
import javax.webbeans.Current;
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-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.Map;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java 2008-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,6 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
import java.lang.annotation.Annotation;
import java.util.HashMap;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java 2008-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+
import java.util.HashSet;
import java.util.Set;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java 2008-10-25 18:38:53 UTC (rev 148)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java 2008-10-25 18:49:56 UTC (rev 149)
@@ -1,7 +1,32 @@
package org.jboss.webbeans.test.util;
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+import org.jboss.webbeans.BeanImpl;
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.introspector.AnnotatedType;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.SimpleComponentModel;
+
+
public class Util
{
+ public static <T> BeanImpl<T> createSimpleWebBean(Class<T> clazz, ManagerImpl manager)
+ {
+ return new BeanImpl<T>(createSimpleModel(clazz, manager), manager);
+ }
+ public static <T> SimpleComponentModel<T> createSimpleModel(Class<T> clazz, ManagerImpl manager)
+ {
+ return new SimpleComponentModel<T>(new SimpleAnnotatedType<T>(clazz), getEmptyAnnotatedItem(clazz), manager);
+ }
+
+ public static <T> AnnotatedType<T> getEmptyAnnotatedItem(Class<T> type)
+ {
+ return new SimpleAnnotatedType<T>(type, new HashMap<Class<? extends Annotation>, Annotation>());
+ }
+
+
+
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r148 - in ri/trunk/webbeans-ri/src: main/java/org/jboss/webbeans/exceptions and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-25 14:38:53 -0400 (Sat, 25 Oct 2008)
New Revision: 148
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/Location.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NameResolutionLocation.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NotAScopeException.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/TypesafeResolutionLocation.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ClientProxy.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/TypeSafeResolutionTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/PlaiceFarm.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java
Log:
Add instantiation
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-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -2,18 +2,19 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import javax.webbeans.AmbiguousDependencyException;
import javax.webbeans.DeploymentException;
import javax.webbeans.Observer;
import javax.webbeans.Production;
import javax.webbeans.Standard;
import javax.webbeans.TypeLiteral;
+import javax.webbeans.UnproxyableDependencyException;
+import javax.webbeans.UnsatisfiedDependencyException;
import javax.webbeans.manager.Bean;
import javax.webbeans.manager.Context;
import javax.webbeans.manager.Decorator;
@@ -21,16 +22,16 @@
import javax.webbeans.manager.Interceptor;
import javax.webbeans.manager.Manager;
-import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
import org.jboss.webbeans.ejb.EjbManager;
import org.jboss.webbeans.event.EventBus;
+import org.jboss.webbeans.exceptions.NameResolutionLocation;
+import org.jboss.webbeans.exceptions.TypesafeResolutionLocation;
import org.jboss.webbeans.injectable.Injectable;
import org.jboss.webbeans.injectable.SimpleInjectable;
+import org.jboss.webbeans.util.ClientProxy;
public class ManagerImpl implements Manager
{
-
- private static final Annotation[] DEFAULT_BINDING = {new CurrentAnnotationLiteral()};
private List<Class<? extends Annotation>> enabledDeploymentTypes;
private ModelManager modelManager;
@@ -47,7 +48,7 @@
this.ejbLookupManager = new EjbManager();
this.beans = new HashSet<Bean<?>>();
this.eventBus = new EventBus();
- resolutionManager = new ResolutionManager(this);
+ this.resolutionManager = new ResolutionManager(this);
}
private void initEnabledDeploymentTypes(
@@ -108,41 +109,20 @@
return ejbLookupManager;
}
- public <T> Set<Bean<T>> resolveByType(Class<T> apiType,
+ public <T> Set<Bean<T>> resolveByType(Class<T> type,
Annotation... bindingTypes)
{
- return resolveByType(apiType, bindingTypes, new Type[0]);
+ return resolveByType(new SimpleInjectable<T>(type, bindingTypes));
}
public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,
Annotation... bindingTypes)
{
- if (apiType.getType() instanceof ParameterizedType)
- {
- return resolveByType(apiType.getRawType(), bindingTypes, ((ParameterizedType) apiType.getType()).getActualTypeArguments());
- }
- else
- {
- return resolveByType(apiType.getRawType(), bindingTypes, new Type[0]);
- }
-
+ return resolveByType(new SimpleInjectable<T>(apiType, bindingTypes));
}
- private <T> Set<Bean<T>> resolveByType(Class<T> apiType, Annotation[] bindingTypes, Type[] actualTypeArguements)
+ private <T> Set<Bean<T>> resolveByType(Injectable<T, ?> injectable)
{
- if (bindingTypes.length == 0)
- {
- bindingTypes = DEFAULT_BINDING;
- }
- Injectable<T, ?> injectable = null;
- if (actualTypeArguements.length > 0)
- {
- injectable = new SimpleInjectable<T>(apiType, bindingTypes, actualTypeArguements);
- }
- else
- {
- injectable = new SimpleInjectable<T>(apiType, bindingTypes);
- }
Set<Bean<T>> beans = getResolutionManager().get(injectable);
if (beans == null)
{
@@ -211,44 +191,78 @@
public <T> T getInstance(Bean<T> bean)
{
- // TODO Auto-generated method stub
- return null;
+ if (getModelManager().getScopeModel(bean.getScopeType()).isNormal())
+ {
+ // TODO return a client proxy
+ return null;
+ }
+ else
+ {
+ return getContext(bean.getScopeType()).get(bean, true);
+ }
}
public Object getInstanceByName(String name)
{
- // TODO Auto-generated method stub
- return null;
+ Set<Bean<?>> beans = resolveByName(name);
+ if (beans.size() == 0)
+ {
+ throw new UnsatisfiedDependencyException(new NameResolutionLocation(name) + "Unable to resolve any Web Beans");
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousDependencyException(new NameResolutionLocation(name) + "Resolved multiple Web Beans");
+ }
+ else
+ {
+ return beans.iterator().next();
+ }
}
public <T> T getInstanceByType(Class<T> type, Annotation... bindingTypes)
{
- // TODO Auto-generated method stub
- return null;
+ return getInstanceByType(new SimpleInjectable<T>(type, bindingTypes));
}
-
- public <T> T getInstanceByType(Class<T> type, Set<Annotation> bindingTypes)
+
+ public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindingTypes)
{
- // TODO Auto-generated method stub
- return null;
+ return getInstanceByType(new SimpleInjectable<T>(type, bindingTypes));
}
-
- public <T> T getInstanceByType(TypeLiteral<T> type,
- Annotation... bindingTypes)
+
+ private <T> T getInstanceByType(Injectable<T, ?> injectable)
{
- // TODO Auto-generated method stub
- return null;
+ Set<Bean<T>> beans = resolveByType(injectable);
+ if (beans.size() == 0)
+ {
+ throw new UnsatisfiedDependencyException(new TypesafeResolutionLocation(injectable) + "Unable to resolve any Web Beans");
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousDependencyException(new TypesafeResolutionLocation(injectable) + "Resolved multiple Web Beans");
+ }
+ else
+ {
+ Bean<T> bean = beans.iterator().next();
+ if (getModelManager().getScopeModel(bean.getScopeType()).isNormal() && !ClientProxy.isProxyable(injectable.getType()))
+ {
+ throw new UnproxyableDependencyException(new TypesafeResolutionLocation(injectable) + "Unable to proxy");
+ }
+ else
+ {
+ return getInstance(bean);
+ }
+ }
}
+
+
- public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType,
- Annotation... bindings)
+ public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
{
// TODO Auto-generated method stub
return this;
}
- public <T> Manager removeObserver(Observer<T> observer,
- TypeLiteral<T> eventType, Annotation... bindings)
+ public <T> Manager removeObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
{
// TODO Auto-generated method stub
return this;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -5,15 +5,34 @@
import java.util.Map;
import org.jboss.webbeans.model.AbstractComponentModel;
+import org.jboss.webbeans.model.ScopeModel;
import org.jboss.webbeans.model.StereotypeModel;
+import org.jboss.webbeans.util.MapWrapper;
public class ModelManager
{
- // TODO Store these in the application context (when it exists)
- private static Map<Class<? extends Annotation>, StereotypeModel<?>> stereotypes = new HashMap<Class<? extends Annotation>, StereotypeModel<?>>();
- private static Map<Class<?>, AbstractComponentModel<?, ?>> componentModels = new HashMap<Class<?>, AbstractComponentModel<?,?>>();
+ @SuppressWarnings("unchecked")
+ private class ScopeModelMap extends MapWrapper<Class<? extends Annotation>, ScopeModel<? extends Annotation>>
+ {
+
+ public ScopeModelMap()
+ {
+ super(new HashMap<Class<? extends Annotation>, ScopeModel<? extends Annotation>>());
+ }
+
+ public <T extends Annotation> ScopeModel<T> get(Class<T> key)
+ {
+ return (ScopeModel<T>) super.get(key);
+ }
+ }
+ private Map<Class<? extends Annotation>, StereotypeModel<?>> stereotypes = new HashMap<Class<? extends Annotation>, StereotypeModel<?>>();
+
+ private Map<Class<?>, AbstractComponentModel<?, ?>> componentModels = new HashMap<Class<?>, AbstractComponentModel<?,?>>();
+
+ private ScopeModelMap scopes = new ScopeModelMap();
+
public void addStereotype(StereotypeModel<?> stereotype)
{
@@ -34,5 +53,19 @@
{
return componentModels.get(clazz);
}
+
+ public <T extends Annotation> ScopeModel<T> getScopeModel(Class<T> scopeType)
+ {
+ if (scopes.containsKey(scopeType))
+ {
+ return scopes.get(scopeType);
+ }
+ else
+ {
+ ScopeModel<T> scopeModel = new ScopeModel<T>(scopeType);
+ scopes.put(scopeType, scopeModel);
+ return scopeModel;
+ }
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -45,15 +45,9 @@
private ManagerImpl manager;
- private boolean rebuildRequired = true;
-
public ResolutionManager(ManagerImpl manager)
{
- this.resolvedInjectionPoints = new InjectableMap();
this.injectionPoints = new HashSet<Injectable<?,?>>();
-
- this.resolvedNames = new HashMap<String, Set<Bean<?>>>();
-
this.manager = manager;
}
@@ -69,20 +63,19 @@
public void clear()
{
- rebuildRequired = true;
- resolvedInjectionPoints.clear();
- resolvedNames.clear();
+ resolvedInjectionPoints = null;
+ resolvedNames = new HashMap<String, Set<Bean<?>>>();
}
- private void resolveBeans()
+ public void resolveBeans()
{
- if (rebuildRequired)
+ if (resolvedInjectionPoints == null)
{
+ resolvedInjectionPoints = new InjectableMap();
for (Injectable<?, ?> injectable : injectionPoints)
{
registerInjectionPoint(injectable);
}
- rebuildRequired = false;
}
}
@@ -108,29 +101,37 @@
beans.add(bean);
}
}
- resolvedNames.put(name, retainHighestPrecedenceBeans(beans, manager.getEnabledDeploymentTypes()));
+ beans = retainHighestPrecedenceBeans(beans, manager.getEnabledDeploymentTypes());
+ resolvedNames.put(name, beans);
return beans;
}
}
private static Set<Bean<?>> retainHighestPrecedenceBeans(Set<Bean<?>> beans, List<Class<? extends Annotation>> enabledDeploymentTypes)
{
- SortedSet<Class<? extends Annotation>> possibleDeploymentTypes = new TreeSet<Class<? extends Annotation>>(new ListComparator<Class<? extends Annotation>>(enabledDeploymentTypes));
- for (Bean<?> bean : beans)
+ if (beans.size() > 0)
{
- possibleDeploymentTypes.add(bean.getDeploymentType());
- }
- possibleDeploymentTypes.retainAll(enabledDeploymentTypes);
- Class<? extends Annotation> highestPrecedencePossibleDeploymentType = possibleDeploymentTypes.last();
- Set<Bean<?>> trimmed = new HashSet<Bean<?>>();
- for (Bean<?> bean : beans)
- {
- if (bean.getDeploymentType().equals(highestPrecedencePossibleDeploymentType))
+ SortedSet<Class<? extends Annotation>> possibleDeploymentTypes = new TreeSet<Class<? extends Annotation>>(new ListComparator<Class<? extends Annotation>>(enabledDeploymentTypes));
+ for (Bean<?> bean : beans)
{
- trimmed.add(bean);
+ possibleDeploymentTypes.add(bean.getDeploymentType());
}
+ possibleDeploymentTypes.retainAll(enabledDeploymentTypes);
+ Class<? extends Annotation> highestPrecedencePossibleDeploymentType = possibleDeploymentTypes.last();
+ Set<Bean<?>> trimmed = new HashSet<Bean<?>>();
+ for (Bean<?> bean : beans)
+ {
+ if (bean.getDeploymentType().equals(highestPrecedencePossibleDeploymentType))
+ {
+ trimmed.add(bean);
+ }
+ }
+ return trimmed;
}
- return trimmed;
+ else
+ {
+ return beans;
+ }
}
}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/Location.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/Location.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/Location.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -0,0 +1,74 @@
+package org.jboss.webbeans.exceptions;
+
+public class Location
+{
+
+ private String type;
+
+ private String bean;
+
+ private String element;
+
+ public Location(String type, String bean, String element)
+ {
+ super();
+ this.type = type;
+ this.bean = bean;
+ this.element = element;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public String getBean()
+ {
+ return bean;
+ }
+
+ public void setBean(String bean)
+ {
+ this.bean = bean;
+ }
+
+ public String getElement()
+ {
+ return element;
+ }
+
+ public void setElement(String element)
+ {
+ this.element = element;
+ }
+
+ protected String getMessage()
+ {
+ String location = "";
+ if (getType() != null)
+ {
+ location += "type: " + getType() + "; ";
+ }
+ if (getBean() != null)
+ {
+ location += "bean: " + getBean() + "; ";
+ }
+ if (getElement() != null)
+ {
+ location += "element: " + getElement() + "; ";
+ }
+ return location;
+ }
+
+ @Override
+ public String toString()
+ {
+ return getMessage();
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/Location.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NameResolutionLocation.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NameResolutionLocation.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NameResolutionLocation.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -0,0 +1,35 @@
+package org.jboss.webbeans.exceptions;
+
+public class NameResolutionLocation extends Location
+{
+
+ private String target;
+
+ public NameResolutionLocation(String target)
+ {
+ super("Named Based Resolution", null, null);
+
+ }
+
+ public String getTarget()
+ {
+ return target;
+ }
+
+ public void setTarget(String target)
+ {
+ this.target = target;
+ }
+
+ @Override
+ protected String getMessage()
+ {
+ String location = super.getMessage();
+ if (getTarget() != null)
+ {
+ location += "target: " + getTarget() + ";";
+ }
+ return location;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NameResolutionLocation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NotAScopeException.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NotAScopeException.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NotAScopeException.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -0,0 +1,28 @@
+package org.jboss.webbeans.exceptions;
+
+import javax.webbeans.DefinitionException;
+
+public class NotAScopeException extends DefinitionException
+{
+
+ public NotAScopeException()
+ {
+ super();
+ }
+
+ public NotAScopeException(String message, Throwable throwable)
+ {
+ super(message, throwable);
+ }
+
+ public NotAScopeException(String message)
+ {
+ super(message);
+ }
+
+ public NotAScopeException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NotAScopeException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/TypesafeResolutionLocation.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/TypesafeResolutionLocation.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/TypesafeResolutionLocation.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -0,0 +1,66 @@
+package org.jboss.webbeans.exceptions;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import org.jboss.webbeans.injectable.Injectable;
+
+public class TypesafeResolutionLocation extends Location
+{
+
+ private String target;
+
+ private TypesafeResolutionLocation()
+ {
+ super("Typesafe resolution", null, null);
+ }
+
+ public TypesafeResolutionLocation(Injectable<?, ?> injectable)
+ {
+ this();
+ this.target = injectable.getAnnotatedItem().toString();
+ }
+
+ public String getTarget()
+ {
+ return target;
+ }
+
+ public void setTarget(String target)
+ {
+ this.target = target;
+ }
+
+ @Override
+ protected String getMessage()
+ {
+ String location = super.getMessage();
+ if (getTarget() != null)
+ {
+ location += "target: " + getTarget() + "; ";
+ }
+ return location;
+ }
+
+ public static String createMessage(Class<?> type, Type[] actualTypeArguements, Set<Annotation> annotations)
+ {
+ String string = type.toString();
+ if (actualTypeArguements.length > 0)
+ {
+ string += "<";
+ for (int i = 0; i < actualTypeArguements.length; i++)
+ {
+ string += actualTypeArguements[i].toString();
+ if (i < actualTypeArguements.length - 1)
+ {
+ string += ",";
+ }
+ }
+ string += ">";
+ }
+ string += annotations;
+ return string;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/TypesafeResolutionLocation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.injectable;
import java.lang.annotation.Annotation;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
@@ -8,6 +9,7 @@
import javax.webbeans.manager.Bean;
import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
import org.jboss.webbeans.introspector.AnnotatedItem;
/**
@@ -20,6 +22,9 @@
public abstract class Injectable<T, S>
{
+ private static final Annotation[] DEFAULT_BINDING_ARRAY = {new CurrentAnnotationLiteral()};
+ private static final Set<Annotation> DEFAULT_BINDING = new HashSet<Annotation>(Arrays.asList(DEFAULT_BINDING_ARRAY));
+
private AnnotatedItem<T, S> annotatedItem;
public Injectable(AnnotatedItem<T, S> annotatedItem)
@@ -27,9 +32,31 @@
this.annotatedItem = annotatedItem;
}
+ public Annotation[] getBindingTypesAsArray()
+ {
+ Annotation[] annotations = annotatedItem.getAnnotationsAsArray(BindingType.class);
+ // TODO This is in the wrong place, where to put it... Probably best to wrap annotated item...
+ if (annotations.length ==0)
+ {
+ return DEFAULT_BINDING_ARRAY;
+ }
+ else
+ {
+ return annotations;
+ }
+ }
+
public Set<Annotation> getBindingTypes()
{
- return annotatedItem.getAnnotations(BindingType.class);
+ Set<Annotation> annotations = annotatedItem.getAnnotations(BindingType.class);
+ if (annotations.size() == 0)
+ {
+ return DEFAULT_BINDING;
+ }
+ else
+ {
+ return annotations;
+ }
}
protected Injectable() {}
@@ -42,7 +69,7 @@
public T getValue(ManagerImpl manager)
{
- return manager.getInstanceByType(getType(), getBindingTypes());
+ return manager.getInstanceByType(getType(), getBindingTypesAsArray());
}
public Class<? extends T> getType()
@@ -76,7 +103,7 @@
{
Injectable<?, ?> that = (Injectable<?, ?>) other;
return this.getAnnotatedItem().isAssignableFrom(that.getAnnotatedItem()) &&
- that.getAnnotatedItem().getAnnotations(BindingType.class).equals(this.getAnnotatedItem().getAnnotations(BindingType.class));
+ that.getBindingTypes().equals(this.getBindingTypes());
}
else
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -3,6 +3,8 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
+import javax.webbeans.TypeLiteral;
+
import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
public class SimpleInjectable<T> extends Injectable<T, Object>
@@ -17,5 +19,10 @@
{
super(new SimpleAnnotatedItem<T, Object>(bindingTypes, type, actualTypeArguements));
}
+
+ public SimpleInjectable(TypeLiteral<T> apiType, Annotation[] bindingTypes)
+ {
+ super(new SimpleAnnotatedItem<T, Object>(bindingTypes, apiType));
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -10,14 +10,16 @@
import java.util.Set;
import java.util.Map.Entry;
+import org.jboss.webbeans.exceptions.TypesafeResolutionLocation;
import org.jboss.webbeans.util.Reflections;
public abstract class AbstractAnnotatedItem<T, S> implements AnnotatedItem<T, S>
{
private Map<Class<? extends Annotation>, Annotation> annotationMap;
- private Map<Class<? extends Annotation>, Set<Annotation>> metaAnnotations;
+ private Map<Class<? extends Annotation>, Set<Annotation>> metaAnnotationMap;
private Set<Annotation> annotationSet;
+ private Annotation[] annotationArray;
public AbstractAnnotatedItem(Map<Class<? extends Annotation>, Annotation> annotationMap)
{
@@ -59,13 +61,22 @@
public Set<Annotation> getAnnotations(Class<? extends Annotation> metaAnnotationType)
{
- if (metaAnnotations == null)
+ if (metaAnnotationMap == null)
{
- metaAnnotations = new HashMap<Class<? extends Annotation>, Set<Annotation>>();
+ metaAnnotationMap = new HashMap<Class<? extends Annotation>, Set<Annotation>>();
}
- populateMetaAnnotationMap(metaAnnotationType, metaAnnotations, annotationMap);
- return metaAnnotations.get(metaAnnotationType);
+ populateMetaAnnotationMap(metaAnnotationType, metaAnnotationMap, annotationMap);
+ return metaAnnotationMap.get(metaAnnotationType);
}
+
+ public Annotation[] getAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
+ {
+ if (annotationArray == null)
+ {
+ annotationArray = getAnnotations(metaAnnotationType).toArray(annotationArray);
+ }
+ return annotationArray;
+ }
public Set<Annotation> getAnnotations()
{
@@ -148,22 +159,7 @@
@Override
public String toString()
{
- String string = getType().toString();
- if (getActualTypeArguements().length > 0)
- {
- string += "<";
- for (int i = 0; i < getActualTypeArguements().length; i++)
- {
- string += getActualTypeArguements()[i].toString();
- if (i < getActualTypeArguements().length - 1)
- {
- string += ",";
- }
- }
- string += ">";
- }
- string += getAnnotations();
- return string;
+ return TypesafeResolutionLocation.createMessage(getType(), getActualTypeArguements(), getAnnotations());
}
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -31,6 +31,9 @@
*/
public Set<Annotation> getAnnotations(
Class<? extends Annotation> metaAnnotationType);
+
+ public Annotation[] getAnnotationsAsArray(
+ Class<? extends Annotation> metaAnnotationType);
/**
* Get an annotation for the annotation type specified.
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -1,20 +1,21 @@
package org.jboss.webbeans.introspector;
import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Map;
+import javax.webbeans.TypeLiteral;
+
public class SimpleAnnotatedItem<T, S> extends AbstractAnnotatedItem<T, S>
{
private Type[] actualTypeArguements = new Type[0];
-
-
private Class<? extends T> type;
public SimpleAnnotatedItem(Map<Class<? extends Annotation>, Annotation> annotationMap)
{
- this(annotationMap, null);
+ super(annotationMap);
}
public SimpleAnnotatedItem(Map<Class<? extends Annotation>, Annotation> annotationMap, Class<? extends T> type)
@@ -23,6 +24,16 @@
this.type = type;
}
+ public SimpleAnnotatedItem(Map<Class<? extends Annotation>, Annotation> annotationMap, TypeLiteral<? extends T> apiType)
+ {
+ super(annotationMap);
+ this.type = apiType.getRawType();
+ if (apiType.getType() instanceof ParameterizedType)
+ {
+ actualTypeArguements = ((ParameterizedType) apiType.getType()).getActualTypeArguments();
+ }
+ }
+
public SimpleAnnotatedItem(Map<Class<? extends Annotation>, Annotation> annotationMap, Class<? extends T> type, Type[] actualTypeArguements)
{
this(annotationMap, type);
@@ -31,7 +42,7 @@
public SimpleAnnotatedItem(Annotation[] annotations)
{
- this(annotations, null);
+ this(buildAnnotationMap(annotations));
}
public SimpleAnnotatedItem(Annotation[] annotations, Class<? extends T> type)
@@ -39,6 +50,11 @@
this(buildAnnotationMap(annotations), type);
}
+ public SimpleAnnotatedItem(Annotation[] annotations, TypeLiteral<? extends T> apiType)
+ {
+ this(buildAnnotationMap(annotations), apiType);
+ }
+
public SimpleAnnotatedItem(Annotation[] annotations, Class<? extends T> type, Type[] actualTypeArguements)
{
this(buildAnnotationMap(annotations), type, actualTypeArguements);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -1,10 +1,8 @@
package org.jboss.webbeans.model;
-import java.lang.reflect.Method;
import java.util.logging.Logger;
import javax.webbeans.BindingType;
-import javax.webbeans.Dependent;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedType;
@@ -138,30 +136,8 @@
throw new RuntimeException("Scope " + getScopeType() + " is not an allowed by the stereotype for " + type);
}
}
- if (isDeclaredFinal(type) && !getScopeType().equals(Dependent.class))
- {
- throw new RuntimeException("Scope " + getScopeType() + " is not allowed as the class is declared final or has methods declared final for " + type + ". Only @Dependent is allowed for final components");
- }
}
- protected static boolean isDeclaredFinal(Class<?> type)
- {
- if (Reflections.isFinal(type))
- {
- return true;
- }
- for (Method method : type.getDeclaredMethods())
- {
- if (Reflections.isFinal(method))
- {
- return true;
- }
- }
- return false;
- }
-
-
-
protected void checkComponentImplementation()
{
if (Reflections.isAbstract(getType()))
Added: 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 (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -0,0 +1,69 @@
+/*
+ * 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.model;
+
+import javax.webbeans.ScopeType;
+
+import org.jboss.webbeans.exceptions.NotAScopeException;
+
+/**
+ *
+ * Model of a scope
+ *
+ * @author Pete Muir
+ *
+ */
+public class ScopeModel<T>
+{
+
+ private Class<T> scopeClass;
+ private boolean normal;
+ private boolean passivating;
+
+ public ScopeModel(Class<T> scope)
+ {
+ if (scope.isAnnotationPresent(ScopeType.class))
+ {
+ ScopeType scopeType = scope.getAnnotation(ScopeType.class);
+ this.scopeClass = scope;
+ this.normal = scopeType.normal();
+ this.passivating = scopeType.passivating();
+ }
+ else
+ {
+ throw new NotAScopeException("Scope " + scope.getName() + " is not annotated with @ScopeType");
+ }
+ }
+
+ public Class<T> getScopeClass()
+ {
+ return scopeClass;
+ }
+
+ public boolean isNormal()
+ {
+ return normal;
+ }
+
+ public boolean isPassivating()
+ {
+ return passivating;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ClientProxy.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ClientProxy.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ClientProxy.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -0,0 +1,33 @@
+package org.jboss.webbeans.util;
+
+
+public class ClientProxy
+{
+
+ public static boolean isProxyable(Class<?> rawType)
+ {
+ // TODO Add logging
+
+ if (Reflections.getConstructor(rawType) == null)
+ {
+ return false;
+ }
+ else if (Reflections.isTypeOrAnyMethodFinal(rawType))
+ {
+ return false;
+ }
+ else if (Reflections.isPrimitive(rawType))
+ {
+ return false;
+ }
+ else if (Reflections.isArrayType(rawType))
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ClientProxy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -56,6 +56,27 @@
return Modifier.isFinal(method.getModifiers());
}
+ public static boolean isTypeOrAnyMethodFinal(Class<?> type)
+ {
+ if (isFinal(type))
+ {
+ return true;
+ }
+ for (Method method : type.getDeclaredMethods())
+ {
+ if (isFinal(method))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean isPrimitive(Class<?> type)
+ {
+ return type.isPrimitive();
+ }
+
public static boolean isAbstract(Class<?> clazz)
{
return Modifier.isAbstract(clazz.getModifiers());
@@ -67,6 +88,10 @@
{
return clazz.getConstructor(parameterTypes);
}
+ catch (NoSuchMethodException e)
+ {
+ return null;
+ }
catch (Exception e)
{
throw new RuntimeException("Error accessing constructor (with parameters " + parameterTypes + ") of " + clazz, e);
@@ -187,4 +212,9 @@
return new Type[0];
}
}
+
+ public static boolean isArrayType(Class<?> rawType)
+ {
+ return rawType.isArray();
+ }
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -7,7 +7,6 @@
import javax.webbeans.Current;
import javax.webbeans.Dependent;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.AbstractEnterpriseComponentModel;
@@ -23,26 +22,12 @@
import org.jboss.webbeans.test.components.Panther;
import org.jboss.webbeans.test.components.Puma;
import org.jboss.webbeans.test.components.Tiger;
-import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.util.Reflections;
-import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class EnterpriseComponentModelTest extends AbstractTest
-{
+{
- private ManagerImpl container;
-
- @SuppressWarnings("unchecked")
- private AnnotatedType emptyAnnotatedItem;
-
- @BeforeMethod
- public void before()
- {
- emptyAnnotatedItem = new SimpleAnnotatedType<Object>(null, new HashMap<Class<? extends Annotation>, Annotation>());
- container = new MockManagerImpl(null);
- }
-
@Test @SpecAssertion(section="2.7.2")
public void testSingleStereotype()
{
@@ -53,7 +38,7 @@
@Test
public void testStateless()
{
- EnterpriseComponentModel<Lion> lion = new EnterpriseComponentModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class), emptyAnnotatedItem, container);
+ EnterpriseComponentModel<Lion> lion = new EnterpriseComponentModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class), getEmptyAnnotatedItem(Lion.class), manager);
assert lion.getScopeType().equals(Dependent.class);
Reflections.annotationSetMatches(lion.getBindingTypes(), Current.class);
assert lion.getName().equals("lion");
@@ -66,7 +51,7 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
AnnotatedType annotatedItem = new SimpleAnnotatedType(Giraffe.class, annotations);
- EnterpriseComponentModel<Giraffe> giraffe = new EnterpriseComponentModel<Giraffe>(new SimpleAnnotatedType(Giraffe.class), annotatedItem, container);
+ EnterpriseComponentModel<Giraffe> giraffe = new EnterpriseComponentModel<Giraffe>(new SimpleAnnotatedType(Giraffe.class), annotatedItem, manager);
assert giraffe.getScopeType().equals(Dependent.class);
Reflections.annotationSetMatches(giraffe.getBindingTypes(), Current.class);
}
@@ -77,7 +62,7 @@
boolean exception = false;
try
{
- new EnterpriseComponentModel<Bear>(new SimpleAnnotatedType<Bear>(Bear.class), getEmptyAnnotatedItem(Bear.class), container);
+ new EnterpriseComponentModel<Bear>(new SimpleAnnotatedType<Bear>(Bear.class), getEmptyAnnotatedItem(Bear.class), manager);
}
catch (Exception e)
{
@@ -89,7 +74,7 @@
// TODO Need EJB3.1 @Test
public void testSingleton()
{
- //ComponentMetaModel<Lion> lion = new ComponentMetaModel<Lion>(new ClassAnnotatedItem(Lion.class), emptyAnnotatedItem, container);
+ //ComponentMetaModel<Lion> lion = new ComponentMetaModel<Lion>(new ClassAnnotatedItem(Lion.class), getEmptyAnnotatedItem(), manager);
//assert lion.getComponentType().equals(ComponentType.ENTERPRISE);
//assert lion.getScopeType().annotationType().equals(ApplicationScoped.class);
}
@@ -97,7 +82,7 @@
// TODO Need EJB3.1 @Test
public void testSingletonWithRequestScope()
{
- //ComponentMetaModel<Lion> lion = new ComponentMetaModel<Lion>(new ClassAnnotatedItem(Lion.class), emptyAnnotatedItem, container);
+ //ComponentMetaModel<Lion> lion = new ComponentMetaModel<Lion>(new ClassAnnotatedItem(Lion.class), getEmptyAnnotatedItem(), manager);
//assert lion.getComponentType().equals(ComponentType.ENTERPRISE);
//assert lion.getScopeType().annotationType().equals(ApplicationScoped.class);
}
@@ -107,7 +92,7 @@
public void testStateful()
{
- AbstractEnterpriseComponentModel<Tiger> tiger = new EnterpriseComponentModel<Tiger>(new SimpleAnnotatedType(Tiger.class), emptyAnnotatedItem, container);
+ AbstractEnterpriseComponentModel<Tiger> tiger = new EnterpriseComponentModel<Tiger>(new SimpleAnnotatedType(Tiger.class), getEmptyAnnotatedItem(Tiger.class), manager);
Reflections.annotationSetMatches(tiger.getBindingTypes(), Synchronous.class);
assert tiger.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
assert tiger.getName() == null;
@@ -118,7 +103,7 @@
public void testMultipleRemoveMethodsWithDestroys()
{
- AbstractEnterpriseComponentModel<Elephant> elephant = new EnterpriseComponentModel<Elephant>(new SimpleAnnotatedType(Elephant.class), emptyAnnotatedItem, container);
+ AbstractEnterpriseComponentModel<Elephant> elephant = new EnterpriseComponentModel<Elephant>(new SimpleAnnotatedType(Elephant.class), getEmptyAnnotatedItem(Elephant.class), manager);
assert elephant.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove2");
}
@@ -129,7 +114,7 @@
boolean exception = false;
try
{
- new EnterpriseComponentModel<Puma>(new SimpleAnnotatedType(Puma.class), emptyAnnotatedItem, container);
+ new EnterpriseComponentModel<Puma>(new SimpleAnnotatedType(Puma.class), getEmptyAnnotatedItem(Puma.class), manager);
}
catch (Exception e)
{
@@ -145,7 +130,7 @@
boolean exception = false;
try
{
- new EnterpriseComponentModel<Cougar>(new SimpleAnnotatedType(Cougar.class), emptyAnnotatedItem, container);
+ new EnterpriseComponentModel<Cougar>(new SimpleAnnotatedType(Cougar.class), getEmptyAnnotatedItem(Cougar.class), manager);
}
catch (Exception e)
{
@@ -161,7 +146,7 @@
boolean exception = false;
try
{
- new EnterpriseComponentModel<Cheetah>(new SimpleAnnotatedType(Cheetah.class), emptyAnnotatedItem, container);
+ new EnterpriseComponentModel<Cheetah>(new SimpleAnnotatedType(Cheetah.class), getEmptyAnnotatedItem(Cheetah.class), manager);
}
catch (Exception e)
{
@@ -175,7 +160,7 @@
public void testRemoveMethodWithDefaultBinding()
{
- AbstractEnterpriseComponentModel<Panther> panther = new EnterpriseComponentModel<Panther>(new SimpleAnnotatedType<Panther>(Panther.class), emptyAnnotatedItem, container);
+ AbstractEnterpriseComponentModel<Panther> panther = new EnterpriseComponentModel<Panther>(new SimpleAnnotatedType<Panther>(Panther.class), getEmptyAnnotatedItem(Panther.class), manager);
assert panther.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
assert panther.getRemoveMethod().getParameters().size() == 1;
@@ -188,7 +173,7 @@
@Test
public void testMessageDriven()
{
- AbstractEnterpriseComponentModel<Leopard> leopard = new EnterpriseComponentModel<Leopard>(new SimpleAnnotatedType(Leopard.class), emptyAnnotatedItem, container);
+ AbstractEnterpriseComponentModel<Leopard> leopard = new EnterpriseComponentModel<Leopard>(new SimpleAnnotatedType(Leopard.class), getEmptyAnnotatedItem(Leopard.class), manager);
Reflections.annotationSetMatches(leopard.getBindingTypes(), Current.class);
}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -1,210 +0,0 @@
-package org.jboss.webbeans.test;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.webbeans.AnnotationLiteral;
-import javax.webbeans.Current;
-import javax.webbeans.TypeLiteral;
-import javax.webbeans.manager.Bean;
-
-import org.jboss.webbeans.BeanImpl;
-import org.jboss.webbeans.ResolutionManager;
-import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
-import org.jboss.webbeans.injectable.InjectableField;
-import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.SimpleComponentModel;
-import org.jboss.webbeans.test.annotations.Whitefish;
-import org.jboss.webbeans.test.bindings.ChunkyAnnotationLiteral;
-import org.jboss.webbeans.test.components.Animal;
-import org.jboss.webbeans.test.components.Cod;
-import org.jboss.webbeans.test.components.Farmer;
-import org.jboss.webbeans.test.components.FishFarm;
-import org.jboss.webbeans.test.components.Haddock;
-import org.jboss.webbeans.test.components.Plaice;
-import org.jboss.webbeans.test.components.Salmon;
-import org.jboss.webbeans.test.components.ScottishFish;
-import org.jboss.webbeans.test.components.ScottishFishFarmer;
-import org.jboss.webbeans.test.components.SeaBass;
-import org.jboss.webbeans.test.components.Sole;
-import org.jboss.webbeans.test.components.Tuna;
-import org.jboss.webbeans.util.Reflections;
-import org.testng.annotations.Test;
-
-public class InjectableTest extends AbstractTest
-{
-
- @SuppressWarnings("unchecked")
- @Test
- public void testInjectableField() throws Exception
- {
- InjectableField<Tuna> tuna = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
- assert tuna.getAnnotatedItem().getType().isAssignableFrom(Tuna.class);
- assert tuna.getBindingTypes().size() == 1;
- assert Reflections.annotationSetMatches(tuna.getBindingTypes(), Current.class);
- assert tuna.getType().isAssignableFrom(Tuna.class);
- }
-
- @Test
- public void testSingleApiTypeWithCurrent() throws Exception
- {
- InjectableField<Tuna> tunaField = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
- Set<Bean<?>> beans = new HashSet<Bean<?>>();
- beans.add(tunaBean);
- Set<Bean<?>> possibleTargets = tunaField.getMatchingBeans(beans);
- assert possibleTargets.size() == 1;
- assert possibleTargets.contains(tunaBean);
- }
-
- @Test
- public void testOneBindingType() throws Exception
- {
- InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
- Set<Bean<?>> beans = new HashSet<Bean<?>>();
- beans.add(codBean);
- beans.add(salmonBean);
- beans.add(soleBean);
- Set<Bean<?>> possibleTargets = whiteScottishFishField.getMatchingBeans(beans);
- assert possibleTargets.size() == 2;
- assert possibleTargets.contains(codBean);
- assert possibleTargets.contains(soleBean);
- }
-
- @Test
- public void testABindingType() throws Exception
- {
- InjectableField<Animal> whiteChunkyFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"));
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
- Set<Bean<?>> beans = new HashSet<Bean<?>>();
- beans.add(codBean);
- beans.add(salmonBean);
- beans.add(soleBean);
- Set<Bean<?>> possibleTargets = whiteChunkyFishField.getMatchingBeans(beans);
- assert possibleTargets.size() == 1;
- assert possibleTargets.contains(codBean);
- }
-
- @Test
- public void testMultipleApiTypeWithCurrent() throws Exception
- {
- InjectableField<Animal> animalField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("animal"));
- Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
- Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
- Set<Bean<?>> beans = new HashSet<Bean<?>>();
- beans.add(seaBassBean);
- beans.add(haddockBean);
- Set<Bean<?>> possibleTargets = animalField.getMatchingBeans(beans);
- assert possibleTargets.size() == 2;
- assert possibleTargets.contains(seaBassBean);
- assert possibleTargets.contains(haddockBean);
- }
-
- @Test
- public void testResolveByType() throws Exception
- {
- InjectableField<Animal> realChunkyWhiteFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"));
- InjectableField<Animal> animalField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("animal"));
- InjectableField<ScottishFish> scottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- InjectableField<Tuna> tunaField = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
-
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
- Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
- Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
-
- manager.addBean(tunaBean);
- manager.addBean(codBean);
- manager.addBean(salmonBean);
- manager.addBean(soleBean);
- manager.addBean(haddockBean);
- manager.addBean(seaBassBean);
-
- ResolutionManager resolutionManager = manager.getResolutionManager();
- resolutionManager.addInjectionPoint(realChunkyWhiteFishField);
- resolutionManager.addInjectionPoint(animalField);
- resolutionManager.addInjectionPoint(scottishFishField);
- resolutionManager.addInjectionPoint(tunaField);
-
- assert manager.resolveByType(Tuna.class, new CurrentAnnotationLiteral()).size() == 1;
- assert manager.resolveByType(Tuna.class, new CurrentAnnotationLiteral()).contains(tunaBean);
-
- assert manager.resolveByType(Tuna.class).size() == 1;
- assert manager.resolveByType(Tuna.class).contains(tunaBean);
-
- assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).size() == 3;
- assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).contains(salmonBean);
- assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).contains(seaBassBean);
- assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).contains(haddockBean);
-
- assert manager.resolveByType(Animal.class, new ChunkyAnnotationLiteral() {
-
- public boolean realChunky()
- {
- return true;
- }
-
- }, new AnnotationLiteral<Whitefish>() {}).size() == 1;
- assert manager.resolveByType(Animal.class, new ChunkyAnnotationLiteral() {
-
- public boolean realChunky()
- {
- return true;
- }
-
- }, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
-
- assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).size() == 2;
- assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
- assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).contains(soleBean);
-
- }
-
- @Test
- public void testResolveByTypeWithTypeParameter() throws Exception
- {
- InjectableField<Farmer<ScottishFish>> scottishFishFarmerField = new InjectableField<Farmer<ScottishFish>>(FishFarm.class.getDeclaredField("scottishFishFarmer"));
-
- Bean<ScottishFishFarmer> scottishFishFarmerBean = new BeanImpl<ScottishFishFarmer>(new SimpleComponentModel<ScottishFishFarmer>(new SimpleAnnotatedType<ScottishFishFarmer>(ScottishFishFarmer.class), getEmptyAnnotatedItem(ScottishFishFarmer.class), super.manager), manager);
- Bean<Farmer> farmerBean = new BeanImpl<Farmer>(new SimpleComponentModel<Farmer>(new SimpleAnnotatedType<Farmer>(Farmer.class), getEmptyAnnotatedItem(Farmer.class), super.manager), manager);
-
- manager.addBean(scottishFishFarmerBean);
- manager.addBean(farmerBean);
-
- ResolutionManager resolutionManager = manager.getResolutionManager();
- resolutionManager.addInjectionPoint(scottishFishFarmerField);
-
- assert manager.resolveByType(new TypeLiteral<Farmer<ScottishFish>>(){}).size() == 1;
- assert manager.resolveByType(new TypeLiteral<Farmer<ScottishFish>>(){}).contains(scottishFishFarmerBean);
- }
-
- @Test
- public void testOnlyHighestEnabledPreecedenceWebBeansResolved() throws Exception
- {
- InjectableField<Animal> whiteFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("whiteFish"));
-
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
- Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleComponentModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
-
-
- manager.addBean(plaiceBean);
- manager.addBean(codBean);
- manager.addBean(soleBean);
-
- ResolutionManager resolutionManager = manager.getResolutionManager();
- resolutionManager.addInjectionPoint(whiteFishField);
-
- assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>() {}).size() == 1;
- assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>() {}).contains(plaiceBean);
-
- }
-
-}
Added: 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 (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -0,0 +1,54 @@
+package org.jboss.webbeans.test;
+
+import javax.webbeans.AmbiguousDependencyException;
+import javax.webbeans.UnsatisfiedDependencyException;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.BeanImpl;
+import org.jboss.webbeans.ResolutionManager;
+import org.jboss.webbeans.injectable.InjectableField;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.test.components.Cod;
+import org.jboss.webbeans.test.components.FishFarm;
+import org.jboss.webbeans.test.components.Salmon;
+import org.jboss.webbeans.test.components.ScottishFish;
+import org.jboss.webbeans.test.components.Sole;
+import org.testng.annotations.Test;
+
+public class InstantiationByNameTest extends AbstractTest
+{
+
+ @Test(expectedExceptions=AmbiguousDependencyException.class)
+ public void testAmbiguousDependencies() throws Exception
+ {
+ InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
+ Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ manager.addBean(plaiceBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+
+ ResolutionManager resolutionManager = manager.getResolutionManager();
+ resolutionManager.addInjectionPoint(whiteScottishFishField);
+
+ manager.getInstanceByName("whitefish");
+ }
+
+ @Test(expectedExceptions=UnsatisfiedDependencyException.class)
+ public void testUnsatisfiedDependencies() throws Exception
+ {
+ InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ manager.addBean(codBean);
+ manager.addBean(salmonBean);
+
+ ResolutionManager resolutionManager = manager.getResolutionManager();
+ resolutionManager.addInjectionPoint(whiteScottishFishField);
+
+ manager.getInstanceByName("foo");
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -0,0 +1,76 @@
+package org.jboss.webbeans.test;
+
+import javax.webbeans.AmbiguousDependencyException;
+import javax.webbeans.AnnotationLiteral;
+import javax.webbeans.UnproxyableDependencyException;
+import javax.webbeans.UnsatisfiedDependencyException;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.BeanImpl;
+import org.jboss.webbeans.ResolutionManager;
+import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
+import org.jboss.webbeans.injectable.InjectableField;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.test.annotations.Whitefish;
+import org.jboss.webbeans.test.components.Cod;
+import org.jboss.webbeans.test.components.FishFarm;
+import org.jboss.webbeans.test.components.Plaice;
+import org.jboss.webbeans.test.components.Salmon;
+import org.jboss.webbeans.test.components.ScottishFish;
+import org.jboss.webbeans.test.components.Sole;
+import org.jboss.webbeans.test.components.Tuna;
+import org.jboss.webbeans.test.components.broken.PlaiceFarm;
+import org.testng.annotations.Test;
+
+public class InstantiationByTypeTest extends AbstractTest
+{
+
+ @Test(expectedExceptions=AmbiguousDependencyException.class)
+ public void testAmbiguousDependencies() throws Exception
+ {
+ InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
+ Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ manager.addBean(plaiceBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+
+ ResolutionManager resolutionManager = manager.getResolutionManager();
+ resolutionManager.addInjectionPoint(whiteScottishFishField);
+
+ manager.getInstanceByType(ScottishFish.class, new AnnotationLiteral<Whitefish>(){});
+ }
+
+ @Test(expectedExceptions=UnsatisfiedDependencyException.class)
+ public void testUnsatisfiedDependencies() throws Exception
+ {
+ InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
+ Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ manager.addBean(plaiceBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+
+ ResolutionManager resolutionManager = manager.getResolutionManager();
+ resolutionManager.addInjectionPoint(whiteScottishFishField);
+
+ manager.getInstanceByType(Tuna.class, new CurrentAnnotationLiteral());
+ }
+
+ @Test(expectedExceptions=UnproxyableDependencyException.class)
+ public void testUnproxyableDependencies() throws Exception
+ {
+ InjectableField<Plaice> plaiceField = new InjectableField<Plaice>(PlaiceFarm.class.getDeclaredField("plaice"));
+ Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleComponentModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
+ manager.addBean(plaiceBean);
+
+ ResolutionManager resolutionManager = manager.getResolutionManager();
+ resolutionManager.addInjectionPoint(plaiceField);
+
+ manager.getInstanceByType(Plaice.class, new AnnotationLiteral<Whitefish>(){});
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -44,7 +44,7 @@
manager.addBean(plaiceBean);
- assert manager.resolveByName("whitefish").size() == 1;
+ assert manager.resolveByName("whitefish").size() == 1;
assert manager.resolveByName("whitefish").contains(plaiceBean);
}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java (from rev 144, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -0,0 +1,210 @@
+package org.jboss.webbeans.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.webbeans.AnnotationLiteral;
+import javax.webbeans.Current;
+import javax.webbeans.TypeLiteral;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.BeanImpl;
+import org.jboss.webbeans.ResolutionManager;
+import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
+import org.jboss.webbeans.injectable.InjectableField;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.test.annotations.Whitefish;
+import org.jboss.webbeans.test.bindings.ChunkyAnnotationLiteral;
+import org.jboss.webbeans.test.components.Animal;
+import org.jboss.webbeans.test.components.Cod;
+import org.jboss.webbeans.test.components.Farmer;
+import org.jboss.webbeans.test.components.FishFarm;
+import org.jboss.webbeans.test.components.Haddock;
+import org.jboss.webbeans.test.components.Plaice;
+import org.jboss.webbeans.test.components.Salmon;
+import org.jboss.webbeans.test.components.ScottishFish;
+import org.jboss.webbeans.test.components.ScottishFishFarmer;
+import org.jboss.webbeans.test.components.SeaBass;
+import org.jboss.webbeans.test.components.Sole;
+import org.jboss.webbeans.test.components.Tuna;
+import org.jboss.webbeans.util.Reflections;
+import org.testng.annotations.Test;
+
+public class TypeSafeResolutionTest extends AbstractTest
+{
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testInjectableField() throws Exception
+ {
+ InjectableField<Tuna> tuna = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
+ assert tuna.getAnnotatedItem().getType().isAssignableFrom(Tuna.class);
+ assert tuna.getBindingTypes().size() == 1;
+ assert Reflections.annotationSetMatches(tuna.getBindingTypes(), Current.class);
+ assert tuna.getType().isAssignableFrom(Tuna.class);
+ }
+
+ @Test
+ public void testSingleApiTypeWithCurrent() throws Exception
+ {
+ InjectableField<Tuna> tunaField = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Set<Bean<?>> beans = new HashSet<Bean<?>>();
+ beans.add(tunaBean);
+ Set<Bean<?>> possibleTargets = tunaField.getMatchingBeans(beans);
+ assert possibleTargets.size() == 1;
+ assert possibleTargets.contains(tunaBean);
+ }
+
+ @Test
+ public void testOneBindingType() throws Exception
+ {
+ InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Set<Bean<?>> beans = new HashSet<Bean<?>>();
+ beans.add(codBean);
+ beans.add(salmonBean);
+ beans.add(soleBean);
+ Set<Bean<?>> possibleTargets = whiteScottishFishField.getMatchingBeans(beans);
+ assert possibleTargets.size() == 2;
+ assert possibleTargets.contains(codBean);
+ assert possibleTargets.contains(soleBean);
+ }
+
+ @Test
+ public void testABindingType() throws Exception
+ {
+ InjectableField<Animal> whiteChunkyFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"));
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Set<Bean<?>> beans = new HashSet<Bean<?>>();
+ beans.add(codBean);
+ beans.add(salmonBean);
+ beans.add(soleBean);
+ Set<Bean<?>> possibleTargets = whiteChunkyFishField.getMatchingBeans(beans);
+ assert possibleTargets.size() == 1;
+ assert possibleTargets.contains(codBean);
+ }
+
+ @Test
+ public void testMultipleApiTypeWithCurrent() throws Exception
+ {
+ InjectableField<Animal> animalField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("animal"));
+ Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
+ Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
+ Set<Bean<?>> beans = new HashSet<Bean<?>>();
+ beans.add(seaBassBean);
+ beans.add(haddockBean);
+ Set<Bean<?>> possibleTargets = animalField.getMatchingBeans(beans);
+ assert possibleTargets.size() == 2;
+ assert possibleTargets.contains(seaBassBean);
+ assert possibleTargets.contains(haddockBean);
+ }
+
+ @Test
+ public void testResolveByType() throws Exception
+ {
+ InjectableField<Animal> realChunkyWhiteFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"));
+ InjectableField<Animal> animalField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("animal"));
+ InjectableField<ScottishFish> scottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
+ InjectableField<Tuna> tunaField = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
+
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
+ Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
+
+ manager.addBean(tunaBean);
+ manager.addBean(codBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+ manager.addBean(haddockBean);
+ manager.addBean(seaBassBean);
+
+ ResolutionManager resolutionManager = manager.getResolutionManager();
+ resolutionManager.addInjectionPoint(realChunkyWhiteFishField);
+ resolutionManager.addInjectionPoint(animalField);
+ resolutionManager.addInjectionPoint(scottishFishField);
+ resolutionManager.addInjectionPoint(tunaField);
+
+ assert manager.resolveByType(Tuna.class, new CurrentAnnotationLiteral()).size() == 1;
+ assert manager.resolveByType(Tuna.class, new CurrentAnnotationLiteral()).contains(tunaBean);
+
+ assert manager.resolveByType(Tuna.class).size() == 1;
+ assert manager.resolveByType(Tuna.class).contains(tunaBean);
+
+ assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).size() == 3;
+ assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).contains(salmonBean);
+ assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).contains(seaBassBean);
+ assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).contains(haddockBean);
+
+ assert manager.resolveByType(Animal.class, new ChunkyAnnotationLiteral() {
+
+ public boolean realChunky()
+ {
+ return true;
+ }
+
+ }, new AnnotationLiteral<Whitefish>() {}).size() == 1;
+ assert manager.resolveByType(Animal.class, new ChunkyAnnotationLiteral() {
+
+ public boolean realChunky()
+ {
+ return true;
+ }
+
+ }, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
+
+ assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).size() == 2;
+ assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
+ assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).contains(soleBean);
+
+ }
+
+ @Test
+ public void testResolveByTypeWithTypeParameter() throws Exception
+ {
+ InjectableField<Farmer<ScottishFish>> scottishFishFarmerField = new InjectableField<Farmer<ScottishFish>>(FishFarm.class.getDeclaredField("scottishFishFarmer"));
+
+ Bean<ScottishFishFarmer> scottishFishFarmerBean = new BeanImpl<ScottishFishFarmer>(new SimpleComponentModel<ScottishFishFarmer>(new SimpleAnnotatedType<ScottishFishFarmer>(ScottishFishFarmer.class), getEmptyAnnotatedItem(ScottishFishFarmer.class), super.manager), manager);
+ Bean<Farmer> farmerBean = new BeanImpl<Farmer>(new SimpleComponentModel<Farmer>(new SimpleAnnotatedType<Farmer>(Farmer.class), getEmptyAnnotatedItem(Farmer.class), super.manager), manager);
+
+ manager.addBean(scottishFishFarmerBean);
+ manager.addBean(farmerBean);
+
+ ResolutionManager resolutionManager = manager.getResolutionManager();
+ resolutionManager.addInjectionPoint(scottishFishFarmerField);
+
+ assert manager.resolveByType(new TypeLiteral<Farmer<ScottishFish>>(){}).size() == 1;
+ assert manager.resolveByType(new TypeLiteral<Farmer<ScottishFish>>(){}).contains(scottishFishFarmerBean);
+ }
+
+ @Test
+ public void testOnlyHighestEnabledPreecedenceWebBeansResolved() throws Exception
+ {
+ InjectableField<Animal> whiteFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("whiteFish"));
+
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleComponentModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
+
+
+ manager.addBean(plaiceBean);
+ manager.addBean(codBean);
+ manager.addBean(soleBean);
+
+ ResolutionManager resolutionManager = manager.getResolutionManager();
+ resolutionManager.addInjectionPoint(whiteFishField);
+
+ assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>() {}).size() == 1;
+ assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>() {}).contains(plaiceBean);
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java 2008-10-25 15:57:11 UTC (rev 147)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.test.components;
import javax.webbeans.Named;
+import javax.webbeans.RequestScoped;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.Whitefish;
@@ -8,7 +9,8 @@
@AnotherDeploymentType
@Whitefish
@Named("whitefish")
-public class Plaice implements Animal
+@RequestScoped
+public final class Plaice implements Animal
{
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/PlaiceFarm.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/PlaiceFarm.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/PlaiceFarm.java 2008-10-25 18:38:53 UTC (rev 148)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.components.broken;
+
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Whitefish;
+import org.jboss.webbeans.test.components.Plaice;
+
+@Production
+public class PlaiceFarm
+{
+
+ @SuppressWarnings("unused")
+ @Whitefish
+ private Plaice plaice;
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/PlaiceFarm.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 10 months
[webbeans-commits] Webbeans SVN: r147 - ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-25 11:57:11 -0400 (Sat, 25 Oct 2008)
New Revision: 147
Modified:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java
Log:
fix var name
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java 2008-10-25 14:59:27 UTC (rev 146)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java 2008-10-25 15:57:11 UTC (rev 147)
@@ -33,7 +33,7 @@
public Class<? extends Annotation> getScopeType();
- public <T> T get(Bean<T> component, boolean create);
+ public <T> T get(Bean<T> bean, boolean create);
boolean isActive();
15 years, 10 months
[webbeans-commits] Webbeans SVN: r146 - ri/trunk/webbeans-api/src/main/java/javax/webbeans.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-25 10:59:27 -0400 (Sat, 25 Oct 2008)
New Revision: 146
Added:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/AmbiguousDependencyException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/CreationException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/DefinitionException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/InconsistentSpecializationException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentConstructorException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentFieldException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentMemberException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentMethodException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentTypeException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/NullableDependencyException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnproxyableDependencyException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnremovedException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnsatisfiedDependencyException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnserializableDependencyException.java
Modified:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/ContextNotActiveException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/DuplicateBindingTypeException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/ExecutionException.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/ObserverException.java
Log:
Add/fix all exceptions
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/AmbiguousDependencyException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/AmbiguousDependencyException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/AmbiguousDependencyException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,47 @@
+/*
+ * 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+public class AmbiguousDependencyException extends DeploymentException
+{
+
+ public AmbiguousDependencyException()
+ {
+ }
+
+ public AmbiguousDependencyException(String message, Throwable throwable)
+ {
+ super(message, throwable);
+ }
+
+ public AmbiguousDependencyException(String message)
+ {
+ super(message);
+ }
+
+ public AmbiguousDependencyException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/AmbiguousDependencyException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/ContextNotActiveException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/ContextNotActiveException.java 2008-10-25 11:54:03 UTC (rev 145)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/ContextNotActiveException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -24,11 +24,12 @@
* @author Shane Bryzak
*/
-public class ContextNotActiveException extends RuntimeException
+public class ContextNotActiveException extends ExecutionException
{
public ContextNotActiveException()
{
+ super();
}
public ContextNotActiveException(String message)
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/CreationException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/CreationException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/CreationException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,48 @@
+/*
+* 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+
+public class CreationException extends ExecutionException
+{
+
+ public CreationException()
+ {
+
+ }
+
+ public CreationException(String message)
+ {
+ super(message);
+ }
+
+ public CreationException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public CreationException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/CreationException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/DefinitionException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/DefinitionException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/DefinitionException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,49 @@
+/*
+ * 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+public class DefinitionException extends RuntimeException
+{
+
+ public DefinitionException()
+ {
+ super();
+ }
+
+ public DefinitionException(String message, Throwable throwable)
+ {
+ super(message, throwable);
+ }
+
+ public DefinitionException(String message)
+ {
+ super(message);
+ }
+
+ public DefinitionException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/DefinitionException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentException.java 2008-10-25 11:54:03 UTC (rev 145)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -1,5 +1,26 @@
+/*
+ * 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 javax.webbeans;
+/**
+ *
+ * @author Pete Muir
+ */
public class DeploymentException extends RuntimeException
{
@@ -8,19 +29,21 @@
super();
}
- public DeploymentException(String arg0, Throwable arg1)
+ public DeploymentException(String message, Throwable throwable)
{
- super(arg0, arg1);
+ super(message, throwable);
}
- public DeploymentException(String arg0)
+ public DeploymentException(String message)
{
- super(arg0);
+ super(message);
}
- public DeploymentException(Throwable arg0)
+ public DeploymentException(Throwable throwable)
{
- super(arg0);
+ super(throwable);
}
+
+
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/DuplicateBindingTypeException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/DuplicateBindingTypeException.java 2008-10-25 11:54:03 UTC (rev 145)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/DuplicateBindingTypeException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -22,7 +22,7 @@
*
* @author David Allen
*/
-public class DuplicateBindingTypeException extends RuntimeException
+public class DuplicateBindingTypeException extends ExecutionException
{
private static final long serialVersionUID = 4194175477451120383L;
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/ExecutionException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/ExecutionException.java 2008-10-25 11:54:03 UTC (rev 145)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/ExecutionException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -1,5 +1,27 @@
+/*
+ * 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 javax.webbeans;
+/**
+ *
+ * @author Pete Muir
+ */
public class ExecutionException extends RuntimeException
{
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/InconsistentSpecializationException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/InconsistentSpecializationException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/InconsistentSpecializationException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,50 @@
+/*
+ * 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+public class InconsistentSpecializationException extends DeploymentException
+{
+
+ public InconsistentSpecializationException()
+ {
+ super();
+ }
+
+ public InconsistentSpecializationException(String message, Throwable throwable)
+ {
+ super(message, throwable);
+ }
+
+ public InconsistentSpecializationException(String message)
+ {
+ super(message);
+ }
+
+ public InconsistentSpecializationException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/InconsistentSpecializationException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentConstructorException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentConstructorException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentConstructorException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,48 @@
+/*
+* 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+
+public class NonexistentConstructorException extends DefinitionException
+{
+
+ public NonexistentConstructorException()
+ {
+
+ }
+
+ public NonexistentConstructorException(String message)
+ {
+ super(message);
+ }
+
+ public NonexistentConstructorException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public NonexistentConstructorException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentConstructorException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentFieldException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentFieldException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentFieldException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,48 @@
+/*
+* 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+
+public class NonexistentFieldException extends DefinitionException
+{
+
+ public NonexistentFieldException()
+ {
+
+ }
+
+ public NonexistentFieldException(String message)
+ {
+ super(message);
+ }
+
+ public NonexistentFieldException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public NonexistentFieldException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentFieldException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentMemberException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentMemberException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentMemberException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,48 @@
+/*
+* 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+
+public class NonexistentMemberException extends DefinitionException
+{
+
+ public NonexistentMemberException()
+ {
+
+ }
+
+ public NonexistentMemberException(String message)
+ {
+ super(message);
+ }
+
+ public NonexistentMemberException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public NonexistentMemberException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentMemberException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentMethodException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentMethodException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentMethodException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,48 @@
+/*
+* 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+
+public class NonexistentMethodException extends DefinitionException
+{
+
+ public NonexistentMethodException()
+ {
+
+ }
+
+ public NonexistentMethodException(String message)
+ {
+ super(message);
+ }
+
+ public NonexistentMethodException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public NonexistentMethodException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentMethodException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentTypeException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentTypeException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentTypeException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,48 @@
+/*
+* 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+
+public class NonexistentTypeException extends DefinitionException
+{
+
+ public NonexistentTypeException()
+ {
+
+ }
+
+ public NonexistentTypeException(String message)
+ {
+ super(message);
+ }
+
+ public NonexistentTypeException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public NonexistentTypeException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonexistentTypeException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NullableDependencyException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/NullableDependencyException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/NullableDependencyException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,50 @@
+/*
+ * 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+public class NullableDependencyException extends DeploymentException
+{
+
+ public NullableDependencyException()
+ {
+ super();
+ }
+
+ public NullableDependencyException(String message, Throwable throwable)
+ {
+ super(message, throwable);
+ }
+
+ public NullableDependencyException(String message)
+ {
+ super(message);
+ }
+
+ public NullableDependencyException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NullableDependencyException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/ObserverException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/ObserverException.java 2008-10-25 11:54:03 UTC (rev 145)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/ObserverException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -22,7 +22,7 @@
* @author Pete Muir
*/
-public class ObserverException extends RuntimeException
+public class ObserverException extends ExecutionException
{
public ObserverException()
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnproxyableDependencyException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnproxyableDependencyException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnproxyableDependencyException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,50 @@
+/*
+ * 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+public class UnproxyableDependencyException extends DeploymentException
+{
+
+ public UnproxyableDependencyException()
+ {
+ super();
+ }
+
+ public UnproxyableDependencyException(String message, Throwable throwable)
+ {
+ super(message, throwable);
+ }
+
+ public UnproxyableDependencyException(String message)
+ {
+ super(message);
+ }
+
+ public UnproxyableDependencyException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnproxyableDependencyException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnremovedException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnremovedException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnremovedException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,48 @@
+/*
+* 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+
+public class UnremovedException extends ExecutionException
+{
+
+ public UnremovedException()
+ {
+
+ }
+
+ public UnremovedException(String message)
+ {
+ super(message);
+ }
+
+ public UnremovedException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public UnremovedException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnremovedException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnsatisfiedDependencyException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnsatisfiedDependencyException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnsatisfiedDependencyException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,50 @@
+/*
+ * 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+public class UnsatisfiedDependencyException extends DeploymentException
+{
+
+ public UnsatisfiedDependencyException()
+ {
+ super();
+ }
+
+ public UnsatisfiedDependencyException(String message, Throwable throwable)
+ {
+ super(message, throwable);
+ }
+
+ public UnsatisfiedDependencyException(String message)
+ {
+ super(message);
+ }
+
+ public UnsatisfiedDependencyException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnsatisfiedDependencyException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnserializableDependencyException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnserializableDependencyException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnserializableDependencyException.java 2008-10-25 14:59:27 UTC (rev 146)
@@ -0,0 +1,50 @@
+/*
+ * 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 javax.webbeans;
+
+/**
+ *
+ * @author Pete Muir
+ */
+public class UnserializableDependencyException extends DeploymentException
+{
+
+ public UnserializableDependencyException()
+ {
+ super();
+ }
+
+ public UnserializableDependencyException(String message, Throwable throwable)
+ {
+ super(message, throwable);
+ }
+
+ public UnserializableDependencyException(String message)
+ {
+ super(message);
+ }
+
+ public UnserializableDependencyException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/UnserializableDependencyException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 10 months
[webbeans-commits] Webbeans SVN: r145 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-25 07:54:03 -0400 (Sat, 25 Oct 2008)
New Revision: 145
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/MapWrapper.java
Log:
minor (thanks Matt :-)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/MapWrapper.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/MapWrapper.java 2008-10-25 00:13:08 UTC (rev 144)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/MapWrapper.java 2008-10-25 11:54:03 UTC (rev 145)
@@ -76,4 +76,22 @@
return delegate.values();
}
+ @Override
+ public boolean equals(Object o)
+ {
+ return delegate.equals(o);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate.hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate.toString();
+ }
+
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r144 - in ri/trunk: webbeans-ri/src/main/java/org/jboss/webbeans and 9 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-24 20:13:08 -0400 (Fri, 24 Oct 2008)
New Revision: 144
Added:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/ExecutionException.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ListComparator.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/ChunkyAnnotationLiteral.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFishFarmer.java
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanMap.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/EmptyAnnotatedType.java
Modified:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedField.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedType.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.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/ContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/Chunky.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cod.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Salmon.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sole.java
Log:
implement name based resolution, resolution index rebuild when a bean is added, use of parameterized types and annotation members when doing typesafe resolution
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -27,6 +27,8 @@
* the annotation type
*/
import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
@@ -35,6 +37,7 @@
{
private Class<T> annotationType;
+ private Method[] members;
protected AnnotationLiteral()
{
@@ -43,12 +46,15 @@
{
throw new RuntimeException(getClass() + "is not a subclass of AnnotationLiteral ");
}
+
annotationType = getTypeParameter(annotationLiteralSubclass);
+
if (annotationType == null)
{
throw new RuntimeException(getClass() + " is missing type parameter in AnnotationLiteral");
-
}
+
+ this.members = annotationType.getDeclaredMethods();
}
@SuppressWarnings("unchecked")
@@ -93,7 +99,17 @@
@Override
public String toString()
{
- return "@" + annotationType().getName() + "()";
+ String string = "@" + annotationType().getName() + "(";
+ for (int i = 0; i < members.length; i++)
+ {
+ string += members[i].getName() + "=";
+ string += invoke(members[i], this);
+ if (i < members.length - 1)
+ {
+ string += ",";
+ }
+ }
+ return string + ")";
}
@Override
@@ -102,17 +118,58 @@
if (other instanceof Annotation)
{
Annotation that = (Annotation) other;
- return this.annotationType().equals(that.annotationType());
+ if (this.annotationType().equals(that.annotationType()))
+ {
+ for (Method member : members)
+ {
+ Object thisValue = invoke(member, this);
+ Object thatValue = invoke(member, that);
+ if (!thisValue.equals(thatValue))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
}
- else
- {
- return false;
- }
+ return false;
}
@Override
+ /*
+ * The hash code of a primitive value v is equal to WrapperType.valueOf(v).hashCode(), where WrapperType is the wrapper type corresponding to the primitive type of v (Byte, Character, Double, Float, Integer, Long, Short, or Boolean).
+ * The hash code of a string, enum, class, or annotation member-value I v is computed as by calling v.hashCode(). (In the case of annotation member values, this is a recursive definition.)
+ * The hash code of an array member-value is computed by calling the appropriate overloading of Arrays.hashCode on the value. (There is one overloading for each primitive type, and one for object reference types.)
+ */
public int hashCode()
{
- return 0;
+ int hashCode = 0;
+ for (Method member : members)
+ {
+ int memberNameHashCode = 127 * member.getName().hashCode();
+ int memberValueHashCode = invoke(member, this).hashCode();
+ hashCode += memberNameHashCode ^ memberValueHashCode;
+ }
+ return hashCode;
}
+
+ private static Object invoke(Method method, Object instance)
+ {
+ try
+ {
+ return method.invoke(instance);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ExecutionException("Error checking value of member method " + method.getName() + " on " + method.getDeclaringClass(), e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ExecutionException("Error checking value of member method " + method.getName() + " on " + method.getDeclaringClass(), e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new ExecutionException("Error checking value of member method " + method.getName() + " on " + method.getDeclaringClass(), e);
+ }
+ }
}
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/ExecutionException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/ExecutionException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/ExecutionException.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -0,0 +1,26 @@
+package javax.webbeans;
+
+public class ExecutionException extends RuntimeException
+{
+
+ public ExecutionException()
+ {
+ super();
+ }
+
+ public ExecutionException(String message, Throwable throwable)
+ {
+ super(message, throwable);
+ }
+
+ public ExecutionException(String message)
+ {
+ super(message);
+ }
+
+ public ExecutionException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/ExecutionException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,30 +1,49 @@
package org.jboss.webbeans;
import java.lang.annotation.Annotation;
+import java.util.HashMap;
import javax.webbeans.ContextNotActiveException;
import javax.webbeans.manager.Bean;
import javax.webbeans.manager.Context;
import javax.webbeans.manager.Manager;
+import org.jboss.webbeans.util.MapWrapper;
-import org.jboss.webbeans.util.BeanMap;
-
/**
* Basic implementation of javax.webbeans.Context, backed by a HashMap
*
* @author Shane Bryzak
* @author Nicklas Karlsson (nickarls(a)gmail.com)
+ * @author Pete\ Muir
+ * @
*/
public class BasicContext implements Context
{
- private BeanMap<Object> beans;
+
+ private class BeanMap extends MapWrapper<Bean<? extends Object>, Object>
+ {
+
+ public BeanMap()
+ {
+ super(new HashMap<Bean<? extends Object>, Object>());
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends Object> T get(Bean<? extends T> key)
+ {
+ return (T) super.get(key);
+ }
+
+ }
+
+ private BeanMap beans;
private Class<? extends Annotation> scopeType;
private boolean active;
public BasicContext(Class<? extends Annotation> scopeType)
{
this.scopeType = scopeType;
- beans = new BeanMap<Object>();
+ beans = new BeanMap();
active = true;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -84,5 +84,10 @@
{
return model.toString();
}
+
+ public AbstractComponentModel<T, ?> getModel()
+ {
+ return model;
+ }
}
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-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -2,6 +2,8 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -19,13 +21,17 @@
import javax.webbeans.manager.Interceptor;
import javax.webbeans.manager.Manager;
+import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
import org.jboss.webbeans.ejb.EjbManager;
import org.jboss.webbeans.event.EventBus;
+import org.jboss.webbeans.injectable.Injectable;
import org.jboss.webbeans.injectable.SimpleInjectable;
public class ManagerImpl implements Manager
{
+ private static final Annotation[] DEFAULT_BINDING = {new CurrentAnnotationLiteral()};
+
private List<Class<? extends Annotation>> enabledDeploymentTypes;
private ModelManager modelManager;
private EjbManager ejbLookupManager;
@@ -66,6 +72,7 @@
public Manager addBean(Bean<?> bean)
{
+ getResolutionManager().clear();
beans.add(bean);
return this;
}
@@ -104,8 +111,39 @@
public <T> Set<Bean<T>> resolveByType(Class<T> apiType,
Annotation... bindingTypes)
{
- Set<Bean<T>> beans = getResolutionManager().get(
- new SimpleInjectable<T>(apiType, bindingTypes));
+ return resolveByType(apiType, bindingTypes, new Type[0]);
+ }
+
+ public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,
+ Annotation... bindingTypes)
+ {
+ if (apiType.getType() instanceof ParameterizedType)
+ {
+ return resolveByType(apiType.getRawType(), bindingTypes, ((ParameterizedType) apiType.getType()).getActualTypeArguments());
+ }
+ else
+ {
+ return resolveByType(apiType.getRawType(), bindingTypes, new Type[0]);
+ }
+
+ }
+
+ private <T> Set<Bean<T>> resolveByType(Class<T> apiType, Annotation[] bindingTypes, Type[] actualTypeArguements)
+ {
+ if (bindingTypes.length == 0)
+ {
+ bindingTypes = DEFAULT_BINDING;
+ }
+ Injectable<T, ?> injectable = null;
+ if (actualTypeArguements.length > 0)
+ {
+ injectable = new SimpleInjectable<T>(apiType, bindingTypes, actualTypeArguements);
+ }
+ else
+ {
+ injectable = new SimpleInjectable<T>(apiType, bindingTypes);
+ }
+ Set<Bean<T>> beans = getResolutionManager().get(injectable);
if (beans == null)
{
return new HashSet<Bean<T>>();
@@ -114,14 +152,9 @@
{
return beans;
}
+
}
- public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,
- Annotation... bindingTypes)
- {
- return resolveByType(apiType.getRawType(), bindingTypes);
- }
-
public ResolutionManager getResolutionManager()
{
return resolutionManager;
@@ -223,8 +256,7 @@
public Set<Bean<?>> resolveByName(String name)
{
- // TODO Auto-generated method stub
- return null;
+ return getResolutionManager().get(name);
}
public List<Decorator> resolveDecorators(Set<Class<?>> types,
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,25 +1,59 @@
package org.jboss.webbeans;
+import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
import javax.webbeans.manager.Bean;
import org.jboss.webbeans.injectable.Injectable;
+import org.jboss.webbeans.util.ListComparator;
+import org.jboss.webbeans.util.MapWrapper;
public class ResolutionManager
{
+
+ // TODO Why can't we generify Set?
- private Map<Injectable<?, ?>, Set<?>> resolvedInjectionPoints;
+ @SuppressWarnings("unchecked")
+ private class InjectableMap extends MapWrapper<Injectable<?, ?>, Set>
+ {
+
+ public InjectableMap()
+ {
+ super(new HashMap<Injectable<?, ?>, Set>());
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> Set<Bean<T>> get(Injectable<T, ?> key)
+ {
+ return (Set<Bean<T>>) super.get(key);
+ }
+
+ }
+
+
+ private InjectableMap resolvedInjectionPoints;
private Set<Injectable<?, ?>> injectionPoints;
+
+ private Map<String, Set<Bean<?>>> resolvedNames;
+
private ManagerImpl manager;
+ private boolean rebuildRequired = true;
+
public ResolutionManager(ManagerImpl manager)
{
- this.resolvedInjectionPoints = new HashMap<Injectable<?, ?>, Set<?>>();
+ this.resolvedInjectionPoints = new InjectableMap();
this.injectionPoints = new HashSet<Injectable<?,?>>();
+
+ this.resolvedNames = new HashMap<String, Set<Bean<?>>>();
+
this.manager = manager;
}
@@ -28,23 +62,75 @@
injectionPoints.add(injectable);
}
- public void registerInjectionPoint(Injectable<?, ?> injectable)
+ private void registerInjectionPoint(Injectable<?, ?> injectable)
{
- resolvedInjectionPoints.put(injectable, injectable.getPossibleBeans(manager.getBeans()));
+ resolvedInjectionPoints.put(injectable, retainHighestPrecedenceBeans(injectable.getMatchingBeans(manager.getBeans()), manager.getEnabledDeploymentTypes()));
}
- public void registerInjectionPoints()
+ public void clear()
{
- for (Injectable<?, ?> injectable : injectionPoints)
+ rebuildRequired = true;
+ resolvedInjectionPoints.clear();
+ resolvedNames.clear();
+ }
+
+ private void resolveBeans()
+ {
+ if (rebuildRequired)
{
- registerInjectionPoint(injectable);
+ for (Injectable<?, ?> injectable : injectionPoints)
+ {
+ registerInjectionPoint(injectable);
+ }
+ rebuildRequired = false;
}
- injectionPoints.clear();
}
public <T> Set<Bean<T>> get(Injectable<T, ?> key)
{
- return (Set<Bean<T>>) resolvedInjectionPoints.get(key);
+ resolveBeans();
+ return resolvedInjectionPoints.get(key);
}
+
+ public Set<Bean<?>> get(String name)
+ {
+ if (resolvedNames.containsKey(name))
+ {
+ return resolvedNames.get(name);
+ }
+ else
+ {
+ Set<Bean<?>> beans = new HashSet<Bean<?>>();
+ for (Bean<?> bean : manager.getBeans())
+ {
+ if ( (bean.getName() == null && name == null) || (bean.getName() != null && bean.getName().equals(name)))
+ {
+ beans.add(bean);
+ }
+ }
+ resolvedNames.put(name, retainHighestPrecedenceBeans(beans, manager.getEnabledDeploymentTypes()));
+ return beans;
+ }
+ }
+
+ private static Set<Bean<?>> retainHighestPrecedenceBeans(Set<Bean<?>> beans, List<Class<? extends Annotation>> enabledDeploymentTypes)
+ {
+ SortedSet<Class<? extends Annotation>> possibleDeploymentTypes = new TreeSet<Class<? extends Annotation>>(new ListComparator<Class<? extends Annotation>>(enabledDeploymentTypes));
+ for (Bean<?> bean : beans)
+ {
+ possibleDeploymentTypes.add(bean.getDeploymentType());
+ }
+ possibleDeploymentTypes.retainAll(enabledDeploymentTypes);
+ Class<? extends Annotation> highestPrecedencePossibleDeploymentType = possibleDeploymentTypes.last();
+ Set<Bean<?>> trimmed = new HashSet<Bean<?>>();
+ for (Bean<?> bean : beans)
+ {
+ if (bean.getDeploymentType().equals(highestPrecedencePossibleDeploymentType))
+ {
+ trimmed.add(bean);
+ }
+ }
+ return trimmed;
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,9 +1,7 @@
package org.jboss.webbeans.injectable;
import java.lang.annotation.Annotation;
-import java.util.ArrayList;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
import javax.webbeans.BindingType;
@@ -31,7 +29,7 @@
public Set<Annotation> getBindingTypes()
{
- return annotatedItem.getAnnotations();
+ return annotatedItem.getAnnotations(BindingType.class);
}
protected Injectable() {}
@@ -39,7 +37,7 @@
@Override
public String toString()
{
- return getType() + " with binding types " + getBindingTypes();
+ return getClass().getSimpleName() + "[" + getAnnotatedItem().toString() + "]";
}
public T getValue(ManagerImpl manager)
@@ -57,33 +55,27 @@
return annotatedItem;
}
- public Set<Bean<?>> getPossibleBeans(Set<Bean<?>> beans)
+ public Set<Bean<?>> getMatchingBeans(Set<Bean<?>> beans)
{
Set<Bean<?>> resolvedBeans = new HashSet<Bean<?>>();
for (Bean<?> bean : beans)
{
- if (bean.getTypes().contains(getType()))
+ if (getAnnotatedItem().isAssignableFrom(bean.getTypes()) && bean.getBindingTypes().containsAll(getBindingTypes()))
{
- List<Annotation> beanBindingTypes = new ArrayList<Annotation>(bean.getBindingTypes());
- if (beanBindingTypes.containsAll(annotatedItem.getAnnotations()))
- {
- // TODO inspect annotation parameters
- // TODO inspect deployment types
- resolvedBeans.add(bean);
- }
+ resolvedBeans.add(bean);
}
}
- return resolvedBeans;
+ return resolvedBeans;
}
@Override
public boolean equals(Object other)
{
- // TODO Currently you must have any annotation literals on other for this to work, probably need to iterate over the set and check both directions
+ // TODO Do we need to check the other direction too?
if (other instanceof Injectable)
{
Injectable<?, ?> that = (Injectable<?, ?>) other;
- return this.getAnnotatedItem().getType().isAssignableFrom(that.getAnnotatedItem().getType()) &&
+ return this.getAnnotatedItem().isAssignableFrom(that.getAnnotatedItem()) &&
that.getAnnotatedItem().getAnnotations(BindingType.class).equals(this.getAnnotatedItem().getAnnotations(BindingType.class));
}
else
@@ -95,7 +87,10 @@
@Override
public int hashCode()
{
+ // TODO Implement this!
return 0;
}
+
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -24,9 +24,9 @@
}
@Override
- public Set<Bean<?>> getPossibleBeans(Set<Bean<?>> possibleBeans)
+ public Set<Bean<?>> getMatchingBeans(Set<Bean<?>> possibleBeans)
{
- return delegate.getPossibleBeans(possibleBeans);
+ return delegate.getMatchingBeans(possibleBeans);
}
@Override
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -24,9 +24,9 @@
}
@Override
- public Set<Bean<?>> getPossibleBeans(Set<Bean<?>> possibleBeans)
+ public Set<Bean<?>> getMatchingBeans(Set<Bean<?>> possibleBeans)
{
- return delegate.getPossibleBeans(possibleBeans);
+ return delegate.getMatchingBeans(possibleBeans);
}
@Override
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.injectable;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
@@ -11,5 +12,10 @@
{
super(new SimpleAnnotatedItem<T, Object>(bindingTypes, type));
}
+
+ public SimpleInjectable(Class<T> type, Annotation[] bindingTypes, Type ... actualTypeArguements)
+ {
+ super(new SimpleAnnotatedItem<T, Object>(bindingTypes, type, actualTypeArguements));
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -2,12 +2,16 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Type;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
+import org.jboss.webbeans.util.Reflections;
+
public abstract class AbstractAnnotatedItem<T, S> implements AnnotatedItem<T, S>
{
@@ -113,10 +117,53 @@
return false;
}
+ public boolean isAssignableFrom(AnnotatedItem<?, ?> that)
+ {
+ return isAssignableFrom(that.getType(), that.getActualTypeArguements());
+ }
+
+ public boolean isAssignableFrom(Set<Class<?>> types)
+ {
+ for (Class<?> type : types)
+ {
+ if (isAssignableFrom(type, Reflections.getActualTypeArguements(type)))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguements)
+ {
+ return getType().isAssignableFrom(type) && Arrays.equals(getActualTypeArguements(), actualTypeArguements);
+ }
+
@Override
public int hashCode()
{
return getType().hashCode();
}
+
+ @Override
+ public String toString()
+ {
+ String string = getType().toString();
+ if (getActualTypeArguements().length > 0)
+ {
+ string += "<";
+ for (int i = 0; i < getActualTypeArguements().length; i++)
+ {
+ string += getActualTypeArguements()[i].toString();
+ if (i < getActualTypeArguements().length - 1)
+ {
+ string += ",";
+ }
+ }
+ string += ">";
+ }
+ string += getAnnotations();
+ return string;
+ }
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.introspector;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
import java.util.Set;
@@ -48,5 +49,11 @@
public S getDelegate();
public Class<? extends T> getType();
+
+ public boolean isAssignableFrom(AnnotatedItem<?, ?> that);
+
+ public boolean isAssignableFrom(Set<Class<?>> types);
+
+ public Type[] getActualTypeArguements();
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedConstructor.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedConstructor.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,9 +1,12 @@
package org.jboss.webbeans.introspector;
import java.lang.reflect.Constructor;
+import java.lang.reflect.Type;
public class SimpleAnnotatedConstructor<T> extends AbstractAnnotatedItem<T, Constructor<T>> implements AnnotatedConstructor<T>
{
+
+ private static final Type[] actualTypeArguements = new Type[0];
private Constructor<T> constructor;
@@ -17,12 +20,6 @@
{
return constructor;
}
-
- @Override
- public String toString()
- {
- return constructor.toGenericString();
- }
public Constructor<T> getDelegate()
{
@@ -33,5 +30,10 @@
{
return constructor.getDeclaringClass();
}
+
+ public Type[] getActualTypeArguements()
+ {
+ return actualTypeArguements;
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedField.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedField.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedField.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,28 +1,31 @@
package org.jboss.webbeans.introspector;
import java.lang.reflect.Field;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
public class SimpleAnnotatedField<T> extends AbstractAnnotatedItem<T, Field> implements AnnotatedField<T>
{
+ private Type[] actualTypeArguements = new Type[0];
+
private Field field;
public SimpleAnnotatedField(Field field)
{
super(buildAnnotationMap(field));
this.field = field;
+ if (field.getGenericType() instanceof ParameterizedType)
+ {
+ ParameterizedType type = (ParameterizedType) field.getGenericType();
+ actualTypeArguements = type.getActualTypeArguments();
+ }
}
public Field getAnnotatedField()
{
return field;
}
-
- @Override
- public String toString()
- {
- return field + " " + getAnnotatedField().toString();
- }
public Field getDelegate()
{
@@ -33,5 +36,10 @@
{
return (Class<T>) field.getType();
}
+
+ public Type[] getActualTypeArguements()
+ {
+ return actualTypeArguements;
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,11 +1,15 @@
package org.jboss.webbeans.introspector;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
import java.util.Map;
public class SimpleAnnotatedItem<T, S> extends AbstractAnnotatedItem<T, S>
{
+ private Type[] actualTypeArguements = new Type[0];
+
+
private Class<? extends T> type;
public SimpleAnnotatedItem(Map<Class<? extends Annotation>, Annotation> annotationMap)
@@ -19,6 +23,12 @@
this.type = type;
}
+ public SimpleAnnotatedItem(Map<Class<? extends Annotation>, Annotation> annotationMap, Class<? extends T> type, Type[] actualTypeArguements)
+ {
+ this(annotationMap, type);
+ this.actualTypeArguements = actualTypeArguements;
+ }
+
public SimpleAnnotatedItem(Annotation[] annotations)
{
this(annotations, null);
@@ -28,6 +38,11 @@
{
this(buildAnnotationMap(annotations), type);
}
+
+ public SimpleAnnotatedItem(Annotation[] annotations, Class<? extends T> type, Type[] actualTypeArguements)
+ {
+ this(buildAnnotationMap(annotations), type, actualTypeArguements);
+ }
public S getDelegate()
{
@@ -39,4 +54,9 @@
return type;
}
+ public Type[] getActualTypeArguements()
+ {
+ return actualTypeArguements;
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedMethod.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedMethod.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,10 +1,13 @@
package org.jboss.webbeans.introspector;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
public class SimpleAnnotatedMethod<T> extends AbstractAnnotatedItem<T, Method> implements AnnotatedMethod<T>
{
+ private static final Type[] actualTypeArguements = new Type[0];
+
private Method method;
public SimpleAnnotatedMethod(Method method)
@@ -17,12 +20,6 @@
{
return method;
}
-
- @Override
- public String toString()
- {
- return method + " " + getAnnotatedMethod().toString();
- }
public Method getDelegate()
{
@@ -33,5 +30,10 @@
{
return (Class<T>) method.getReturnType();
}
+
+ public Type[] getActualTypeArguements()
+ {
+ return actualTypeArguements;
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedType.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedType.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedType.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -2,6 +2,8 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -18,6 +20,7 @@
{
private Class<T> clazz;
+ private Type[] actualTypeArguements;
private Set<AnnotatedField<?>> fields;
private Map<Class<? extends Annotation>, Set<AnnotatedField<?>>> annotatedFields;
private Map<Class<? extends Annotation>, Set<AnnotatedField<?>>> metaAnnotatedFields;
@@ -26,6 +29,15 @@
{
super(annotationMap);
this.clazz = annotatedClass;
+ if (this.clazz.getGenericSuperclass() instanceof ParameterizedType)
+ {
+ ParameterizedType type = (ParameterizedType) this.clazz.getGenericSuperclass();
+ actualTypeArguements = type.getActualTypeArguments();
+ }
+ else
+ {
+ actualTypeArguements = new Type[0];
+ }
}
public SimpleAnnotatedType(Class<T> annotatedClass)
@@ -38,12 +50,6 @@
return clazz;
}
- @Override
- public String toString()
- {
- return clazz + " " + super.getAnnotationMap().toString();
- }
-
public Class<T> getDelegate()
{
return clazz;
@@ -137,4 +143,9 @@
return clazz;
}
+ public Type[] getActualTypeArguements()
+ {
+ return actualTypeArguements;
+ }
+
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -324,4 +324,9 @@
return injectionPoints;
}
+ public boolean isAssignableFrom(AnnotatedItem<?, ?> annotatedItem)
+ {
+ return this.getAnnotatedItem().isAssignableFrom(annotatedItem);
+ }
+
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -131,7 +131,7 @@
@Override
public String toString()
{
- return "SimpleComponentModel[" + getType().getName() + "]";
+ return "SimpleWebBean[" + getAnnotatedItem().toString() + "]";
}
@Override
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanMap.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanMap.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,21 +0,0 @@
-package org.jboss.webbeans.util;
-
-import java.util.HashMap;
-
-import javax.webbeans.manager.Bean;
-
-public class BeanMap<V> extends MapWrapper<Bean<? extends V>, V>
-{
-
- public BeanMap()
- {
- super(new HashMap<Bean<? extends V>, V>());
- }
-
- @SuppressWarnings("unchecked")
- public <T extends V> T get(Bean<? extends T> key)
- {
- return (T) super.get(key);
- }
-
-}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ListComparator.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ListComparator.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ListComparator.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.util;
+
+import java.util.Comparator;
+import java.util.List;
+
+public class ListComparator<T> implements Comparator<T>
+{
+
+ private List<T> list;
+
+ public ListComparator(List<T> list)
+ {
+ this.list = list;
+ }
+
+ public int compare(T o1, T o2)
+ {
+ int p1 = list.indexOf(o1);
+ int p2 = list.indexOf(o2);
+ return p1 - p2;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ListComparator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -5,6 +5,8 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -173,4 +175,16 @@
}
return annotationTypeList.size() == 0;
}
+
+ public static Type[] getActualTypeArguements(Class<?> clazz)
+ {
+ if (clazz.getGenericSuperclass() instanceof ParameterizedType)
+ {
+ return ((ParameterizedType) clazz.getGenericSuperclass()).getActualTypeArguments();
+ }
+ else
+ {
+ return new Type[0];
+ }
+ }
}
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-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -5,6 +5,7 @@
import java.util.HashMap;
import java.util.List;
+import javax.webbeans.Production;
import javax.webbeans.Standard;
import org.jboss.webbeans.ManagerImpl;
@@ -20,24 +21,21 @@
import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
import org.jboss.webbeans.test.annotations.RiverFishStereotype;
import org.jboss.webbeans.test.mock.MockManagerImpl;
-import org.jboss.webbeans.test.util.EmptyAnnotatedType;
import org.testng.annotations.BeforeMethod;
public class AbstractTest
{
protected ManagerImpl manager;
+
- @Deprecated
- protected AnnotatedType<?> emptyAnnotatedItem;
-
@BeforeMethod
public void before()
{
- emptyAnnotatedItem = new EmptyAnnotatedType<Object>(new HashMap<Class<? extends Annotation>, Annotation>());
List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
enabledDeploymentTypes.add(Standard.class);
+ enabledDeploymentTypes.add(Production.class);
enabledDeploymentTypes.add(AnotherDeploymentType.class);
enabledDeploymentTypes.add(HornedAnimalDeploymentType.class);
manager = new MockManagerImpl(enabledDeploymentTypes);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContextTest.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -11,7 +11,6 @@
import org.jboss.webbeans.model.SimpleComponentModel;
import org.jboss.webbeans.test.components.Tuna;
import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.ExpectedExceptions;
import org.testng.annotations.Test;
/**
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -5,6 +5,7 @@
import javax.webbeans.AnnotationLiteral;
import javax.webbeans.Current;
+import javax.webbeans.TypeLiteral;
import javax.webbeans.manager.Bean;
import org.jboss.webbeans.BeanImpl;
@@ -13,14 +14,17 @@
import org.jboss.webbeans.injectable.InjectableField;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.SimpleComponentModel;
-import org.jboss.webbeans.test.annotations.Chunky;
import org.jboss.webbeans.test.annotations.Whitefish;
+import org.jboss.webbeans.test.bindings.ChunkyAnnotationLiteral;
import org.jboss.webbeans.test.components.Animal;
import org.jboss.webbeans.test.components.Cod;
+import org.jboss.webbeans.test.components.Farmer;
import org.jboss.webbeans.test.components.FishFarm;
import org.jboss.webbeans.test.components.Haddock;
+import org.jboss.webbeans.test.components.Plaice;
import org.jboss.webbeans.test.components.Salmon;
import org.jboss.webbeans.test.components.ScottishFish;
+import org.jboss.webbeans.test.components.ScottishFishFarmer;
import org.jboss.webbeans.test.components.SeaBass;
import org.jboss.webbeans.test.components.Sole;
import org.jboss.webbeans.test.components.Tuna;
@@ -48,7 +52,7 @@
Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
Set<Bean<?>> beans = new HashSet<Bean<?>>();
beans.add(tunaBean);
- Set<Bean<?>> possibleTargets = tunaField.getPossibleBeans(beans);
+ Set<Bean<?>> possibleTargets = tunaField.getMatchingBeans(beans);
assert possibleTargets.size() == 1;
assert possibleTargets.contains(tunaBean);
}
@@ -56,7 +60,7 @@
@Test
public void testOneBindingType() throws Exception
{
- InjectableField<ScottishFish> scottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("scottishFish"));
+ InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
@@ -64,7 +68,7 @@
beans.add(codBean);
beans.add(salmonBean);
beans.add(soleBean);
- Set<Bean<?>> possibleTargets = scottishFishField.getPossibleBeans(beans);
+ Set<Bean<?>> possibleTargets = whiteScottishFishField.getMatchingBeans(beans);
assert possibleTargets.size() == 2;
assert possibleTargets.contains(codBean);
assert possibleTargets.contains(soleBean);
@@ -73,7 +77,7 @@
@Test
public void testABindingType() throws Exception
{
- InjectableField<Animal> whiteChunkyFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("whiteChunkyFish"));
+ InjectableField<Animal> whiteChunkyFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"));
Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
@@ -81,7 +85,7 @@
beans.add(codBean);
beans.add(salmonBean);
beans.add(soleBean);
- Set<Bean<?>> possibleTargets = whiteChunkyFishField.getPossibleBeans(beans);
+ Set<Bean<?>> possibleTargets = whiteChunkyFishField.getMatchingBeans(beans);
assert possibleTargets.size() == 1;
assert possibleTargets.contains(codBean);
}
@@ -95,7 +99,7 @@
Set<Bean<?>> beans = new HashSet<Bean<?>>();
beans.add(seaBassBean);
beans.add(haddockBean);
- Set<Bean<?>> possibleTargets = animalField.getPossibleBeans(beans);
+ Set<Bean<?>> possibleTargets = animalField.getMatchingBeans(beans);
assert possibleTargets.size() == 2;
assert possibleTargets.contains(seaBassBean);
assert possibleTargets.contains(haddockBean);
@@ -104,9 +108,9 @@
@Test
public void testResolveByType() throws Exception
{
- InjectableField<Animal> whiteChunkyFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("whiteChunkyFish"));
+ InjectableField<Animal> realChunkyWhiteFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"));
InjectableField<Animal> animalField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("animal"));
- InjectableField<ScottishFish> scottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("scottishFish"));
+ InjectableField<ScottishFish> scottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
InjectableField<Tuna> tunaField = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
@@ -124,30 +128,83 @@
manager.addBean(seaBassBean);
ResolutionManager resolutionManager = manager.getResolutionManager();
- resolutionManager.addInjectionPoint(whiteChunkyFishField);
+ resolutionManager.addInjectionPoint(realChunkyWhiteFishField);
resolutionManager.addInjectionPoint(animalField);
resolutionManager.addInjectionPoint(scottishFishField);
resolutionManager.addInjectionPoint(tunaField);
- resolutionManager.registerInjectionPoints();
-
- System.out.println("injection points registered");
-
assert manager.resolveByType(Tuna.class, new CurrentAnnotationLiteral()).size() == 1;
assert manager.resolveByType(Tuna.class, new CurrentAnnotationLiteral()).contains(tunaBean);
+ assert manager.resolveByType(Tuna.class).size() == 1;
+ assert manager.resolveByType(Tuna.class).contains(tunaBean);
+
assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).size() == 3;
assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).contains(salmonBean);
assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).contains(seaBassBean);
assert manager.resolveByType(Animal.class, new CurrentAnnotationLiteral()).contains(haddockBean);
- assert manager.resolveByType(Animal.class, new AnnotationLiteral<Chunky>() {}, new AnnotationLiteral<Whitefish>() {}).size() == 1;
- assert manager.resolveByType(Animal.class, new AnnotationLiteral<Chunky>() {}, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
+ assert manager.resolveByType(Animal.class, new ChunkyAnnotationLiteral() {
+
+ public boolean realChunky()
+ {
+ return true;
+ }
+
+ }, new AnnotationLiteral<Whitefish>() {}).size() == 1;
+ assert manager.resolveByType(Animal.class, new ChunkyAnnotationLiteral() {
+
+ public boolean realChunky()
+ {
+ return true;
+ }
+
+ }, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).size() == 2;
assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).contains(codBean);
assert manager.resolveByType(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).contains(soleBean);
}
+
+ @Test
+ public void testResolveByTypeWithTypeParameter() throws Exception
+ {
+ InjectableField<Farmer<ScottishFish>> scottishFishFarmerField = new InjectableField<Farmer<ScottishFish>>(FishFarm.class.getDeclaredField("scottishFishFarmer"));
+ Bean<ScottishFishFarmer> scottishFishFarmerBean = new BeanImpl<ScottishFishFarmer>(new SimpleComponentModel<ScottishFishFarmer>(new SimpleAnnotatedType<ScottishFishFarmer>(ScottishFishFarmer.class), getEmptyAnnotatedItem(ScottishFishFarmer.class), super.manager), manager);
+ Bean<Farmer> farmerBean = new BeanImpl<Farmer>(new SimpleComponentModel<Farmer>(new SimpleAnnotatedType<Farmer>(Farmer.class), getEmptyAnnotatedItem(Farmer.class), super.manager), manager);
+
+ manager.addBean(scottishFishFarmerBean);
+ manager.addBean(farmerBean);
+
+ ResolutionManager resolutionManager = manager.getResolutionManager();
+ resolutionManager.addInjectionPoint(scottishFishFarmerField);
+
+ assert manager.resolveByType(new TypeLiteral<Farmer<ScottishFish>>(){}).size() == 1;
+ assert manager.resolveByType(new TypeLiteral<Farmer<ScottishFish>>(){}).contains(scottishFishFarmerBean);
+ }
+
+ @Test
+ public void testOnlyHighestEnabledPreecedenceWebBeansResolved() throws Exception
+ {
+ InjectableField<Animal> whiteFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("whiteFish"));
+
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleComponentModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
+
+
+ manager.addBean(plaiceBean);
+ manager.addBean(codBean);
+ manager.addBean(soleBean);
+
+ ResolutionManager resolutionManager = manager.getResolutionManager();
+ resolutionManager.addInjectionPoint(whiteFishField);
+
+ assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>() {}).size() == 1;
+ assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>() {}).contains(plaiceBean);
+
+ }
+
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -0,0 +1,51 @@
+package org.jboss.webbeans.test;
+
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.BeanImpl;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.test.components.Cod;
+import org.jboss.webbeans.test.components.Haddock;
+import org.jboss.webbeans.test.components.Plaice;
+import org.jboss.webbeans.test.components.Salmon;
+import org.jboss.webbeans.test.components.SeaBass;
+import org.jboss.webbeans.test.components.Sole;
+import org.jboss.webbeans.test.components.Tuna;
+import org.testng.annotations.Test;
+
+public class NameBasedResolutionTest extends AbstractTest
+{
+
+ @Test
+ public void testNamedBasedResolution()
+ {
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleComponentModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleComponentModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleComponentModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
+ Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
+ Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleComponentModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
+
+ manager.addBean(tunaBean);
+ manager.addBean(codBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+ manager.addBean(haddockBean);
+ manager.addBean(seaBassBean);
+
+ assert manager.resolveByName("salmon").size() == 1;
+ assert manager.resolveByName("salmon").contains(salmonBean);
+
+ assert manager.resolveByName("whitefish").size() == 2;
+ assert manager.resolveByName("whitefish").contains(codBean);
+ assert manager.resolveByName("whitefish").contains(soleBean);
+
+ manager.addBean(plaiceBean);
+
+ assert manager.resolveByName("whitefish").size() == 1;
+ assert manager.resolveByName("whitefish").contains(plaiceBean);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/Chunky.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/Chunky.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/Chunky.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -18,5 +18,7 @@
@BindingType
public @interface Chunky
{
+
+ boolean realChunky();
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/ChunkyAnnotationLiteral.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/ChunkyAnnotationLiteral.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/ChunkyAnnotationLiteral.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.test.bindings;
+
+import javax.webbeans.AnnotationLiteral;
+
+import org.jboss.webbeans.test.annotations.Chunky;
+
+public abstract class ChunkyAnnotationLiteral extends AnnotationLiteral<Chunky> implements Chunky
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/ChunkyAnnotationLiteral.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cod.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cod.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Cod.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,5 +1,6 @@
package org.jboss.webbeans.test.components;
+import javax.webbeans.Named;
import javax.webbeans.Production;
import org.jboss.webbeans.test.annotations.Chunky;
@@ -7,7 +8,8 @@
@Production
@Whitefish
-@Chunky
+@Chunky(realChunky=true)
+@Named("whitefish")
public class Cod implements ScottishFish
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -20,11 +20,18 @@
@SuppressWarnings("unused")
@Whitefish
- private ScottishFish scottishFish;
+ private ScottishFish whiteScottishFish;
- @Whitefish @Chunky
- private Animal whiteChunkyFish;
+ @SuppressWarnings("unused")
+ @Whitefish
+ private Animal whiteFish;
+ @SuppressWarnings("unused")
+ @Whitefish @Chunky(realChunky=true)
+ private Animal realChunkyWhiteFish;
+
+ @SuppressWarnings("unused")
+ @Current
private Farmer<ScottishFish> scottishFishFarmer;
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.components;
+
+import javax.webbeans.Named;
+
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
+import org.jboss.webbeans.test.annotations.Whitefish;
+
+@AnotherDeploymentType
+@Whitefish
+@Named("whitefish")
+public class Plaice implements Animal
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Plaice.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Salmon.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Salmon.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Salmon.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,10 +1,10 @@
package org.jboss.webbeans.test.components;
+import javax.webbeans.Named;
import javax.webbeans.Production;
-import org.jboss.webbeans.test.annotations.Whitefish;
-
@Production
+@Named
public class Salmon implements ScottishFish
{
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFishFarmer.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFishFarmer.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFishFarmer.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.components;
+
+import javax.webbeans.Production;
+
+@Production
+public class ScottishFishFarmer extends Farmer<ScottishFish>
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/ScottishFishFarmer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sole.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sole.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Sole.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,11 +1,13 @@
package org.jboss.webbeans.test.components;
+import javax.webbeans.Named;
import javax.webbeans.Production;
import org.jboss.webbeans.test.annotations.Whitefish;
@Production
@Whitefish
+@Named("whitefish")
public class Sole implements ScottishFish
{
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/EmptyAnnotatedType.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/EmptyAnnotatedType.java 2008-10-24 15:13:35 UTC (rev 143)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/EmptyAnnotatedType.java 2008-10-25 00:13:08 UTC (rev 144)
@@ -1,38 +0,0 @@
-package org.jboss.webbeans.test.util;
-
-import java.lang.annotation.Annotation;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.webbeans.introspector.AnnotatedField;
-import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-
-/**
- * An empty annotated type
- *
- * TODO Update testsuite not to need this hack
- *
- * @author pmuir
- *
- */
-public class EmptyAnnotatedType<T> extends SimpleAnnotatedType<T>
-{
-
- public EmptyAnnotatedType(Map<Class<? extends Annotation>, Annotation> annotationMap)
- {
- super(null, annotationMap);
- }
-
- public Set<AnnotatedField<?>> getFields()
- {
- return null;
- }
-
- @Override
- public Set<AnnotatedField<?>> getMetaAnnotatedFields(
- Class<? extends Annotation> metaAnnotationType)
- {
- return null;
- }
-
-}
\ No newline at end of file
15 years, 10 months