Author: pete.muir(a)jboss.org
Date: 2009-01-09 12:27:59 -0500 (Fri, 09 Jan 2009)
New Revision: 863
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/BeansImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ContextsImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ManagersImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/TCKRunner.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/BeansImpl.java
Modified:
ri/trunk/webbeans-ri/pom.xml
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Managers.java
Log:
Make RI run TCK tests
Modified: ri/trunk/webbeans-ri/pom.xml
===================================================================
--- ri/trunk/webbeans-ri/pom.xml 2009-01-09 17:21:05 UTC (rev 862)
+++ ri/trunk/webbeans-ri/pom.xml 2009-01-09 17:27:59 UTC (rev 863)
@@ -33,6 +33,12 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.webbeans.tck</groupId>
+ <artifactId>webbeans-tck-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+
<!-- <dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-embedded</artifactId>
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri (from rev 856,
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl)
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/BeansImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/BeansImpl.java 2009-01-09
13:02:40 UTC (rev 856)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/BeansImpl.java 2009-01-09
17:27:59 UTC (rev 863)
@@ -1,39 +0,0 @@
-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());
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/BeansImpl.java (from
rev 862, 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/ri/BeansImpl.java
(rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/BeansImpl.java 2009-01-09
17:27:59 UTC (rev 863)
@@ -0,0 +1,39 @@
+package org.jboss.webbeans.tck.ri;
+
+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<?>
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());
+ }
+
+}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ContextsImpl.java
(from rev 862,
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/ContextsImpl.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ContextsImpl.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ContextsImpl.java 2009-01-09
17:27:59 UTC (rev 863)
@@ -0,0 +1,27 @@
+package org.jboss.webbeans.tck.ri;
+
+import org.jboss.webbeans.context.AbstractContext;
+import org.jboss.webbeans.context.RequestContext;
+import org.jboss.webbeans.tck.api.Contexts;
+
+public class ContextsImpl implements Contexts<AbstractContext>
+{
+
+ public RequestContext getRequestContext()
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public void setActive(AbstractContext context)
+ {
+ context.setActive(true);
+ }
+
+ public void setInactive(AbstractContext context)
+ {
+ context.setActive(false);
+ }
+
+
+
+}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ManagersImpl.java
(from rev 858,
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/MangersImpl.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ManagersImpl.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ManagersImpl.java 2009-01-09
17:27:59 UTC (rev 863)
@@ -0,0 +1,26 @@
+package org.jboss.webbeans.tck.ri;
+
+import java.lang.annotation.Annotation;
+import java.util.List;
+
+import javax.webbeans.manager.Manager;
+
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.tck.api.Managers;
+import org.jboss.webbeans.test.mock.MockBootstrap;
+
+public class ManagersImpl implements Managers
+{
+
+ public Manager createManager()
+ {
+ new MockBootstrap();
+ return CurrentManager.rootManager();
+ }
+
+ public void setEnabledDeploymentTypes(List<Class<? extends Annotation>>
enabledDeploymentTypes)
+ {
+ CurrentManager.rootManager().setEnabledDeploymentTypes(enabledDeploymentTypes);
+ }
+
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ManagersImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/TCKRunner.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/TCKRunner.java
(rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/TCKRunner.java 2009-01-09
17:27:59 UTC (rev 863)
@@ -0,0 +1,29 @@
+package org.jboss.webbeans.tck.ri;
+
+import org.jboss.webbeans.tck.api.TCKConfiguration;
+import org.jboss.webbeans.tck.api.WebBeansTCK;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class TCKRunner
+{
+
+ private WebBeansTCK tck;
+
+ @BeforeClass
+ public void beforeClass()
+ {
+ TCKConfiguration configuration = new TCKConfiguration(new BeansImpl(), new
ContextsImpl(), new ManagersImpl());
+ tck = WebBeansTCK.newInstance(configuration);
+ }
+
+ @Test
+ public void runTCK()
+ {
+ if (!tck.run())
+ {
+ throw new AssertionError("TCK run failed, see log");
+ }
+ }
+
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/TCKRunner.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Managers.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Managers.java 2009-01-09
17:21:05 UTC (rev 862)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Managers.java 2009-01-09
17:27:59 UTC (rev 863)
@@ -26,5 +26,5 @@
*
* @return the Manager
*/
- Manager getManager();
+ Manager createManager();
}
Show replies by date