Author: pete.muir(a)jboss.org
Date: 2009-01-09 08:02:40 -0500 (Fri, 09 Jan 2009)
New Revision: 856
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/BeansImpl.java
Log:
Start implementing TCK api
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/BeansImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/BeansImpl.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/BeansImpl.java 2009-01-09
13:02:40 UTC (rev 856)
@@ -0,0 +1,39 @@
+package org.jboss.webbeans.tck.impl;
+
+import java.lang.reflect.Method;
+
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.bean.AbstractClassBean;
+import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.bean.ProducerMethodBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.tck.api.Beans;
+
+public class BeansImpl implements Beans
+{
+
+ public <T> Bean<T> createSimpleBean(Class<T> clazz)
+ {
+ return SimpleBean.of(clazz, CurrentManager.rootManager());
+ }
+
+ public <T> Bean<T> createProducerMethodBean(Method method, Bean<T>
declaringBean)
+ {
+ if (declaringBean instanceof AbstractClassBean)
+ {
+ return ProducerMethodBean.of(method, (AbstractClassBean<?>) declaringBean,
CurrentManager.rootManager());
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot create a producer method from a
bean that wasn't created by the RI " + declaringBean);
+ }
+ }
+
+ public <T> Bean<T> createEnterpriseBean(Class<T> clazz)
+ {
+ return EnterpriseBean.of(clazz, CurrentManager.rootManager());
+ }
+
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/BeansImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Show replies by date