[webbeans-commits] Webbeans SVN: r871 - in tck/trunk/impl: src/main/resources and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 20:11:28 -0500 (Fri, 09 Jan 2009)
New Revision: 871
Modified:
tck/trunk/impl/
tck/trunk/impl/src/main/resources/tck-unit-tests.xml
Log:
minor
Property changes on: tck/trunk/impl
___________________________________________________________________
Name: svn:ignore
- target
.classpath
.project
.settings
+ target
.classpath
.project
.settings
test-output
temp-testng-customsuite.xml
Modified: tck/trunk/impl/src/main/resources/tck-unit-tests.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-unit-tests.xml 2009-01-10 00:52:06 UTC (rev 870)
+++ tck/trunk/impl/src/main/resources/tck-unit-tests.xml 2009-01-10 01:11:28 UTC (rev 871)
@@ -1,6 +1,6 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-<suite name="WebBeans TCK" verbose="2" >
+<suite name="Web Beans TCK" verbose="2" >
<test name="Web Beans TCK" >
<groups >
@@ -32,7 +32,7 @@
<exclude name="broken" />
</run>
</groups>
- <packages >
+ <packages>
<package name="org.jboss.webbeans.tck.tests" />
</packages>
</test>
16 years
[webbeans-commits] Webbeans SVN: r870 - in ri/trunk/webbeans-ri/src/test: resources and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 19:52:06 -0500 (Fri, 09 Jan 2009)
New Revision: 870
Added:
ri/trunk/webbeans-ri/src/test/resources/
ri/trunk/webbeans-ri/src/test/resources/META-INF/
ri/trunk/webbeans-ri/src/test/resources/META-INF/web-beans-tck.properties
Log:
Ooops
Added: ri/trunk/webbeans-ri/src/test/resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/webbeans-ri/src/test/resources/META-INF/web-beans-tck.properties (rev 0)
+++ ri/trunk/webbeans-ri/src/test/resources/META-INF/web-beans-tck.properties 2009-01-10 00:52:06 UTC (rev 870)
@@ -0,0 +1,3 @@
+org.jboss.webbeans.tck.api.Managers=org.jboss.webbeans.test.tck.ManagersImpl
+org.jboss.webbeans.tck.api.Beans=org.jboss.webbeans.test.tck.BeansImpl
+org.jboss.webbeans.tck.api.Contexts=org.jboss.webbeans.test.tck.ContextsImpl
\ No newline at end of file
Property changes on: ri/trunk/webbeans-ri/src/test/resources/META-INF/web-beans-tck.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years
[webbeans-commits] Webbeans SVN: r869 - in tck/trunk: api and 10 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 19:44:42 -0500 (Fri, 09 Jan 2009)
New Revision: 869
Added:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/SpecAssertion.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/SpecVersion.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/BindingTypeTest.java
tck/trunk/impl/src/main/resources/tck-unit-tests.xml
tck/trunk/impl/src/test/
tck/trunk/impl/src/test/java/
tck/trunk/impl/src/test/resources/
Removed:
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/BindingTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java
tck/trunk/impl/src/main/resources/unit-tests.xml
Modified:
tck/trunk/
tck/trunk/api/
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/api/src/main/java/org/jboss/webbeans/tck/api/TCKConfiguration.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TestSuite.java
tck/trunk/impl/pom.xml
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java
Log:
slight package changes, add reading configuration from properties
Property changes on: tck/trunk
___________________________________________________________________
Name: svn:ignore
- target
+ target
test-output
Property changes on: tck/trunk/api
___________________________________________________________________
Name: svn:ignore
- target
.classpath
.project
.settings
+ target
.classpath
.project
.settings
test-output
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-10 00:41:41 UTC (rev 868)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -13,6 +13,8 @@
public interface Beans
{
+ public static final String PROPERTY_NAME = Beans.class.getName();
+
/**
* Create a new simple bean from the given class
*
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-10 00:41:41 UTC (rev 868)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Contexts.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -11,6 +11,9 @@
*/
public interface Contexts<T extends Context>
{
+
+ public static final String PROPERTY_NAME = Contexts.class.getName();
+
/**
* Sets the specified context as active
*
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-10 00:41:41 UTC (rev 868)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Managers.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -15,6 +15,9 @@
*/
public interface Managers
{
+
+ public static final String PROPERTY_NAME = Managers.class.getName();
+
/**
*
* @param enabledDeploymentTypes
Modified: 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 2009-01-10 00:41:41 UTC (rev 868)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TCKConfiguration.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -3,6 +3,11 @@
public class TCKConfiguration
{
+ public static final TCKConfiguration newInstance(Beans beans, Contexts<?> contexts, Managers managers, TestSuite testSuite)
+ {
+ return new TCKConfiguration(beans, contexts, managers, testSuite);
+ }
+
private Beans beans;
private Contexts<?> contexts;
@@ -11,13 +16,20 @@
private TestSuite testSuite;
- public TCKConfiguration(Beans beans, Contexts<?> contexts, Managers managers, TestSuite testSuite)
+ protected TCKConfiguration(Beans beans, Contexts<?> contexts, Managers managers, TestSuite testSuite)
{
super();
this.beans = beans;
this.contexts = contexts;
this.managers = managers;
- this.testSuite = testSuite;
+ if (testSuite == null)
+ {
+ this.testSuite = testSuite;
+ }
+ else
+ {
+ this.testSuite = new TestSuite(null);
+ }
}
public Beans getBeans()
Modified: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TestSuite.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TestSuite.java 2009-01-10 00:41:41 UTC (rev 868)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TestSuite.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -3,6 +3,8 @@
public class TestSuite
{
+ public static final String PROPERTY_NAME = TestSuite.class.getName();
+
private String outputDirectory;
public TestSuite(String outputDirectory)
Modified: tck/trunk/impl/pom.xml
===================================================================
--- tck/trunk/impl/pom.xml 2009-01-10 00:41:41 UTC (rev 868)
+++ tck/trunk/impl/pom.xml 2009-01-10 00:44:42 UTC (rev 869)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>parent</artifactId>
<groupId>org.jboss.webbeans.tck</groupId>
@@ -17,7 +17,7 @@
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-api</artifactId>
</dependency>
-
+
<dependency>
<groupId>org.jboss.webbeans.tck</groupId>
<artifactId>webbeans-tck-api</artifactId>
@@ -28,7 +28,7 @@
<artifactId>testng</artifactId>
<classifier>jdk15</classifier>
</dependency>
-
+
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
@@ -58,26 +58,40 @@
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</dependency>
-
+
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
</dependency>
-
+
</dependencies>
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.2</version>
- <configuration>
- <suiteXmlFiles>
- <suiteXmlFile>testng.xml</suiteXmlFile>
- </suiteXmlFiles>
- </configuration>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-unit-tests.xml</file>
+ <type>xml</type>
+ <classifier>suite</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
+
</plugins>
</build>
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/SpecAssertion.java (from rev 858, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/SpecAssertion.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/SpecAssertion.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.impl;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+(a)Target(ElementType.METHOD)
+@Documented
+public @interface SpecAssertion
+{
+
+ public String[] section();
+
+ public String note() default "";
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/SpecVersion.java (from rev 858, tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/SpecVersion.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/SpecVersion.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.tck.impl;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+@Documented
+(a)Target(ElementType.TYPE)
+public @interface SpecVersion {
+
+ String value();
+
+}
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-10 00:41:41 UTC (rev 868)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -4,11 +4,17 @@
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
import javax.xml.parsers.ParserConfigurationException;
+import org.jboss.webbeans.tck.api.Beans;
+import org.jboss.webbeans.tck.api.Contexts;
+import org.jboss.webbeans.tck.api.Managers;
import org.jboss.webbeans.tck.api.TCKConfiguration;
+import org.jboss.webbeans.tck.api.TestSuite;
import org.jboss.webbeans.tck.api.WebBeansTCK;
+import org.jboss.webbeans.tck.impl.util.DeploymentProperties;
import org.testng.TestNG;
import org.testng.xml.Parser;
import org.testng.xml.XmlSuite;
@@ -17,8 +23,17 @@
public class WebBeansTCKImpl extends WebBeansTCK
{
- public static TCKConfiguration configuration;
+ private static TCKConfiguration configuration;
+ public static TCKConfiguration configuration()
+ {
+ if (configuration == null)
+ {
+ configuration = createTCKConfiguration();
+ }
+ return configuration;
+ }
+
public WebBeansTCKImpl()
{
super();
@@ -39,7 +54,7 @@
private static void setXmlSuitePath(TestNG testNG)
{
- InputStream is = WebBeansTCKImpl.class.getResourceAsStream("/unit-tests.xml");
+ InputStream is = WebBeansTCKImpl.class.getResourceAsStream("/tck-unit-tests.xml");
if (is == null)
{
throw new IllegalStateException("Unable to load testng.xml");
@@ -68,15 +83,55 @@
@Override
protected void configure(TCKConfiguration configuration)
{
- if (configuration == null)
+ if (configuration != null)
{
- // TODO load configuration from properties
+ WebBeansTCKImpl.configuration = configuration;
}
+ }
+
+
+ public static final TCKConfiguration createTCKConfiguration()
+ {
+ DeploymentProperties deploymentProperties = new DeploymentProperties();
+ Managers managers = create(deploymentProperties.getClasses(Managers.PROPERTY_NAME, Managers.class), Managers.class, true);
+ Beans beans = create(deploymentProperties.getClasses(Beans.PROPERTY_NAME, Beans.class), Beans.class, true);
+ Contexts<?> contexts = create(deploymentProperties.getClasses(Contexts.PROPERTY_NAME, Contexts.class), Contexts.class, true);
+ TestSuite testSuite = create(deploymentProperties.getClasses(TestSuite.PROPERTY_NAME, TestSuite.class), TestSuite.class, false);
+ return TCKConfiguration.newInstance(beans, contexts, managers, testSuite);
+ }
+
+ private static <T> T create(Set<Class<? extends T>> classes, Class<T> expectedType, boolean required)
+ {
+ if (classes.size() == 0)
+ {
+ if (required)
+ {
+ throw new IllegalArgumentException("Cannot find any implementations of " + expectedType.getSimpleName() + ", check that " + expectedType.getName() + " is specified");
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else if (classes.size() > 1)
+ {
+ throw new IllegalArgumentException("More than one implementation of " + expectedType.getSimpleName() + " specified, not sure which one to use!");
+ }
else
{
- WebBeansTCKImpl.configuration = configuration;
+ Class<? extends T> clazz = classes.iterator().next();
+ try
+ {
+ return clazz.newInstance();
+ }
+ catch (InstantiationException e)
+ {
+ throw new IllegalStateException("Unable to instantiate " + clazz, e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new IllegalStateException("Unable to instantiate " + clazz, e);
+ }
}
}
-
-
}
Deleted: 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-10 00:41:41 UTC (rev 868)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -1,109 +0,0 @@
-package org.jboss.webbeans.tck.impl.test;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-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;
-
-import org.jboss.webbeans.tck.impl.WebBeansTCKImpl;
-import org.jboss.webbeans.tck.impl.test.annotations.AnotherDeploymentType;
-import org.testng.annotations.BeforeMethod;
-
-public class AbstractTest
-{
- protected static final int BUILT_IN_BEANS = 3;
-
- protected Manager manager;
-
- public static boolean visited = false;
-
- @BeforeMethod
- public final void before()
- {
- manager = WebBeansTCKImpl.configuration.getManagers().createManager();
- WebBeansTCKImpl.configuration.getManagers().setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class, AnotherDeploymentType.class));
- }
-
- public <T> Bean<T> getSimpleBean(Class<T> beanClass)
- {
- return WebBeansTCKImpl.configuration.getBeans().createSimpleBean(beanClass);
- }
-
- public <T> Bean<?> getProducerMethodBean(Method method, Bean<?> producerBean)
- {
- return WebBeansTCKImpl.configuration.getBeans().createProducerMethodBean(method, producerBean);
- }
-
- /*
- protected <T> AbstractClassBean<T> registerBean(Class<T> clazz)
- {
- AbstractClassBean<T> bean = null;
- if (CurrentManager.rootManager().getEjbDescriptorCache().containsKey(clazz))
- {
- bean = EnterpriseBean.of(clazz, manager);
- }
- else
- {
- bean = SimpleBean.of(clazz, manager);
- }
- CurrentManager.rootManager().addBean(bean);
- return bean;
- }
- */
-
-/*
- protected void registerBeans(Class<?>[] classes)
- {
- for (Class<?> clazz : classes)
- {
- registerBean(clazz);
- }
- }
- */
-
- /*
- @SuppressWarnings("unchecked")
- protected void addStandardDeploymentTypesForTests()
- {
- manager.setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class, AnotherDeploymentType.class, HornedAnimalDeploymentType.class));
- }
-
- protected <T> void addToEjbCache(Class<T> clazz)
- {
- manager.getEjbDescriptorCache().add(new MockEjbDescriptor<T>(clazz));
- }
- */
-
- protected byte[] serialize(Object instance) throws IOException
- {
- ByteArrayOutputStream bytes = new ByteArrayOutputStream();
- ObjectOutputStream out = new ObjectOutputStream(bytes);
- out.writeObject(instance);
- return bytes.toByteArray();
- }
-
- protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
- {
- ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
- return in.readObject();
- }
-
-/* protected void activateDependentContext()
- {
- DependentContext.INSTANCE.setActive(true);
- }
-
- protected void deactivateDependentContext()
- {
- DependentContext.INSTANCE.setActive(false);
- }
- */
-}
\ No newline at end of file
Deleted: 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-10 00:41:41 UTC (rev 868)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -1,167 +0,0 @@
-package org.jboss.webbeans.tck.impl.test;
-
-import java.lang.reflect.Method;
-
-import javax.webbeans.Current;
-import javax.webbeans.manager.Bean;
-
-import org.jboss.webbeans.tck.impl.test.annotations.Synchronous;
-import org.jboss.webbeans.tck.impl.test.beans.Barn;
-import org.jboss.webbeans.tck.impl.test.beans.Cat;
-import org.jboss.webbeans.tck.impl.test.beans.Cod;
-import org.jboss.webbeans.tck.impl.test.beans.DefangedTarantula;
-import org.jboss.webbeans.tck.impl.test.beans.Order;
-import org.jboss.webbeans.tck.impl.test.beans.Spider;
-import org.jboss.webbeans.tck.impl.test.beans.SpiderProducer;
-import org.jboss.webbeans.tck.impl.test.beans.Tarantula;
-import org.jboss.webbeans.tck.impl.test.beans.Tuna;
-import org.jboss.webbeans.tck.impl.test.binding.CurrentBinding;
-import org.jboss.webbeans.tck.impl.util.Reflections;
-import org.testng.annotations.Test;
-
-@SpecVersion("20081206")
-public class BindingTypeTest extends AbstractTest
-{
-
- @SuppressWarnings("unchecked")
- @Test @SpecAssertion(section={"2.3.3", "2.3.1"})
- public void testDefaultBindingTypeDeclaredInJava()
- {
- Bean<Order> order = getSimpleBean(Order.class);
- assert order.getBindingTypes().size() == 1;
- order.getBindingTypes().iterator().next().annotationType().equals(Current.class);
- }
-
- @Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.3.2")
- public void testBindingTypeHasCorrectTarget()
- {
- assert false;
- }
-
- @Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.3.2")
- public void testBindingTypeHasCorrectRetention()
- {
- assert false;
- }
-
- @Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.3.2")
- public void testBindingTypeDeclaresBindingTypeAnnotation()
- {
- assert false;
- }
-
- @SuppressWarnings("unchecked")
- @Test @SpecAssertion(section="2.3.3")
- public void testBindingTypesDeclaredInJava()
- {
- Bean<Cat> cat = getSimpleBean(Cat.class);
- assert cat.getBindingTypes().size() == 1;
- assert Reflections.annotationSetMatches(cat.getBindingTypes(), Synchronous.class);
- }
-
- @Test @SpecAssertion(section="2.3.3")
- public void testMultipleBindingTypes()
- {
- Bean<?> model = getSimpleBean(Cod.class);
- assert model.getBindingTypes().size() == 2;
- }
-
- @SuppressWarnings("unchecked")
- @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.3.4")
- public void testBindingTypesDeclaredInXml()
- {
- //Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- //annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
- //AnnotatedClass annotatedItem = new SimpleAnnotatedClass(Antelope.class, annotations);
-
- //SimpleBean<Antelope> antelope = createSimpleBean(Antelope.class, annotatedItem, manager);
- // assert Reflections.annotationSetMatches(antelope.getBindingTypes(), Asynchronous.class);
- assert false;
- }
-
- @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.3.4")
- public void testXmlBindingTypeOverridesAndIgnoresJava()
- {
- //Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- //annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
- //AnnotatedClass<Cat> annotatedItem = new SimpleAnnotatedClass<Cat>(Cat.class, annotations);
-
- //SimpleBean<Cat> cat = createSimpleBean(Cat.class, annotatedItem, manager);
- //assert cat.getBindingTypes().size() == 1;
- //assert cat.getBindingTypes().contains(new AnnotationLiteral<Asynchronous>() {});
- assert false;
- }
-
- @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.3.4")
- public void testNoBindingTypesDeclaredInXml()
- {
- //Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- //AnnotatedClass<Cat> annotatedItem = new SimpleAnnotatedClass<Cat>(Cat.class, annotations);
-
- //SimpleBean<Cat> cat = createSimpleBean(Cat.class, annotatedItem, manager);
- //assert cat.getBindingTypes().size() == 1;
- //assert cat.getBindingTypes().contains(new AnnotationLiteral<Synchronous>() {});
- assert false;
- }
-
- @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section={"2.3.4", "2.3.1"})
- public void testDefaultBindingTypeDeclaredInXml()
- {
- Bean<?> model = getSimpleBean(Tuna.class);
- assert model.getBindingTypes().size() == 1;
- assert model.getBindingTypes().contains(new CurrentBinding());
- assert false;
- }
-
- @Test(groups={"injection", "producerMethod"}) @SpecAssertion(section="2.3.5")
- public void testFieldInjectedFromProducerMethod() throws Exception
- {
- Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
- manager.addBean(spiderProducer);
- Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(getProducerMethodBean(method, spiderProducer));
- Barn barn = getSimpleBean(Barn.class).create();
- assert barn.petSpider != null;
- assert barn.petSpider instanceof DefangedTarantula;
- }
-
- @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.5")
- public void testFieldWithBindingTypeInXml()
- {
- assert false;
- }
-
- @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.5")
- public void testFieldWithBindingTypeInXmlIgnoresAnnotations()
- {
- assert false;
- }
-
- @SuppressWarnings("unchecked")
- @Test(groups={"injection", "producerMethod"})
- public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws Exception
- {
- Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
- manager.addBean(spiderProducer);
- Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(getProducerMethodBean(method, spiderProducer));
- method = SpiderProducer.class.getMethod("produceSpiderFromInjection", Tarantula.class);
- Bean<Spider> spiderBean = (Bean<Spider>) getProducerMethodBean(method, spiderProducer);
- Spider spider = spiderBean.create();
- assert spider != null;
- assert spider instanceof DefangedTarantula;
- }
-
- @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.6")
- public void testMethodWithBindingAnnotationsOnParametersDeclaredInXml()
- {
- assert false;
- }
-
- @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.6")
- public void testMethodWithBindingAnnotationsOnParametersDeclaredInXmlIgnoresAnnotations()
- {
- assert false;
- }
-
-}
\ No newline at end of file
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java 2009-01-10 00:41:41 UTC (rev 868)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.tck.impl.test;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
-(a)Target(ElementType.METHOD)
-@Documented
-public @interface SpecAssertion
-{
-
- public String[] section();
-
- public String note() default "";
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java 2009-01-10 00:41:41 UTC (rev 868)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -1,13 +0,0 @@
-package org.jboss.webbeans.tck.impl.test;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
-@Documented
-(a)Target(ElementType.TYPE)
-public @interface SpecVersion {
-
- String value();
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java 2009-01-10 00:41:41 UTC (rev 868)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -17,7 +17,7 @@
public class DeploymentProperties
{
// The resource bundle used to control Web Beans RI deployment
- public static final String RESOURCE_BUNDLE = "META-INF/web-beans-ri.properties";
+ public static final String RESOURCE_BUNDLE = "META-INF/web-beans-tck.properties";
// The class to work from
private SimpleResourceLoader resourceLoader;
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/AbstractTest.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -0,0 +1,110 @@
+package org.jboss.webbeans.tck.tests;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+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;
+
+import org.jboss.webbeans.tck.impl.WebBeansTCKImpl;
+import org.jboss.webbeans.tck.impl.test.annotations.AnotherDeploymentType;
+import org.testng.annotations.BeforeMethod;
+
+public class AbstractTest
+{
+ protected static final int BUILT_IN_BEANS = 3;
+
+ protected Manager manager;
+
+ public static boolean visited = false;
+
+ @BeforeMethod
+ public final void before()
+ {
+ manager = WebBeansTCKImpl.configuration().getManagers().createManager();
+ WebBeansTCKImpl.configuration().getManagers().setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class, AnotherDeploymentType.class));
+ }
+
+ public <T> Bean<T> getSimpleBean(Class<T> beanClass)
+ {
+ return WebBeansTCKImpl.configuration().getBeans().createSimpleBean(beanClass);
+ }
+
+ public <T> Bean<?> getProducerMethodBean(Method method, Bean<?> producerBean)
+ {
+ return WebBeansTCKImpl.configuration().getBeans().createProducerMethodBean(method, producerBean);
+ }
+
+ /*
+ protected <T> AbstractClassBean<T> registerBean(Class<T> clazz)
+ {
+ AbstractClassBean<T> bean = null;
+ if (CurrentManager.rootManager().getEjbDescriptorCache().containsKey(clazz))
+ {
+ bean = EnterpriseBean.of(clazz, manager);
+ }
+ else
+ {
+ bean = SimpleBean.of(clazz, manager);
+ }
+ CurrentManager.rootManager().addBean(bean);
+ return bean;
+ }
+ */
+
+/*
+ protected void registerBeans(Class<?>[] classes)
+ {
+ for (Class<?> clazz : classes)
+ {
+ registerBean(clazz);
+ }
+ }
+ */
+
+ /*
+ @SuppressWarnings("unchecked")
+ protected void addStandardDeploymentTypesForTests()
+ {
+ manager.setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class, AnotherDeploymentType.class, HornedAnimalDeploymentType.class));
+ }
+
+ protected <T> void addToEjbCache(Class<T> clazz)
+ {
+ manager.getEjbDescriptorCache().add(new MockEjbDescriptor<T>(clazz));
+ }
+ */
+
+ protected byte[] serialize(Object instance) throws IOException
+ {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bytes);
+ out.writeObject(instance);
+ return bytes.toByteArray();
+ }
+
+ protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
+ {
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
+ return in.readObject();
+ }
+
+/* protected void activateDependentContext()
+ {
+ DependentContext.INSTANCE.setActive(true);
+ }
+
+ protected void deactivateDependentContext()
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
+ */
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/BindingTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/BindingTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/BindingTypeTest.java 2009-01-10 00:44:42 UTC (rev 869)
@@ -0,0 +1,170 @@
+package org.jboss.webbeans.tck.tests;
+
+
+import java.lang.reflect.Method;
+
+import javax.webbeans.Current;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+import org.jboss.webbeans.tck.impl.test.annotations.Synchronous;
+import org.jboss.webbeans.tck.impl.test.beans.Barn;
+import org.jboss.webbeans.tck.impl.test.beans.Cat;
+import org.jboss.webbeans.tck.impl.test.beans.Cod;
+import org.jboss.webbeans.tck.impl.test.beans.DefangedTarantula;
+import org.jboss.webbeans.tck.impl.test.beans.Order;
+import org.jboss.webbeans.tck.impl.test.beans.Spider;
+import org.jboss.webbeans.tck.impl.test.beans.SpiderProducer;
+import org.jboss.webbeans.tck.impl.test.beans.Tarantula;
+import org.jboss.webbeans.tck.impl.test.beans.Tuna;
+import org.jboss.webbeans.tck.impl.test.binding.CurrentBinding;
+import org.jboss.webbeans.tck.impl.util.Reflections;
+import org.testng.annotations.Test;
+
+@SpecVersion("20081206")
+public class BindingTypeTest extends AbstractTest
+{
+
+ @SuppressWarnings("unchecked")
+ @Test @SpecAssertion(section={"2.3.3", "2.3.1"})
+ public void testDefaultBindingTypeDeclaredInJava()
+ {
+ Bean<Order> order = getSimpleBean(Order.class);
+ assert order.getBindingTypes().size() == 1;
+ order.getBindingTypes().iterator().next().annotationType().equals(Current.class);
+ }
+
+ @Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.3.2")
+ public void testBindingTypeHasCorrectTarget()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.3.2")
+ public void testBindingTypeHasCorrectRetention()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.3.2")
+ public void testBindingTypeDeclaresBindingTypeAnnotation()
+ {
+ assert false;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test @SpecAssertion(section="2.3.3")
+ public void testBindingTypesDeclaredInJava()
+ {
+ Bean<Cat> cat = getSimpleBean(Cat.class);
+ assert cat.getBindingTypes().size() == 1;
+ assert Reflections.annotationSetMatches(cat.getBindingTypes(), Synchronous.class);
+ }
+
+ @Test @SpecAssertion(section="2.3.3")
+ public void testMultipleBindingTypes()
+ {
+ Bean<?> model = getSimpleBean(Cod.class);
+ assert model.getBindingTypes().size() == 2;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.3.4")
+ public void testBindingTypesDeclaredInXml()
+ {
+ //Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ //annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
+ //AnnotatedClass annotatedItem = new SimpleAnnotatedClass(Antelope.class, annotations);
+
+ //SimpleBean<Antelope> antelope = createSimpleBean(Antelope.class, annotatedItem, manager);
+ // assert Reflections.annotationSetMatches(antelope.getBindingTypes(), Asynchronous.class);
+ assert false;
+ }
+
+ @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.3.4")
+ public void testXmlBindingTypeOverridesAndIgnoresJava()
+ {
+ //Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ //annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
+ //AnnotatedClass<Cat> annotatedItem = new SimpleAnnotatedClass<Cat>(Cat.class, annotations);
+
+ //SimpleBean<Cat> cat = createSimpleBean(Cat.class, annotatedItem, manager);
+ //assert cat.getBindingTypes().size() == 1;
+ //assert cat.getBindingTypes().contains(new AnnotationLiteral<Asynchronous>() {});
+ assert false;
+ }
+
+ @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.3.4")
+ public void testNoBindingTypesDeclaredInXml()
+ {
+ //Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ //AnnotatedClass<Cat> annotatedItem = new SimpleAnnotatedClass<Cat>(Cat.class, annotations);
+
+ //SimpleBean<Cat> cat = createSimpleBean(Cat.class, annotatedItem, manager);
+ //assert cat.getBindingTypes().size() == 1;
+ //assert cat.getBindingTypes().contains(new AnnotationLiteral<Synchronous>() {});
+ assert false;
+ }
+
+ @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section={"2.3.4", "2.3.1"})
+ public void testDefaultBindingTypeDeclaredInXml()
+ {
+ Bean<?> model = getSimpleBean(Tuna.class);
+ assert model.getBindingTypes().size() == 1;
+ assert model.getBindingTypes().contains(new CurrentBinding());
+ assert false;
+ }
+
+ @Test(groups={"injection", "producerMethod"}) @SpecAssertion(section="2.3.5")
+ public void testFieldInjectedFromProducerMethod() throws Exception
+ {
+ Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
+ manager.addBean(spiderProducer);
+ Method method = SpiderProducer.class.getMethod("produceTameTarantula");
+ manager.addBean(getProducerMethodBean(method, spiderProducer));
+ Barn barn = getSimpleBean(Barn.class).create();
+ assert barn.petSpider != null;
+ assert barn.petSpider instanceof DefangedTarantula;
+ }
+
+ @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.5")
+ public void testFieldWithBindingTypeInXml()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.5")
+ public void testFieldWithBindingTypeInXmlIgnoresAnnotations()
+ {
+ assert false;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test(groups={"injection", "producerMethod"})
+ public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws Exception
+ {
+ Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
+ manager.addBean(spiderProducer);
+ Method method = SpiderProducer.class.getMethod("produceTameTarantula");
+ manager.addBean(getProducerMethodBean(method, spiderProducer));
+ method = SpiderProducer.class.getMethod("produceSpiderFromInjection", Tarantula.class);
+ Bean<Spider> spiderBean = (Bean<Spider>) getProducerMethodBean(method, spiderProducer);
+ Spider spider = spiderBean.create();
+ assert spider != null;
+ assert spider instanceof DefangedTarantula;
+ }
+
+ @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.6")
+ public void testMethodWithBindingAnnotationsOnParametersDeclaredInXml()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.6")
+ public void testMethodWithBindingAnnotationsOnParametersDeclaredInXmlIgnoresAnnotations()
+ {
+ assert false;
+ }
+
+}
\ No newline at end of file
Copied: tck/trunk/impl/src/main/resources/tck-unit-tests.xml (from rev 862, tck/trunk/impl/src/main/resources/unit-tests.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/tck-unit-tests.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/tck-unit-tests.xml 2009-01-10 00:44:42 UTC (rev 869)
@@ -0,0 +1,40 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="WebBeans TCK" verbose="2" >
+
+ <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.tests" />
+ </packages>
+ </test>
+
+</suite>
\ No newline at end of file
Deleted: tck/trunk/impl/src/main/resources/unit-tests.xml
===================================================================
--- tck/trunk/impl/src/main/resources/unit-tests.xml 2009-01-10 00:41:41 UTC (rev 868)
+++ tck/trunk/impl/src/main/resources/unit-tests.xml 2009-01-10 00:44:42 UTC (rev 869)
@@ -1,40 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-
-<suite name="WebBeans TCK" verbose="2" >
-
- <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: r868 - in ri/trunk: webbeans-ri and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 19:41:41 -0500 (Fri, 09 Jan 2009)
New Revision: 868
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/TCKRunner.java
Modified:
ri/trunk/pom.xml
ri/trunk/webbeans-ri/pom.xml
Log:
updates for running TCK
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2009-01-09 21:58:03 UTC (rev 867)
+++ ri/trunk/pom.xml 2009-01-10 00:41:41 UTC (rev 868)
@@ -64,7 +64,11 @@
<module>webbeans-ri</module>
<module>webbeans-ri-spi</module>
</modules>
-
+
+ <properties>
+ <webbeans.tck.version>1.0.0-SNAPSHOT</webbeans.tck.version>
+ </properties>
+
<dependencyManagement>
<dependencies>
@@ -187,13 +191,13 @@
<dependency>
<groupId>org.jboss.webbeans.tck</groupId>
<artifactId>webbeans-tck-api</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>${webbeans.tck.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.webbeans.tck</groupId>
<artifactId>webbeans-tck-impl</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>${webbeans.tck.version}</version>
</dependency>
</dependencies>
Modified: ri/trunk/webbeans-ri/pom.xml
===================================================================
--- ri/trunk/webbeans-ri/pom.xml 2009-01-09 21:58:03 UTC (rev 867)
+++ ri/trunk/webbeans-ri/pom.xml 2009-01-10 00:41:41 UTC (rev 868)
@@ -103,17 +103,43 @@
<build>
<defaultGoal>install</defaultGoal>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.2</version>
- <configuration>
- <suiteXmlFiles>
- <suiteXmlFile>testng.xml</suiteXmlFile>
- </suiteXmlFiles>
- </configuration>
- </plugin>
- </plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.webbeans.tck</groupId>
+ <artifactId>webbeans-tck-impl</artifactId>
+ <version>${webbeans.tck.version}</version>
+ <type>xml</type>
+ <classifier>suite</classifier>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>testng.xml,</suiteXmlFile>
+ <suiteXmlFile>${project.build.directory}/dependency/webbeans-tck-impl-${webbeans.tck.version}-suite.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
</project>
\ No newline at end of file
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/TCKRunner.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/TCKRunner.java 2009-01-09 21:58:03 UTC (rev 867)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/TCKRunner.java 2009-01-10 00:41:41 UTC (rev 868)
@@ -1,30 +0,0 @@
-package org.jboss.webbeans.test.tck;
-
-import org.jboss.webbeans.tck.api.TCKConfiguration;
-import org.jboss.webbeans.tck.api.TestSuite;
-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(), new TestSuite("target/surefire-reports"));
- tck = WebBeansTCK.newInstance(configuration);
- }
-
- @Test
- public void runTCK()
- {
- if (!tck.run())
- {
- throw new AssertionError("TCK run failed, see log");
- }
- }
-
-}
16 years
[webbeans-commits] Webbeans SVN: r867 - ri/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 16:58:03 -0500 (Fri, 09 Jan 2009)
New Revision: 867
Modified:
ri/trunk/pom.xml
Log:
add snapshots repo
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2009-01-09 21:56:21 UTC (rev 866)
+++ ri/trunk/pom.xml 2009-01-09 21:58:03 UTC (rev 867)
@@ -43,6 +43,12 @@
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2</url>
</repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <url>http://snapshots.jboss.org/maven2</url>
+ <snapshots />
+ </repository>
</repositories>
<pluginRepositories>
16 years
[webbeans-commits] Webbeans SVN: r866 - ri/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 16:56:21 -0500 (Fri, 09 Jan 2009)
New Revision: 866
Modified:
ri/trunk/pom.xml
Log:
ws
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2009-01-09 21:18:53 UTC (rev 865)
+++ ri/trunk/pom.xml 2009-01-09 21:56:21 UTC (rev 866)
@@ -14,7 +14,6 @@
<developers>
<developer>
-
<name>Pete Muir</name>
<roles>
<role>Project Lead</role>
@@ -22,7 +21,6 @@
<email>pete.muir(a)jboss.org</email>
<organization>JBoss, a division of Red Hat</organization>
<url>http://in.relation.to/Bloggers/Pete</url>
-
</developer>
<developer>
@@ -32,7 +30,6 @@
<developer>
<name>David Allen</name>
-
</developer>
<developer>
@@ -43,7 +40,6 @@
<repositories>
<repository>
<id>repository.jboss.org</id>
-
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2</url>
</repository>
@@ -52,7 +48,6 @@
<pluginRepositories>
<pluginRepository>
<id>repository.jboss.org</id>
-
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2</url>
</pluginRepository>
@@ -120,7 +115,6 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
-
</dependency>
<dependency>
@@ -130,7 +124,6 @@
</dependency>
<dependency>
-
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2_10</version>
@@ -146,7 +139,6 @@
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-embedded</artifactId>
<version>1.0.0-Alpha1</version>
-
</dependency>
<dependency>
@@ -156,7 +148,6 @@
</dependency>
<dependency>
-
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>1.1.15.B1</version>
@@ -257,7 +248,6 @@
</manifest>
</archive>
</configuration>
-
</plugin>
</plugins>
</pluginManagement>
@@ -364,7 +354,6 @@
</configuration>
</plugin>
</plugins>
-
</reporting>
</project>
16 years
[webbeans-commits] Webbeans SVN: r865 - ri/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 16:18:53 -0500 (Fri, 09 Jan 2009)
New Revision: 865
Modified:
ri/trunk/pom.xml
Log:
add tck impl
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2009-01-09 21:18:35 UTC (rev 864)
+++ ri/trunk/pom.xml 2009-01-09 21:18:53 UTC (rev 865)
@@ -192,6 +192,12 @@
<artifactId>webbeans-tck-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans.tck</groupId>
+ <artifactId>webbeans-tck-impl</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</dependencyManagement>
16 years
[webbeans-commits] Webbeans SVN: r864 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 16:18:35 -0500 (Fri, 09 Jan 2009)
New Revision: 864
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TestSuite.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/BeansImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/ContextsImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/ManagersImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/TCKRunner.java
ri/trunk/webbeans-ri/testng.xml
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TCKConfiguration.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/test/AbstractTest.java
Log:
repackage tck tests, add ability to set output dir
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck (from rev 863, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri)
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/BeansImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/BeansImpl.java 2009-01-09 17:27:59 UTC (rev 863)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/BeansImpl.java 2009-01-09 21:18:35 UTC (rev 864)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.ri;
+package org.jboss.webbeans.test.tck;
import java.lang.reflect.Method;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/ContextsImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ContextsImpl.java 2009-01-09 17:27:59 UTC (rev 863)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/ContextsImpl.java 2009-01-09 21:18:35 UTC (rev 864)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.ri;
+package org.jboss.webbeans.test.tck;
import org.jboss.webbeans.context.AbstractContext;
import org.jboss.webbeans.context.RequestContext;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/ManagersImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/ManagersImpl.java 2009-01-09 17:27:59 UTC (rev 863)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/ManagersImpl.java 2009-01-09 21:18:35 UTC (rev 864)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.ri;
+package org.jboss.webbeans.test.tck;
import java.lang.annotation.Annotation;
import java.util.List;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/TCKRunner.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck/ri/TCKRunner.java 2009-01-09 17:27:59 UTC (rev 863)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/tck/TCKRunner.java 2009-01-09 21:18:35 UTC (rev 864)
@@ -1,6 +1,7 @@
-package org.jboss.webbeans.tck.ri;
+package org.jboss.webbeans.test.tck;
import org.jboss.webbeans.tck.api.TCKConfiguration;
+import org.jboss.webbeans.tck.api.TestSuite;
import org.jboss.webbeans.tck.api.WebBeansTCK;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -13,7 +14,7 @@
@BeforeClass
public void beforeClass()
{
- TCKConfiguration configuration = new TCKConfiguration(new BeansImpl(), new ContextsImpl(), new ManagersImpl());
+ TCKConfiguration configuration = new TCKConfiguration(new BeansImpl(), new ContextsImpl(), new ManagersImpl(), new TestSuite("target/surefire-reports"));
tck = WebBeansTCK.newInstance(configuration);
}
Modified: ri/trunk/webbeans-ri/testng.xml
===================================================================
--- ri/trunk/webbeans-ri/testng.xml 2009-01-09 17:27:59 UTC (rev 863)
+++ ri/trunk/webbeans-ri/testng.xml 2009-01-09 21:18:35 UTC (rev 864)
@@ -33,6 +33,7 @@
</run>
</groups>
<packages>
+ <package name="org.jboss.webbeans.test.tck"></package>
<package name="org.jboss.webbeans.test"></package>
<package name="org.jboss.webbeans.test.contexts"></package>
<package name="org.jboss.webbeans.examples"></package>
Modified: 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 2009-01-09 17:27:59 UTC (rev 863)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TCKConfiguration.java 2009-01-09 21:18:35 UTC (rev 864)
@@ -8,13 +8,16 @@
private Contexts<?> contexts;
private Managers managers;
+
+ private TestSuite testSuite;
- public TCKConfiguration(Beans beans, Contexts<?> contexts, Managers managers)
+ public TCKConfiguration(Beans beans, Contexts<?> contexts, Managers managers, TestSuite testSuite)
{
super();
this.beans = beans;
this.contexts = contexts;
this.managers = managers;
+ this.testSuite = testSuite;
}
public Beans getBeans()
@@ -32,4 +35,9 @@
return managers;
}
+ public TestSuite getTestSuite()
+ {
+ return testSuite;
+ }
+
}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TestSuite.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TestSuite.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TestSuite.java 2009-01-09 21:18:35 UTC (rev 864)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.tck.api;
+
+public class TestSuite
+{
+
+ private String outputDirectory;
+
+ public TestSuite(String outputDirectory)
+ {
+ super();
+ this.outputDirectory = outputDirectory;
+ }
+
+ public String getOutputDirectory()
+ {
+ return outputDirectory;
+ }
+
+}
Property changes on: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TestSuite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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 17:27:59 UTC (rev 863)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java 2009-01-09 21:18:35 UTC (rev 864)
@@ -29,6 +29,10 @@
{
TestNG testNG = new TestNG();
setXmlSuitePath(testNG);
+ if (configuration.getTestSuite().getOutputDirectory() != null)
+ {
+ testNG.setOutputDirectory(configuration.getTestSuite().getOutputDirectory());
+ }
testNG.run();
return !(testNG.hasFailure() || testNG.hasSkip());
}
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 17:27:59 UTC (rev 863)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java 2009-01-09 21:18:35 UTC (rev 864)
@@ -28,7 +28,7 @@
@BeforeMethod
public final void before()
{
- manager = WebBeansTCKImpl.configuration.getManagers().getManager();
+ manager = WebBeansTCKImpl.configuration.getManagers().createManager();
WebBeansTCKImpl.configuration.getManagers().setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class, AnotherDeploymentType.class));
}
16 years
[webbeans-commits] Webbeans SVN: r863 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/tck and 2 other directories.
by webbeans-commits@lists.jboss.org
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();
}
16 years
[webbeans-commits] Webbeans SVN: r862 - in tck/trunk: impl/src/main/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 12:21:05 -0500 (Fri, 09 Jan 2009)
New Revision: 862
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/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/test/AbstractTest.java
tck/trunk/impl/src/main/resources/unit-tests.xml
Log:
Fix tests
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 16:13:20 UTC (rev 861)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Managers.java 2009-01-09 17:21:05 UTC (rev 862)
@@ -22,7 +22,7 @@
void setEnabledDeploymentTypes(List<Class<? extends Annotation>> enabledDeploymentTypes);
/**
- * Get the Manager instance
+ * Get a new Manager instance
*
* @return the Manager
*/
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 16:13:20 UTC (rev 861)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/WebBeansTCK.java 2009-01-09 17:21:05 UTC (rev 862)
@@ -45,10 +45,10 @@
/**
* Run the whole TCK
*/
- public final void run()
+ public final boolean run()
{
// Load Configuration and run
- runUnitTests();
+ return runUnitTests();
}
public static void main(String[] args)
@@ -60,7 +60,7 @@
{
}
- protected abstract void runUnitTests();
+ protected abstract boolean runUnitTests();
/**
* Configure the TCK
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 16:13:20 UTC (rev 861)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/WebBeansTCKImpl.java 2009-01-09 17:21:05 UTC (rev 862)
@@ -17,7 +17,7 @@
public class WebBeansTCKImpl extends WebBeansTCK
{
- private TCKConfiguration configuration;
+ public static TCKConfiguration configuration;
public WebBeansTCKImpl()
{
@@ -25,11 +25,12 @@
}
@Override
- public void runUnitTests()
+ public boolean runUnitTests()
{
TestNG testNG = new TestNG();
setXmlSuitePath(testNG);
testNG.run();
+ return !(testNG.hasFailure() || testNG.hasSkip());
}
private static void setXmlSuitePath(TestNG testNG)
@@ -69,7 +70,7 @@
}
else
{
- this.configuration = configuration;
+ WebBeansTCKImpl.configuration = configuration;
}
}
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 16:13:20 UTC (rev 861)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java 2009-01-09 17:21:05 UTC (rev 862)
@@ -6,11 +6,15 @@
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;
-import org.jboss.webbeans.tck.impl.TckUtils;
+import org.jboss.webbeans.tck.impl.WebBeansTCKImpl;
+import org.jboss.webbeans.tck.impl.test.annotations.AnotherDeploymentType;
import org.testng.annotations.BeforeMethod;
public class AbstractTest
@@ -24,18 +28,18 @@
@BeforeMethod
public final void before()
{
- manager = TckUtils.getManagers().getManager();
- //addStandardDeploymentTypesForTests();
+ manager = WebBeansTCKImpl.configuration.getManagers().getManager();
+ WebBeansTCKImpl.configuration.getManagers().setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class, AnotherDeploymentType.class));
}
public <T> Bean<T> getSimpleBean(Class<T> beanClass)
{
- return TckUtils.getBeans().createSimpleBean(beanClass);
+ return WebBeansTCKImpl.configuration.getBeans().createSimpleBean(beanClass);
}
public <T> Bean<?> getProducerMethodBean(Method method, Bean<?> producerBean)
{
- return TckUtils.getBeans().createProducerMethodBean(method, producerBean);
+ return WebBeansTCKImpl.configuration.getBeans().createProducerMethodBean(method, producerBean);
}
/*
Modified: tck/trunk/impl/src/main/resources/unit-tests.xml
===================================================================
--- tck/trunk/impl/src/main/resources/unit-tests.xml 2009-01-09 16:13:20 UTC (rev 861)
+++ tck/trunk/impl/src/main/resources/unit-tests.xml 2009-01-09 17:21:05 UTC (rev 862)
@@ -1,6 +1,6 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-<suite name="WebBeans TCK" verbose="3" >
+<suite name="WebBeans TCK" verbose="2" >
<test name="Web Beans TCK" >
<groups >
16 years