[webbeans-commits] Webbeans SVN: r861 - in tck/trunk: api/src/main/java/org/jboss/webbeans/tck/api and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 11:13:20 -0500 (Fri, 09 Jan 2009)
New Revision: 861
Added:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TCKConfiguration.java
tck/trunk/impl/src/main/resources/unit-tests.xml
Removed:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/testng.xml
Modified:
tck/trunk/api/pom.xml
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/WebBeansTCK.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java
Log:
TCK run infrastructure
Modified: tck/trunk/api/pom.xml
===================================================================
--- tck/trunk/api/pom.xml 2009-01-09 14:41:48 UTC (rev 860)
+++ tck/trunk/api/pom.xml 2009-01-09 16:13:20 UTC (rev 861)
@@ -43,5 +43,23 @@
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.jboss.webbeans.tck.api.WebBeansTCK</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
</project>
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TCKConfiguration.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TCKConfiguration.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TCKConfiguration.java 2009-01-09 16:13:20 UTC (rev 861)
@@ -0,0 +1,35 @@
+package org.jboss.webbeans.tck.api;
+
+public class TCKConfiguration
+{
+
+ private Beans beans;
+
+ private Contexts<?> contexts;
+
+ private Managers managers;
+
+ public TCKConfiguration(Beans beans, Contexts<?> contexts, Managers managers)
+ {
+ super();
+ this.beans = beans;
+ this.contexts = contexts;
+ this.managers = managers;
+ }
+
+ public Beans getBeans()
+ {
+ return beans;
+ }
+
+ public Contexts<?> getContexts()
+ {
+ return contexts;
+ }
+
+ public Managers getManagers()
+ {
+ return managers;
+ }
+
+}
Property changes on: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TCKConfiguration.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/WebBeansTCK.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/WebBeansTCK.java 2009-01-09 14:41:48 UTC (rev 860)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/WebBeansTCK.java 2009-01-09 16:13:20 UTC (rev 861)
@@ -1,10 +1,25 @@
package org.jboss.webbeans.tck.api;
+/**
+ * TCK runner
+ *
+ * @author Pete Muir
+ *
+ */
public abstract class WebBeansTCK
{
- public static final void run()
+ /**
+ * Obtain an instance of the TCK
+ *
+ * @param configuration
+ * the TCK configuration; if null, the TCK should try to load
+ * configuration from system properties and
+ * web-beans-tck.properties
+ * @return
+ */
+ public static final WebBeansTCK newInstance(TCKConfiguration configuration)
{
WebBeansTCK webBeansTCK;
try
@@ -13,30 +28,47 @@
}
catch (InstantiationException e)
{
- throw new IllegalStateException("WebBeansTCK cannot be run unless webbeans-tck-impl.jar is on the classpath");
+ throw new IllegalStateException("WebBeansTCK cannot be run unless webbeans-tck-impl.jar is on the classpath", e);
}
catch (IllegalAccessException e)
{
- throw new IllegalStateException("WebBeansTCK cannot be run unless webbeans-tck-impl.jar is on the classpath");
+ throw new IllegalStateException("WebBeansTCK cannot be run unless webbeans-tck-impl.jar is on the classpath", e);
}
catch (ClassNotFoundException e)
{
- throw new IllegalStateException("WebBeansTCK cannot be run unless webbeans-tck-impl.jar is on the classpath");
+ throw new IllegalStateException("WebBeansTCK cannot be run unless webbeans-tck-impl.jar is on the classpath", e);
}
-
- // Run the TCK testsuite
- webBeansTCK.runUnitTests();
+ webBeansTCK.configure(configuration);
+ return webBeansTCK;
}
+ /**
+ * Run the whole TCK
+ */
+ public final void run()
+ {
+ // Load Configuration and run
+ runUnitTests();
+ }
+
public static void main(String[] args)
{
- run();
+ newInstance(null).run();
}
protected WebBeansTCK()
{
}
- public abstract void runUnitTests();
+ protected abstract void runUnitTests();
+ /**
+ * Configure the TCK
+ *
+ * @param configuration if null, the TCK should try to load
+ * configuration from system properties and
+ * web-beans-tck.properties
+ */
+ protected abstract void configure(TCKConfiguration configuration);
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java 2009-01-09 14:41:48 UTC (rev 860)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java 2009-01-09 16:13:20 UTC (rev 861)
@@ -1,14 +1,24 @@
package org.jboss.webbeans.tck.impl;
+import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.jboss.webbeans.tck.api.TCKConfiguration;
import org.jboss.webbeans.tck.api.WebBeansTCK;
import org.testng.TestNG;
+import org.testng.xml.Parser;
+import org.testng.xml.XmlSuite;
+import org.xml.sax.SAXException;
public class WebBeansTCKImpl extends WebBeansTCK
{
+ private TCKConfiguration configuration;
+
public WebBeansTCKImpl()
{
super();
@@ -18,10 +28,50 @@
public void runUnitTests()
{
TestNG testNG = new TestNG();
- List<String> suites = new ArrayList<String>();
- suites.add("testng.xml");
- testNG.setTestSuites(suites);
+ setXmlSuitePath(testNG);
testNG.run();
}
+ private static void setXmlSuitePath(TestNG testNG)
+ {
+ InputStream is = WebBeansTCKImpl.class.getResourceAsStream("/unit-tests.xml");
+ if (is == null)
+ {
+ throw new IllegalStateException("Unable to load testng.xml");
+ }
+ List<XmlSuite> suites = new ArrayList<XmlSuite>();
+ try
+ {
+ suites.addAll(new Parser(is).parse());
+
+ }
+ catch (ParserConfigurationException e)
+ {
+ throw new IllegalStateException("Unable to load testng.xml", e);
+ }
+ catch (SAXException e)
+ {
+ throw new IllegalStateException("Unable to load testng.xml", e);
+ }
+ catch (IOException e)
+ {
+ throw new IllegalStateException("Unable to load testng.xml", e);
+ }
+ testNG.setXmlSuites(suites);
+ }
+
+ @Override
+ protected void configure(TCKConfiguration configuration)
+ {
+ if (configuration == null)
+ {
+ // TODO load configuration from properties
+ }
+ else
+ {
+ this.configuration = configuration;
+ }
+ }
+
+
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/testng.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/testng.xml 2009-01-09 14:41:48 UTC (rev 860)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/testng.xml 2009-01-09 16:13:20 UTC (rev 861)
@@ -1,40 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-
-<suite name="WebBeans TCK" verbose="1" >
-
- <test name="Web Beans TCK">
- <groups>
- <run>
-<!--
- <exclude name="specialization" />
- <exclude name="deployment" />
- <exclude name="disposalMethod" />
-
- <exclude name="observerMethod" />
- <exclude name="deferredEvent" />
- <exclude name="ejb3" />
- <exclude name="webservice" />
- <exclude name="annotationDefinition" />
- <exclude name="webbeansxml" />
- <exclude name="el" />
- <exclude name="jms" />
- <exclude name="interceptors" />
- <exclude name="decorators" />
- <exclude name="servlet" />
-
- <exclude name="passivation" />
- <exclude name="singletons" />
- <exclude name="ejbjarxml" />
- <exclude name="beanDestruction" />
- <exclude name="commonAnnotations" />
--->
- <exclude name="stub" />
- <exclude name="broken" />
- </run>
- </groups>
- <packages>
- <package name="org.jboss.webbeans.tck.impl" />
- </packages>
- </test>
-
-</suite>
\ No newline at end of file
Copied: tck/trunk/impl/src/main/resources/unit-tests.xml (from rev 860, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/testng.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/unit-tests.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/unit-tests.xml 2009-01-09 16:13:20 UTC (rev 861)
@@ -0,0 +1,40 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="WebBeans TCK" verbose="3" >
+
+ <test name="Web Beans TCK" >
+ <groups >
+ <run>
+<!--
+ <exclude name="specialization" />
+ <exclude name="deployment" />
+ <exclude name="disposalMethod" />
+
+ <exclude name="observerMethod" />
+ <exclude name="deferredEvent" />
+ <exclude name="ejb3" />
+ <exclude name="webservice" />
+ <exclude name="annotationDefinition" />
+ <exclude name="webbeansxml" />
+ <exclude name="el" />
+ <exclude name="jms" />
+ <exclude name="interceptors" />
+ <exclude name="decorators" />
+ <exclude name="servlet" />
+
+ <exclude name="passivation" />
+ <exclude name="singletons" />
+ <exclude name="ejbjarxml" />
+ <exclude name="beanDestruction" />
+ <exclude name="commonAnnotations" />
+-->
+ <exclude name="stub" />
+ <exclude name="broken" />
+ </run>
+ </groups>
+ <packages >
+ <package name="org.jboss.webbeans.tck.impl" />
+ </packages>
+ </test>
+
+</suite>
\ No newline at end of file
16 years
[webbeans-commits] Webbeans SVN: r860 - in tck/trunk: impl and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 09:41:48 -0500 (Fri, 09 Jan 2009)
New Revision: 860
Added:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/WebBeansTCK.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/testng.xml
Removed:
tck/trunk/impl/testng.xml
Log:
A TCK runner
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/WebBeansTCK.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/WebBeansTCK.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/WebBeansTCK.java 2009-01-09 14:41:48 UTC (rev 860)
@@ -0,0 +1,42 @@
+package org.jboss.webbeans.tck.api;
+
+
+public abstract class WebBeansTCK
+{
+
+ public static final void run()
+ {
+ WebBeansTCK webBeansTCK;
+ try
+ {
+ webBeansTCK = (WebBeansTCK) Class.forName("org.jboss.webbeans.tck.impl.WebBeansTCKImpl").newInstance();
+ }
+ catch (InstantiationException e)
+ {
+ throw new IllegalStateException("WebBeansTCK cannot be run unless webbeans-tck-impl.jar is on the classpath");
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new IllegalStateException("WebBeansTCK cannot be run unless webbeans-tck-impl.jar is on the classpath");
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new IllegalStateException("WebBeansTCK cannot be run unless webbeans-tck-impl.jar is on the classpath");
+ }
+
+ // Run the TCK testsuite
+ webBeansTCK.runUnitTests();
+ }
+
+ public static void main(String[] args)
+ {
+ run();
+ }
+
+ protected WebBeansTCK()
+ {
+ }
+
+ public abstract void runUnitTests();
+
+}
Property changes on: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/WebBeansTCK.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java 2009-01-09 14:41:48 UTC (rev 860)
@@ -0,0 +1,27 @@
+package org.jboss.webbeans.tck.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.webbeans.tck.api.WebBeansTCK;
+import org.testng.TestNG;
+
+public class WebBeansTCKImpl extends WebBeansTCK
+{
+
+ public WebBeansTCKImpl()
+ {
+ super();
+ }
+
+ @Override
+ public void runUnitTests()
+ {
+ TestNG testNG = new TestNG();
+ List<String> suites = new ArrayList<String>();
+ suites.add("testng.xml");
+ testNG.setTestSuites(suites);
+ testNG.run();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/testng.xml (from rev 858, tck/trunk/impl/testng.xml)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/testng.xml (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/testng.xml 2009-01-09 14:41:48 UTC (rev 860)
@@ -0,0 +1,40 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="WebBeans TCK" verbose="1" >
+
+ <test name="Web Beans TCK">
+ <groups>
+ <run>
+<!--
+ <exclude name="specialization" />
+ <exclude name="deployment" />
+ <exclude name="disposalMethod" />
+
+ <exclude name="observerMethod" />
+ <exclude name="deferredEvent" />
+ <exclude name="ejb3" />
+ <exclude name="webservice" />
+ <exclude name="annotationDefinition" />
+ <exclude name="webbeansxml" />
+ <exclude name="el" />
+ <exclude name="jms" />
+ <exclude name="interceptors" />
+ <exclude name="decorators" />
+ <exclude name="servlet" />
+
+ <exclude name="passivation" />
+ <exclude name="singletons" />
+ <exclude name="ejbjarxml" />
+ <exclude name="beanDestruction" />
+ <exclude name="commonAnnotations" />
+-->
+ <exclude name="stub" />
+ <exclude name="broken" />
+ </run>
+ </groups>
+ <packages>
+ <package name="org.jboss.webbeans.tck.impl" />
+ </packages>
+ </test>
+
+</suite>
\ No newline at end of file
Deleted: tck/trunk/impl/testng.xml
===================================================================
--- tck/trunk/impl/testng.xml 2009-01-09 14:32:25 UTC (rev 859)
+++ tck/trunk/impl/testng.xml 2009-01-09 14:41:48 UTC (rev 860)
@@ -1,43 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-
-<suite name="WebBeans RI" verbose="1" >
-
- <test name="Web Beans RI">
- <groups>
- <run>
-<!--
- <exclude name="specialization" />
- <exclude name="deployment" />
- <exclude name="disposalMethod" />
-
- <exclude name="observerMethod" />
- <exclude name="deferredEvent" />
- <exclude name="ejb3" />
- <exclude name="webservice" />
- <exclude name="annotationDefinition" />
- <exclude name="webbeansxml" />
- <exclude name="el" />
- <exclude name="jms" />
- <exclude name="interceptors" />
- <exclude name="decorators" />
- <exclude name="servlet" />
-
- <exclude name="passivation" />
- <exclude name="singletons" />
- <exclude name="ejbjarxml" />
- <exclude name="beanDestruction" />
- <exclude name="commonAnnotations" />
--->
- <exclude name="stub" />
- <exclude name="broken" />
- </run>
- </groups>
- <packages>
- <package name="org.jboss.webbeans.test"></package>
- <package name="org.jboss.webbeans.test.contexts"></package>
- <package name="org.jboss.webbeans.examples"></package>
- <package name="org.jboss.webbeans.test.ejb"></package>
- </packages>
- </test>
-
-</suite>
\ No newline at end of file
16 years
[webbeans-commits] Webbeans SVN: r859 - ri/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 09:32:25 -0500 (Fri, 09 Jan 2009)
New Revision: 859
Modified:
ri/trunk/pom.xml
Log:
fix build
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2009-01-09 14:15:51 UTC (rev 858)
+++ ri/trunk/pom.xml 2009-01-09 14:32:25 UTC (rev 859)
@@ -181,12 +181,17 @@
<version>${project.version}</version>
</dependency>
-
<dependency>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-ri-spi</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans.tck</groupId>
+ <artifactId>webbeans-tck-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</dependencyManagement>
16 years
[webbeans-commits] Webbeans SVN: r858 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 09:15:51 -0500 (Fri, 09 Jan 2009)
New Revision: 858
Added:
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/impl/MangersImpl.java
Modified:
ri/trunk/webbeans-ri/pom.xml
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/BeansImpl.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Contexts.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Managers.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java
Log:
Update API slightly, implement in RI
Modified: ri/trunk/webbeans-ri/pom.xml
===================================================================
--- ri/trunk/webbeans-ri/pom.xml 2009-01-09 13:17:16 UTC (rev 857)
+++ ri/trunk/webbeans-ri/pom.xml 2009-01-09 14:15:51 UTC (rev 858)
@@ -27,6 +27,12 @@
<classifier>jdk15</classifier>
</dependency>
+ <dependency>
+ <groupId>org.jboss.webbeans.tck</groupId>
+ <artifactId>webbeans-tck-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+
<!-- <dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-embedded</artifactId>
Modified: 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 2009-01-09 13:17:16 UTC (rev 857)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/BeansImpl.java 2009-01-09 14:15:51 UTC (rev 858)
@@ -19,7 +19,7 @@
return SimpleBean.of(clazz, CurrentManager.rootManager());
}
- public <T> Bean<T> createProducerMethodBean(Method method, Bean<T> declaringBean)
+ public <T> Bean<T> createProducerMethodBean(Method method, Bean<?> declaringBean)
{
if (declaringBean instanceof AbstractClassBean)
{
Added: 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/impl/ContextsImpl.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/ContextsImpl.java 2009-01-09 14:15:51 UTC (rev 858)
@@ -0,0 +1,27 @@
+package org.jboss.webbeans.tck.impl;
+
+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);
+ }
+
+
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/ContextsImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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/impl/MangersImpl.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/impl/MangersImpl.java 2009-01-09 14:15:51 UTC (rev 858)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.tck.impl;
+
+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;
+
+public class MangersImpl implements Managers
+{
+
+ public Manager getManager()
+ {
+ 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/impl/MangersImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-09 13:17:16 UTC (rev 857)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-09 14:15:51 UTC (rev 858)
@@ -53,6 +53,6 @@
* method
* @return the producer bean
*/
- public <T> Bean<T> createProducerMethodBean(Method method, Bean<T> declaringBean);
+ public <T> Bean<T> createProducerMethodBean(Method method, Bean<?> declaringBean);
}
Modified: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Contexts.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Contexts.java 2009-01-09 13:17:16 UTC (rev 857)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Contexts.java 2009-01-09 14:15:51 UTC (rev 858)
@@ -6,27 +6,29 @@
* Context related operations
*
* @author Shane Bryzak
+ * @author Pete Muir
+ *
*/
-public interface Contexts
+public interface Contexts<T extends Context>
{
/**
* Sets the specified context as active
*
* @param context The context to set active
*/
- void setActive(Context context);
+ void setActive(T context);
/**
* Sets the specified context as inactive
*
* @param context The context to set inactive
*/
- void setInactive(Context context);
+ void setInactive(T context);
/**
* Creates a new request context
*
* @return The new request context
*/
- Context createRequestContext();
+ T getRequestContext();
}
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 13:17:16 UTC (rev 857)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Managers.java 2009-01-09 14:15:51 UTC (rev 858)
@@ -22,9 +22,9 @@
void setEnabledDeploymentTypes(List<Class<? extends Annotation>> enabledDeploymentTypes);
/**
- * Creates a new Manager instance
+ * Get the Manager instance
*
- * @return The new Manager
+ * @return the Manager
*/
- Manager createManager();
+ Manager getManager();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java 2009-01-09 13:17:16 UTC (rev 857)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java 2009-01-09 14:15:51 UTC (rev 858)
@@ -24,7 +24,7 @@
@BeforeMethod
public final void before()
{
- manager = TckUtils.getManagers().createManager();
+ manager = TckUtils.getManagers().getManager();
//addStandardDeploymentTypesForTests();
}
16 years
[webbeans-commits] Webbeans SVN: r857 - tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 08:17:16 -0500 (Fri, 09 Jan 2009)
New Revision: 857
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java
Log:
fix build
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java 2009-01-09 13:02:40 UTC (rev 856)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java 2009-01-09 13:17:16 UTC (rev 857)
@@ -6,10 +6,7 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Method;
-import java.util.Arrays;
-import javax.webbeans.Production;
-import javax.webbeans.Standard;
import javax.webbeans.manager.Bean;
import javax.webbeans.manager.Manager;
@@ -33,12 +30,12 @@
public <T> Bean<T> getSimpleBean(Class<T> beanClass)
{
- return TckUtils.getBeans().createSimpleBean(beanClass, manager);
+ return TckUtils.getBeans().createSimpleBean(beanClass);
}
public <T> Bean<?> getProducerMethodBean(Method method, Bean<?> producerBean)
{
- return TckUtils.getBeans().getProducerMethodBean(method, producerBean, manager);
+ return TckUtils.getBeans().createProducerMethodBean(method, producerBean);
}
/*
16 years
[webbeans-commits] Webbeans SVN: r856 - in ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans: tck and 1 other directories.
by webbeans-commits@lists.jboss.org
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
16 years
[webbeans-commits] Webbeans SVN: r855 - tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-01-09 08:01:56 -0500 (Fri, 09 Jan 2009)
New Revision: 855
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java
Log:
fix spec version
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java 2009-01-09 12:59:14 UTC (rev 854)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java 2009-01-09 13:01:56 UTC (rev 855)
@@ -19,7 +19,7 @@
import org.jboss.webbeans.tck.impl.util.Reflections;
import org.testng.annotations.Test;
-@SpecVersion("2001206")
+@SpecVersion("20081206")
public class BindingTypeTest extends AbstractTest
{
16 years
[webbeans-commits] Webbeans SVN: r854 - tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 07:59:14 -0500 (Fri, 09 Jan 2009)
New Revision: 854
Modified:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java
Log:
Tweak API, javadoc
Modified: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-09 12:51:09 UTC (rev 853)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-09 12:59:14 UTC (rev 854)
@@ -3,15 +3,56 @@
import java.lang.reflect.Method;
import javax.webbeans.manager.Bean;
-import javax.webbeans.manager.Manager;
/**
* Provides Bean related operations.
*
* @author Shane Bryzak
+ * @author Pete Muir
*/
public interface Beans
{
- <T> Bean<T> createSimpleBean(Class<T> clazz, Manager manager);
- <T> Bean<T> getProducerMethodBean(Method method, Bean<T> clazz, Manager manager);
+
+ /**
+ * Create a new simple bean from the given class
+ *
+ * @param <T>
+ * The type of the bean
+ * @param clazz
+ * the class to create the bean
+ * @return the created bean
+ */
+ public <T> Bean<T> createSimpleBean(Class<T> clazz);
+
+ /**
+ * Create a new enterprise bean from the given class. The given class should
+ * represent an EJB declared using annotions of XML.
+ *
+ * @param <T>
+ * The type of the bean
+ * @param clazz
+ * the class to create the bean
+ * @return the created bean
+ */
+ public <T> Bean<T> createEnterpriseBean(Class<T> clazz);
+
+ /**
+ * Create a new producer method bean from the given method. The simple or
+ * enterprise bean on which the method is declared is provided.
+ *
+ * The declaringBean is a simple or enterprise bean that has been created by
+ * calling {@link #createSimpleBean(Class)} or
+ * {@link #createEnterpriseBean(Class)}.
+ *
+ * @param <T>
+ * the type of the bean
+ * @param method
+ * the producer method
+ * @param declaringBean
+ * the simple or enterprise bean which declares this producer
+ * method
+ * @return the producer bean
+ */
+ public <T> Bean<T> createProducerMethodBean(Method method, Bean<T> declaringBean);
+
}
16 years
[webbeans-commits] Webbeans SVN: r853 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 07:51:09 -0500 (Fri, 09 Jan 2009)
New Revision: 853
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
Log:
copy and paste error
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-01-09 12:44:45 UTC (rev 852)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-01-09 12:51:09 UTC (rev 853)
@@ -61,7 +61,7 @@
return new ProducerMethodBean<T>(method, declaringBean, manager);
}
- public static <T> ProducerMethodBean<T> of(Method method, SimpleBean<?> declaringBean, ManagerImpl manager)
+ public static <T> ProducerMethodBean<T> of(Method method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
{
return of(new AnnotatedMethodImpl<T>(method, declaringBean.getAnnotatedItem()), declaringBean, manager);
}
16 years
[webbeans-commits] Webbeans SVN: r852 - tck/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 07:44:45 -0500 (Fri, 09 Jan 2009)
New Revision: 852
Modified:
tck/trunk/pom.xml
Log:
enable snapshot repo
Modified: tck/trunk/pom.xml
===================================================================
--- tck/trunk/pom.xml 2009-01-09 12:37:54 UTC (rev 851)
+++ tck/trunk/pom.xml 2009-01-09 12:44:45 UTC (rev 852)
@@ -42,6 +42,11 @@
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2</url>
</repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Repository</name>
+ <url>http://snapshots.jboss.org/maven2</url>
+ </repository>
</repositories>
<pluginRepositories>
16 years