[webbeans-commits] Webbeans SVN: r2327 - ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/impl and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: vitold
Date: 2009-04-07 05:39:36 -0400 (Tue, 07 Apr 2009)
New Revision: 2327
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/Order.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/namespace
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/impl/BeanChildrenCheckerImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
Log:
add tests for 9.2.1
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java 2009-04-07 00:03:19 UTC (rev 2326)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java 2009-04-07 09:39:36 UTC (rev 2327)
@@ -57,4 +57,6 @@
public static final String PRODUCES = "Produces";
public static final String VALUE = "value";
+
+ public static final String ARRAY = "Array";
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java 2009-04-07 00:03:19 UTC (rev 2326)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java 2009-04-07 09:39:36 UTC (rev 2327)
@@ -61,6 +61,7 @@
Document document = createDocument(url);
if (document != null)
{
+ parseForArrays(document);
parseForAnnotationTypes(document);
parseForBeans(document);
parseForDeploy(document);
@@ -68,6 +69,32 @@
}
}
+ private void parseForArrays(Document document)
+ {
+ Element root = document.getRootElement();
+ checkChildrenForArray(root);
+ }
+
+ private void checkChildrenForArray(Element element)
+ {
+ Iterator<?> childIterator = element.elementIterator();
+ while(childIterator.hasNext())
+ {
+ Element child = (Element)childIterator.next();
+
+ if(child.getName().equalsIgnoreCase(XmlConstants.ARRAY))
+ {
+ if(child.elements().size() != 1)
+ throw new DefinitionException("<Array> element must have only one child");
+
+ Element arrayChild = (Element)child.elements().get(0);
+ ParseXmlHelper.loadElementClass(arrayChild, Object.class, environment, packagesMap);
+ }
+ else
+ checkChildrenForArray(child);
+ }
+ }
+
private void parseForAnnotationTypes(Document document)
{
Element root = document.getRootElement();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/impl/BeanChildrenCheckerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/impl/BeanChildrenCheckerImpl.java 2009-04-07 00:03:19 UTC (rev 2326)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/impl/BeanChildrenCheckerImpl.java 2009-04-07 09:39:36 UTC (rev 2327)
@@ -96,6 +96,8 @@
{
try
{
+ if(beanChildElement.getName().equalsIgnoreCase(XmlConstants.ARRAY))
+ return;
AnnotatedClass<?> beanChildClass = ParseXmlHelper.loadElementClass(beanChildElement, Object.class, environment, packagesMap);
Class<?> beanChildType = beanChildClass.getRawType();
boolean isJavaClass = !beanChildType.isEnum() && !beanChildType.isPrimitive() && !beanChildType.isInterface();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java 2009-04-07 00:03:19 UTC (rev 2326)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java 2009-04-07 09:39:36 UTC (rev 2327)
@@ -17,7 +17,7 @@
@Artifact
@Resources({
@Resource(source="namespace", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/metadata/namespace"),
- @Resource(source="schema.xsd", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/metadata/namespace")
+ @Resource(source="schema.xsd", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/metadata/schema.xsd")
})
@Classes({Order.class})
@BeansXml("beans.xml")
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java 2009-04-07 09:39:36 UTC (rev 2327)
@@ -0,0 +1,35 @@
+package org.jboss.jsr299.tck.tests.xml.namespace.javaee;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.metadata.foo.Order;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+@Resources({
+ @Resource(source="namespace", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/metadata/namespace")
+})
+(a)Classes({Order.class})
+@BeansXml("beans.xml")
+//(a)ExpectedDeploymentException(DefinitionException.class)
+public class JavaEeNamespaceTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.2.1", id="a"),
+ @SpecAssertion(section="9.2.1", id="b"),
+ @SpecAssertion(section="9.2.1", id="c"),
+ @SpecAssertion(section="9.2.1", id="d"),
+ @SpecAssertion(section="9.2.1", id="e")
+ })
+ public void testJavaEeNamespace()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/AnotherDeploymentType.java 2009-04-07 09:39:36 UTC (rev 2327)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.xml.namespace.javaee.foo;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+public @interface AnotherDeploymentType
+{
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/Order.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/foo/Order.java 2009-04-07 09:39:36 UTC (rev 2327)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.xml.namespace.javaee.foo;
+
+public class Order
+{
+ public Integer val;
+
+ public Order(Integer val)
+ {
+ this.val = val;
+ }
+}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/beans.xml 2009-04-07 09:39:36 UTC (rev 2327)
@@ -0,0 +1,21 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.xml.namespace.javaee">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+ <test:Order>
+ <RequestScoped />
+ <Integer />
+ <Array>
+ <String />
+ </Array>
+ </test:Order>
+ <Decorators>
+ <test:TestDecorator />
+ </Decorators>
+ <Interceptors>
+ <test:TestInterceptor />
+ </Interceptors>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/namespace
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/namespace (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/javaee/namespace 2009-04-07 09:39:36 UTC (rev 2327)
@@ -0,0 +1,2 @@
+org.jboss.jsr299.tck.tests.xml.namespace.javaee
+org.jboss.jsr299.tck.tests.xml.namespace.javaee.foo
\ No newline at end of file
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2326 - in extensions/trunk/tomcat: build and 14 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-06 20:03:19 -0400 (Mon, 06 Apr 2009)
New Revision: 2326
Added:
extensions/trunk/tomcat/extras/
extensions/trunk/tomcat/extras/pom.xml
extensions/trunk/tomcat/extras/src/
extensions/trunk/tomcat/extras/src/etc/
extensions/trunk/tomcat/extras/src/etc/header.txt
extensions/trunk/tomcat/extras/src/main/
extensions/trunk/tomcat/extras/src/main/java/
extensions/trunk/tomcat/extras/src/main/java/org/
extensions/trunk/tomcat/extras/src/main/java/org/jboss/
extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/
extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/
extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/servlet/
extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/tomcat/
extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingAnnotationProcessor.java
extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java
extensions/trunk/tomcat/extras/src/main/resources/
extensions/trunk/tomcat/extras/src/test/
extensions/trunk/tomcat/extras/src/test/java/
extensions/trunk/tomcat/extras/src/test/resources/
Removed:
extensions/trunk/tomcat/build/target/
Modified:
extensions/trunk/tomcat/build/.classpath
extensions/trunk/tomcat/build/.settings/org.eclipse.jdt.core.prefs
extensions/trunk/tomcat/build/pom.xml
extensions/trunk/tomcat/int/pom.xml
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java
Log:
POC for servlet injection in Tomcat
Modified: extensions/trunk/tomcat/build/.classpath
===================================================================
--- extensions/trunk/tomcat/build/.classpath 2009-04-06 21:54:22 UTC (rev 2325)
+++ extensions/trunk/tomcat/build/.classpath 2009-04-07 00:03:19 UTC (rev 2326)
@@ -1,6 +1,8 @@
<classpath>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/annotations-api/6.0.18/annotations-api-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/catalina/6.0.18/catalina-6.0.18.jar"/>
<classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javassist/javassist/3.8.1.GA/javassist-3.8.1.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.8.1.GA/javassist-3.8.1.GA-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT-sources.jar">
@@ -8,6 +10,8 @@
<attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
</attributes>
</classpathentry>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/juli/6.0.18/juli-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/servlet-api/6.0.18/servlet-api-6.0.18.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/webbeans-api/1.0.0-SNAPSHOT/webbeans-api-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/webbeans-api/1.0.0-SNAPSHOT/webbeans-api-1.0.0-SNAPSHOT-sources.jar">
<attributes>
<attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/webbeans-api/1.0.0-SNAPSHOT/webbeans-api-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
Modified: extensions/trunk/tomcat/build/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- extensions/trunk/tomcat/build/.settings/org.eclipse.jdt.core.prefs 2009-04-06 21:54:22 UTC (rev 2325)
+++ extensions/trunk/tomcat/build/.settings/org.eclipse.jdt.core.prefs 2009-04-07 00:03:19 UTC (rev 2326)
@@ -1,4 +1,4 @@
-#Mon Apr 06 17:56:29 BST 2009
+#Tue Apr 07 00:46:08 BST 2009
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.5
Modified: extensions/trunk/tomcat/build/pom.xml
===================================================================
--- extensions/trunk/tomcat/build/pom.xml 2009-04-06 21:54:22 UTC (rev 2325)
+++ extensions/trunk/tomcat/build/pom.xml 2009-04-07 00:03:19 UTC (rev 2326)
@@ -54,6 +54,10 @@
<artifactSet>
<excludes>
<exclude>xml-apis:xml-apis</exclude>
+ <exclude>org.apache.tomcat:catalina</exclude>
+ <exclude>org.apache.tomcat:servlet-api</exclude>
+ <exclude>org.apache.tomcat:juli</exclude>
+ <exclude>org.apache.tomcat:annotations-api</exclude>
</excludes>
</artifactSet>
</configuration>
Added: extensions/trunk/tomcat/extras/pom.xml
===================================================================
--- extensions/trunk/tomcat/extras/pom.xml (rev 0)
+++ extensions/trunk/tomcat/extras/pom.xml 2009-04-07 00:03:19 UTC (rev 2326)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <parent>
+ <artifactId>webbeans-tomcat-parent</artifactId>
+ <groupId>org.jboss.webbeans.tomcat</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.webbeans.tomcat</groupId>
+ <artifactId>webbeans-tomcat-extras</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Web Beans Tomcat Integration</name>
+ <url>http://www.seamframework.org/WebBeans</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ <exclusions>
+ <exclusion>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-spi</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>6.0.18</version>
+ </dependency>
+
+
+ </dependencies>
+
+</project>
Added: extensions/trunk/tomcat/extras/src/etc/header.txt
===================================================================
--- extensions/trunk/tomcat/extras/src/etc/header.txt (rev 0)
+++ extensions/trunk/tomcat/extras/src/etc/header.txt 2009-04-07 00:03:19 UTC (rev 2326)
@@ -0,0 +1,14 @@
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
Added: extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingAnnotationProcessor.java
===================================================================
--- extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingAnnotationProcessor.java (rev 0)
+++ extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/tomcat/ForwardingAnnotationProcessor.java 2009-04-07 00:03:19 UTC (rev 2326)
@@ -0,0 +1,29 @@
+package org.jboss.webbeans.environment.tomcat;
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.naming.NamingException;
+
+import org.apache.AnnotationProcessor;
+
+public abstract class ForwardingAnnotationProcessor implements AnnotationProcessor
+{
+
+ protected abstract AnnotationProcessor delegate();
+
+ public void postConstruct(Object instance) throws IllegalAccessException, InvocationTargetException
+ {
+ delegate().postConstruct(instance);
+ }
+
+ public void preDestroy(Object instance) throws IllegalAccessException, InvocationTargetException
+ {
+ delegate().preDestroy(instance);
+ }
+
+ public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException
+ {
+ delegate().processAnnotations(instance);
+ }
+
+}
Added: extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java
===================================================================
--- extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java (rev 0)
+++ extensions/trunk/tomcat/extras/src/main/java/org/jboss/webbeans/environment/tomcat/WebBeansLifecycleListener.java 2009-04-07 00:03:19 UTC (rev 2326)
@@ -0,0 +1,48 @@
+package org.jboss.webbeans.environment.tomcat;
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.naming.NamingException;
+import javax.servlet.ServletContext;
+
+import org.apache.AnnotationProcessor;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.core.StandardContext;
+
+public class WebBeansLifecycleListener implements LifecycleListener
+{
+
+ public void lifecycleEvent(LifecycleEvent event)
+ {
+ if (event.getType().equals("after_start") && event.getLifecycle() instanceof StandardContext)
+ {
+ StandardContext context = (StandardContext) event.getLifecycle();
+ final ServletContext servletContext = context.getServletContext();
+ final AnnotationProcessor annotationProcessor = context.getAnnotationProcessor();
+ context.setAnnotationProcessor(new ForwardingAnnotationProcessor()
+ {
+
+ @Override
+ protected AnnotationProcessor delegate()
+ {
+ return annotationProcessor;
+ }
+
+ @Override
+ public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException
+ {
+ super.processAnnotations(instance);
+ Object o = servletContext.getAttribute("org.jboss.webbeans.environment.tomcat.WebBeansAnnotationProcessor");
+ if (o != null)
+ {
+ AnnotationProcessor processor = (AnnotationProcessor) o;
+ processor.processAnnotations(instance);
+ }
+ }
+
+ });
+ }
+ }
+
+}
Modified: extensions/trunk/tomcat/int/pom.xml
===================================================================
--- extensions/trunk/tomcat/int/pom.xml 2009-04-06 21:54:22 UTC (rev 2325)
+++ extensions/trunk/tomcat/int/pom.xml 2009-04-07 00:03:19 UTC (rev 2326)
@@ -42,6 +42,13 @@
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-logging</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>6.0.18</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
Modified: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java
===================================================================
--- extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java 2009-04-06 21:54:22 UTC (rev 2325)
+++ extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java 2009-04-07 00:03:19 UTC (rev 2326)
@@ -29,6 +29,9 @@
import org.jboss.webbeans.environment.servlet.discovery.TomcatWebBeanDiscovery;
import org.jboss.webbeans.environment.servlet.resources.ReadOnlyNamingContext;
import org.jboss.webbeans.environment.servlet.util.Reflections;
+import org.jboss.webbeans.environment.tomcat.WebBeansAnnotationProcessor;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.manager.api.WebBeansManager;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceServices;
@@ -42,6 +45,8 @@
public class Listener extends ForwardingServletListener
{
+ private static final Log log = Logging.getLog(Listener.class);
+
private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
private static final String WEB_BEANS_LISTENER_CLASS_NAME = "org.jboss.webbeans.servlet.WebBeansListener";
private static final String APPLICATION_BEAN_STORE_ATTRIBUTE_NAME = Listener.class.getName() + ".applicationBeanStore";
@@ -105,9 +110,44 @@
bootstrap.setApplicationContext(applicationBeanStore);
bootstrap.initialize();
manager = bootstrap.getManager();
+
+ boolean tomcat = true;
+ try
+ {
+ Reflections.loadClass("org.apache.AnnotationProcessor", Object.class);
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.info("JSR-299 injection will not be available in Servlets, Filters etc. This facility is only available in Tomcat");
+ tomcat = false;
+ }
+ catch (NoClassDefFoundError e)
+ {
+ log.info("JSR-299 injection will not be available in Servlets, Filters etc. This facility is only available in Tomcat");
+ tomcat = false;
+ }
+
+ if (tomcat)
+ {
+ // Try pushing a Tomcat AnnotationProcessor into the servlet context
+ try
+ {
+ Class<?> clazz = Reflections.loadClass(WebBeansAnnotationProcessor.class.getName(), Object.class);
+ Object annotationProcessor = clazz.getConstructor(WebBeansManager.class).newInstance(manager);
+ sce.getServletContext().setAttribute(WebBeansAnnotationProcessor.class.getName(), annotationProcessor);
+ }
+ catch (Exception e)
+ {
+ log.error("Unable to create Tomcat AnnotationProcessor. JSR-299 injection will not be available in Servlets, Filters etc.", e);
+ }
+ }
+
+
bootstrap.boot();
super.contextInitialized(sce);
}
+
+
@Override
protected ServletListener delegate()
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2325 - in ri/trunk: dist and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-06 17:54:22 -0400 (Mon, 06 Apr 2009)
New Revision: 2325
Modified:
ri/trunk/
ri/trunk/dist/
ri/trunk/jboss-as/build.xml
ri/trunk/version-matrix/pom.xml
Log:
update for new jboss-int artifact names
Property changes on: ri/trunk
___________________________________________________________________
Name: svn:ignore
-
arget
.classpath
.settings
.project
tests
+
.classpath
.settings
.project
tests
target
Property changes on: ri/trunk/dist
___________________________________________________________________
Name: svn:ignore
+
webbeans-*
Modified: ri/trunk/jboss-as/build.xml
===================================================================
--- ri/trunk/jboss-as/build.xml 2009-04-06 19:10:32 UTC (rev 2324)
+++ ri/trunk/jboss-as/build.xml 2009-04-06 21:54:22 UTC (rev 2325)
@@ -23,7 +23,7 @@
<delete dir="target" failonerror="false" />
<artifact:dependencies filesetId="webbeans.deployer.fileset" versionsId="webbeans.deployer.versions" >
- <dependency groupId="org.jboss.webbeans.integration" artifactId="webbeans-ri-int-deployer" version="${webbeans-ri-int.version}" type="zip" />
+ <dependency groupId="org.jboss.webbeans.integration" artifactId="webbeans-jboss-int-deployer" version="${webbeans-ri-int.version}" type="zip" />
<dependency groupId="org.jboss.webbeans" artifactId="webbeans-core" version="${webbeans.version}" />
<remoteRepository id="repository.jboss.org" url="http://repository.jboss.org/maven2" />
<remoteRepository id="snapshots.jboss.org" url="http://snapshots.jboss.org/maven2" />
@@ -38,7 +38,7 @@
</chainedmapper>
</copy>
- <unzip dest="target" src="target/dependency/lib/webbeans-ri-int-deployer.zip" />
+ <unzip dest="target" src="target/dependency/lib/webbeans-jboss-int-deployer.zip" />
<copy todir="target/webbeans.deployer/lib-int/" overwrite="true">
<fileset dir="target/dependency/lib">
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-04-06 19:10:32 UTC (rev 2324)
+++ ri/trunk/version-matrix/pom.xml 2009-04-06 21:54:22 UTC (rev 2325)
@@ -257,6 +257,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-core-test</artifactId>
+ <version>${webbeans.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.webbeans.tomcat</groupId>
<artifactId>webbeans-tomcat-int</artifactId>
<version>${webbeans.tomcat.version}</version>
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2324 - examples/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-06 15:10:32 -0400 (Mon, 06 Apr 2009)
New Revision: 2324
Modified:
examples/trunk/build.properties
examples/trunk/build.xml
examples/trunk/pom.xml
Log:
support for tomcat example
Modified: examples/trunk/build.properties
===================================================================
--- examples/trunk/build.properties 2009-04-06 19:09:51 UTC (rev 2323)
+++ examples/trunk/build.properties 2009-04-06 19:10:32 UTC (rev 2324)
@@ -1 +1,2 @@
jboss.home=/Applications/jboss-5.0.1.GA
+tomcat.home=/Applications/apache-tomcat-6.0.18
Modified: examples/trunk/build.xml
===================================================================
--- examples/trunk/build.xml 2009-04-06 19:09:51 UTC (rev 2323)
+++ examples/trunk/build.xml 2009-04-06 19:10:32 UTC (rev 2324)
@@ -39,11 +39,23 @@
</copy>
</target>
+ <target name="tomcat.explode" depends="package">
+ <mkdir dir="${tomcat.home}/webapps/${example.name}"/>
+ <copy todir="${tomcat.home}/webapps/${example.name}">
+ <fileset dir="${artifact.dir}" />
+ </copy>
+ </target>
+
<target name="deploy" depends="package">
<copy todir="${jboss.home}/server/default/deploy/" file="${artifact.target.dir}/${example.name}.${type}"/>
<echo message="The app can be accessed at ${final.url}" />
</target>
+ <target name="tomcat.deploy" depends="package">
+ <copy todir="${tomcat.home}/webapps/" file="${artifact.target.dir}/${example.name}.${type}"/>
+ <echo message="The app can be accessed at ${final.url}" />
+ </target>
+
<target name="clean">
<maven target="clean" basedir="${basedir}"/>
</target>
@@ -52,6 +64,10 @@
<touch file="${jboss.home}/server/default/deploy/${example.name}.war/WEB-INF/web.xml" />
</target>
+ <target name="tomcat.restart" depends="tomcat.explode" if="war">
+ <touch file="${tomcat.home}/webapps/${example.name}/WEB-INF/web.xml" />
+ </target>
+
<target name="restart.ear" depends="explode" if="ear">
<touch file="${jboss.home}/server/default/deploy/${example.name}.ear/META-INF/application.xml" />
</target>
@@ -65,6 +81,11 @@
<delete file="${jboss.home}/server/default/deploy/${example.name}.${type}" failonerror="false" />
</target>
+ <target name="tomcat.undeploy">
+ <delete dir="${tomcat.home}/webapps/${example.name}" failonerror="false" />
+ <delete file="${tomcat.home}/webapps/${example.name}" failonerror="false" />
+ </target>
+
<macrodef name="maven">
<attribute name="target" />
<attribute name="basedir" />
Modified: examples/trunk/pom.xml
===================================================================
--- examples/trunk/pom.xml 2009-04-06 19:09:51 UTC (rev 2323)
+++ examples/trunk/pom.xml 2009-04-06 19:10:32 UTC (rev 2324)
@@ -47,6 +47,7 @@
<modules>
<module>numberguess</module>
<module>jsf2</module>
+ <module>tomcat</module>
<module>translator</module>
<module>login</module>
<module>conversations</module>
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2323 - examples/trunk/tomcat/WebContent/META-INF and 21 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-06 15:09:51 -0400 (Mon, 06 Apr 2009)
New Revision: 2323
Added:
extensions/trunk/tomcat/build/.classpath
extensions/trunk/tomcat/build/.project
extensions/trunk/tomcat/build/.settings/
extensions/trunk/tomcat/build/.settings/org.eclipse.jdt.core.prefs
extensions/trunk/tomcat/build/target/
extensions/trunk/tomcat/build/target/dependency-reduced-pom.xml
extensions/trunk/tomcat/build/target/maven-archiver/
extensions/trunk/tomcat/build/target/maven-archiver/pom.properties
extensions/trunk/tomcat/build/target/original-webbeans-tomcat-1.0.0-SNAPSHOT.jar
extensions/trunk/tomcat/build/target/webbeans-tomcat-1.0.0-SNAPSHOT-sources.jar
extensions/trunk/tomcat/build/target/webbeans-tomcat-1.0.0-SNAPSHOT.jar
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/resources/
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/util/
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceServices.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/AbstractResourceServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceServices.java
Removed:
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/Listener.java
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/discovery/
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/resources/
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/util/
Modified:
doc/trunk/reference/en-US/environments.xml
examples/trunk/tomcat/WebContent/META-INF/context.xml
examples/trunk/tomcat/WebContent/WEB-INF/web.xml
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/AbstractScanner.java
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/Scanner.java
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/TomcatWebBeanDiscovery.java
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/URLScanner.java
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/resources/ReadOnlyNamingContext.java
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/util/Reflections.java
extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/util/Servlets.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockBootstrap.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEjbServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockNamingContext.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockWebBeanDiscovery.java
Log:
WBX-15
Modified: doc/trunk/reference/en-US/environments.xml
===================================================================
--- doc/trunk/reference/en-US/environments.xml 2009-04-06 16:12:49 UTC (rev 2322)
+++ doc/trunk/reference/en-US/environments.xml 2009-04-06 19:09:51 UTC (rev 2323)
@@ -51,14 +51,14 @@
</section>
<section>
- <title>Tomcat</title>
+ <title>Tomcat (or any plain Servlet container)</title>
<para>Web Beans can be used in Tomcat 6.0.</para>
<note>
<para>
Web Beans doesn't support deploying session beans, injection using
- <literal>@EJB</literal>, <literal>@Resource</literal>, or
+ <literal>@EJB</literal>, or
<literal>@PersistenceContext</literal> or using transactional events
on Tomcat.
</para>
@@ -122,7 +122,7 @@
</para>
<programlisting><![CDATA[<listener>
- <listener-class>org.jboss.webbeans.environment.tomcat.Listener</listener-class>
+ <listener-class>org.jboss.webbeans.environment.servlet.Listener</listener-class>
</listener>]]></programlisting>
<para>
Modified: examples/trunk/tomcat/WebContent/META-INF/context.xml
===================================================================
--- examples/trunk/tomcat/WebContent/META-INF/context.xml 2009-04-06 16:12:49 UTC (rev 2322)
+++ examples/trunk/tomcat/WebContent/META-INF/context.xml 2009-04-06 19:09:51 UTC (rev 2323)
@@ -2,4 +2,6 @@
<Resource name="app/Manager" auth="Container"
type="javax.inject.manager.Manager"
factory="org.jboss.webbeans.resources.ManagerObjectFactory"/>
+ <Listener className="org.jboss.webbeans.environment.tomcat.WebBeansLifecycleListener" />
+
</Context>
Modified: examples/trunk/tomcat/WebContent/WEB-INF/web.xml
===================================================================
--- examples/trunk/tomcat/WebContent/WEB-INF/web.xml 2009-04-06 16:12:49 UTC (rev 2322)
+++ examples/trunk/tomcat/WebContent/WEB-INF/web.xml 2009-04-06 19:09:51 UTC (rev 2323)
@@ -30,7 +30,7 @@
</session-config>
<listener>
- <listener-class>org.jboss.webbeans.environment.tomcat.Listener</listener-class>
+ <listener-class>org.jboss.webbeans.environment.servlet.Listener</listener-class>
</listener>
<resource-env-ref>
Added: extensions/trunk/tomcat/build/.classpath
===================================================================
--- extensions/trunk/tomcat/build/.classpath (rev 0)
+++ extensions/trunk/tomcat/build/.classpath 2009-04-06 19:09:51 UTC (rev 2323)
@@ -0,0 +1,33 @@
+<classpath>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.8.1.GA/javassist-3.8.1.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.8.1.GA/javassist-3.8.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT-sources.jar">
+ <attributes>
+ <attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/webbeans-api/1.0.0-SNAPSHOT/webbeans-api-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/webbeans-api/1.0.0-SNAPSHOT/webbeans-api-1.0.0-SNAPSHOT-sources.jar">
+ <attributes>
+ <attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/webbeans-api/1.0.0-SNAPSHOT/webbeans-api-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/webbeans-core/1.0.0-SNAPSHOT/webbeans-core-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/webbeans-core/1.0.0-SNAPSHOT/webbeans-core-1.0.0-SNAPSHOT-sources.jar">
+ <attributes>
+ <attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/webbeans-core/1.0.0-SNAPSHOT/webbeans-core-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/webbeans-logging/1.0.0-SNAPSHOT/webbeans-logging-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/webbeans-logging/1.0.0-SNAPSHOT/webbeans-logging-1.0.0-SNAPSHOT-sources.jar">
+ <attributes>
+ <attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/webbeans-logging/1.0.0-SNAPSHOT/webbeans-logging-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/webbeans/webbeans-spi/1.0.0-SNAPSHOT/webbeans-spi-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/webbeans/webbeans-spi/1.0.0-SNAPSHOT/webbeans-spi-1.0.0-SNAPSHOT-sources.jar">
+ <attributes>
+ <attribute value="jar:file:/Users/pmuir/.m2/repository/org/jboss/webbeans/webbeans-spi/1.0.0-SNAPSHOT/webbeans-spi-1.0.0-SNAPSHOT-javadoc.jar!/" name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" path="/webbeans-tomcat-int"/>
+ <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>
+</classpath>
\ No newline at end of file
Property changes on: extensions/trunk/tomcat/build/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/tomcat/build/.project
===================================================================
--- extensions/trunk/tomcat/build/.project (rev 0)
+++ extensions/trunk/tomcat/build/.project 2009-04-06 19:09:51 UTC (rev 2323)
@@ -0,0 +1,15 @@
+<projectDescription>
+ <name>webbeans-tomcat</name>
+ <comment>Support for Web Beans on Tomcat</comment>
+ <projects>
+ <project>webbeans-tomcat-int</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Property changes on: extensions/trunk/tomcat/build/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/tomcat/build/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- extensions/trunk/tomcat/build/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ extensions/trunk/tomcat/build/.settings/org.eclipse.jdt.core.prefs 2009-04-06 19:09:51 UTC (rev 2323)
@@ -0,0 +1,5 @@
+#Mon Apr 06 17:56:29 BST 2009
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Property changes on: extensions/trunk/tomcat/build/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/tomcat/build/target/dependency-reduced-pom.xml
===================================================================
--- extensions/trunk/tomcat/build/target/dependency-reduced-pom.xml (rev 0)
+++ extensions/trunk/tomcat/build/target/dependency-reduced-pom.xml 2009-04-06 19:09:51 UTC (rev 2323)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <parent>
+ <artifactId>webbeans-tomcat-parent</artifactId>
+ <groupId>org.jboss.webbeans.tomcat</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.webbeans.tomcat</groupId>
+ <artifactId>webbeans-tomcat</artifactId>
+ <name>Web Beans Tomcat module</name>
+ <version>1.0.0-SNAPSHOT</version>
+ <url>http://www.seamframework.org/WebBeans</url>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <artifactSet>
+ <excludes>
+ <exclude>xml-apis:xml-apis</exclude>
+ </excludes>
+ </artifactSet>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Property changes on: extensions/trunk/tomcat/build/target/dependency-reduced-pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/tomcat/build/target/maven-archiver/pom.properties
===================================================================
--- extensions/trunk/tomcat/build/target/maven-archiver/pom.properties (rev 0)
+++ extensions/trunk/tomcat/build/target/maven-archiver/pom.properties 2009-04-06 19:09:51 UTC (rev 2323)
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Mon Apr 06 20:03:06 BST 2009
+version=1.0.0-SNAPSHOT
+groupId=org.jboss.webbeans.tomcat
+artifactId=webbeans-tomcat
Property changes on: extensions/trunk/tomcat/build/target/maven-archiver/pom.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/tomcat/build/target/original-webbeans-tomcat-1.0.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: extensions/trunk/tomcat/build/target/original-webbeans-tomcat-1.0.0-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: extensions/trunk/tomcat/build/target/webbeans-tomcat-1.0.0-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)
Property changes on: extensions/trunk/tomcat/build/target/webbeans-tomcat-1.0.0-SNAPSHOT-sources.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: extensions/trunk/tomcat/build/target/webbeans-tomcat-1.0.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: extensions/trunk/tomcat/build/target/webbeans-tomcat-1.0.0-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java (from rev 2287, extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/Listener.java)
===================================================================
--- extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java (rev 0)
+++ extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/Listener.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.environment.servlet;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.ServletContextEvent;
+
+import org.jboss.webbeans.bootstrap.api.Bootstrap;
+import org.jboss.webbeans.bootstrap.api.Environments;
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.context.api.BeanStore;
+import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.webbeans.environment.servlet.discovery.TomcatWebBeanDiscovery;
+import org.jboss.webbeans.environment.servlet.resources.ReadOnlyNamingContext;
+import org.jboss.webbeans.environment.servlet.util.Reflections;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.resources.spi.NamingContext;
+import org.jboss.webbeans.resources.spi.ResourceServices;
+import org.jboss.webbeans.resources.spi.helpers.AbstractResourceServices;
+import org.jboss.webbeans.servlet.api.ServletListener;
+import org.jboss.webbeans.servlet.api.helpers.ForwardingServletListener;
+
+/**
+ * @author Pete Muir
+ */
+public class Listener extends ForwardingServletListener
+{
+
+ private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
+ private static final String WEB_BEANS_LISTENER_CLASS_NAME = "org.jboss.webbeans.servlet.WebBeansListener";
+ private static final String APPLICATION_BEAN_STORE_ATTRIBUTE_NAME = Listener.class.getName() + ".applicationBeanStore";
+
+ private final transient Bootstrap bootstrap;
+ private final transient ServletListener webBeansListener;
+ private WebBeansManager manager;
+
+ public Listener()
+ {
+ try
+ {
+ bootstrap = Reflections.newInstance(BOOTSTRAP_IMPL_CLASS_NAME, Bootstrap.class);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
+ }
+ try
+ {
+ webBeansListener = Reflections.newInstance(WEB_BEANS_LISTENER_CLASS_NAME, ServletListener.class);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error loading Web Beans listener, check that Web Beans is on the classpath", e);
+ }
+ }
+
+ public void contextDestroyed(ServletContextEvent sce)
+ {
+ manager.shutdown();
+ super.contextDestroyed(sce);
+ }
+
+ public void contextInitialized(ServletContextEvent sce)
+ {
+ BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
+ sce.getServletContext().setAttribute(APPLICATION_BEAN_STORE_ATTRIBUTE_NAME, applicationBeanStore);
+ bootstrap.setEnvironment(Environments.SERVLET);
+ bootstrap.getServices().add(WebBeanDiscovery.class, new TomcatWebBeanDiscovery(sce.getServletContext()) {});
+ bootstrap.getServices().add(NamingContext.class, new ReadOnlyNamingContext() {});
+ final Context context;
+ try
+ {
+ context = new InitialContext();
+ }
+ catch (NamingException e)
+ {
+ throw new IllegalStateException("Error creating JNDI context", e);
+ }
+ bootstrap.getServices().add(ResourceServices.class, new AbstractResourceServices()
+ {
+
+ @Override
+ protected Context getContext()
+ {
+ return context;
+ }
+
+ });
+ bootstrap.setApplicationContext(applicationBeanStore);
+ bootstrap.initialize();
+ manager = bootstrap.getManager();
+ bootstrap.boot();
+ super.contextInitialized(sce);
+ }
+
+ @Override
+ protected ServletListener delegate()
+ {
+ return webBeansListener;
+ }
+
+}
Copied: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery (from rev 2287, extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/discovery)
Modified: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/AbstractScanner.java
===================================================================
--- extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/discovery/AbstractScanner.java 2009-03-31 21:49:34 UTC (rev 2287)
+++ extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/AbstractScanner.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.tomcat.discovery;
+package org.jboss.webbeans.environment.servlet.discovery;
import java.net.URL;
Modified: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/Scanner.java
===================================================================
--- extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/discovery/Scanner.java 2009-03-31 21:49:34 UTC (rev 2287)
+++ extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/Scanner.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.tomcat.discovery;
+package org.jboss.webbeans.environment.servlet.discovery;
import java.io.File;
Modified: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/TomcatWebBeanDiscovery.java
===================================================================
--- extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/discovery/TomcatWebBeanDiscovery.java 2009-03-31 21:49:34 UTC (rev 2287)
+++ extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/TomcatWebBeanDiscovery.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.tomcat.discovery;
+package org.jboss.webbeans.environment.servlet.discovery;
import java.io.File;
import java.net.MalformedURLException;
@@ -26,8 +26,8 @@
import javax.servlet.ServletContext;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.environment.tomcat.util.Reflections;
-import org.jboss.webbeans.environment.tomcat.util.Servlets;
+import org.jboss.webbeans.environment.servlet.util.Reflections;
+import org.jboss.webbeans.environment.servlet.util.Servlets;
/**
* The means by which Web Beans are discovered on the classpath. This will only
Modified: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/URLScanner.java
===================================================================
--- extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/discovery/URLScanner.java 2009-03-31 21:49:34 UTC (rev 2287)
+++ extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/discovery/URLScanner.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.tomcat.discovery;
+package org.jboss.webbeans.environment.servlet.discovery;
import java.io.File;
import java.io.IOException;
Copied: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/resources (from rev 2287, extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/resources)
Modified: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/resources/ReadOnlyNamingContext.java
===================================================================
--- extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/resources/ReadOnlyNamingContext.java 2009-03-31 21:49:34 UTC (rev 2287)
+++ extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/resources/ReadOnlyNamingContext.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.tomcat.resources;
+package org.jboss.webbeans.environment.servlet.resources;
import javax.inject.DeploymentException;
import javax.naming.Context;
Copied: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/util (from rev 2287, extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/util)
Modified: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/util/Reflections.java
===================================================================
--- extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/util/Reflections.java 2009-03-31 21:49:34 UTC (rev 2287)
+++ extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/util/Reflections.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.tomcat.util;
+package org.jboss.webbeans.environment.servlet.util;
/**
* Reflection utilities
Modified: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/util/Servlets.java
===================================================================
--- extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/util/Servlets.java 2009-03-31 21:49:34 UTC (rev 2287)
+++ extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/servlet/util/Servlets.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.environment.tomcat.util;
+package org.jboss.webbeans.environment.servlet.util;
import java.io.File;
import java.net.MalformedURLException;
Deleted: extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/Listener.java
===================================================================
--- extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/Listener.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ extensions/trunk/tomcat/int/src/main/java/org/jboss/webbeans/environment/tomcat/Listener.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.environment.tomcat;
-
-import javax.servlet.ServletContextEvent;
-
-import org.jboss.webbeans.bootstrap.api.Bootstrap;
-import org.jboss.webbeans.bootstrap.api.Environments;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
-import org.jboss.webbeans.environment.tomcat.discovery.TomcatWebBeanDiscovery;
-import org.jboss.webbeans.environment.tomcat.resources.ReadOnlyNamingContext;
-import org.jboss.webbeans.environment.tomcat.util.Reflections;
-import org.jboss.webbeans.manager.api.WebBeansManager;
-import org.jboss.webbeans.resources.spi.NamingContext;
-import org.jboss.webbeans.servlet.api.ServletListener;
-import org.jboss.webbeans.servlet.api.helpers.ForwardingServletListener;
-
-/**
- * @author Pete Muir
- */
-public class Listener extends ForwardingServletListener
-{
-
- private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
- private static final String WEB_BEANS_LISTENER_CLASS_NAME = "org.jboss.webbeans.servlet.WebBeansListener";
- private static final String APPLICATION_BEAN_STORE_ATTRIBUTE_NAME = Listener.class.getName() + ".applicationBeanStore";
-
- private final transient Bootstrap bootstrap;
- private final transient ServletListener webBeansListener;
- private WebBeansManager manager;
-
- public Listener()
- {
- try
- {
- bootstrap = Reflections.newInstance(BOOTSTRAP_IMPL_CLASS_NAME, Bootstrap.class);
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
- }
- try
- {
- webBeansListener = Reflections.newInstance(WEB_BEANS_LISTENER_CLASS_NAME, ServletListener.class);
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Error loading Web Beans listener, check that Web Beans is on the classpath", e);
- }
- }
-
- public void contextDestroyed(ServletContextEvent sce)
- {
- manager.shutdown();
- super.contextDestroyed(sce);
- }
-
- public void contextInitialized(ServletContextEvent sce)
- {
- BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
- sce.getServletContext().setAttribute(APPLICATION_BEAN_STORE_ATTRIBUTE_NAME, applicationBeanStore);
- bootstrap.setEnvironment(Environments.SERVLET);
- bootstrap.getServices().add(WebBeanDiscovery.class, new TomcatWebBeanDiscovery(sce.getServletContext()) {});
- bootstrap.getServices().add(NamingContext.class, new ReadOnlyNamingContext() {});
- bootstrap.setApplicationContext(applicationBeanStore);
- bootstrap.initialize();
- manager = bootstrap.getManager();
- bootstrap.boot();
- super.contextInitialized(sce);
- }
-
- @Override
- protected ServletListener delegate()
- {
- return webBeansListener;
- }
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -47,6 +47,7 @@
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.resources.spi.ResourceServices;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
@@ -258,25 +259,33 @@
*/
protected void injectEjbAndCommonFields(T beanInstance)
{
- if (getManager().getServices().contains(EjbServices.class))
+ EjbServices ejbServices = manager.getServices().get(EjbServices.class);
+ JpaServices jpaServices = manager.getServices().get(JpaServices.class);
+ ResourceServices resourceServices = manager.getServices().get(ResourceServices.class);
+
+ if (ejbServices != null)
{
- EjbServices ejbServices = manager.getServices().get(EjbServices.class);
- JpaServices jpaServices = manager.getServices().get(JpaServices.class);
for (AnnotatedInjectionPoint<?, ?> injectionPoint : ejbInjectionPoints)
{
Object ejbInstance = ejbServices.resolveEjb(injectionPoint);
injectionPoint.inject(beanInstance, ejbInstance);
}
-
+ }
+
+ if (jpaServices != null)
+ {
for (AnnotatedInjectionPoint<?, ?> injectionPoint : persistenceUnitInjectionPoints)
{
Object puInstance = jpaServices.resolvePersistenceContext(injectionPoint);
injectionPoint.inject(beanInstance, puInstance);
}
-
+ }
+
+ if (resourceServices != null)
+ {
for (AnnotatedInjectionPoint<?, ?> injectionPoint : resourceInjectionPoints)
{
- Object resourceInstance = ejbServices.resolveResource(injectionPoint);
+ Object resourceInstance = resourceServices.resolveResource(injectionPoint);
injectionPoint.inject(beanInstance, resourceInstance);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -52,6 +52,7 @@
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.jsf.JSFApiAbstraction;
import org.jboss.webbeans.literal.DeployedLiteral;
import org.jboss.webbeans.literal.InitializedLiteral;
@@ -64,6 +65,7 @@
import org.jboss.webbeans.resources.ManagerObjectFactory;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.jboss.webbeans.resources.spi.ResourceServices;
import org.jboss.webbeans.servlet.HttpSessionManager;
import org.jboss.webbeans.servlet.ServletApiAbstraction;
import org.jboss.webbeans.transaction.spi.TransactionServices;
@@ -100,8 +102,16 @@
}
if (!getServices().contains(EjbServices.class))
{
- log.info("EJB services not available. Session beans will be simple beans, injection into non-contextual EJBs, injection of @Resource, @PersistenceContext and @EJB in simple beans, injection of Java EE resources and JMS resources will not be available.");
+ log.info("EJB services not available. Session beans will be simple beans, injection into non-contextual EJBs, injection of @EJB in simple beans, injection of Java EE resources and JMS resources will not be available.");
}
+ if (!getServices().contains(JpaServices.class))
+ {
+ log.info("JPA services not available. Injection of @PersistenceContext will not occur. Entity beans will be discovered as simple beans.");
+ }
+ if (!getServices().contains(ResourceServices.class))
+ {
+ log.info("@Resource injection not available.");
+ }
addImplementationServices();
this.manager = ManagerImpl.newRootManager(ServiceRegistries.unmodifiableServiceRegistry(getServices()));
bindManagerIntoJndi();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -19,6 +19,7 @@
import org.jboss.webbeans.bootstrap.api.Environments;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.resources.spi.ResourceServices;
import org.jboss.webbeans.transaction.spi.TransactionServices;
public class MockEELifecycle extends MockServletLifecycle
@@ -32,6 +33,7 @@
getBootstrap().getServices().add(TransactionServices.class, MOCK_TRANSACTION_SERVICES);
getBootstrap().getServices().add(EjbServices.class, new MockEjBServices(getWebBeanDiscovery()));
getBootstrap().getServices().add(JpaServices.class, new MockJpaServices(getWebBeanDiscovery()));
+ getBootstrap().getServices().add(ResourceServices.class, new MockResourceServices());
getBootstrap().setEnvironment(Environments.EE);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -3,6 +3,7 @@
*/
package org.jboss.webbeans.mock;
+import java.lang.reflect.Field;
import java.util.Collection;
import javax.inject.manager.InjectionPoint;
@@ -27,11 +28,6 @@
return null;
}
- public Object resolveResource(InjectionPoint injectionPoint)
- {
- return null;
- }
-
public void removeEjb(Collection<Object> instance)
{
// No-op
@@ -59,6 +55,12 @@
}
+ public Object getFieldValue(Field field)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
};
}
}
\ No newline at end of file
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.mock;
+
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.webbeans.resources.spi.ResourceServices;
+
+/**
+ * @author Pete Muir
+ *
+ */
+public class MockResourceServices implements ResourceServices
+{
+
+ public Object resolveResource(InjectionPoint injectionPoint)
+ {
+ return null;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -25,6 +25,7 @@
import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.jboss.webbeans.resources.spi.ResourceServices;
import org.jboss.webbeans.transaction.spi.TransactionServices;
/**
@@ -39,12 +40,12 @@
/**
* Java EE5 or Java EE6
*/
- EE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
+ EE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
/**
* Java EE6 Web Profile
*/
- EE_WEB_PROFILE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class,TransactionServices.class, NamingContext.class, ResourceLoader.class),
+ EE_WEB_PROFILE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
/**
* Servlet container such as Tomcat
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -10,6 +10,7 @@
import org.jboss.webbeans.manager.api.WebBeansManager;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.jboss.webbeans.resources.spi.ResourceServices;
import org.jboss.webbeans.transaction.spi.TransactionServices;
/**
@@ -47,6 +48,16 @@
{
return bootstrap.getServices().get(JpaServices.class);
}
+
+ public ResourceServices getResourceServices()
+ {
+ return bootstrap.getServices().get(ResourceServices.class);
+ }
+
+ public void setResourceServices(ResourceServices resourceServices)
+ {
+ bootstrap.getServices().add(ResourceServices.class, resourceServices);
+ }
public void setWebBeanDiscovery(WebBeanDiscovery webBeanDiscovery)
{
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -24,7 +24,7 @@
/**
* A container should implement this interface to allow the Web Beans RI to
- * resolve EJBs, Resources and JPA persistence units and discover EJBs
+ * resolve EJB and discover EJBs
*
* @author Pete Muir
*
@@ -48,21 +48,6 @@
public Object resolveEjb(InjectionPoint injectionPoint);
/**
- * Resolve the value for the given @Resource injection point
- *
- * @param injectionPoint
- * the injection point metadata
- * @return an instance of the resource
- * @throws IllegalArgumentException
- * if the injection point is not annotated with @Resource, or, if
- * the injection point is a method that doesn't follow JavaBean
- * conventions
- * @throws IllegalStateException
- * if no resource can be resolved for injection
- */
- public Object resolveResource(InjectionPoint injectionPoint);
-
- /**
* Request a reference to an EJB session object from the container. If the
* EJB being resolved is a stateful session bean, the container should ensure
* the session bean is created before this method returns.
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -46,11 +46,6 @@
{
return delegate().resolveEjb(ejbDescriptor);
}
-
- public Object resolveResource(InjectionPoint injectionPoint)
- {
- return delegate().resolveResource(injectionPoint);
- }
public Iterable<EjbDescriptor<?>> discoverEjbs()
{
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceServices.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceServices.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.resources.spi;
+
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+
+/**
+ * A container should implement this interface to allow the Web Beans RI to
+ * resolve Resources
+ *
+ * @author Pete Muir
+ *
+ */
+public interface ResourceServices extends Service
+{
+
+ /**
+ * Resolve the value for the given @Resource injection point
+ *
+ * @param injectionPoint
+ * the injection point metadata
+ * @return an instance of the resource
+ * @throws IllegalArgumentException
+ * if the injection point is not annotated with @Resource, or, if
+ * the injection point is a method that doesn't follow JavaBean
+ * conventions
+ * @throws IllegalStateException
+ * if no resource can be resolved for injection
+ */
+ public Object resolveResource(InjectionPoint injectionPoint);
+
+}
\ No newline at end of file
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/AbstractResourceServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/AbstractResourceServices.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/AbstractResourceServices.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -0,0 +1,98 @@
+package org.jboss.webbeans.resources.spi.helpers;
+
+import java.beans.Introspector;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.annotation.Resource;
+import javax.inject.ExecutionException;
+import javax.inject.manager.InjectionPoint;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.jboss.webbeans.resources.spi.ResourceServices;
+
+public abstract class AbstractResourceServices implements ResourceServices
+{
+
+ private static final String RESOURCE_LOOKUP_PREFIX = "java:/comp/env";
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.resources.spi.helpers.ResourceServices#resolveResource(javax.inject.manager.InjectionPoint)
+ */
+ public Object resolveResource(InjectionPoint injectionPoint)
+ {
+ if (!injectionPoint.isAnnotationPresent(Resource.class))
+ {
+ throw new IllegalArgumentException("No @Resource annotation found on injection point " + injectionPoint);
+ }
+ if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
+ {
+ throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
+ }
+ String name = getResourceName(injectionPoint);
+ try
+ {
+ return getContext().lookup(name);
+ }
+ catch (NamingException e)
+ {
+ throw new ExecutionException("Error looking up " + name + " in JNDI", e);
+ }
+ }
+
+ protected abstract Context getContext();
+
+ private static String getResourceName(InjectionPoint injectionPoint)
+ {
+ Resource resource = injectionPoint.getAnnotation(Resource.class);
+ String mappedName = resource.mappedName();
+ if (!mappedName.equals(""))
+ {
+ return mappedName;
+ }
+ String name = resource.name();
+ if (!name.equals(""))
+ {
+ return RESOURCE_LOOKUP_PREFIX + "/" + name;
+ }
+ String propertyName;
+ if (injectionPoint.getMember() instanceof Field)
+ {
+ propertyName = injectionPoint.getMember().getName();
+ }
+ else if (injectionPoint.getMember() instanceof Method)
+ {
+ propertyName = getPropertyName((Method) injectionPoint.getMember());
+ if (propertyName == null)
+ {
+ throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (unable to determine property name) " + injectionPoint);
+ }
+ }
+ else
+ {
+ throw new AssertionError("Unable to inject into " + injectionPoint);
+ }
+ String className = injectionPoint.getMember().getDeclaringClass().getName();
+ return RESOURCE_LOOKUP_PREFIX + "/" + className + "/" + propertyName;
+ }
+
+ public static String getPropertyName(Method method)
+ {
+ String methodName = method.getName();
+ if (methodName.matches("^(get).*") && method.getParameterTypes().length == 0)
+ {
+ return Introspector.decapitalize(methodName.substring(3));
+ }
+ else if (methodName.matches("^(is).*") && method.getParameterTypes().length == 0)
+ {
+ return Introspector.decapitalize(methodName.substring(2));
+ }
+ else
+ {
+ return null;
+ }
+
+ }
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/AbstractResourceServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -8,6 +8,7 @@
import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.jboss.webbeans.resources.spi.ResourceServices;
import org.jboss.webbeans.transaction.spi.TransactionServices;
import org.testng.annotations.Test;
@@ -36,6 +37,7 @@
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -50,6 +52,7 @@
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+ bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -65,6 +68,7 @@
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -80,6 +84,7 @@
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -94,9 +99,25 @@
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
+ @Test(expectedExceptions=IllegalStateException.class)
+ public void testMissingResourceServices()
+ {
+ AbstractBootstrap bootstrap = new MockBootstrap();
+ bootstrap.setEnvironment(Environments.EE);
+ bootstrap.getServices().add(NamingContext.class, new MockNamingContext());
+ bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+ bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+ bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+ bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
+ bootstrap.initialize();
+ }
+
@Test
public void testSEEnv()
{
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockBootstrap.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockBootstrap.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockBootstrap.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -8,13 +8,11 @@
public void boot()
{
- // TODO Auto-generated method stub
}
public WebBeansManager getManager()
{
- // TODO Auto-generated method stub
return null;
}
@@ -25,8 +23,6 @@
public void shutdown()
{
- // TODO Auto-generated method stub
-
}
}
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEjbServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEjbServices.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEjbServices.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -11,26 +11,17 @@
public Iterable<EjbDescriptor<?>> discoverEjbs()
{
- // TODO Auto-generated method stub
return null;
}
public SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
{
- // TODO Auto-generated method stub
return null;
}
public Object resolveEjb(InjectionPoint injectionPoint)
{
- // TODO Auto-generated method stub
return null;
}
- public Object resolveResource(InjectionPoint injectionPoint)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
}
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -11,13 +11,11 @@
public Collection<Class<?>> discoverEntities()
{
- // TODO Auto-generated method stub
return null;
}
public Object resolvePersistenceContext(InjectionPoint injectionPoint)
{
- // TODO Auto-generated method stub
return null;
}
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockNamingContext.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockNamingContext.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockNamingContext.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -7,19 +7,15 @@
public void bind(String name, Object value)
{
- // TODO Auto-generated method stub
-
}
public <T> T lookup(String name, Class<? extends T> expectedType)
{
- // TODO Auto-generated method stub
return null;
}
public void unbind(String key)
{
- // TODO Auto-generated method stub
}
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -9,19 +9,16 @@
public Class<?> classForName(String name)
{
- // TODO Auto-generated method stub
return null;
}
public URL getResource(String name)
{
- // TODO Auto-generated method stub
return null;
}
public Iterable<URL> getResources(String name)
{
- // TODO Auto-generated method stub
return null;
}
Added: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceServices.java (rev 0)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceServices.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.bootstrap.api.test;
+
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.webbeans.resources.spi.ResourceServices;
+
+public class MockResourceServices implements ResourceServices
+{
+
+ public Object resolveResource(InjectionPoint injectionPoint)
+ {
+ return null;
+ }
+
+}
Property changes on: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -9,14 +9,11 @@
public boolean isTransactionActive()
{
- // TODO Auto-generated method stub
return false;
}
public void registerSynchronization(Synchronization synchronizedObserver)
{
- // TODO Auto-generated method stub
-
}
}
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockWebBeanDiscovery.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockWebBeanDiscovery.java 2009-04-06 16:12:49 UTC (rev 2322)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockWebBeanDiscovery.java 2009-04-06 19:09:51 UTC (rev 2323)
@@ -9,13 +9,11 @@
public Iterable<Class<?>> discoverWebBeanClasses()
{
- // TODO Auto-generated method stub
return null;
}
public Iterable<URL> discoverWebBeansXml()
{
- // TODO Auto-generated method stub
return null;
}
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2322 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-06 12:12:49 -0400 (Mon, 06 Apr 2009)
New Revision: 2322
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java
Log:
use an object factory
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-04-06 15:00:38 UTC (rev 2321)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-04-06 16:12:49 UTC (rev 2322)
@@ -22,6 +22,8 @@
import java.util.List;
import javax.inject.ExecutionException;
+import javax.inject.manager.Manager;
+import javax.naming.Reference;
import org.jboss.webbeans.BeanValidator;
import org.jboss.webbeans.CurrentManager;
@@ -59,6 +61,7 @@
import org.jboss.webbeans.resources.ClassTransformer;
import org.jboss.webbeans.resources.DefaultNamingContext;
import org.jboss.webbeans.resources.DefaultResourceLoader;
+import org.jboss.webbeans.resources.ManagerObjectFactory;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.servlet.HttpSessionManager;
@@ -101,17 +104,7 @@
}
addImplementationServices();
this.manager = ManagerImpl.newRootManager(ServiceRegistries.unmodifiableServiceRegistry(getServices()));
- try
- {
- getServices().get(NamingContext.class).unbind(ManagerImpl.JNDI_KEY);
- }
- catch (ExecutionException e)
- {
- }
- finally
- {
- getServices().get(NamingContext.class).bind(ManagerImpl.JNDI_KEY, getManager());
- }
+ bindManagerIntoJndi();
CurrentManager.setRootManager(manager);
initializeContexts();
}
@@ -126,10 +119,22 @@
// TODO expose AnnotatedClass on SPI and allow container to provide impl of this via ResourceLoader
getServices().add(ClassTransformer.class, new ClassTransformer());
getServices().add(MetaDataCache.class, new MetaDataCache(getServices().get(ClassTransformer.class)));
-
-
}
+ private void bindManagerIntoJndi()
+ {
+ try
+ {
+ getServices().get(NamingContext.class).unbind(ManagerImpl.JNDI_KEY);
+ }
+ catch (ExecutionException e) {}
+ finally
+ {
+ Reference managerReference = new Reference(Manager.class.getName(), ManagerObjectFactory.class.getName(), null);
+ getServices().get(NamingContext.class).bind(ManagerImpl.JNDI_KEY, managerReference);
+ }
+ }
+
public ManagerImpl getManager()
{
return manager;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java 2009-04-06 15:00:38 UTC (rev 2321)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java 2009-04-06 16:12:49 UTC (rev 2322)
@@ -11,9 +11,11 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.testng.annotations.Test;
@Artifact
+@IntegrationTest
public class JndiManagerCurrentActivityTest extends AbstractJSR299Test
{
@@ -57,7 +59,7 @@
}
- @Test(groups="ri-broken")
+ @Test
@SpecAssertion(section="11.6.1", id="f")
public void testJndiManagerIsCurrentActivity()
{
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2321 - ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/impl and 9 other directories.
by webbeans-commits@lists.jboss.org
Author: vitold
Date: 2009-04-06 11:00:38 -0400 (Mon, 06 Apr 2009)
New Revision: 2321
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/foo/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/foo/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/foo/Order.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/foo/TestDeploymentType.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/namespace
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/schema.xsd
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/impl/BeanChildrenCheckerImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/NamespaceAggregationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/beans.xml
Log:
make some tck tests
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java 2009-04-06 14:48:19 UTC (rev 2320)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java 2009-04-06 15:00:38 UTC (rev 2321)
@@ -55,4 +55,6 @@
public static final String NAMESPACE_FILE_DELIMETER = " ";
public static final String PRODUCES = "Produces";
+
+ public static final String VALUE = "value";
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java 2009-04-06 14:48:19 UTC (rev 2320)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java 2009-04-06 15:00:38 UTC (rev 2321)
@@ -156,13 +156,13 @@
{
String message = "Can not open stream for " + url;
log.debug(message, e);
- throw new DeploymentException(message, e);
+ throw new DefinitionException(message, e);
}
catch (DocumentException e)
{
String message = "Error during the processing of a DOM4J document for " + url;
log.debug(message, e);
- throw new DeploymentException(message, e);
+ throw new DefinitionException(message, e);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/impl/BeanChildrenCheckerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/impl/BeanChildrenCheckerImpl.java 2009-04-06 14:48:19 UTC (rev 2320)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/impl/BeanChildrenCheckerImpl.java 2009-04-06 15:00:38 UTC (rev 2321)
@@ -1,6 +1,8 @@
package org.jboss.webbeans.xml.checker.beanchildren.impl;
+import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -18,6 +20,7 @@
import javax.inject.Realizes;
import javax.inject.Specializes;
import javax.interceptor.Interceptor;
+import javax.interceptor.InterceptorBindingType;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceUnit;
import javax.xml.ws.WebServiceRef;
@@ -25,6 +28,7 @@
import org.dom4j.Element;
import org.dom4j.Namespace;
import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.xml.ParseXmlHelper;
import org.jboss.webbeans.xml.XmlConstants;
import org.jboss.webbeans.xml.XmlEnvironment;
@@ -36,6 +40,10 @@
private final Map<String, Set<String>> packagesMap;
+ private Set<AnnotatedField<?>> beanFields;
+
+ private List<Method> beanMethods;
+
private boolean haveBeanDeploymentTypeDeclaration = false;
private boolean haveBeanScopeTypeDeclaration = false;
@@ -64,6 +72,9 @@
public void checkChildren(Element beanElement, AnnotatedClass<?> beanClass)
{
+ beanFields = beanClass.getFields();
+ beanMethods = Arrays.asList(beanClass.getRawType().getDeclaredMethods());
+
checkForInterceptorChild(beanElement);
checkForDecoratorChild(beanElement);
@@ -83,7 +94,6 @@
private void checkBeanChild(Element beanChildElement, AnnotatedClass<?> beanClass)
{
- //TODO: not finished
try
{
AnnotatedClass<?> beanChildClass = ParseXmlHelper.loadElementClass(beanChildElement, Object.class, environment, packagesMap);
@@ -153,12 +163,12 @@
checkChildForDecoratorType(beanChildElement);
return;
}
- //TODO: add interceptor binding type
- if(beanChildClass.isAnnotationPresent(BindingType.class) || beanChildClass.isAnnotationPresent(Stereotype.class) ||
- beanChildClass.isAnnotationPresent(Named.class) || beanChildClass.isAnnotationPresent(Specializes.class) ||
- beanChildClass.isAnnotationPresent(Realizes.class) || beanChildClass.isAnnotationPresent(Resource.class) ||
- beanChildClass.isAnnotationPresent(EJB.class) || beanChildClass.isAnnotationPresent(WebServiceRef.class) ||
- beanChildClass.isAnnotationPresent(PersistenceContext.class) || beanChildClass.isAnnotationPresent(PersistenceUnit.class))
+ if(beanChildClass.isAnnotationPresent(BindingType.class) || beanChildClass.isAnnotationPresent(InterceptorBindingType.class) ||
+ beanChildClass.isAnnotationPresent(Stereotype.class) || beanChildClass.isAnnotationPresent(Named.class) ||
+ beanChildClass.isAnnotationPresent(Specializes.class) || beanChildClass.isAnnotationPresent(Realizes.class) ||
+ beanChildClass.isAnnotationPresent(Resource.class) || beanChildClass.isAnnotationPresent(EJB.class) ||
+ beanChildClass.isAnnotationPresent(WebServiceRef.class) || beanChildClass.isAnnotationPresent(PersistenceContext.class) ||
+ beanChildClass.isAnnotationPresent(PersistenceUnit.class))
return;
throw new DefinitionException("Can't determine annotation type of <" + beanChildElement.getName() + "> element in bean '" +
@@ -166,6 +176,58 @@
}
private void checkFieldOrMethodChild(Element beanChildElement, AnnotatedClass<?> beanClass)
+ { //TODO: not finished
+ boolean isField = false;
+ boolean isMethod = false;
+
+ for(AnnotatedField<?> field : beanFields)
+ {
+ if(beanChildElement.getName().equalsIgnoreCase(field.getName()))
+ {
+ if(isField)
+ throw new DefinitionException("Bean class '" + beanClass.getName() + "' does not have exactly one field " +
+ "with the specified name '" + beanChildElement.getName() + "'");
+ isField = true;
+ }
+ }
+
+ for(Method method : beanMethods)
+ {
+ if(beanChildElement.getName().equalsIgnoreCase(method.getName()))
+ isMethod = true;
+ }
+
+ if(isField && isMethod)
+ throw new DefinitionException("The name of the child element <" + beanChildElement.getName() +
+ "> matches the name of both a method and a field of the bean class '" + beanClass.getName() + "'");
+
+ if(isField)
+ checkFieldChild(beanChildElement, beanClass);
+
+ if(isMethod)
+ checkMethodChild(beanChildElement, beanClass);
+ }
+
+ private void checkFieldChild(Element beanChildElement, AnnotatedClass<?> beanClass)
+ {//TODO: not finished
+ Element elementParent = beanChildElement.getParent();
+ String elementName = beanChildElement.getName();
+ String elementPrefix = beanChildElement.getNamespacePrefix();
+ String elementUri = beanChildElement.getNamespaceURI();
+
+ if(ParseXmlHelper.findElements(elementParent, elementName, elementPrefix, elementUri).size() > 1)
+ throw new DefinitionException("More than one child element of a bean '" + elementParent.getName() +
+ "' declaration represents the same field'" + elementName + "'");
+
+ if(beanChildElement.elements().size() > 1 &&
+ beanChildElement.elements().size() != ParseXmlHelper.findElementsInEeNamespace(beanChildElement, XmlConstants.VALUE).size())
+ throw new DefinitionException("Declaration of a field '" + beanChildElement.getName() + "' has more than one direct child element, " +
+ "and at least one of these elements is something other than a <value> element in the Java EE namespace");
+
+
+ }
+
+ private void checkMethodChild(Element beanChildElement, AnnotatedClass<?> beanClass)
{
//TODO: not finished
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java 2009-04-06 15:00:38 UTC (rev 2321)
@@ -0,0 +1,42 @@
+package org.jboss.jsr299.tck.tests.xml.metadata;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.metadata.foo.Order;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+@Resources({
+ @Resource(source="namespace", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/metadata/namespace"),
+ @Resource(source="schema.xsd", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/metadata/namespace")
+})
+(a)Classes({Order.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class XmlBasedMetadataTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9", id="a"),
+ @SpecAssertion(section="9", id="b"),
+ @SpecAssertion(section="9", id="c"),
+ @SpecAssertion(section="9", id="d"),
+ @SpecAssertion(section="9", id="e"),
+ @SpecAssertion(section="9.1", id="b"),
+ @SpecAssertion(section="9.1", id="c"),
+ @SpecAssertion(section="9.1", id="d")
+ })
+ public void testXmlBasedMetadata()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/foo/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/foo/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/foo/AnotherDeploymentType.java 2009-04-06 15:00:38 UTC (rev 2321)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.xml.metadata.foo;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+public @interface AnotherDeploymentType
+{
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/foo/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/foo/Order.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/foo/Order.java 2009-04-06 15:00:38 UTC (rev 2321)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.xml.metadata.foo;
+
+public class Order
+{
+ public String str;
+
+ public String getStr()
+ {
+ return str;
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/NamespaceAggregationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/NamespaceAggregationTest.java 2009-04-06 14:48:19 UTC (rev 2320)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/NamespaceAggregationTest.java 2009-04-06 15:00:38 UTC (rev 2321)
@@ -23,9 +23,11 @@
@Test
@SpecAssertions({
+ @SpecAssertion(section="9.1", id="a"),
@SpecAssertion(section="9.2", id="a"),
@SpecAssertion(section="9.2", id="b"),
- @SpecAssertion(section="9.2", id="c")
+ @SpecAssertion(section="9.2", id="c"),
+ @SpecAssertion(section="9.2", id="d")
})
public void testNamespaceAggregation()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/foo/TestDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/foo/TestDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/foo/TestDeploymentType.java 2009-04-06 15:00:38 UTC (rev 2321)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.xml.namespace.aggregation.foo;
+
+import javax.inject.DeploymentType;
+
+@DeploymentType
+public @interface TestDeploymentType
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java 2009-04-06 14:48:19 UTC (rev 2320)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java 2009-04-06 15:00:38 UTC (rev 2321)
@@ -1,12 +1,13 @@
package org.jboss.jsr299.tck.tests.xml.namespace.aggregation.multipleTypes;
-
import javax.inject.DefinitionException;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.namespace.aggregation.Cow;
import org.jboss.jsr299.tck.tests.xml.namespace.aggregation.foo.AnotherDeploymentType;
+import org.jboss.jsr299.tck.tests.xml.namespace.aggregation.foo.TestDeploymentType;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
@@ -19,19 +20,19 @@
@Resources({
@Resource(source="namespace", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/namespace")
})
-(a)Classes({AnotherDeploymentType.class, org.jboss.jsr299.tck.tests.xml.namespace.aggregation.foo.copy.AnotherDeploymentType.class})
+(a)Classes({AnotherDeploymentType.class, TestDeploymentType.class})
@BeansXml("beans.xml")
@ExpectedDeploymentException(DefinitionException.class)
public class MultipleTypesInAggregatedNamespacesTest extends AbstractJSR299Test
-{
-
+{
@Test
@SpecAssertions({
- @SpecAssertion(section="9.2", id="e")
+ @SpecAssertion(section="9.2", id="e"),
+ @SpecAssertion(section="9.2", id="f")
})
public void testNamespaceAggregation()
{
- assert false;
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
}
}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/beans.xml 2009-04-06 15:00:38 UTC (rev 2321)
@@ -0,0 +1,16 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="http://www.w3.org/2001/XMLSchema-instance"
+ test:schemaLocation="urn:java:ee
+ urn:java:org.jboss.jsr299.tck.tests.xml.metadata http://mydomain.com/myapp/schema-1.2.xsd">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+ <test:Order>
+ <RequestScoped />
+ <test:str>hello</test:str>
+ <test:getStr />
+ <my:Type />
+ </test:Order>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/namespace
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/namespace (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/namespace 2009-04-06 15:00:38 UTC (rev 2321)
@@ -0,0 +1,2 @@
+org.jboss.jsr299.tck.tests.xml.metadata
+org.jboss.jsr299.tck.tests.xml.metadata.foo
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/metadata/schema.xsd
===================================================================
Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/beans.xml 2009-04-06 14:48:19 UTC (rev 2320)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/beans.xml 2009-04-06 15:00:38 UTC (rev 2321)
@@ -3,6 +3,7 @@
<Deploy>
<Standard />
<Production />
- <test:AnotherDeploymentType />
+ <test:TestDeploymentType />
+ <test:AnotherDeploymentType />
</Deploy>
</Beans>
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2320 - doc/trunk/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-06 10:48:19 -0400 (Mon, 06 Apr 2009)
New Revision: 2320
Modified:
doc/trunk/reference/en-US/ri-spi.xml
Log:
minor
Modified: doc/trunk/reference/en-US/ri-spi.xml
===================================================================
--- doc/trunk/reference/en-US/ri-spi.xml 2009-04-06 14:37:20 UTC (rev 2319)
+++ doc/trunk/reference/en-US/ri-spi.xml 2009-04-06 14:48:19 UTC (rev 2320)
@@ -24,8 +24,8 @@
<title>The Web Beans RI SPI</title>
<para>
- The Web Beans SPI is located in <literal>webbeans-ri-spi</literal>
- module, and packaged as <literal>webbeans-ri-spi.jar</literal>. Some
+ The Web Beans SPI is located in <literal>webbeans-spi</literal>
+ module, and packaged as <literal>webbeans-spi.jar</literal>. Some
SPIs are optional, if you need to override the default behavior,
others are required.
</para>
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2319 - in extensions/trunk/logger: src/test/java/org/jboss/webbeans/test and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-06 10:37:20 -0400 (Mon, 06 Apr 2009)
New Revision: 2319
Removed:
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/StandaloneContainersImpl.java
Modified:
extensions/trunk/logger/pom.xml
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/LoggerInjectionTest.java
extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties
Log:
WBRI-216
Modified: extensions/trunk/logger/pom.xml
===================================================================
--- extensions/trunk/logger/pom.xml 2009-04-06 14:36:06 UTC (rev 2318)
+++ extensions/trunk/logger/pom.xml 2009-04-06 14:37:20 UTC (rev 2319)
@@ -53,6 +53,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-core-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-api</artifactId>
<scope>test</scope>
Deleted: extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java 2009-04-06 14:36:06 UTC (rev 2318)
+++ extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java 2009-04-06 14:37:20 UTC (rev 2319)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.test;
-
-import javax.inject.manager.Manager;
-
-import org.jboss.testharness.AbstractTest;
-import org.jboss.webbeans.CurrentManager;
-import org.testng.ITestContext;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.BeforeSuite;
-
-/**
- * Some basic abstractions useful for tests in this project.
- *
- * @author David Allen
- *
- */
-public abstract class AbstractLogTest extends AbstractTest
-{
- private Manager manager;
-
- @Override
- @BeforeSuite
- public void beforeSuite(ITestContext context) throws Exception
- {
- if (!isInContainer())
- {
- getCurrentConfiguration().setStandaloneContainers(new StandaloneContainersImpl());
- getCurrentConfiguration().getExtraPackages().add(AbstractLogTest.class.getPackage().getName());
- }
- super.beforeSuite(context);
- }
-
- @BeforeMethod
- public void before() throws Exception
- {
- this.manager = CurrentManager.rootManager();
- }
-
- @AfterMethod
- public void after() throws Exception
- {
- manager = null;
- }
-
- public Manager getCurrentManager()
- {
- return manager;
- }
-}
Deleted: extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/StandaloneContainersImpl.java
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/StandaloneContainersImpl.java 2009-04-06 14:36:06 UTC (rev 2318)
+++ extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/StandaloneContainersImpl.java 2009-04-06 14:37:20 UTC (rev 2319)
@@ -1,78 +0,0 @@
-package org.jboss.webbeans.test;
-
-import java.net.URL;
-
-import org.jboss.testharness.api.DeploymentException;
-import org.jboss.testharness.spi.StandaloneContainers;
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.mock.MockEELifecycle;
-import org.jboss.webbeans.mock.MockServletLifecycle;
-import org.jboss.webbeans.mock.MockWebBeanDiscovery;
-
-public class StandaloneContainersImpl implements StandaloneContainers
-{
-
- // TODO this is a hack ;-)
- public static Class<? extends MockServletLifecycle> lifecycleClass = MockEELifecycle.class;
-
- private MockServletLifecycle lifecycle;
-
- public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
- {
- try
- {
- this.lifecycle = lifecycleClass.newInstance();
- }
- catch (InstantiationException e1)
- {
- throw new DeploymentException("Error instantiating lifeycle", e1);
- }
- catch (IllegalAccessException e1)
- {
- throw new DeploymentException("Error instantiating lifeycle", e1);
- }
- lifecycle.initialize();
- try
- {
- MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
- discovery.setWebBeanClasses(classes);
- if (beansXml != null)
- {
- discovery.setWebBeansXmlFiles(beansXml);
- }
- lifecycle.beginApplication();
- }
- catch (Exception e)
- {
- throw new DeploymentException("Error deploying beans", e);
- }
- lifecycle.beginSession();
- lifecycle.beginRequest();
- }
-
- public void deploy(Iterable<Class<?>> classes) throws DeploymentException
- {
- deploy(classes, null);
- }
-
- public void cleanup()
- {
- // Np-op
-
- }
-
- public void setup()
- {
- // No-op
- }
-
- public void undeploy()
- {
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
- CurrentManager.setRootManager(null);
- lifecycle = null;
- }
-
-}
Modified: extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/LoggerInjectionTest.java
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/LoggerInjectionTest.java 2009-04-06 14:36:06 UTC (rev 2318)
+++ extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/LoggerInjectionTest.java 2009-04-06 14:37:20 UTC (rev 2319)
@@ -19,7 +19,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
-import org.jboss.webbeans.test.AbstractLogTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
/**
@@ -29,7 +29,7 @@
*/
@Artifact
@Classes(packages = { "org.jboss.webbeans.log", "org.jboss.webbeans.test.log" })
-public class LoggerInjectionTest extends AbstractLogTest
+public class LoggerInjectionTest extends AbstractWebBeansTest
{
@Test
public void testBasicLogInjection()
Modified: extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties
===================================================================
--- extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties 2009-04-06 14:36:06 UTC (rev 2318)
+++ extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties 2009-04-06 14:37:20 UTC (rev 2319)
@@ -1,3 +1 @@
-org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.test.StandaloneContainersImpl
-org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
org.jboss.testharness.testPackage=org.jboss.webbeans.test
\ No newline at end of file
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2318 - in ri/trunk/tests: src/main/java and 33 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-06 10:36:06 -0400 (Mon, 06 Apr 2009)
New Revision: 2318
Added:
ri/trunk/tests/src/main/java/org/
ri/trunk/tests/src/main/java/org/jboss/
ri/trunk/tests/src/main/java/org/jboss/webbeans/
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java
ri/trunk/tests/src/main/resources/META-INF/
ri/trunk/tests/src/main/resources/META-INF/web-beans-tck.properties
Removed:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java
Modified:
ri/trunk/tests/
ri/trunk/tests/pom.xml
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/ExampleTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockExampleTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ApplicationScopedTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ContextTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ParameterizedTypeScopedTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/ELResolverTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ExceptionHandlingTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/ManagerProducerTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/LookupInstanceTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/deploy/BeansXmlParserTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties
Log:
WBRI-216
Property changes on: ri/trunk/tests
___________________________________________________________________
Name: svn:ignore
- .project
.classpath
.settings
target
temp-testng-customsuite.xml
test-output
+
.project
.classpath
.settings
target
temp-testng-customsuite.xml
test-output
bin
Modified: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/pom.xml 2009-04-06 14:36:06 UTC (rev 2318)
@@ -6,7 +6,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core-tests</artifactId>
+ <artifactId>webbeans-core-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Web Beans Core Tests</name>
<dependencies>
@@ -15,11 +15,15 @@
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-core</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-spi</artifactId>
+ </dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <scope>test</scope>
<classifier>jdk15</classifier>
<exclusions>
<exclusion>
@@ -32,7 +36,6 @@
<dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
@@ -44,16 +47,19 @@
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
+ <scope>test</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>javax.el</groupId>
<artifactId>el-ri</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-api</artifactId>
+ <scope>test</scope>
<optional>true</optional>
<exclusions>
<exclusion>
Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java (from rev 2307, ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -0,0 +1,140 @@
+package org.jboss.webbeans.test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.lang.annotation.Annotation;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.inject.Production;
+import javax.inject.Standard;
+
+import org.jboss.testharness.AbstractTest;
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.util.EnumerationIterable;
+import org.testng.ITestContext;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
+
+public abstract class AbstractWebBeansTest extends AbstractTest
+{
+
+ protected abstract static class RunInDependentContext
+ {
+
+ protected void setup()
+ {
+ DependentContext.INSTANCE.setActive(true);
+ }
+
+ protected void cleanup()
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
+
+ public final void run() throws Exception
+ {
+ try
+ {
+ setup();
+ execute();
+ }
+ finally
+ {
+ cleanup();
+ }
+ }
+
+ protected abstract void execute() throws Exception;
+
+ }
+
+ protected static final int BUILT_IN_BEANS = 3;
+
+ private ManagerImpl manager;
+
+ public static boolean visited = false;
+
+ @Override
+ @BeforeSuite
+ public void beforeSuite(ITestContext context) throws Exception
+ {
+ if (!isInContainer())
+ {
+ getCurrentConfiguration().setStandaloneContainers(new StandaloneContainersImpl());
+ getCurrentConfiguration().getExtraPackages().add(AbstractWebBeansTest.class.getPackage().getName());
+ }
+ super.beforeSuite(context);
+ }
+
+ @BeforeMethod
+ public void before() throws Exception
+ {
+ this.manager = CurrentManager.rootManager();
+ }
+
+ @AfterMethod
+ public void after() throws Exception
+ {
+ this.manager = null;
+ }
+
+
+ protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+ {
+ return getDefaultDeploymentTypes();
+ }
+
+ @SuppressWarnings("unchecked")
+ protected final List<Class<? extends Annotation>> getDefaultDeploymentTypes()
+ {
+ return Arrays.asList(Standard.class, Production.class);
+ }
+
+ protected Iterable<URL> getResources(String name)
+ {
+ if (name.startsWith("/"))
+ {
+ name = name.substring(1);
+ }
+ else
+ {
+ name = getClass().getPackage().getName().replace(".", "/") + "/" + name;
+ }
+ try
+ {
+ return new EnumerationIterable<URL>(getClass().getClassLoader().getResources(name));
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Error loading resource from classloader" + name, e);
+ }
+ }
+
+ 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 ManagerImpl getCurrentManager()
+ {
+ return manager;
+ }
+
+}
Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java (from rev 2307, ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -0,0 +1,78 @@
+package org.jboss.webbeans.test;
+
+import java.net.URL;
+
+import org.jboss.testharness.api.DeploymentException;
+import org.jboss.testharness.spi.StandaloneContainers;
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.MockServletLifecycle;
+import org.jboss.webbeans.mock.MockWebBeanDiscovery;
+
+public class StandaloneContainersImpl implements StandaloneContainers
+{
+
+ // TODO this is a hack ;-)
+ public static Class<? extends MockServletLifecycle> lifecycleClass = MockEELifecycle.class;
+
+ private MockServletLifecycle lifecycle;
+
+ public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
+ {
+ try
+ {
+ this.lifecycle = lifecycleClass.newInstance();
+ }
+ catch (InstantiationException e1)
+ {
+ throw new DeploymentException("Error instantiating lifeycle", e1);
+ }
+ catch (IllegalAccessException e1)
+ {
+ throw new DeploymentException("Error instantiating lifeycle", e1);
+ }
+ lifecycle.initialize();
+ try
+ {
+ MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
+ discovery.setWebBeanClasses(classes);
+ if (beansXml != null)
+ {
+ discovery.setWebBeansXmlFiles(beansXml);
+ }
+ lifecycle.beginApplication();
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Error deploying beans", e);
+ }
+ lifecycle.beginSession();
+ lifecycle.beginRequest();
+ }
+
+ public void deploy(Iterable<Class<?>> classes) throws DeploymentException
+ {
+ deploy(classes, null);
+ }
+
+ public void cleanup()
+ {
+ // Np-op
+
+ }
+
+ public void setup()
+ {
+ // No-op
+ }
+
+ public void undeploy()
+ {
+ lifecycle.endRequest();
+ lifecycle.endSession();
+ lifecycle.endApplication();
+ CurrentManager.setRootManager(null);
+ lifecycle = null;
+ }
+
+}
Added: ri/trunk/tests/src/main/resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/tests/src/main/resources/META-INF/web-beans-tck.properties (rev 0)
+++ ri/trunk/tests/src/main/resources/META-INF/web-beans-tck.properties 2009-04-06 14:36:06 UTC (rev 2318)
@@ -0,0 +1,2 @@
+org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.test.StandaloneContainersImpl
+org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/ExampleTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/ExampleTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/ExampleTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -1,7 +1,7 @@
package org.jboss.webbeans.test.examples;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -16,12 +16,12 @@
@Override
protected void execute() throws Exception
{
- Game game1 = manager.getInstanceByType(Game.class);
- Game game2 = manager.getInstanceByType(Game.class);
+ Game game1 = getCurrentManager().getInstanceByType(Game.class);
+ Game game2 = getCurrentManager().getInstanceByType(Game.class);
assert game1!=game2;
assert game1.getNumber()!=game2.getNumber();
- Generator gen1 = manager.getInstanceByType(Generator.class);
- Generator gen2 = manager.getInstanceByType(Generator.class);
+ Generator gen1 = getCurrentManager().getInstanceByType(Generator.class);
+ Generator gen2 = getCurrentManager().getInstanceByType(Generator.class);
assert gen1.getRandom()!=null;
assert gen1.getRandom()==gen2.getRandom();
}
@@ -38,7 +38,7 @@
@Override
protected void execute() throws Exception
{
- TextTranslator tt1 = manager.getInstanceByType(TextTranslator.class);
+ TextTranslator tt1 = getCurrentManager().getInstanceByType(TextTranslator.class);
try
{
tt1.translate("hello world");
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockExampleTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockExampleTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockExampleTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -2,7 +2,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -20,7 +20,7 @@
@Override
protected void execute() throws Exception
{
- TextTranslator tt2 = manager.getInstanceByType(TextTranslator.class);
+ TextTranslator tt2 = getCurrentManager().getInstanceByType(TextTranslator.class);
assert "Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.".equals( tt2.translate("Hello world. How's tricks?") );
}
Deleted: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -1,135 +0,0 @@
-package org.jboss.webbeans.test.unit;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.annotation.Annotation;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.inject.Production;
-import javax.inject.Standard;
-
-import org.jboss.testharness.AbstractTest;
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.context.DependentContext;
-import org.jboss.webbeans.util.EnumerationIterable;
-import org.testng.ITestContext;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.BeforeSuite;
-
-public abstract class AbstractWebBeansTest extends AbstractTest
-{
-
- protected abstract static class RunInDependentContext
- {
-
- protected void setup()
- {
- DependentContext.INSTANCE.setActive(true);
- }
-
- protected void cleanup()
- {
- DependentContext.INSTANCE.setActive(false);
- }
-
- public final void run() throws Exception
- {
- try
- {
- setup();
- execute();
- }
- finally
- {
- cleanup();
- }
- }
-
- protected abstract void execute() throws Exception;
-
- }
-
- protected static final int BUILT_IN_BEANS = 3;
-
- protected ManagerImpl manager;
-
- public static boolean visited = false;
-
- @Override
- @BeforeSuite
- public void beforeSuite(ITestContext context) throws Exception
- {
- if (!isInContainer())
- {
- getCurrentConfiguration().setStandaloneContainers(new StandaloneContainersImpl());
- getCurrentConfiguration().getExtraPackages().add(AbstractWebBeansTest.class.getPackage().getName());
- }
- super.beforeSuite(context);
- }
-
- @BeforeMethod
- public void before() throws Exception
- {
- this.manager = CurrentManager.rootManager();
- }
-
- @AfterMethod
- public void after() throws Exception
- {
- manager = null;
- }
-
-
- protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
- {
- return getDefaultDeploymentTypes();
- }
-
- @SuppressWarnings("unchecked")
- protected final List<Class<? extends Annotation>> getDefaultDeploymentTypes()
- {
- return Arrays.asList(Standard.class, Production.class);
- }
-
- protected Iterable<URL> getResources(String name)
- {
- if (name.startsWith("/"))
- {
- name = name.substring(1);
- }
- else
- {
- name = getClass().getPackage().getName().replace(".", "/") + "/" + name;
- }
- try
- {
- return new EnumerationIterable<URL>(getClass().getClassLoader().getResources(name));
- }
- catch (IOException e)
- {
- throw new RuntimeException("Error loading resource from classloader" + name, e);
- }
- }
-
- 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();
- }
-
-}
Deleted: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -1,78 +0,0 @@
-package org.jboss.webbeans.test.unit;
-
-import java.net.URL;
-
-import org.jboss.testharness.api.DeploymentException;
-import org.jboss.testharness.spi.StandaloneContainers;
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.mock.MockEELifecycle;
-import org.jboss.webbeans.mock.MockServletLifecycle;
-import org.jboss.webbeans.mock.MockWebBeanDiscovery;
-
-public class StandaloneContainersImpl implements StandaloneContainers
-{
-
- // TODO this is a hack ;-)
- public static Class<? extends MockServletLifecycle> lifecycleClass = MockEELifecycle.class;
-
- private MockServletLifecycle lifecycle;
-
- public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
- {
- try
- {
- this.lifecycle = lifecycleClass.newInstance();
- }
- catch (InstantiationException e1)
- {
- throw new DeploymentException("Error instantiating lifeycle", e1);
- }
- catch (IllegalAccessException e1)
- {
- throw new DeploymentException("Error instantiating lifeycle", e1);
- }
- lifecycle.initialize();
- try
- {
- MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
- discovery.setWebBeanClasses(classes);
- if (beansXml != null)
- {
- discovery.setWebBeansXmlFiles(beansXml);
- }
- lifecycle.beginApplication();
- }
- catch (Exception e)
- {
- throw new DeploymentException("Error deploying beans", e);
- }
- lifecycle.beginSession();
- lifecycle.beginRequest();
- }
-
- public void deploy(Iterable<Class<?>> classes) throws DeploymentException
- {
- deploy(classes, null);
- }
-
- public void cleanup()
- {
- // Np-op
-
- }
-
- public void setup()
- {
- // No-op
- }
-
- public void undeploy()
- {
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
- CurrentManager.setRootManager(null);
- lifecycle = null;
- }
-
-}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -3,7 +3,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -8,7 +8,7 @@
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.jboss.webbeans.WebBean;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -20,11 +20,11 @@
@Test
public void testDeploymentTypesLoadedFromBeansXml()
{
- assert manager.getEnabledDeploymentTypes().size() == 4;
- assert manager.getEnabledDeploymentTypes().get(0).equals(Standard.class);
- assert manager.getEnabledDeploymentTypes().get(1).equals(WebBean.class);
- assert manager.getEnabledDeploymentTypes().get(2).equals(Production.class);
- assert manager.getEnabledDeploymentTypes().get(3).equals(AnotherDeploymentType.class);
+ assert getCurrentManager().getEnabledDeploymentTypes().size() == 4;
+ assert getCurrentManager().getEnabledDeploymentTypes().get(0).equals(Standard.class);
+ assert getCurrentManager().getEnabledDeploymentTypes().get(1).equals(WebBean.class);
+ assert getCurrentManager().getEnabledDeploymentTypes().get(2).equals(Production.class);
+ assert getCurrentManager().getEnabledDeploymentTypes().get(3).equals(AnotherDeploymentType.class);
}
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -11,7 +11,7 @@
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -22,7 +22,7 @@
@Test(groups="bootstrap")
public void testMultipleEnterpriseBean()
{
- List<Bean<?>> beans = manager.getBeans();
+ List<Bean<?>> beans = getCurrentManager().getBeans();
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>, Bean<?>>();
for (Bean<?> bean : beans)
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -12,7 +12,7 @@
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -23,7 +23,7 @@
@Test(groups="bootstrap")
public void testMultipleEnterpriseAndSimpleBean()
{
- List<Bean<?>> beans = manager.getBeans();
+ List<Bean<?>> beans = getCurrentManager().getBeans();
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>, Bean<?>>();
for (Bean<?> bean : beans)
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/BootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/BootstrapTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/BootstrapTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -9,7 +9,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -19,7 +19,7 @@
@Test(groups="bootstrap")
public void testMultipleSimpleBean()
{
- List<Bean<?>> beans = manager.getBeans();
+ List<Bean<?>> beans = getCurrentManager().getBeans();
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>, Bean<?>>();
for (Bean<?> bean : beans)
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/BootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/BootstrapTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/BootstrapTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -10,7 +10,7 @@
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -21,7 +21,7 @@
@Test(groups="bootstrap")
public void testSingleEnterpriseBean()
{
- List<Bean<?>> beans = manager.getBeans();
+ List<Bean<?>> beans = getCurrentManager().getBeans();
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>, Bean<?>>();
for (Bean<?> bean : beans)
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -12,7 +12,7 @@
import org.jboss.webbeans.bean.ProducerMethodBean;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -24,7 +24,7 @@
public void testProducerMethodBean()
{
//deployBeans(TarantulaProducer.class);
- List<Bean<?>> beans = manager.getBeans();
+ List<Bean<?>> beans = getCurrentManager().getBeans();
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>, Bean<?>>();
for (Bean<?> bean : beans)
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -8,7 +8,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -18,7 +18,7 @@
@Test(groups="bootstrap")
public void testSingleSimpleBean()
{
- List<Bean<?>> beans = manager.getBeans();
+ List<Bean<?>> beans = getCurrentManager().getBeans();
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>, Bean<?>>();
for (Bean<?> bean : beans)
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ApplicationScopedTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ApplicationScopedTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ApplicationScopedTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -3,7 +3,7 @@
import java.util.concurrent.CountDownLatch;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -22,7 +22,7 @@
{
try
{
- manager.getInstanceByType(ApplictionScopedObject.class).increment();
+ getCurrentManager().getInstanceByType(ApplictionScopedObject.class).increment();
}
finally
{
@@ -32,7 +32,7 @@
}).start();
}
latch.await();
- int value = manager.getInstanceByType(ApplictionScopedObject.class).getValue();
+ int value = getCurrentManager().getInstanceByType(ApplictionScopedObject.class).getValue();
System.out.println(value);
assert value == 10;
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ContextTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ContextTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ContextTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -2,7 +2,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ParameterizedTypeScopedTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ParameterizedTypeScopedTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ParameterizedTypeScopedTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -5,7 +5,7 @@
import javax.inject.TypeLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -15,7 +15,7 @@
@Test
public void testStringList()
{
- List<String> str = manager.getInstanceByType(new TypeLiteral<List<String>>()
+ List<String> str = getCurrentManager().getInstanceByType(new TypeLiteral<List<String>>()
{
});
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -10,7 +10,7 @@
import org.testng.annotations.Test;
@Artifact
-public class PassivatingContextTest extends org.jboss.webbeans.test.unit.AbstractWebBeansTest
+public class PassivatingContextTest extends org.jboss.webbeans.test.AbstractWebBeansTest
{
/**
@@ -20,7 +20,7 @@
@Test(groups = { "contexts", "passivation" })
public void testIsSessionScopePassivating()
{
- assert manager.getServices().get(MetaDataCache.class).getScopeModel(SessionScoped.class).isPassivating();
+ assert getCurrentManager().getServices().get(MetaDataCache.class).getScopeModel(SessionScoped.class).isPassivating();
}
/**
@@ -30,7 +30,7 @@
@Test(groups = { "contexts", "passivation" })
public void testIsConversationScopePassivating()
{
- assert manager.getServices().get(MetaDataCache.class).getScopeModel(ConversationScoped.class).isPassivating();
+ assert getCurrentManager().getServices().get(MetaDataCache.class).getScopeModel(ConversationScoped.class).isPassivating();
}
/**
@@ -40,7 +40,7 @@
@Test(groups = { "contexts", "passivation" })
public void testIsApplicationScopeNonPassivating()
{
- assert !manager.getServices().get(MetaDataCache.class).getScopeModel(ApplicationScoped.class).isPassivating();
+ assert !getCurrentManager().getServices().get(MetaDataCache.class).getScopeModel(ApplicationScoped.class).isPassivating();
}
/**
@@ -50,7 +50,7 @@
@Test(groups = { "contexts", "passivation" })
public void testIsRequestScopeNonPassivating()
{
- assert !manager.getServices().get(MetaDataCache.class).getScopeModel(RequestScoped.class).isPassivating();
+ assert !getCurrentManager().getServices().get(MetaDataCache.class).getScopeModel(RequestScoped.class).isPassivating();
}
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/ELResolverTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/ELResolverTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/ELResolverTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -4,7 +4,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.webbeans.mock.el.EL;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -7,7 +7,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.webbeans.metadata.StereotypeModel;
import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -12,7 +12,7 @@
import org.jboss.webbeans.bean.NewEnterpriseBean;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.literal.NewLiteral;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.jboss.webbeans.util.Proxies.TypeInfo;
import org.testng.annotations.Test;
@@ -28,13 +28,13 @@
public void initNewBean() {
- assert manager.resolveByType(WrappedEnterpriseBeanLocal.class).size() == 1;
- assert manager.resolveByType(WrappedEnterpriseBeanLocal.class).iterator().next() instanceof EnterpriseBean;
- wrappedEnterpriseBean = (EnterpriseBean<WrappedEnterpriseBeanLocal>) manager.resolveByType(WrappedEnterpriseBeanLocal.class).iterator().next();
+ assert getCurrentManager().resolveByType(WrappedEnterpriseBeanLocal.class).size() == 1;
+ assert getCurrentManager().resolveByType(WrappedEnterpriseBeanLocal.class).iterator().next() instanceof EnterpriseBean;
+ wrappedEnterpriseBean = (EnterpriseBean<WrappedEnterpriseBeanLocal>) getCurrentManager().resolveByType(WrappedEnterpriseBeanLocal.class).iterator().next();
- assert manager.resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).size() == 1;
- assert manager.resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).iterator().next() instanceof NewEnterpriseBean;
- newEnterpriseBean = (NewEnterpriseBean<WrappedEnterpriseBeanLocal>) manager.resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).iterator().next();
+ assert getCurrentManager().resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).size() == 1;
+ assert getCurrentManager().resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).iterator().next() instanceof NewEnterpriseBean;
+ newEnterpriseBean = (NewEnterpriseBean<WrappedEnterpriseBeanLocal>) getCurrentManager().resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).iterator().next();
}
@@ -66,7 +66,7 @@
{
initNewBean();
Class<?> type = TypeInfo.ofTypes(newEnterpriseBean.getTypes()).getSuperClass();
- assert manager.resolveDisposalBeans(type, newEnterpriseBean.getBindings().toArray(new Annotation[0])).isEmpty();
+ assert getCurrentManager().resolveDisposalBeans(type, newEnterpriseBean.getBindings().toArray(new Annotation[0])).isEmpty();
}
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -12,7 +12,7 @@
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -4,7 +4,7 @@
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -9,7 +9,7 @@
import javax.inject.manager.Bean;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -19,7 +19,7 @@
@Test(groups="incontainer-broken")
public void testSerializeSessionBeanInterceptor() throws Exception
{
- Bean<?> foobean = manager.getNewEnterpriseBeanMap().get(Foo.class);
+ Bean<?> foobean = getCurrentManager().getNewEnterpriseBeanMap().get(Foo.class);
assert foobean != null;
MockSessionBeanInterceptor interceptor = new MockSessionBeanInterceptor();
interceptor.postConstruct(new MockInvocationContext());
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ExceptionHandlingTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ExceptionHandlingTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ExceptionHandlingTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -4,7 +4,7 @@
import javax.inject.CreationException;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -22,7 +22,7 @@
{
try
{
- manager.getInstanceByType(Lorry_Broken.class);
+ getCurrentManager().getInstanceByType(Lorry_Broken.class);
}
catch (Exception e)
{
@@ -48,7 +48,7 @@
{
try
{
- manager.getInstanceByType(Ship.class, new AnnotationLiteral<Large>() {});
+ getCurrentManager().getInstanceByType(Ship.class, new AnnotationLiteral<Large>() {});
}
catch (Exception e)
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -9,7 +9,7 @@
import org.jboss.webbeans.bean.SimpleBean;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.literal.NewLiteral;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -22,13 +22,13 @@
public void initNewBean() {
- assert manager.resolveByType(WrappedSimpleBean.class).size() == 1;
- assert manager.resolveByType(WrappedSimpleBean.class).iterator().next() instanceof SimpleBean;
- wrappedSimpleBean = (SimpleBean<WrappedSimpleBean>) manager.resolveByType(WrappedSimpleBean.class).iterator().next();
+ assert getCurrentManager().resolveByType(WrappedSimpleBean.class).size() == 1;
+ assert getCurrentManager().resolveByType(WrappedSimpleBean.class).iterator().next() instanceof SimpleBean;
+ wrappedSimpleBean = (SimpleBean<WrappedSimpleBean>) getCurrentManager().resolveByType(WrappedSimpleBean.class).iterator().next();
- assert manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).size() == 1;
- assert manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).iterator().next() instanceof NewSimpleBean;
- newSimpleBean = (NewSimpleBean<WrappedSimpleBean>) manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).iterator().next();
+ assert getCurrentManager().resolveByType(WrappedSimpleBean.class, NEW_LITERAL).size() == 1;
+ assert getCurrentManager().resolveByType(WrappedSimpleBean.class, NEW_LITERAL).iterator().next() instanceof NewSimpleBean;
+ newSimpleBean = (NewSimpleBean<WrappedSimpleBean>) getCurrentManager().resolveByType(WrappedSimpleBean.class, NEW_LITERAL).iterator().next();
}
@Test(groups = { "new" })
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -6,7 +6,7 @@
import javax.inject.TypeLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -16,11 +16,11 @@
@Test
public void testParameterizedListInjection()
{
- assert manager.getInstanceByType(new TypeLiteral<List<String>>()
+ assert getCurrentManager().getInstanceByType(new TypeLiteral<List<String>>()
{
}).size() == 2;
- ParameterizedListInjection item = manager.getInstanceByType(ParameterizedListInjection.class);
+ ParameterizedListInjection item = getCurrentManager().getInstanceByType(ParameterizedListInjection.class);
assert item.getFieldInjection().size() == 2;
assert item.getValue().size() == 2;
assert item.getSetterInjection().size() == 2;
@@ -30,11 +30,11 @@
@Test
public void testParameterizedCollectionInjection()
{
- assert manager.getInstanceByType(new TypeLiteral<Collection<String>>()
+ assert getCurrentManager().getInstanceByType(new TypeLiteral<Collection<String>>()
{
}).size() == 2;
- ParameterizedCollectionInjection item = manager.getInstanceByType(ParameterizedCollectionInjection.class);
+ ParameterizedCollectionInjection item = getCurrentManager().getInstanceByType(ParameterizedCollectionInjection.class);
assert item.getFieldInjection().size() == 2;
assert item.getValue().size() == 2;
assert item.getSetterInjection().size() == 2;
@@ -44,9 +44,9 @@
@Test
public void testNoParameterizedCollectionInjection()
{
- assert manager.getInstanceByType(Collection.class).size() == 3;
+ assert getCurrentManager().getInstanceByType(Collection.class).size() == 3;
- NoParameterizedCollectionInjection item = manager.getInstanceByType(NoParameterizedCollectionInjection.class);
+ NoParameterizedCollectionInjection item = getCurrentManager().getInstanceByType(NoParameterizedCollectionInjection.class);
assert item.getFieldInjection().size() == 3;
assert item.getValue().size() == 3;
assert item.getSetterInjection().size() == 3;
@@ -56,9 +56,9 @@
@Test
public void testIntegerCollectionInjection()
{
- assert manager.getInstanceByType(new TypeLiteral<Collection<Integer>>(){}).size() == 4;
+ assert getCurrentManager().getInstanceByType(new TypeLiteral<Collection<Integer>>(){}).size() == 4;
- IntegerCollectionInjection item = manager.getInstanceByType(IntegerCollectionInjection.class);
+ IntegerCollectionInjection item = getCurrentManager().getInstanceByType(IntegerCollectionInjection.class);
assert item.getFieldInjection().size() == 4;
assert item.getValue().size() == 4;
assert item.getSetterInjection().size() == 4;
@@ -68,14 +68,14 @@
@Test
public void testInstanceList()
{
- ListInstance listInstance = manager.getInstanceByType(ListInstance.class);
+ ListInstance listInstance = getCurrentManager().getInstanceByType(ListInstance.class);
assert listInstance.get().size() == 3;
}
@Test
public void testTypeParameterInstance()
{
- ListStringInstance listInstance = manager.getInstanceByType(ListStringInstance.class);
+ ListStringInstance listInstance = getCurrentManager().getInstanceByType(ListStringInstance.class);
assert listInstance.get().size() == 2;
}
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/ManagerProducerTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/ManagerProducerTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/ManagerProducerTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -1,7 +1,7 @@
package org.jboss.webbeans.test.unit.implementation.producer.method;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -11,7 +11,7 @@
public void testInjectManagerProducer()
{
ManagerProducer.setInjectionPointInjected(false);
- manager.getInstanceByType(IntInjection.class);
+ getCurrentManager().getInstanceByType(IntInjection.class);
assert ManagerProducer.isInjectionPointInjected();
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -1,7 +1,7 @@
package org.jboss.webbeans.test.unit.implementation.producer.method;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -10,9 +10,9 @@
@Test
public void testNamedProducer()
{
- String[] iemon = (String[]) manager.getInstanceByName("iemon");
+ String[] iemon = (String[]) getCurrentManager().getInstanceByName("iemon");
assert iemon.length == 3;
- String[] itoen = (String[]) manager.getInstanceByName("itoen");
+ String[] itoen = (String[]) getCurrentManager().getInstanceByName("itoen");
assert itoen.length == 2;
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -1,7 +1,7 @@
package org.jboss.webbeans.test.unit.implementation.proxy;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -11,7 +11,7 @@
@Test(description="WBRI-122")
public void testImplementationClassImplementsSerializable()
{
- manager.getInstanceByName("foo");
+ getCurrentManager().getInstanceByName("foo");
}
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -5,7 +5,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -25,7 +25,7 @@
@Override
protected void execute() throws Exception
{
- Object mouse = manager.getInstanceByType(MouseLocal.class);
+ Object mouse = getCurrentManager().getInstanceByType(MouseLocal.class);
assert mouse instanceof ProxyObject;
assert mouse instanceof MouseLocal;
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/LookupInstanceTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/LookupInstanceTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/LookupInstanceTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -7,7 +7,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.webbeans.literal.ObtainsLiteral;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -18,7 +18,7 @@
@Test
public void testLookupInstance() throws Exception
{
- assert manager.getInstanceByType(new TypeLiteral<Instance<List<?>>>(){}, new ObtainsLiteral()) == null;
+ assert getCurrentManager().getInstanceByType(new TypeLiteral<Instance<List<?>>>(){}, new ObtainsLiteral()) == null;
}
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -1,7 +1,7 @@
package org.jboss.webbeans.test.unit.lookup.circular;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -13,7 +13,7 @@
public void testCircularInjectionOnTwoNormalBeans() throws Exception
{
//deployBeans(Pig.class, Food.class);
- manager.getInstanceByType(Pig.class).getName();
+ getCurrentManager().getInstanceByType(Pig.class).getName();
assert Pig.success;
assert Food.success;
}
@@ -28,7 +28,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(Car.class).getName();
+ getCurrentManager().getInstanceByType(Car.class).getName();
assert Petrol.success;
assert Car.success;
}
@@ -47,7 +47,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(Petrol.class).getName();
+ getCurrentManager().getInstanceByType(Petrol.class).getName();
assert Petrol.success;
assert Car.success;
}
@@ -67,7 +67,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(Foo.class).getName();
+ getCurrentManager().getInstanceByType(Foo.class).getName();
assert Foo.success;
assert Bar.success;
}
@@ -85,7 +85,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(DependentSelfConsumingDependentProducer.class).ping();
+ getCurrentManager().getInstanceByType(DependentSelfConsumingDependentProducer.class).ping();
}
}.run();
@@ -101,7 +101,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(NormalSelfConsumingNormalProducer.class).ping();
+ getCurrentManager().getInstanceByType(NormalSelfConsumingNormalProducer.class).ping();
}
}.run();
@@ -117,7 +117,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(DependentSelfConsumingNormalProducer.class).ping();
+ getCurrentManager().getInstanceByType(DependentSelfConsumingNormalProducer.class).ping();
}
}.run();
@@ -133,7 +133,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(NormalSelfConsumingDependentProducer.class).ping();
+ getCurrentManager().getInstanceByType(NormalSelfConsumingDependentProducer.class).ping();
}
}.run();
@@ -149,7 +149,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(Violation.class).ping();
+ getCurrentManager().getInstanceByType(Violation.class).ping();
}
}.run();
@@ -165,7 +165,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(Violation.class).ping();
+ getCurrentManager().getInstanceByType(Violation.class).ping();
}
}.run();
@@ -181,7 +181,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(Fish.class);
+ getCurrentManager().getInstanceByType(Fish.class);
}
}.run();
@@ -197,7 +197,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(Bird.class);
+ getCurrentManager().getInstanceByType(Bird.class);
}
}.run();
@@ -213,7 +213,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(Planet.class);
+ getCurrentManager().getInstanceByType(Planet.class);
}
}.run();
@@ -229,7 +229,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(Farm.class);
+ getCurrentManager().getInstanceByType(Farm.class);
}
}.run();
@@ -245,7 +245,7 @@
@Override
protected void execute() throws Exception
{
- manager.getInstanceByType(House.class);
+ getCurrentManager().getInstanceByType(House.class);
}
}.run();
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -17,7 +17,7 @@
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.literal.CurrentLiteral;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@Artifact
@@ -113,18 +113,18 @@
@Test
public void testRootManagerSerializability() throws Exception
{
- Integer rootManagerId = manager.getId();
- ManagerImpl deserializedRootManager = (ManagerImpl) deserialize(serialize(manager));
+ Integer rootManagerId = getCurrentManager().getId();
+ ManagerImpl deserializedRootManager = (ManagerImpl) deserialize(serialize(getCurrentManager()));
assert deserializedRootManager.getId().equals(rootManagerId);
- assert manager.resolveByType(Foo.class).size() == 1;
+ assert getCurrentManager().resolveByType(Foo.class).size() == 1;
assert deserializedRootManager.resolveByType(Foo.class).size() == 1;
- assert manager.resolveByType(Foo.class).iterator().next().equals(deserializedRootManager.resolveByType(Foo.class).iterator().next());
+ assert getCurrentManager().resolveByType(Foo.class).iterator().next().equals(deserializedRootManager.resolveByType(Foo.class).iterator().next());
}
@Test
public void testChildManagerSerializability() throws Exception
{
- ManagerImpl childManager = manager.createActivity();
+ ManagerImpl childManager = getCurrentManager().createActivity();
Bean<?> dummyBean = new DummyBean(childManager);
childManager.addBean(dummyBean);
Integer childManagerId = childManager.getId();
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/deploy/BeansXmlParserTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/deploy/BeansXmlParserTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/deploy/BeansXmlParserTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -14,7 +14,7 @@
import org.jboss.webbeans.mock.MockResourceLoader;
import org.jboss.webbeans.mock.MockXmlEnvironment;
import org.jboss.webbeans.resources.spi.ResourceLoader;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.jboss.webbeans.xml.XmlEnvironment;
import org.jboss.webbeans.xml.XmlParser;
import org.testng.annotations.Test;
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java 2009-04-06 14:36:06 UTC (rev 2318)
@@ -25,7 +25,7 @@
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.mock.MockXmlEnvironment;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.jboss.webbeans.test.unit.xml.beans.Order;
import org.jboss.webbeans.test.unit.xml.beans.TestBean;
import org.jboss.webbeans.test.unit.xml.beans.TestDeploymentType;
Modified: ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties 2009-04-06 14:18:16 UTC (rev 2317)
+++ ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties 2009-04-06 14:36:06 UTC (rev 2318)
@@ -1,3 +1 @@
-org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.test.unit.StandaloneContainersImpl
-org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
-org.jboss.testharness.testPackage=org.jboss.webbeans.test
\ No newline at end of file
+org.jboss.testharness.testPackage=org.jboss.webbeans.test
15 years, 8 months