[webbeans-commits] Webbeans SVN: r2087 - in ri/trunk: impl and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-03-18 06:53:38 -0400 (Wed, 18 Mar 2009)
New Revision: 2087
Modified:
ri/trunk/impl/pom.xml
ri/trunk/logging/pom.xml
ri/trunk/pom.xml
Log:
Added logging to build process
Modified: ri/trunk/impl/pom.xml
===================================================================
--- ri/trunk/impl/pom.xml 2009-03-18 09:47:11 UTC (rev 2086)
+++ ri/trunk/impl/pom.xml 2009-03-18 10:53:38 UTC (rev 2087)
@@ -81,33 +81,23 @@
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <optional>true</optional>
- </dependency>
-
- <dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</dependency>
-
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</dependency>
-
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<optional>true</optional>
</dependency>
-
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-ri</artifactId>
<optional>true</optional>
</dependency>
-
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
Modified: ri/trunk/logging/pom.xml
===================================================================
--- ri/trunk/logging/pom.xml 2009-03-18 09:47:11 UTC (rev 2086)
+++ ri/trunk/logging/pom.xml 2009-03-18 10:53:38 UTC (rev 2087)
@@ -29,9 +29,4 @@
</dependency>
</dependencies>
-
- <build>
- <defaultGoal>install</defaultGoal>
- </build>
-
</project>
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2009-03-18 09:47:11 UTC (rev 2086)
+++ ri/trunk/pom.xml 2009-03-18 10:53:38 UTC (rev 2087)
@@ -68,6 +68,7 @@
<module>api</module>
<module>spi</module>
<module>core-api</module>
+ <module>logging</module>
<module>impl</module>
<module>tests</module>
<module>porting-package</module>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2086 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-18 05:47:11 -0400 (Wed, 18 Mar 2009)
New Revision: 2086
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
removed ambiguous language
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-18 09:41:01 UTC (rev 2085)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-18 09:47:11 UTC (rev 2086)
@@ -2146,27 +2146,27 @@
<section id="4.1" title="Inheritance of type-level metadata">
<assertion id="aa">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="ab">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="ac">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="ad">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="ae">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="af">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _interceptor binding type_ Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="ag">
@@ -2194,11 +2194,11 @@
</assertion>
<assertion id="ba">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not declare a scope type.</text>
</assertion>
<assertion id="bb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not declare a scope type.</text>
</assertion>
<assertion id="bc">
@@ -2210,11 +2210,11 @@
</assertion>
<assertion id="ca">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a deployment type Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a deployment type.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a deployment type Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not declare a deployment type.</text>
</assertion>
<assertion id="cb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a deployment type Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a deployment type.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a deployment type Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not declare a deployment type.</text>
</assertion>
<assertion id="cc">
@@ -2335,11 +2335,11 @@
</assertion>
<assertion id="baa">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
</assertion>
<assertion id="bab">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
</assertion>
<assertion id="bac">
@@ -2351,11 +2351,11 @@
</assertion>
<assertion id="bba">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
</assertion>
<assertion id="bbb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
</assertion>
<assertion id="bbc">
@@ -2367,11 +2367,11 @@
</assertion>
<assertion id="ca">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x().</text>
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if Y does not override the method x().</text>
</assertion>
<assertion id="cb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x().</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static method_ x() annotated with an interceptor binding type Z then Y inherits the binding if and only if Y does not override the method x().</text>
</assertion>
<assertion id="cc">
@@ -2447,11 +2447,11 @@
</assertion>
<assertion id="fa">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y defines a delegate attribute</text>
+ <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if Y does not define a delegate attribute</text>
</assertion>
<assertion id="fb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y defines a delegate attribute</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if Y is a decorator and X declares a delegate attribute x then Y inherits x if and only if neither Y does not define a delegate attribute</text>
</assertion>
<assertion id="fc">
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2085 - ri/trunk and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-03-18 05:41:01 -0400 (Wed, 18 Mar 2009)
New Revision: 2085
Added:
ri/trunk/logging/
Removed:
extensions/trunk/logging/
Log:
Moving the basic logging project under RI core tree.
Copied: ri/trunk/logging (from rev 2084, extensions/trunk/logging)
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2084 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy: array and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-18 05:32:13 -0400 (Wed, 18 Mar 2009)
New Revision: 2084
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/ArrayTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/InjectionPointBean_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/FinalMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/Tuna_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/InjectionPointBean_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/PrivateConstructorTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/Unproxyable_Broken.java
Log:
proxy tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/ArrayTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/ArrayTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/ArrayTest.java 2009-03-18 09:32:13 UTC (rev 2084)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.array;
+
+import javax.inject.UnproxyableDependencyException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(UnproxyableDependencyException.class)
+public class ArrayTest
+{
+ @Test(groups = "broken")
+ @SpecAssertion(section = "5.4.1", id = "d")
+ public void testInjectionPointWithArrayType()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/InjectionPointBean_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/InjectionPointBean_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/InjectionPointBean_Broken.java 2009-03-18 09:32:13 UTC (rev 2084)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.array;
+
+import javax.inject.Instance;
+import javax.inject.Obtains;
+
+public class InjectionPointBean_Broken
+{
+ @Obtains Instance<String[]> foo;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/AnotherDeploymentType.java 2009-03-18 09:32:13 UTC (rev 2084)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.finalmethod;
+
+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 })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
+
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/FinalMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/FinalMethodTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/FinalMethodTest.java 2009-03-18 09:32:13 UTC (rev 2084)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.finalmethod;
+
+import javax.inject.UnproxyableDependencyException;
+
+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.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(UnproxyableDependencyException.class)
+public class FinalMethodTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "5.4.1", id = "bb")
+ public void testClassWithFinalMethodCannotBeProxied()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/Tuna_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/Tuna_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/finalmethod/Tuna_Broken.java 2009-03-18 09:32:13 UTC (rev 2084)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.finalmethod;
+
+import javax.context.RequestScoped;
+
+@AnotherDeploymentType
+@RequestScoped
+class Tuna_Broken
+{
+ public final String getFoo() { return null; }
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/AnotherDeploymentType.java 2009-03-18 09:32:13 UTC (rev 2084)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.privateconstructor;
+
+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 })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/InjectionPointBean_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/InjectionPointBean_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/InjectionPointBean_Broken.java 2009-03-18 09:32:13 UTC (rev 2084)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.privateconstructor;
+
+import javax.inject.Instance;
+import javax.inject.Obtains;
+
+class InjectionPointBean_Broken
+{
+ @Obtains Instance<Unproxyable_Broken> foo;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/PrivateConstructorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/PrivateConstructorTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/PrivateConstructorTest.java 2009-03-18 09:32:13 UTC (rev 2084)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.privateconstructor;
+
+import javax.inject.UnproxyableDependencyException;
+
+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.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+
+@Artifact
+(a)ExpectedDeploymentException(UnproxyableDependencyException.class)
+public class PrivateConstructorTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "5.4.1", id = "a")
+ public void testClassWithPrivateConstructor()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/Unproxyable_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/Unproxyable_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/Unproxyable_Broken.java 2009-03-18 09:32:13 UTC (rev 2084)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.privateconstructor;
+
+import javax.context.RequestScoped;
+
+@AnotherDeploymentType
+@RequestScoped
+class Unproxyable_Broken
+{
+ private Unproxyable_Broken()
+ {
+
+ }
+}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2083 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: implementation/simple/lifecycle and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-18 05:30:58 -0400 (Wed, 18 Mar 2009)
New Revision: 2083
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IndirectOrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IntermediateOrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/MegaPoorHenHouse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/PoorHenHouse.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java
Log:
inheritance tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-03-18 08:27:05 UTC (rev 2082)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-03-18 09:30:58 UTC (rev 2083)
@@ -200,6 +200,7 @@
@SpecAssertion(section = "4.2", id = "da")
public void testNonStaticProducerMethodNotInherited()
{
+ // TODO - does this even test the assertion correctly? where is class Y?
assert getCurrentManager().resolveByType(Egg.class, new AnnotationLiteral<Yummy>() {}).size() == 1;
System.out.println(getCurrentManager().getInstanceByType(Egg.class, new AnnotationLiteral<Yummy>() {}).getMother().getClass());
assert getCurrentManager().getInstanceByType(Egg.class, new AnnotationLiteral<Yummy>() {}).getMother().getClass().equals(Chicken.class);
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IndirectOrderProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IndirectOrderProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IndirectOrderProcessor.java 2009-03-18 09:30:58 UTC (rev 2083)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+class IndirectOrderProcessor extends IntermediateOrderProcessor
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IntermediateOrderProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IntermediateOrderProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/IntermediateOrderProcessor.java 2009-03-18 09:30:58 UTC (rev 2083)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+class IntermediateOrderProcessor extends OrderProcessor
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-03-18 08:27:05 UTC (rev 2082)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-03-18 09:30:58 UTC (rev 2083)
@@ -165,6 +165,23 @@
}.run();
assert OrderProcessor.postConstructCalled;
}
+
+ @Test
+ @SpecAssertion(section = "4.2", id = "bac")
+ public void testIndirectSubClassInheritsPostConstructOnSuperclass() throws Exception
+ {
+ OrderProcessor.postConstructCalled = false;
+ assert getCurrentManager().resolveByType(IndirectOrderProcessor.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(IndirectOrderProcessor.class).order();
+ }
+ }.run();
+ assert OrderProcessor.postConstructCalled;
+ }
@Test
@SpecAssertion(section = "4.2", id = "bba")
@@ -184,6 +201,25 @@
}.run();
assert OrderProcessor.preDestroyCalled;
}
+
+ @Test
+ @SpecAssertion(section = "4.2", id = "bbc")
+ public void testIndirectSubClassInheritsPreDestroyOnSuperclass() throws Exception
+ {
+ OrderProcessor.preDestroyCalled = false;
+ assert getCurrentManager().resolveByType(IndirectOrderProcessor.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<IndirectOrderProcessor> bean = getCurrentManager().resolveByType(IndirectOrderProcessor.class).iterator().next();
+ IndirectOrderProcessor instance = getCurrentManager().getInstanceByType(IndirectOrderProcessor.class);
+ bean.destroy(instance);
+ }
+ }.run();
+ assert OrderProcessor.preDestroyCalled;
+ }
@Test
@SpecAssertion(section = "4.2", id = "baa")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-03-18 08:27:05 UTC (rev 2082)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-03-18 09:30:58 UTC (rev 2083)
@@ -29,7 +29,7 @@
}
@Test
- @SpecAssertion(section="unknown", id="unknown")
+ @SpecAssertion(section="5.10", id="c")
public void testQualifiedNameLookup()
{
assert getCurrentConfiguration().getEl().evaluateValueExpression("#{javax.context.conversation}", Conversation.class) != null;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-03-18 08:27:05 UTC (rev 2082)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-03-18 09:30:58 UTC (rev 2083)
@@ -64,6 +64,22 @@
}
}.run();
}
+
+ @Test
+ @SpecAssertion(section="4.2", id = "ac")
+ public void testFieldDeclaredInIndirectSuperclassInjected() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ MegaPoorHenHouse henHouse = getCurrentManager().getInstanceByType(MegaPoorHenHouse.class);
+ assert henHouse.fox != null;
+ assert henHouse.fox.getName().equals("gavin");
+ }
+ }.run();
+ }
@Test(groups = { "stub", "injection", "webbeansxml" })
@SpecAssertion(section = "3.8.2", id = "a")
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/MegaPoorHenHouse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/MegaPoorHenHouse.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/MegaPoorHenHouse.java 2009-03-18 09:30:58 UTC (rev 2083)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.injection;
+
+public class MegaPoorHenHouse extends PoorHenHouse
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/PoorHenHouse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/PoorHenHouse.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/PoorHenHouse.java 2009-03-18 09:30:58 UTC (rev 2083)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.injection;
+
+public class PoorHenHouse extends HenHouse
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java 2009-03-18 08:27:05 UTC (rev 2082)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java 2009-03-18 09:30:58 UTC (rev 2083)
@@ -5,6 +5,7 @@
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.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
import org.testng.annotations.Test;
@@ -13,11 +14,12 @@
*
* Spec version: PRD2
*/
+@IntegrationTest
@Artifact
@Packaging(PackagingType.EAR)
public class SessionBeanInjectionTest extends AbstractJSR299Test
{
- @Test(groups = "broken")
+ @Test//(groups = "broken")
@SpecAssertion(section = "4.2", id = "ab")
public void testFieldDeclaredInSessionBeanSuperclassInjected() throws Exception
{
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2082 - in extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd: helpers and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-03-18 04:27:05 -0400 (Wed, 18 Mar 2009)
New Revision: 2082
Modified:
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java
Log:
xsd stuff
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java 2009-03-18 06:31:05 UTC (rev 2081)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java 2009-03-18 08:27:05 UTC (rev 2082)
@@ -42,6 +42,11 @@
// Namespace infos
private Map<String, SchemaNamespace> schemaNamespaces = new HashMap<String, SchemaNamespace>();
+ public Map<String, SchemaNamespace> getSchemaNamespaces()
+ {
+ return schemaNamespaces;
+ }
+
/**
* Creats a new namespace generator
*
@@ -59,14 +64,14 @@
* @author Nicklas Karlsson
*
*/
- private class SchemaNamespace
+ public class SchemaNamespace
{
// The package name
String packageName;
// The full namespace
- String namespace;
- // The namespace abbreviation
String shortNamespace;
+ // The urn
+ String urn;
// Is this a EE reserved package?
boolean ee;
@@ -74,13 +79,15 @@
{
this.packageName = packageName;
this.shortNamespace = shortNamespace;
- // Skip ":" for default namespace
- String colon = "".equals(shortNamespace) ? "" : ":";
- // Hardcode "ee" for EE reserved packages
- String url = ee ? "ee" : packageName;
- this.namespace = "xmlns" + colon + shortNamespace + "=\"urn:java:" + url + "\"";
this.ee = ee;
+ this.urn = "urn:java:" + (ee ? "ee" : packageName);
}
+
+ @Override
+ public String toString()
+ {
+ return shortNamespace + "=" + urn;
+ }
}
/**
@@ -88,16 +95,15 @@
*
* @return The used namespaces
*/
- public Set<String> getUsedNamespaces()
- {
- Set<String> usedNamespaces = new HashSet<String>();
- for (SchemaNamespace schemaNamespace : schemaNamespaces.values())
- {
- usedNamespaces.add(schemaNamespace.namespace);
- }
- return usedNamespaces;
- }
-
+ // public Set<String> getUsedNamespaces()
+ // {
+ // Set<String> usedNamespaces = new HashSet<String>();
+ // for (SchemaNamespace schemaNamespace : schemaNamespaces.values())
+ // {
+ // usedNamespaces.add(schemaNamespace.getFullNamespace());
+ // }
+ // return usedNamespaces;
+ // }
/**
* Gets a namespace abbreviation for a package
*
@@ -106,9 +112,10 @@
*/
public String getShortNamespace(String packageName)
{
- if (schemaNamespaces.containsKey(packageName))
+ String shortName = getPackageName(packageName);
+ if (schemaNamespaces.containsKey(shortName))
{
- return schemaNamespaces.get(packageName).shortNamespace;
+ return schemaNamespaces.get(shortName).shortNamespace;
}
else
{
@@ -128,6 +135,12 @@
return lastDot < 0 ? packageName : packageName.substring(lastDot + 1);
}
+ private String getPackageName(String FQN)
+ {
+ int lastDot = FQN.lastIndexOf(".");
+ return lastDot < 0 ? "nopak" : FQN.substring(0, lastDot);
+ }
+
public void addPackage(String packageName)
{
if (schemaNamespaces.containsKey(packageName))
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-18 06:31:05 UTC (rev 2081)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-18 08:27:05 UTC (rev 2082)
@@ -94,7 +94,7 @@
private ClassModel inspectClass(Element element)
{
TypeElement typeElement = (TypeElement) element;
- ClassModel classModel = new ClassModel(typeElement.getQualifiedName().toString());
+ ClassModel classModel = ClassModel.of(typeElement);
// If the class has superclass's, scan them recursively
if (typeElement.getSuperclass().getKind() != TypeKind.NONE)
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java 2009-03-18 06:31:05 UTC (rev 2081)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java 2009-03-18 08:27:05 UTC (rev 2082)
@@ -24,6 +24,7 @@
import org.dom4j.Document;
import org.dom4j.DocumentFactory;
+import org.jboss.webbeans.xsd.NamespaceHandler.SchemaNamespace;
import org.jboss.webbeans.xsd.model.ClassModel;
import org.jboss.webbeans.xsd.model.TypedModel;
@@ -76,22 +77,20 @@
this.packageName = packageName;
}
- public Set<String> getNamespaces()
- {
- return namespaceHandler.getUsedNamespaces();
- }
+// public Set<String> getNamespaces()
+// {
+// return namespaceHandler.getUsedNamespaces();
+// }
public void rebuild(PackageElement packageElement)
{
- for (String namespace : namespaceHandler.getUsedNamespaces())
+ for (SchemaNamespace schemaNamespace : namespaceHandler.getSchemaNamespaces().values())
{
- document.getRootElement().addNamespace("x", namespace);
+ document.getRootElement().addNamespace(schemaNamespace.shortNamespace, schemaNamespace.urn);
}
for (ClassModel classModel : classModels)
{
- org.dom4j.Element classElement = DocumentFactory.getInstance().createElement("element");
- classElement.addAttribute("name", classModel.getSimpleName());
- document.getRootElement().add(classElement);
+ document.getRootElement().add(classModel.toXSD(namespaceHandler));
}
// System.out.println("Current contents of package " + packageName);
// for (Element e : packageElement.getEnclosedElements())
@@ -106,9 +105,9 @@
StringBuilder buffer = new StringBuilder();
buffer.append("Package: " + packageName + "\n");
buffer.append("Used namespaces\n");
- for (String namespace : namespaceHandler.getUsedNamespaces())
+ for (SchemaNamespace schemaNamespace : namespaceHandler.getSchemaNamespaces().values())
{
- buffer.append(" " + namespace + "\n");
+ buffer.append(" " + schemaNamespace + "\n");
}
buffer.append("Contained classes:\n");
for (ClassModel classModel : classModels)
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java 2009-03-18 06:31:05 UTC (rev 2081)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java 2009-03-18 08:27:05 UTC (rev 2082)
@@ -162,11 +162,11 @@
}
catch (DocumentException e)
{
- throw new RuntimeException("Could not parse schema for package " + packageName);
+ throw new RuntimeException("Could not parse schema for package " + packageName, e);
}
catch (IOException e)
{
- throw new RuntimeException("Could not read schema for package " + packageName);
+ throw new RuntimeException("Could not read schema for package " + packageName, e);
}
schemaMap.put(packageName, schema);
}
@@ -187,11 +187,14 @@
System.out.println(schema.getDocument().asXML());
try
{
- writeSchema(schema);
+ if (1 == 2)
+ {
+ writeSchema(schema);
+ }
}
catch (IOException e)
{
- throw new RuntimeException("Could not write schema for " + schema.getPackageName());
+ throw new RuntimeException("Could not write schema for " + schema.getPackageName(), e);
}
}
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-18 06:31:05 UTC (rev 2081)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-18 08:27:05 UTC (rev 2082)
@@ -22,6 +22,12 @@
import java.util.List;
import java.util.Set;
+import javax.lang.model.element.TypeElement;
+
+import org.dom4j.DocumentFactory;
+import org.dom4j.Element;
+import org.jboss.webbeans.xsd.NamespaceHandler;
+
/**
* A model of a class
*
@@ -40,7 +46,7 @@
// The constructors of the class
private List<MethodModel> constructors = new ArrayList<MethodModel>();
- public ClassModel(String name)
+ protected ClassModel(String name)
{
super(name);
}
@@ -224,4 +230,28 @@
return buffer.toString();
}
+ public static ClassModel of(TypeElement typeElement)
+ {
+ return new ClassModel(typeElement.getQualifiedName().toString());
+ }
+
+ public Element toXSD(NamespaceHandler namespaceHandler)
+ {
+ Element classElement = DocumentFactory.getInstance().createElement("element");
+ classElement.addAttribute("name", getSimpleName());
+ for (MethodModel constructor : getMergedConstructors())
+ {
+ classElement.add(constructor.toXSD(namespaceHandler));
+ }
+ for (NamedModel field : getMergedFields())
+ {
+ classElement.add(field.toXSD(namespaceHandler));
+ }
+ for (MethodModel method : getMergedMethods())
+ {
+ classElement.add(method.toXSD(namespaceHandler));
+ }
+ return classElement;
+ }
+
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-18 06:31:05 UTC (rev 2081)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-18 08:27:05 UTC (rev 2082)
@@ -20,6 +20,9 @@
import java.util.ArrayList;
import java.util.List;
+import org.dom4j.Element;
+import org.jboss.webbeans.xsd.NamespaceHandler;
+
/**
* The model of a method
*
@@ -64,4 +67,15 @@
return "\n " + name + "(" + (parameters.isEmpty() ? "" : parameters) + ")";
}
+ @Override
+ public Element toXSD(NamespaceHandler namespaceHandler)
+ {
+ Element method = super.toXSD(namespaceHandler);
+ for (TypedModel parameter : parameters)
+ {
+ method.add(parameter.toXSD(namespaceHandler));
+ }
+ return method;
+ }
+
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java 2009-03-18 06:31:05 UTC (rev 2081)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java 2009-03-18 08:27:05 UTC (rev 2082)
@@ -17,6 +17,10 @@
package org.jboss.webbeans.xsd.model;
+import org.dom4j.DocumentFactory;
+import org.dom4j.Element;
+import org.jboss.webbeans.xsd.NamespaceHandler;
+
/**
* A superclass for named models
*
@@ -55,4 +59,11 @@
{
return name.hashCode();
}
+
+ public Element toXSD(NamespaceHandler namespaceHandler)
+ {
+ Element item = DocumentFactory.getInstance().createElement("element");
+ item.addAttribute("name", name);
+ return item;
+ }
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java 2009-03-18 06:31:05 UTC (rev 2081)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java 2009-03-18 08:27:05 UTC (rev 2082)
@@ -17,6 +17,10 @@
package org.jboss.webbeans.xsd.model;
+import org.dom4j.DocumentFactory;
+import org.dom4j.Element;
+import org.jboss.webbeans.xsd.NamespaceHandler;
+
/**
* The model of a typed member
*
@@ -88,4 +92,12 @@
return type.hashCode();
}
+ public Element toXSD(NamespaceHandler namespaceHandler)
+ {
+ String namespace = isPrimitive() ? "" : namespaceHandler.getShortNamespace(type);
+ Element item = DocumentFactory.getInstance().createElement("element");
+ item.addAttribute("type", type);
+ return item;
+ }
+
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2081 - ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-18 02:31:05 -0400 (Wed, 18 Mar 2009)
New Revision: 2081
Modified:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Generator.java
Log:
don't dispense the same random number twice in a row, otherwise 1/100 test runs will fail
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Generator.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Generator.java 2009-03-18 05:53:53 UTC (rev 2080)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Generator.java 2009-03-18 06:31:05 UTC (rev 2081)
@@ -6,6 +6,7 @@
@ApplicationScoped
public class Generator {
+ private int lastInt = 0;
private java.util.Random random = new java.util.Random( System.currentTimeMillis() );
java.util.Random getRandom()
@@ -13,8 +14,14 @@
return random;
}
- @Produces @Random int next() {
- return getRandom().nextInt(100);
+ @Produces @Random int next() {
+ int nextInt = getRandom().nextInt(100);
+ while (nextInt == lastInt)
+ {
+ nextInt = getRandom().nextInt(100);
+ }
+ lastInt = nextInt;
+ return nextInt;
}
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2080 - in extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd: helpers and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-03-18 01:53:53 -0400 (Wed, 18 Mar 2009)
New Revision: 2080
Modified:
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java
Log:
Some more xsd stuff
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java 2009-03-18 01:38:30 UTC (rev 2079)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/NamespaceHandler.java 2009-03-18 05:53:53 UTC (rev 2080)
@@ -128,20 +128,6 @@
return lastDot < 0 ? packageName : packageName.substring(lastDot + 1);
}
- // TODO testing, remove
- public static void main(String[] params)
- {
- NamespaceHandler ng = new NamespaceHandler("com.acme.foo");
- System.out.println(ng.getShortNamespace("com.acme.foo"));
- System.out.println(ng.getShortNamespace("com.acme.foo.foo"));
- System.out.println(ng.getShortNamespace("com.acme.foo.foo.foo"));
- System.out.println(ng.getShortNamespace("java.util"));
- for (String ns : ng.getUsedNamespaces())
- {
- System.out.println(ns);
- }
- }
-
public void addPackage(String packageName)
{
if (schemaNamespaces.containsKey(packageName))
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-18 01:38:30 UTC (rev 2079)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-18 05:53:53 UTC (rev 2080)
@@ -94,9 +94,8 @@
private ClassModel inspectClass(Element element)
{
TypeElement typeElement = (TypeElement) element;
-
- ClassModel classModel = new ClassModel();
-
+ ClassModel classModel = new ClassModel(typeElement.getQualifiedName().toString());
+
// If the class has superclass's, scan them recursively
if (typeElement.getSuperclass().getKind() != TypeKind.NONE)
{
@@ -104,11 +103,8 @@
}
// Gets the parent from the cache. We know it's there since we has scanned
- // the
- // hierarchy already
- ClassModel parent = helper.getCachedClassModel(typeElement.getSuperclass().toString());
- // Populate the class level info (name, parent etc)
- DataSetter.populateClassModel(classModel, element, parent);
+ // the hierarchy already
+ classModel.setParent(helper.getCachedClassModel(typeElement.getSuperclass().toString()));
// Filter out the fields and populate the model
for (Element field : ElementFilter.fieldsIn(element.getEnclosedElements()))
{
@@ -126,7 +122,6 @@
}
// Place the new class model in the cache
helper.cacheClassModel(classModel);
- System.out.println(classModel);
return classModel;
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java 2009-03-18 01:38:30 UTC (rev 2079)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/Schema.java 2009-03-18 05:53:53 UTC (rev 2080)
@@ -20,10 +20,10 @@
import java.util.HashSet;
import java.util.Set;
-import javax.lang.model.element.Element;
import javax.lang.model.element.PackageElement;
import org.dom4j.Document;
+import org.dom4j.DocumentFactory;
import org.jboss.webbeans.xsd.model.ClassModel;
import org.jboss.webbeans.xsd.model.TypedModel;
@@ -83,11 +83,39 @@
public void rebuild(PackageElement packageElement)
{
- System.out.println("Stuff in " + packageName);
- for (Element e : packageElement.getEnclosedElements())
+ for (String namespace : namespaceHandler.getUsedNamespaces())
{
- System.out.println(e.asType().toString());
+ document.getRootElement().addNamespace("x", namespace);
}
+ for (ClassModel classModel : classModels)
+ {
+ org.dom4j.Element classElement = DocumentFactory.getInstance().createElement("element");
+ classElement.addAttribute("name", classModel.getSimpleName());
+ document.getRootElement().add(classElement);
+ }
+ // System.out.println("Current contents of package " + packageName);
+ // for (Element e : packageElement.getEnclosedElements())
+ // {
+ // System.out.println(e.asType().toString());
+ // }
}
+ @Override
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("Package: " + packageName + "\n");
+ buffer.append("Used namespaces\n");
+ for (String namespace : namespaceHandler.getUsedNamespaces())
+ {
+ buffer.append(" " + namespace + "\n");
+ }
+ buffer.append("Contained classes:\n");
+ for (ClassModel classModel : classModels)
+ {
+ buffer.append(classModel + "\n");
+ }
+ return buffer.toString();
+ }
+
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java 2009-03-18 01:38:30 UTC (rev 2079)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java 2009-03-18 05:53:53 UTC (rev 2080)
@@ -20,9 +20,7 @@
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
-import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
-import javax.lang.model.type.TypeKind;
import org.jboss.webbeans.xsd.model.ClassModel;
import org.jboss.webbeans.xsd.model.MethodModel;
@@ -50,20 +48,6 @@
}
/**
- * Inspects a type element and populates a class model
- *
- * @param classModel The class model to populate
- * @param element The element to inspect
- * @param parent The parent of the class
- */
- public static void populateClassModel(ClassModel classModel, Element element, ClassModel parent)
- {
- TypeElement typeElement = (TypeElement) element;
- classModel.setName(typeElement.getQualifiedName().toString());
- classModel.setParent(parent);
- }
-
- /**
* Inspects a field element and populates a class model
*
* @param classModel The class model to populate
@@ -75,9 +59,7 @@
{
return;
}
- String name = element.getSimpleName().toString();
- NamedModel field = new NamedModel();
- field.setName(name);
+ NamedModel field = new NamedModel(element.getSimpleName().toString());
classModel.addField(field);
}
@@ -95,26 +77,16 @@
}
ExecutableElement executableElement = (ExecutableElement) element;
- String name = element.getSimpleName().toString();
-
- TypedModel returnType = new TypedModel();
- returnType.setType(executableElement.getReturnType().toString());
- returnType.setPrimitive(executableElement.getReturnType().getKind().isPrimitive() || executableElement.getReturnType().getKind() == TypeKind.VOID);
-
- MethodModel method = new MethodModel();
- method.setName(name);
-
+ MethodModel method = new MethodModel(element.getSimpleName().toString());
+
for (VariableElement parameterElement : executableElement.getParameters())
{
- String paramType = parameterElement.asType().toString();
- boolean paramPrimitive = parameterElement.asType().getKind().isPrimitive();
- TypedModel parameter = new TypedModel();
- parameter.setType(paramType);
- parameter.setPrimitive(paramPrimitive);
+ boolean primitive = parameterElement.asType().getKind().isPrimitive();
+ TypedModel parameter = new TypedModel(parameterElement.asType().toString(), primitive);
method.addParameter(parameter);
}
// OK, cheating a little with a common model for methods and constructors
- if ("<init>".equals(name))
+ if ("<init>".equals(method.getName()))
{
classModel.addConstructor(method);
}
@@ -123,5 +95,5 @@
classModel.addMethod(method);
}
}
-
+
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java 2009-03-18 01:38:30 UTC (rev 2079)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java 2009-03-18 05:53:53 UTC (rev 2080)
@@ -30,7 +30,10 @@
import org.dom4j.Document;
import org.dom4j.DocumentException;
+import org.dom4j.DocumentFactory;
import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.QName;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
@@ -74,9 +77,17 @@
{
Schema schema = new Schema(packageName);
Document document = readSchema(packageName);
- if (document == null) {
+ if (document == null)
+ {
document = DocumentHelper.createDocument();
- document.addElement("schema");
+ QName rootQName = DocumentFactory.getInstance().createQName("schema", "xs", "http://www.w3.org/2001/XMLSchema");
+ Element rootElement = DocumentFactory.getInstance().createElement(rootQName);
+ rootElement.addAttribute("elementFormDefault", "qualified");
+ rootElement.addAttribute("targetNamespace", "urn:java:" + packageName);
+ rootElement.addAttribute("elementFormDefault", "qualified");
+ rootElement.addNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
+ rootElement.addAttribute("xsi:schemaLocation", "http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd");
+ document.setRootElement(rootElement);
}
schema.setDocument(document);
return schema;
@@ -165,14 +176,15 @@
/**
* Writes the schemas back to disk
- * @param packageModels
+ *
+ * @param packageModels
*/
public void writeSchemas(Map<String, PackageElement> packageModels)
{
for (Schema schema : schemaMap.values())
{
schema.rebuild(packageModels.get(schema.getPackageName()));
- System.out.println(schema.getPackageName() + " (" + schema.getNamespaces() + ")");
+ System.out.println(schema.getDocument().asXML());
try
{
writeSchema(schema);
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-18 01:38:30 UTC (rev 2079)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-18 05:53:53 UTC (rev 2080)
@@ -40,6 +40,11 @@
// The constructors of the class
private List<MethodModel> constructors = new ArrayList<MethodModel>();
+ public ClassModel(String name)
+ {
+ super(name);
+ }
+
/**
* Adds a field to the class model
*
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-18 01:38:30 UTC (rev 2079)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-18 05:53:53 UTC (rev 2080)
@@ -24,12 +24,17 @@
* The model of a method
*
* @author Nicklas Karlsson
- *
+ *
*/
public class MethodModel extends NamedModel
{
private List<TypedModel> parameters = new ArrayList<TypedModel>();
+ public MethodModel(String name)
+ {
+ super(name);
+ }
+
public List<TypedModel> getParameters()
{
return parameters;
@@ -52,7 +57,7 @@
{
return name.hashCode() + parameters.hashCode();
}
-
+
@Override
public String toString()
{
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java 2009-03-18 01:38:30 UTC (rev 2079)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java 2009-03-18 05:53:53 UTC (rev 2080)
@@ -27,14 +27,14 @@
{
protected String name;
- public String getName()
+ public NamedModel(String name)
{
- return name;
+ this.name = name;
}
- public void setName(String name)
+ public String getName()
{
- this.name = name;
+ return name;
}
@Override
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java 2009-03-18 01:38:30 UTC (rev 2079)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java 2009-03-18 05:53:53 UTC (rev 2080)
@@ -28,6 +28,12 @@
protected String type;
protected boolean primitive;
+ public TypedModel(String type, boolean primitive)
+ {
+ this.type = type;
+ this.primitive = primitive;
+ }
+
public String getType()
{
return type;
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java 2009-03-18 01:38:30 UTC (rev 2079)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java 2009-03-18 05:53:53 UTC (rev 2080)
@@ -13,6 +13,7 @@
public int poo;
public Bar bar;
public org.jboss.webbeans.xsd.test.test.Foo foo2;
+ public org.jboss.webbeans.xsd.test.test.test.Tar tar2;
public Tar tar;
@Initializer
@@ -26,7 +27,7 @@
return foo;
}
- public void testy() {
+ public void testy(org.jboss.webbeans.xsd.test.test.Foo a, org.jboss.webbeans.xsd.test.test.test.Tar b) {
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2079 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 18 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-17 21:38:30 -0400 (Tue, 17 Mar 2009)
New Revision: 2079
Added:
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingServiceRegistry.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ServiceRegistries.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java
ri/trunk/tests/temp-testng-customsuite.xml
ri/trunk/tests/test-output/
ri/trunk/tests/test-output/emailable-report.html
ri/trunk/tests/test-output/index.html
ri/trunk/tests/test-output/testng-failed.xml
ri/trunk/tests/test-output/testng-results.xml
ri/trunk/tests/test-output/testng.css
ri/trunk/tests/test-output/webbeans-core-tests/
ri/trunk/tests/test-output/webbeans-core-tests/classes.html
ri/trunk/tests/test-output/webbeans-core-tests/groups.html
ri/trunk/tests/test-output/webbeans-core-tests/index.html
ri/trunk/tests/test-output/webbeans-core-tests/main.html
ri/trunk/tests/test-output/webbeans-core-tests/methods-alphabetical.html
ri/trunk/tests/test-output/webbeans-core-tests/methods-not-run.html
ri/trunk/tests/test-output/webbeans-core-tests/methods.html
ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.html
ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.properties
ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.xml
ri/trunk/tests/test-output/webbeans-core-tests/reporter-output.html
ri/trunk/tests/test-output/webbeans-core-tests/testng-failed.xml
ri/trunk/tests/test-output/webbeans-core-tests/testng.xml.html
ri/trunk/tests/test-output/webbeans-core-tests/toc.html
Removed:
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/JSFApiAbstraction.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ServletApiAbstraction.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/AbstractBootstrap.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/api/SessionObjectReference.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/MockEjbServices.java
Log:
More fixes to SPI and oterh cleanups
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -131,7 +131,7 @@
private transient final Set<Interceptor> interceptors;
// The EJB resolver provided by the container
- private transient final ServiceRegistry serviceRegistry;
+ private transient final ServiceRegistry simpleServiceRegistry;
private transient final EjbDescriptorCache ejbDescriptorCache;
@@ -144,9 +144,9 @@
*
* @param ejbServices the ejbResolver to use
*/
- public ManagerImpl(ServiceRegistry serviceRegistry)
+ public ManagerImpl(ServiceRegistry simpleServiceRegistry)
{
- this.serviceRegistry = serviceRegistry;
+ this.simpleServiceRegistry = simpleServiceRegistry;
this.beans = new CopyOnWriteArrayList<Bean<?>>();
this.newEnterpriseBeanMap = new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>();
this.riBeans = new ConcurrentHashMap<String, RIBean<?>>();
@@ -888,7 +888,7 @@
public ServiceRegistry getServices()
{
- return serviceRegistry;
+ return simpleServiceRegistry;
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -35,7 +35,6 @@
import javax.inject.DefinitionException;
import javax.interceptor.Interceptor;
-import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bean.proxy.EnterpriseBeanInstance;
import org.jboss.webbeans.bean.proxy.EnterpriseBeanProxyMethodHandler;
@@ -49,7 +48,6 @@
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.util.Proxies;
/**
@@ -382,7 +380,7 @@
public SessionObjectReference createReference()
{
- return manager.getServices().get(EjbServices.class).resolveEJB(getEjbDescriptor(), CurrentManager.rootManager().getServices().get(NamingContext.class));
+ return manager.getServices().get(EjbServices.class).resolveEjb(getEjbDescriptor());
}
}
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-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.bean;
+import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.Set;
@@ -25,12 +26,11 @@
import javax.context.CreationalContext;
import javax.inject.DefinitionException;
import javax.inject.Initializer;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.context.DependentStorageRequest;
+import org.jboss.webbeans.ejb.EJBApiAbstraction;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
import org.jboss.webbeans.injection.ConstructorInjectionPoint;
@@ -217,13 +217,14 @@
protected void initEjbInjectionPoints()
{
+ Class<? extends Annotation> ejbAnnotationType = manager.getServices().get(EJBApiAbstraction.class).EJB_ANNOTATION_CLASS;
this.ejbInjectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
- for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(manager.getServices().get(EjbServices.class).getEJBAnnotation()))
+ for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(ejbAnnotationType))
{
this.ejbInjectionPoints.add(FieldInjectionPoint.of(this, field));
}
- for (AnnotatedMethod<?> method : annotatedItem.getAnnotatedMethods(manager.getServices().get(EjbServices.class).getEJBAnnotation()))
+ for (AnnotatedMethod<?> method : annotatedItem.getAnnotatedMethods(ejbAnnotationType))
{
this.ejbInjectionPoints.add(MethodInjectionPoint.of(this, method));
}
@@ -232,18 +233,21 @@
protected void initPersistenceUnitInjectionPoints()
{
this.persistenceUnitInjectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
- for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(manager.getServices().get(EjbServices.class).getPersistenceContextAnnotation()))
+ Class<? extends Annotation> persistenceContextAnnotationType = manager.getServices().get(EJBApiAbstraction.class).PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
+ Object extendedPersistenceContextEnum = manager.getServices().get(EJBApiAbstraction.class).EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
+
+ for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(persistenceContextAnnotationType))
{
- if (field.getAnnotation(PersistenceContext.class).type().equals(PersistenceContextType.EXTENDED))
+ if (extendedPersistenceContextEnum.equals(Reflections.invokeAndWrap("type", field.getAnnotation(persistenceContextAnnotationType))))
{
throw new DefinitionException("Cannot inject an extended persistence context into " + field);
}
this.persistenceUnitInjectionPoints.add(FieldInjectionPoint.of(this, field));
}
- for (AnnotatedMethod<?> method : annotatedItem.getAnnotatedMethods(manager.getServices().get(EjbServices.class).getPersistenceContextAnnotation()))
+ for (AnnotatedMethod<?> method : annotatedItem.getAnnotatedMethods(persistenceContextAnnotationType))
{
- if (method.getAnnotation(PersistenceContext.class).type().equals(PersistenceContextType.EXTENDED))
+ if (extendedPersistenceContextEnum.equals(Reflections.invokeAndWrap("type", method.getAnnotation(persistenceContextAnnotationType))))
{
throw new DefinitionException("Cannot inject an extended persistence context into " + method);
}
@@ -253,8 +257,9 @@
protected void initResourceInjectionPoints()
{
+ Class<? extends Annotation> resourceAnnotationType = manager.getServices().get(EJBApiAbstraction.class).RESOURCE_ANNOTATION_CLASS;
this.resourceInjectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
- for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(manager.getServices().get(EjbServices.class).getResourceAnnotation()))
+ for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(resourceAnnotationType))
{
this.resourceInjectionPoints.add(FieldInjectionPoint.of(this, field));
}
@@ -271,19 +276,19 @@
NamingContext namingContext = manager.getServices().get(NamingContext.class);
for (AnnotatedInjectionPoint<?, ?> injectionPoint : ejbInjectionPoints)
{
- Object ejbInstance = ejbServices.resolveEjb(injectionPoint, namingContext);
+ Object ejbInstance = ejbServices.resolveEjb(injectionPoint);
injectionPoint.inject(beanInstance, ejbInstance);
}
for (AnnotatedInjectionPoint<?, ?> injectionPoint : persistenceUnitInjectionPoints)
{
- Object puInstance = ejbServices.resolvePersistenceContext(injectionPoint, namingContext);
+ Object puInstance = ejbServices.resolvePersistenceContext(injectionPoint);
injectionPoint.inject(beanInstance, puInstance);
}
for (AnnotatedInjectionPoint<?, ?> injectionPoint : resourceInjectionPoints)
{
- Object resourceInstance = ejbServices.resolveResource(injectionPoint, namingContext);
+ Object resourceInstance = ejbServices.resolveResource(injectionPoint);
injectionPoint.inject(beanInstance, resourceInstance);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -131,7 +131,7 @@
{
businessInterface = objectInterface;
}
- Object proxiedInstance = reference.getReference(businessInterface);
+ Object proxiedInstance = reference.getBusinessObject(businessInterface);
Method proxiedMethod = Reflections.lookupMethod(method, proxiedInstance);
Object returnValue = Reflections.invokeAndWrap(proxiedMethod, proxiedInstance, args);
log.trace("Executed " + method + " on " + proxiedInstance + " with parameters " + args + " and got return value " + returnValue);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -40,8 +40,8 @@
import org.jboss.webbeans.jsf.JSFApiAbstraction;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.servlet.ServletApiAbstraction;
+import org.jboss.webbeans.util.Reflections;
public class BeanDeployer
{
@@ -265,12 +265,12 @@
*/
private boolean isTypeSimpleWebBean(AnnotatedClass<?> clazz)
{
- ResourceLoader resourceLoader = manager.getServices().get(ResourceLoader.class);
- EJBApiAbstraction ejbApiAbstraction = new EJBApiAbstraction(resourceLoader);
- JSFApiAbstraction jsfApiAbstraction = new JSFApiAbstraction(resourceLoader);
- ServletApiAbstraction servletApiAbstraction = new ServletApiAbstraction(resourceLoader);
+ Class<?> rawType = clazz.getRawType();
+ EJBApiAbstraction ejbApiAbstraction = manager.getServices().get(EJBApiAbstraction.class);
+ JSFApiAbstraction jsfApiAbstraction = manager.getServices().get(JSFApiAbstraction.class);
+ ServletApiAbstraction servletApiAbstraction = manager.getServices().get(ServletApiAbstraction.class);
// TODO: check 3.2.1 for more rules!!!!!!
- return !clazz.isAbstract() && !clazz.isParameterizedType() && !servletApiAbstraction.SERVLET_CLASS.isAssignableFrom(clazz) && !servletApiAbstraction.FILTER_CLASS.isAssignableFrom(clazz) && !servletApiAbstraction.SERVLET_CONTEXT_LISTENER_CLASS.isAssignableFrom(clazz) && !servletApiAbstraction.HTTP_SESSION_LISTENER_CLASS.isAssignableFrom(clazz) && !servletApiAbstraction.SERVLET_REQUEST_LISTENER_CLASS.isAssignableFrom(clazz) && !ejbApiAbstraction.ENTERPRISE_BEAN_CLASS.isAssignableFrom(clazz) && !jsfApiAbstraction.UICOMPONENT_CLASS.isAssignableFrom(clazz) && hasSimpleWebBeanConstructor(clazz);
+ return !Reflections.isAbstract(rawType) && !Reflections.isParameterizedType(rawType) && !servletApiAbstraction.SERVLET_CLASS.isAssignableFrom(rawType) && !servletApiAbstraction.FILTER_CLASS.isAssignableFrom(rawType) && !servletApiAbstraction.SERVLET_CONTEXT_LISTENER_CLASS.isAssignableFrom(rawType) && !servletApiAbstraction.HTTP_SESSION_LISTENER_CLASS.isAssignableFrom(rawType) && !servletApiAbstraction.SERVLET_REQUEST_LISTENER_CLASS.isAssignableFrom(rawType) && !ejbApiAbstraction.ENTERPRISE_BEAN_CLASS.isAssignableFrom(rawType) && !jsfApiAbstraction.UICOMPONENT_CLASS.isAssignableFrom(rawType) && hasSimpleWebBeanConstructor(clazz);
}
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-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -28,6 +28,7 @@
import org.jboss.webbeans.bootstrap.api.Bootstrap;
import org.jboss.webbeans.bootstrap.api.Environments;
import org.jboss.webbeans.bootstrap.api.helpers.AbstractBootstrap;
+import org.jboss.webbeans.bootstrap.api.helpers.ServiceRegistries;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.ConversationContext;
@@ -40,7 +41,9 @@
import org.jboss.webbeans.conversation.JavaSEConversationTerminator;
import org.jboss.webbeans.conversation.NumericConversationIdGenerator;
import org.jboss.webbeans.conversation.ServletConversationManager;
+import org.jboss.webbeans.ejb.EJBApiAbstraction;
import org.jboss.webbeans.ejb.spi.EjbServices;
+import org.jboss.webbeans.jsf.JSFApiAbstraction;
import org.jboss.webbeans.literal.DeployedLiteral;
import org.jboss.webbeans.literal.InitializedLiteral;
import org.jboss.webbeans.log.LogProvider;
@@ -50,6 +53,7 @@
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.servlet.HttpSessionManager;
+import org.jboss.webbeans.servlet.ServletApiAbstraction;
import org.jboss.webbeans.transaction.spi.TransactionServices;
/**
@@ -84,12 +88,21 @@
{
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.");
}
- this.manager = new ManagerImpl(getServices());
+ addImplementationServices();
+ this.manager = new ManagerImpl(ServiceRegistries.unmodifiableServiceRegistry(getServices()));
getServices().get(NamingContext.class).bind(ManagerImpl.JNDI_KEY, getManager());
CurrentManager.setRootManager(manager);
initializeContexts();
}
+ private void addImplementationServices()
+ {
+ ResourceLoader resourceLoader = getServices().get(ResourceLoader.class);
+ getServices().add(EJBApiAbstraction.class, new EJBApiAbstraction(resourceLoader));
+ getServices().add(JSFApiAbstraction.class, new JSFApiAbstraction(resourceLoader));
+ getServices().add(ServletApiAbstraction.class, new ServletApiAbstraction(resourceLoader));
+ }
+
public ManagerImpl getManager()
{
return manager;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -17,7 +17,9 @@
package org.jboss.webbeans.ejb;
-import org.jboss.webbeans.introspector.AnnotatedClass;
+import java.lang.annotation.Annotation;
+
+import org.jboss.webbeans.bootstrap.api.Service;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.util.ApiAbstraction;
@@ -26,15 +28,25 @@
*
* @author Pete Muir
*/
-public class EJBApiAbstraction extends ApiAbstraction
+public class EJBApiAbstraction extends ApiAbstraction implements Service
{
public EJBApiAbstraction(ResourceLoader resourceLoader)
{
super(resourceLoader);
ENTERPRISE_BEAN_CLASS = classForName("javax.ejb.EnterpriseBean");
+ PERSISTENCE_CONTEXT_ANNOTATION_CLASS = annotationTypeForName("javax.persistence.PersistenceContext");
+ EJB_ANNOTATION_CLASS = annotationTypeForName("javax.ejb.EJB");
+ RESOURCE_ANNOTATION_CLASS = annotationTypeForName("javax.annotation.Resource");
+ PERSISTENCE_CONTEXT_TYPE_CLASS = classForName("javax.persistence.PersistenceContextType");
+ EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = enumValue(PERSISTENCE_CONTEXT_TYPE_CLASS, "EXTENDED");
}
- public final AnnotatedClass<?> ENTERPRISE_BEAN_CLASS;
-
+ public final Class<?> PERSISTENCE_CONTEXT_TYPE_CLASS;
+ public final Class<?> ENTERPRISE_BEAN_CLASS;
+ public final Class<? extends Annotation> PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
+ public final Class<? extends Annotation> EJB_ANNOTATION_CLASS;
+ public final Class<? extends Annotation> RESOURCE_ANNOTATION_CLASS;
+ public final Object EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -51,4 +51,6 @@
*/
public <A> AnnotatedMethod<A> getMember(String memberName, AnnotatedClass<A> expectedType);
+ public Class<T> getRawType();
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -186,6 +186,8 @@
public boolean isAbstract();
+ public boolean isEnum();
+
public <S> S cast(Object object);
public <U> AnnotatedClass<? extends U> asSubclass(AnnotatedClass<U> clazz);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -106,6 +106,11 @@
return delegate().isAbstract();
}
+ public boolean isEnum()
+ {
+ return delegate().isEnum();
+ }
+
@Deprecated
public AnnotatedMethod<?> getDeclaredMethod(Method method)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -259,6 +259,7 @@
private final boolean _nonStaticMemberClass;
private final boolean _abstract;
+ private final boolean _enum;
public static <T> AnnotatedClass<T> of(Class<T> clazz)
@@ -279,6 +280,7 @@
this.declaredMetaAnnotatedFields = new AnnotatedFieldMap();
this._nonStaticMemberClass = Reflections.isNonMemberInnerClass(rawType);
this._abstract = Reflections.isAbstract(rawType);
+ this._enum = rawType.isEnum();
for (Class<?> c = rawType; c != Object.class && c != null; c = c.getSuperclass())
{
for (Field field : c.getDeclaredFields())
@@ -495,6 +497,11 @@
return _abstract;
}
+ public boolean isEnum()
+ {
+ return _enum;
+ }
+
/**
* Gets the abstracted methods that have a certain annotation type present
*
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -100,7 +100,15 @@
else
{
Class<?> clazz = constructor.getParameterTypes()[i];
- Type type = constructor.getGenericParameterTypes()[i];
+ Type type;
+ if (constructor.getGenericParameterTypes().length > i)
+ {
+ type = constructor.getGenericParameterTypes()[i];
+ }
+ else
+ {
+ type = clazz;
+ }
AnnotatedParameter<?> parameter = AnnotatedParameterImpl.of(new Annotation[0], clazz, type, this);
parameters.add(parameter);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/JSFApiAbstraction.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/JSFApiAbstraction.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/JSFApiAbstraction.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -17,7 +17,7 @@
package org.jboss.webbeans.jsf;
-import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.bootstrap.api.Service;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.util.ApiAbstraction;
@@ -27,11 +27,11 @@
* @author Pete Muir
*
*/
-public class JSFApiAbstraction extends ApiAbstraction
+public class JSFApiAbstraction extends ApiAbstraction implements Service
{
// An UI component
- public final AnnotatedClass<?> UICOMPONENT_CLASS;
+ public final Class<?> UICOMPONENT_CLASS;
public JSFApiAbstraction(ResourceLoader resourceLoader)
{
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-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -15,7 +15,6 @@
import org.jboss.webbeans.ejb.api.SessionObjectReference;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.resources.spi.NamingContext;
public class MockEjBServices implements EjbServices
{
@@ -37,12 +36,12 @@
return PersistenceContext.class;
}
- public Object resolveEjb(InjectionPoint injectionPoint, NamingContext namingContext)
+ public Object resolveEjb(InjectionPoint injectionPoint)
{
return null;
}
- public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext namingContext)
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint)
{
return null;
}
@@ -52,7 +51,7 @@
return Resource.class;
}
- public Object resolveResource(InjectionPoint injectionPoint, NamingContext namingContext)
+ public Object resolveResource(InjectionPoint injectionPoint)
{
return null;
}
@@ -67,12 +66,12 @@
return ejbDiscovery.discoverEjbs();
}
- public SessionObjectReference resolveEJB(EjbDescriptor<?> ejbDescriptor, NamingContext naming)
+ public SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
{
return new SessionObjectReference()
{
- public <S> S getReference(Class<S> businessInterfaceType)
+ public <S> S getBusinessObject(Class<S> businessInterfaceType)
{
// TODO Auto-generated method stub
return null;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ServletApiAbstraction.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ServletApiAbstraction.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ServletApiAbstraction.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -17,7 +17,7 @@
package org.jboss.webbeans.servlet;
-import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.bootstrap.api.Service;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.util.ApiAbstraction;
@@ -26,14 +26,14 @@
*
* @author Pete Muir
*/
-public class ServletApiAbstraction extends ApiAbstraction
+public class ServletApiAbstraction extends ApiAbstraction implements Service
{
- public final AnnotatedClass<?> SERVLET_CLASS;
- public final AnnotatedClass<?> FILTER_CLASS;
- public final AnnotatedClass<?> SERVLET_CONTEXT_LISTENER_CLASS;
- public final AnnotatedClass<?> HTTP_SESSION_LISTENER_CLASS;
- public final AnnotatedClass<?> SERVLET_REQUEST_LISTENER_CLASS;
+ public final Class<?> SERVLET_CLASS;
+ public final Class<?> FILTER_CLASS;
+ public final Class<?> SERVLET_CONTEXT_LISTENER_CLASS;
+ public final Class<?> HTTP_SESSION_LISTENER_CLASS;
+ public final Class<?> SERVLET_REQUEST_LISTENER_CLASS;
/**
* Constructor
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -19,10 +19,6 @@
import java.lang.annotation.Annotation;
-import org.jboss.webbeans.introspector.AnnotatedAnnotation;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.jlr.AnnotatedAnnotationImpl;
-import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceLoadingException;
@@ -34,9 +30,10 @@
public class ApiAbstraction
{
- private static final AnnotatedAnnotation<DummyAnnotation> DUMMY_ANNOTATION = AnnotatedAnnotationImpl.of(DummyAnnotation.class);
+ private static final Class<DummyAnnotation> DUMMY_ANNOTATION = DummyAnnotation.class;
- private static final AnnotatedClass<Dummy> DUMMY_CLASS = AnnotatedClassImpl.of(Dummy.class);
+ private static final Class<Dummy> DUMMY_CLASS = Dummy.class;
+ private static final Class<Object> OBJECT_CLASS = Object.class;
private ResourceLoader resourceLoader;
@@ -73,11 +70,11 @@
* not found
*/
@SuppressWarnings("unchecked")
- protected AnnotatedAnnotation<?> annotationTypeForName(String name)
+ protected Class<? extends Annotation> annotationTypeForName(String name)
{
try
{
- return AnnotatedAnnotationImpl.of((Class<? extends Annotation>) resourceLoader.classForName(name));
+ return (Class<? extends Annotation>) resourceLoader.classForName(name);
}
catch (ResourceLoadingException cnfe)
{
@@ -93,16 +90,36 @@
* found.
*/
@SuppressWarnings("unchecked")
- protected AnnotatedClass<?> classForName(String name)
+ protected Class<?> classForName(String name)
{
try
{
- return AnnotatedClassImpl.of(resourceLoader.classForName(name));
+ return resourceLoader.classForName(name);
}
catch (ResourceLoadingException cnfe)
{
return DUMMY_CLASS;
}
}
+
+ protected Object enumValue(Class<?> clazz, String memberName)
+ {
+ if (!clazz.isEnum())
+ {
+ throw new IllegalArgumentException(clazz + " is not an enum!");
+ }
+ try
+ {
+ return clazz.getField(memberName);
+ }
+ catch (SecurityException e)
+ {
+ return null;
+ }
+ catch (NoSuchFieldException e)
+ {
+ return null;
+ }
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -325,6 +325,27 @@
throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
}
}
+
+ public static Object invokeAndWrap(String methodName, Object instance, Object... parameters)
+ {
+ Class<?>[] parameterTypes = new Class<?>[parameters.length];
+ for (int i = 0; i < parameters.length; i++)
+ {
+ parameterTypes[i] = parameters[i].getClass();
+ }
+ try
+ {
+ return invokeAndWrap(instance.getClass().getMethod(methodName, parameterTypes), instance, parameters);
+ }
+ catch (SecurityException e)
+ {
+ throw new ExecutionException("Error invoking method " + methodName + " on " + instance.getClass(), e);
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new ExecutionException("Error invoking method " + methodName + " on " + instance.getClass(), e);
+ }
+ }
/**
* Gets value of a field and wraps exceptions
@@ -348,6 +369,22 @@
throw new ExecutionException("Error getting field " + field.getName() + " on " + field.getDeclaringClass(), e);
}
}
+
+ public static Object getAndWrap(String fieldName, Object target)
+ {
+ try
+ {
+ return getAndWrap(target.getClass().getField(fieldName), target);
+ }
+ catch (SecurityException e)
+ {
+ throw new ExecutionException("Error getting field " + fieldName + " on " + target.getClass(), e);
+ }
+ catch (NoSuchFieldException e)
+ {
+ throw new ExecutionException("Error getting field " + fieldName + " on " + target.getClass(), e);
+ }
+ }
/**
* Looks up a method in the type hierarchy of an instance
Deleted: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -1,84 +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.bootstrap.api;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A registry for services
- *
- * @author Pete Muir
- *
- */
-public class ServiceRegistry
-{
-
- private final Map<Class<? extends Service>, Service> services;
-
- public ServiceRegistry()
- {
- this.services = new HashMap<Class<? extends Service>, Service>();
- }
-
- /**
- * Add a service to bootstrap
- *
- * @see Service
- *
- * @param <S> the service type to add
- * @param serviceType the service type to add
- * @param service the service implementation
- */
- public <S extends Service> void add(java.lang.Class<S> type, S service)
- {
- if (service == null)
- {
- services.remove(type);
- }
- else
- {
- services.put(type, service);
- }
- }
-
- /**
- * Retrieve a service implementation
- *
- * @param <S> the service type
- * @param serviceType the service type
- * @return the service implementation, or null if none is registered
- */
- @SuppressWarnings("unchecked")
- public <S extends Service> S get(Class<S> type)
- {
- return (S) services.get(type);
- }
-
- /**
- * Check if a service is registered
- *
- * @param <S> the service type
- * @param serviceType the service type
- * @return true if a service is registered, otherwise false
- */
- public <S extends Service> boolean contains(Class<S> type)
- {
- return services.containsKey(type);
- }
-
-}
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,41 @@
+package org.jboss.webbeans.bootstrap.api;
+
+/**
+ * A service registry
+ *
+ * @author Pete Muir
+ *
+ */
+public interface ServiceRegistry
+{
+
+ /**
+ * Add a service to bootstrap
+ *
+ * @see Service
+ *
+ * @param <S> the service type to add
+ * @param serviceType the service type to add
+ * @param service the service implementation
+ */
+ public <S extends Service> void add(java.lang.Class<S> type, S service);
+
+ /**
+ * Retrieve a service implementation
+ *
+ * @param <S> the service type
+ * @param serviceType the service type
+ * @return the service implementation, or null if none is registered
+ */
+ public <S extends Service> S get(Class<S> type);
+
+ /**
+ * Check if a service is registered
+ *
+ * @param <S> the service type
+ * @param serviceType the service type
+ * @return true if a service is registered, otherwise false
+ */
+ public <S extends Service> boolean contains(Class<S> type);
+
+}
\ No newline at end of file
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/AbstractBootstrap.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/AbstractBootstrap.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/AbstractBootstrap.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -39,14 +39,14 @@
*/
public abstract class AbstractBootstrap implements Bootstrap
{
- private final ServiceRegistry serviceRegistry;
+ private final ServiceRegistry simpleServiceRegistry;
private Environment environment = EE;
private BeanStore applicationContext;
public AbstractBootstrap()
{
- this.serviceRegistry = new ServiceRegistry();
+ this.simpleServiceRegistry = new SimpleServiceRegistry();
}
@Deprecated
@@ -142,7 +142,7 @@
public ServiceRegistry getServices()
{
- return serviceRegistry;
+ return simpleServiceRegistry;
}
}
\ No newline at end of file
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingServiceRegistry.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingServiceRegistry.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingServiceRegistry.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,26 @@
+package org.jboss.webbeans.bootstrap.api.helpers;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
+
+public abstract class ForwardingServiceRegistry implements ServiceRegistry
+{
+
+ protected abstract ServiceRegistry delegate();
+
+ public <S extends Service> void add(Class<S> type, S service)
+ {
+ delegate().add(type, service);
+ }
+
+ public <S extends Service> boolean contains(Class<S> type)
+ {
+ return delegate().contains(type);
+ }
+
+ public <S extends Service> S get(Class<S> type)
+ {
+ return delegate().get(type);
+ }
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingServiceRegistry.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ServiceRegistries.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ServiceRegistries.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ServiceRegistries.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,30 @@
+package org.jboss.webbeans.bootstrap.api.helpers;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
+
+public class ServiceRegistries
+{
+
+ private ServiceRegistries() {}
+
+ public static ServiceRegistry unmodifiableServiceRegistry(final ServiceRegistry serviceRegistry)
+ {
+ return new ForwardingServiceRegistry()
+ {
+
+ public <S extends Service> void add(java.lang.Class<S> type, S service)
+ {
+ throw new UnsupportedOperationException("This service registry is unmodifiable");
+ }
+
+ @Override
+ protected ServiceRegistry delegate()
+ {
+ return serviceRegistry;
+ }
+
+ };
+ }
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ServiceRegistries.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java (from rev 2064, ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java)
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,82 @@
+/*
+ * 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.bootstrap.api.helpers;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
+
+/**
+ * A registry for services
+ *
+ * @author Pete Muir
+ *
+ */
+class SimpleServiceRegistry implements ServiceRegistry
+{
+
+ private final Map<Class<? extends Service>, Service> services;
+
+ public SimpleServiceRegistry()
+ {
+ this.services = new HashMap<Class<? extends Service>, Service>();
+ }
+
+ public <S extends Service> void add(java.lang.Class<S> type, S service)
+ {
+ if (service == null)
+ {
+ services.remove(type);
+ }
+ else
+ {
+ services.put(type, service);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public <S extends Service> S get(Class<S> type)
+ {
+ return (S) services.get(type);
+ }
+
+ public <S extends Service> boolean contains(Class<S> type)
+ {
+ return services.containsKey(type);
+ }
+
+ @Override
+ public String toString()
+ {
+ return services.toString();
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return services.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return services.equals(obj);
+ }
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/api/SessionObjectReference.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/api/SessionObjectReference.java 2009-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/api/SessionObjectReference.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -36,17 +36,20 @@
* the type of the business interface
* @return a reference
*
- * @throws IllegalStateException
+ * @throws IllegalArgumentException
+ * if the business interface is not a local business interface of
+ * the session bean
+ * @throws NoSuchEJBException
* if the session object has already been removed
*/
- public <S> S getReference(Class<S> businessInterfaceType);
+ public <S> S getBusinessObject(Class<S> businessInterfaceType);
/**
* Request the EJB container remove the stateful session object
*
* @throws UnsupportedOperationException
* if the reference is not backed by a stateful session object
- * @throws IllegalStateException
+ * @throws NoSuchEJBException
* if the session object has already been removed
*/
public void remove();
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-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -17,13 +17,10 @@
package org.jboss.webbeans.ejb.spi;
-import java.lang.annotation.Annotation;
-
import javax.inject.manager.InjectionPoint;
import org.jboss.webbeans.bootstrap.api.Service;
import org.jboss.webbeans.ejb.api.SessionObjectReference;
-import org.jboss.webbeans.resources.spi.NamingContext;
/**
* A container should implement this interface to allow the Web Beans RI to
@@ -35,8 +32,6 @@
public interface EjbServices extends Service
{
- public static final String PROPERTY_NAME = EjbServices.class.getName();
-
/**
* Resolve the value for the given @EJB injection point
*
@@ -50,15 +45,13 @@
* @throws IllegalStateException
* if no EJBs can be resolved for injection
*/
- public Object resolveEjb(InjectionPoint injectionPoint, NamingContext namingContext);
+ public Object resolveEjb(InjectionPoint injectionPoint);
/**
* Resolve the value for the given @PersistenceContext injection point
*
* @param injectionPoint
* the injection point metadata
- * @param namingContext
- * the pluggable Web Beans JNDI lookup facility
* @return an instance of the persistence unit
* @throws IllegalArgumentException
* if the injection point is not annotated with
@@ -67,15 +60,13 @@
* @throws IllegalStateException
* if no suitable persistence units can be resolved for injection
*/
- public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext namingContext);
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint);
/**
* Resolve the value for the given @Resource injection point
*
* @param injectionPoint
* the injection point metadata
- * @param namingContext
- * the pluggable Web Beans JNDI lookup facility
* @return an instance of the resource
* @throws IllegalArgumentException
* if the injection point is not annotated with @Resource, or, if
@@ -84,7 +75,7 @@
* @throws IllegalStateException
* if no resource can be resolved for injection
*/
- public Object resolveResource(InjectionPoint injectionPoint, NamingContext namingContext);
+ public Object resolveResource(InjectionPoint injectionPoint);
/**
* Request a reference to an EJB session object from the container. If the
@@ -92,10 +83,9 @@
* the session bean is created before this method returns.
*
* @param ejbDescriptor the ejb to resolve
- * @param namingContext the pluggable Web Beans JNDI lookup facility
* @return a reference to the session object
*/
- public SessionObjectReference resolveEJB(EjbDescriptor<?> ejbDescriptor, NamingContext namingContext);
+ public SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor);
/**
* Gets a descriptor for each EJB in the application
@@ -104,25 +94,4 @@
*/
public Iterable<EjbDescriptor<?>> discoverEjbs();
- /**
- * Get the annotation which defines an @EJB injection point
- *
- * @return the annotation which defines an @EJB injection point
- */
- public Class<? extends Annotation> getEJBAnnotation();
-
- /**
- * Get the annotation which defines a @PersistenceContext injection point
- *
- * @return the annotation which defines a @PersistenceContext injection point
- */
- public Class<? extends Annotation> getPersistenceContextAnnotation();
-
- /**
- * Get the annotation which defines a @Resource injection point
- *
- * @return the annotation which defines a @Resource injection point
- */
- public Class<? extends Annotation> getResourceAnnotation();
-
}
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-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -1,13 +1,10 @@
package org.jboss.webbeans.ejb.spi.helpers;
-import java.lang.annotation.Annotation;
-
import javax.inject.manager.InjectionPoint;
import org.jboss.webbeans.ejb.api.SessionObjectReference;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.resources.spi.NamingContext;
/**
* An implementation of {@link EjbServices} which forwards all its method calls
@@ -24,40 +21,25 @@
public abstract EjbServices delegate();
- public Class<? extends Annotation> getEJBAnnotation()
+ public Object resolveEjb(InjectionPoint injectionPoint)
{
- return delegate().getEJBAnnotation();
+ return delegate().resolveEjb(injectionPoint);
}
- public Class<? extends Annotation> getPersistenceContextAnnotation()
+ public SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
{
- return delegate().getPersistenceContextAnnotation();
+ return delegate().resolveEjb(ejbDescriptor);
}
- public Class<? extends Annotation> getResourceAnnotation()
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint)
{
- return delegate().getResourceAnnotation();
+ return delegate().resolvePersistenceContext(injectionPoint);
}
- public Object resolveEjb(InjectionPoint injectionPoint, NamingContext namingContext)
+ public Object resolveResource(InjectionPoint injectionPoint)
{
- return delegate().resolveEjb(injectionPoint, namingContext);
+ return delegate().resolveResource(injectionPoint);
}
-
- public SessionObjectReference resolveEJB(EjbDescriptor<?> ejbDescriptor, NamingContext namingContext)
- {
- return delegate().resolveEJB(ejbDescriptor, namingContext);
- }
-
- public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext namingContext)
- {
- return delegate().resolvePersistenceContext(injectionPoint, namingContext);
- }
-
- public Object resolveResource(InjectionPoint injectionPoint, NamingContext namingContext)
- {
- return delegate().resolveResource(injectionPoint, namingContext);
- }
public Iterable<EjbDescriptor<?>> discoverEjbs()
{
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-03-17 22:20:19 UTC (rev 2078)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEjbServices.java 2009-03-18 01:38:30 UTC (rev 2079)
@@ -7,7 +7,6 @@
import org.jboss.webbeans.ejb.api.SessionObjectReference;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.resources.spi.NamingContext;
public class MockEjbServices implements EjbServices
{
@@ -36,25 +35,25 @@
return null;
}
- public SessionObjectReference resolveEJB(EjbDescriptor<?> ejbDescriptor, NamingContext namingContext)
+ public SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
{
// TODO Auto-generated method stub
return null;
}
- public Object resolveEjb(InjectionPoint injectionPoint, NamingContext namingContext)
+ public Object resolveEjb(InjectionPoint injectionPoint)
{
// TODO Auto-generated method stub
return null;
}
- public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext namingContext)
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint)
{
// TODO Auto-generated method stub
return null;
}
- public Object resolveResource(InjectionPoint injectionPoint, NamingContext namingContext)
+ public Object resolveResource(InjectionPoint injectionPoint)
{
// TODO Auto-generated method stub
return null;
Added: ri/trunk/tests/temp-testng-customsuite.xml
===================================================================
--- ri/trunk/tests/temp-testng-customsuite.xml (rev 0)
+++ ri/trunk/tests/temp-testng-customsuite.xml 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,8 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="webbeans-core-tests">
+ <test verbose="2" name="org.jboss.webbeans.test.examples.ExampleTest" annotations="JDK">
+ <classes>
+ <class name="org.jboss.webbeans.test.examples.ExampleTest"/>
+ </classes>
+ </test>
+</suite>
Property changes on: ri/trunk/tests/temp-testng-customsuite.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/emailable-report.html
===================================================================
--- ri/trunk/tests/test-output/emailable-report.html (rev 0)
+++ ri/trunk/tests/test-output/emailable-report.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>TestNG: Unit Test</title>
+<style type="text/css">
+table caption,table.info_table,table.param,table.passed,table.failed {margin-bottom:10px;border:1px solid #000099;border-collapse:collapse;empty-cells:show;}
+table.info_table td,table.info_table th,table.param td,table.param th,table.passed td,table.passed th,table.failed td,table.failed th {
+border:1px solid #000099;padding:.25em .5em .25em .5em
+}
+table.param th {vertical-align:bottom}
+td.numi,th.numi,td.numi_attn {
+text-align:right
+}
+tr.total td {font-weight:bold}
+table caption {
+text-align:center;font-weight:bold;
+}
+table.passed tr.stripe td,table tr.passedodd td {background-color: #00AA00;}
+table.passed td,table tr.passedeven td {background-color: #33FF33;}
+table.passed tr.stripe td,table tr.skippedodd td {background-color: #cccccc;}
+table.passed td,table tr.skippedodd td {background-color: #dddddd;}
+table.failed tr.stripe td,table tr.failedodd td,table.param td.numi_attn {background-color: #FF3333;}
+table.failed td,table tr.failedeven td,table.param tr.stripe td.numi_attn {background-color: #DD0000;}
+tr.stripe td,tr.stripe th {background-color: #E6EBF9;}
+p.totop {font-size:85%;text-align:center;border-bottom:2px black solid}
+div.shootout {padding:2em;border:3px #4854A8 solid}
+</style>
+</head>
+<body>
+<table cellspacing=0 cellpadding=0 class="param">
+<tr><th>Test</th><th class="numi">Methods<br/>Passed</th><th class="numi">Scenarios<br/>Passed</th><th class="numi"># skipped</th><th class="numi"># failed</th><th class="numi">Total<br/>Time</th><th class="numi">Included<br/>Groups</th><th class="numi">Excluded<br/>Groups</th></tr>
+<tr><td style="text-align:left;padding-right:2em">org.jboss.webbeans.test.examples.ExampleTest</td><td class="numi">2</td><td class="numi">2</td><td class="numi">0</td><td class="numi">0</td><td class="numi">0.7 seconds</td><td class="numi"></td><td class="numi"></td></tr>
+</table>
+<a id="summary"></a>
+<table cellspacing=0 cellpadding=0 class="passed">
+<tr><th>Class</th><th>Method</th><th># of<br/>Scenarios</th><th>Time<br/>(Msecs)</th></tr>
+<tr><th colspan="4">org.jboss.webbeans.test.examples.ExampleTest — passed</th></tr>
+<tr class="passedodd"><td rowspan="2">org.jboss.webbeans.test.examples.ExampleTest<td><a href="#m1">testGameGenerator</a></td><td class="numi">1</td><td class="numi">49</td></tr><tr class="passedodd"><td><a href="#m2">testSentenceTranslator</a></td><td class="numi">1</td><td class="numi">6</td></tr>
+</table>
+<h1>org.jboss.webbeans.test.examples.ExampleTest</h1>
+<a id="m1"></a><h2>org.jboss.webbeans.test.examples.ExampleTest:testGameGenerator</h2>
+<p class="totop"><a href="#summary">back to summary</a></p>
+<a id="m2"></a><h2>org.jboss.webbeans.test.examples.ExampleTest:testSentenceTranslator</h2>
+<p class="totop"><a href="#summary">back to summary</a></p>
+</body></html>
Property changes on: ri/trunk/tests/test-output/emailable-report.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/index.html
===================================================================
--- ri/trunk/tests/test-output/index.html (rev 0)
+++ ri/trunk/tests/test-output/index.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,9 @@
+<html>
+<head><title>Test results</title><link href="./testng.css" rel="stylesheet" type="text/css" />
+<link href="./my-testng.css" rel="stylesheet" type="text/css" />
+</head><body>
+<h2><p align='center'>Test results</p></h2>
+<table border='1' width='100%' class='main-page'><tr><th>Suite</th><th>Passed</th><th>Failed</th><th>Skipped</th><th>testng.xml</th></tr>
+<tr align='center' class='invocation-passed'><td><em>Total</em></td><td><em>2</em></td><td><em>0</em></td><td><em>0</em></td><td> </td></tr>
+<tr align='center' class='invocation-passed'><td><a href='webbeans-core-tests/index.html'>webbeans-core-tests</a></td>
+<td>2</td><td>0</td><td>0</td><td><a href='webbeans-core-tests/testng.xml.html'>Link</a></td></tr></table></body></html>
Property changes on: ri/trunk/tests/test-output/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/testng-failed.xml
===================================================================
--- ri/trunk/tests/test-output/testng-failed.xml (rev 0)
+++ ri/trunk/tests/test-output/testng-failed.xml 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,17 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite thread-count="5" skipfailedinvocationCounts="false" verbose="1" name="Failed suite [webbeans-core-tests]" junit="false" annotations="JDK">
+ <test name="org.jboss.webbeans.test.examples.ExampleTest(failed)" junit="false" annotations="JDK">
+ <classes>
+ <class name="org.jboss.webbeans.test.examples.ExampleTest">
+ <methods>
+ <include name="afterClass"/>
+ <include name="testSentenceTranslator"/>
+ <include name="beforeClass"/>
+ <include name="afterSuite"/>
+ <include name="testGameGenerator"/>
+ <include name="beforeSuite"/>
+ </methods>
+ </class>
+ </classes>
+ </test>
+</suite>
Property changes on: ri/trunk/tests/test-output/testng-failed.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/testng-results.xml
===================================================================
--- ri/trunk/tests/test-output/testng-results.xml (rev 0)
+++ ri/trunk/tests/test-output/testng-results.xml 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,39 @@
+<testng-results>
+ <reporter-output>
+ </reporter-output>
+ <suite name="webbeans-core-tests">
+ <groups>
+ </groups>
+ <test name="org.jboss.webbeans.test.examples.ExampleTest">
+ <class name="org.jboss.webbeans.test.examples.ExampleTest">
+ <test-method status="PASS" signature="beforeSuite(org.testng.ITestContext)" name="beforeSuite" is-config="true" duration-ms="39" started-at="2009-03-18T00:53:36Z" finished-at="2009-03-18T00:53:36Z">
+ <params>
+ <param index="0">
+ <value>
+ <![CDATA[org.testng.TestRunner@76307efc]]>
+ </value>
+ </param>
+ </params>
+ </test-method>
+ <test-method status="PASS" signature="before()" name="before" is-config="true" duration-ms="0" started-at="2009-03-18T00:53:37Z" finished-at="2009-03-18T00:53:37Z">
+ </test-method>
+ <test-method status="PASS" signature="afterClass()" name="afterClass" is-config="true" duration-ms="1" started-at="2009-03-18T00:53:37Z" finished-at="2009-03-18T00:53:37Z">
+ </test-method>
+ <test-method status="PASS" signature="testGameGenerator()" name="testGameGenerator" duration-ms="49" started-at="2009-03-18T00:53:37Z" finished-at="2009-03-18T00:53:37Z">
+ </test-method>
+ <test-method status="PASS" signature="after()" name="after" is-config="true" duration-ms="0" started-at="2009-03-18T00:53:37Z" finished-at="2009-03-18T00:53:37Z">
+ </test-method>
+ <test-method status="PASS" signature="testSentenceTranslator()" name="testSentenceTranslator" duration-ms="6" started-at="2009-03-18T00:53:37Z" finished-at="2009-03-18T00:53:37Z">
+ </test-method>
+ <test-method status="PASS" signature="before()" name="before" is-config="true" duration-ms="0" started-at="2009-03-18T00:53:37Z" finished-at="2009-03-18T00:53:37Z">
+ </test-method>
+ <test-method status="PASS" signature="beforeClass()" name="beforeClass" is-config="true" duration-ms="672" started-at="2009-03-18T00:53:36Z" finished-at="2009-03-18T00:53:37Z">
+ </test-method>
+ <test-method status="PASS" signature="after()" name="after" is-config="true" duration-ms="1" started-at="2009-03-18T00:53:37Z" finished-at="2009-03-18T00:53:37Z">
+ </test-method>
+ <test-method status="PASS" signature="afterSuite()" name="afterSuite" is-config="true" duration-ms="1" started-at="2009-03-18T00:53:37Z" finished-at="2009-03-18T00:53:37Z">
+ </test-method>
+ </class>
+ </test>
+ </suite>
+</testng-results>
Property changes on: ri/trunk/tests/test-output/testng-results.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/testng.css
===================================================================
--- ri/trunk/tests/test-output/testng.css (rev 0)
+++ ri/trunk/tests/test-output/testng.css 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,9 @@
+.invocation-failed, .test-failed { background-color: #DD0000; }
+.invocation-percent, .test-percent { background-color: #006600; }
+.invocation-passed, .test-passed { background-color: #00AA00; }
+.invocation-skipped, .test-skipped { background-color: #CCCC00; }
+
+.main-page {
+ font-size: x-large;
+}
+
Property changes on: ri/trunk/tests/test-output/testng.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/classes.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/classes.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/classes.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,50 @@
+<table border='1'>
+<tr>
+<th>Class name</th>
+<th>Method name</th>
+<th>Groups</th>
+</tr><tr>
+<td>org.jboss.webbeans.test.examples.ExampleTest</td>
+<td> </td><td> </td></tr>
+<tr>
+<td align='center' colspan='3'>@Test</td>
+</tr>
+<tr>
+<td> </td>
+<td>testSentenceTranslator</td>
+<td> </td></tr>
+<tr>
+<td> </td>
+<td>testGameGenerator</td>
+<td> </td></tr>
+<tr>
+<td align='center' colspan='3'>@BeforeClass</td>
+</tr>
+<tr>
+<td> </td>
+<td>beforeClass</td>
+<td>scaffold </td>
+</tr>
+<tr>
+<td align='center' colspan='3'>@BeforeMethod</td>
+</tr>
+<tr>
+<td> </td>
+<td>before</td>
+<td> </td></tr>
+<tr>
+<td align='center' colspan='3'>@AfterMethod</td>
+</tr>
+<tr>
+<td> </td>
+<td>after</td>
+<td> </td></tr>
+<tr>
+<td align='center' colspan='3'>@AfterClass</td>
+</tr>
+<tr>
+<td> </td>
+<td>afterClass</td>
+<td>scaffold </td>
+</tr>
+</table>
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/classes.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/groups.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/groups.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/groups.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1 @@
+<h2>Groups used for this test run</h2>
\ No newline at end of file
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/groups.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/index.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/index.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/index.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,6 @@
+<html><head><title>Results for webbeans-core-tests</title></head>
+<frameset cols="26%,74%">
+<frame src="toc.html" name="navFrame">
+<frame src="main.html" name="mainFrame">
+</frameset>
+</html>
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/main.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/main.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/main.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,2 @@
+<html><head><title>Results for webbeans-core-tests</title></head>
+<body>Select a result on the left-hand pane.</body></html>
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/main.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/methods-alphabetical.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/methods-alphabetical.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/methods-alphabetical.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,24 @@
+<h2>Methods run, sorted chronologically</h2><h3>>> means before, << means after</h3><p/><br/><em>webbeans-core-tests</em><p/><small><i>(Hover the method name to see the test class name)</i></small><p/>
+<table border="1">
+<tr><th>Time</th><th>Delta (ms)</th><th>Suite<br>configuration</th><th>Test<br>configuration</th><th>Class<br>configuration</th><th>Groups<br>configuration</th><th>Method<br>configuration</th><th>Test<br>method</th><th>Thread</th><th>Instances</th></tr>
+<tr bgcolor="836be4"> <td>09/03/18 00:53:37</td> <td>0</td> <td> </td><td> </td><td> </td><td> </td><td title="<<org.jboss.webbeans.test.unit.AbstractWebBeansTest.after()"><<after</td>
+<td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="836be4"> <td>09/03/18 00:53:37</td> <td>0</td> <td> </td><td> </td><td> </td><td> </td><td title="<<org.jboss.webbeans.test.unit.AbstractWebBeansTest.after()"><<after</td>
+<td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="7b6fad"> <td>09/03/18 00:53:37</td> <td>2</td> <td> </td><td> </td><td title="<<org.jboss.testharness.AbstractTest.afterClass()"><<afterClass</td>
+<td> </td><td> </td><td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="7b6fad"> <td>09/03/18 00:53:37</td> <td>16</td> <td title="<<org.jboss.testharness.AbstractTest.afterSuite()"><<afterSuite</td>
+<td> </td><td> </td><td> </td><td> </td><td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="836be4"> <td>09/03/18 00:53:37</td> <td>-50</td> <td> </td><td> </td><td> </td><td> </td><td title=">>org.jboss.webbeans.test.unit.AbstractWebBeansTest.before()">>>before</td>
+<td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="836be4"> <td>09/03/18 00:53:37</td> <td>-50</td> <td> </td><td> </td><td> </td><td> </td><td title=">>org.jboss.webbeans.test.unit.AbstractWebBeansTest.before()">>>before</td>
+<td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="7b6fad"> <td>09/03/18 00:53:36</td> <td>-733</td> <td> </td><td> </td><td title=">>org.jboss.testharness.AbstractTest.beforeClass()">>>beforeClass</td>
+<td> </td><td> </td><td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="836be4"> <td>09/03/18 00:53:36</td> <td>-778</td> <td title=">>org.jboss.webbeans.test.unit.AbstractWebBeansTest.beforeSuite(org.testng.ITestContext)">>>beforeSuite</td>
+<td> </td><td> </td><td> </td><td> </td><td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="908fc5"> <td>09/03/18 00:53:37</td> <td>-49</td> <td> </td><td> </td><td> </td><td> </td><td> </td><td title="org.jboss.webbeans.test.examples.ExampleTest.testGameGenerator()">testGameGenerator</td>
+ <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="908fc5"> <td>09/03/18 00:53:37</td> <td>-56</td> <td> </td><td> </td><td> </td><td> </td><td> </td><td title="org.jboss.webbeans.test.examples.ExampleTest.testSentenceTranslator()">testSentenceTranslator</td>
+ <td>main@408255870</td> <td></td> </tr>
+</table>
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/methods-alphabetical.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/methods-not-run.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/methods-not-run.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/methods-not-run.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,2 @@
+<h2>Methods that were not run</h2><table>
+</table>
\ No newline at end of file
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/methods-not-run.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/methods.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/methods.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/methods.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,24 @@
+<h2>Methods run, sorted chronologically</h2><h3>>> means before, << means after</h3><p/><br/><em>webbeans-core-tests</em><p/><small><i>(Hover the method name to see the test class name)</i></small><p/>
+<table border="1">
+<tr><th>Time</th><th>Delta (ms)</th><th>Suite<br>configuration</th><th>Test<br>configuration</th><th>Class<br>configuration</th><th>Groups<br>configuration</th><th>Method<br>configuration</th><th>Test<br>method</th><th>Thread</th><th>Instances</th></tr>
+<tr bgcolor="836be4"> <td>09/03/18 00:53:36</td> <td>0</td> <td title=">>org.jboss.webbeans.test.unit.AbstractWebBeansTest.beforeSuite(org.testng.ITestContext)">>>beforeSuite</td>
+<td> </td><td> </td><td> </td><td> </td><td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="7b6fad"> <td>09/03/18 00:53:36</td> <td>45</td> <td> </td><td> </td><td title=">>org.jboss.testharness.AbstractTest.beforeClass()">>>beforeClass</td>
+<td> </td><td> </td><td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="836be4"> <td>09/03/18 00:53:37</td> <td>728</td> <td> </td><td> </td><td> </td><td> </td><td title=">>org.jboss.webbeans.test.unit.AbstractWebBeansTest.before()">>>before</td>
+<td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="908fc5"> <td>09/03/18 00:53:37</td> <td>722</td> <td> </td><td> </td><td> </td><td> </td><td> </td><td title="org.jboss.webbeans.test.examples.ExampleTest.testSentenceTranslator()">testSentenceTranslator</td>
+ <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="836be4"> <td>09/03/18 00:53:37</td> <td>778</td> <td> </td><td> </td><td> </td><td> </td><td title="<<org.jboss.webbeans.test.unit.AbstractWebBeansTest.after()"><<after</td>
+<td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="836be4"> <td>09/03/18 00:53:37</td> <td>728</td> <td> </td><td> </td><td> </td><td> </td><td title=">>org.jboss.webbeans.test.unit.AbstractWebBeansTest.before()">>>before</td>
+<td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="908fc5"> <td>09/03/18 00:53:37</td> <td>729</td> <td> </td><td> </td><td> </td><td> </td><td> </td><td title="org.jboss.webbeans.test.examples.ExampleTest.testGameGenerator()">testGameGenerator</td>
+ <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="836be4"> <td>09/03/18 00:53:37</td> <td>778</td> <td> </td><td> </td><td> </td><td> </td><td title="<<org.jboss.webbeans.test.unit.AbstractWebBeansTest.after()"><<after</td>
+<td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="7b6fad"> <td>09/03/18 00:53:37</td> <td>780</td> <td> </td><td> </td><td title="<<org.jboss.testharness.AbstractTest.afterClass()"><<afterClass</td>
+<td> </td><td> </td><td> </td> <td>main@408255870</td> <td></td> </tr>
+<tr bgcolor="7b6fad"> <td>09/03/18 00:53:37</td> <td>794</td> <td title="<<org.jboss.testharness.AbstractTest.afterSuite()"><<afterSuite</td>
+<td> </td><td> </td><td> </td><td> </td><td> </td> <td>main@408255870</td> <td></td> </tr>
+</table>
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/methods.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,88 @@
+<html>
+<head>
+<title>TestNG: org.jboss.webbeans.test.examples.ExampleTest</title>
+<link href="../testng.css" rel="stylesheet" type="text/css" />
+<link href="../my-testng.css" rel="stylesheet" type="text/css" />
+
+<style type="text/css">
+.log { display: none;}
+.stack-trace { display: none;}
+</style>
+<script type="text/javascript">
+<!--
+function flip(e) {
+ current = e.style.display;
+ if (current == 'block') {
+ e.style.display = 'none';
+ return 0;
+ }
+ else {
+ e.style.display = 'block';
+ return 1;
+ }
+}
+
+function toggleBox(szDivId, elem, msg1, msg2)
+{
+ var res = -1; if (document.getElementById) {
+ res = flip(document.getElementById(szDivId));
+ }
+ else if (document.all) {
+ // this is the way old msie versions work
+ res = flip(document.all[szDivId]);
+ }
+ if(elem) {
+ if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
+ }
+
+}
+
+function toggleAllBoxes() {
+ if (document.getElementsByTagName) {
+ d = document.getElementsByTagName('div');
+ for (i = 0; i < d.length; i++) {
+ if (d[i].className == 'log') {
+ flip(d[i]);
+ }
+ }
+ }
+}
+
+// -->
+</script>
+
+</head>
+<body>
+<h2 align='center'>org.jboss.webbeans.test.examples.ExampleTest</h2><table border='1' align="center">
+<tr>
+<td>Tests passed/Failed/Skipped:</td><td>2/0/0</td>
+</tr><tr>
+<td>Started on:</td><td>Wed Mar 18 00:53:36 GMT 2009</td>
+</tr>
+<tr><td>Total time:</td><td>0 seconds (744 ms)</td>
+</tr><tr>
+<td>Included groups:</td><td></td>
+</tr><tr>
+<td>Excluded groups:</td><td></td>
+</tr>
+</table><p/>
+<small><i>(Hover the method name to see the test class name)</i></small><p/>
+<table width='100%' border='1' class='invocation-passed'>
+<tr><td colspan='3' align='center'><b>PASSED TESTS</b></td></tr>
+<tr><td><b>Test method</b></td>
+<td width="10%"><b>Time (seconds)</b></td>
+<td width="30%"><b>Exception</b></td>
+</tr>
+<tr>
+<td title='org.jboss.webbeans.test.examples.ExampleTest.testGameGenerator()'>testGameGenerator</td>
+<td>0</td>
+<td></td>
+</tr>
+<tr>
+<td title='org.jboss.webbeans.test.examples.ExampleTest.testSentenceTranslator()'>testSentenceTranslator</td>
+<td>0</td>
+<td></td>
+</tr>
+</table><p>
+</body>
+</html>
\ No newline at end of file
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.properties
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.properties (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.properties 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1 @@
+[SuiteResult org.jboss.webbeans.test.examples.ExampleTest]
\ No newline at end of file
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.xml
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.xml (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.xml 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testsuite name="org.jboss.webbeans.test.examples.ExampleTest" failures="0" tests="2" time="0.744" errors="0">
+ <properties/>
+ <testcase name="testSentenceTranslator" time="0.0060" classname="org.jboss.webbeans.test.examples.ExampleTest"/>
+ <testcase name="testGameGenerator" time="0.049" classname="org.jboss.webbeans.test.examples.ExampleTest"/>
+</testsuite>
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/org.jboss.webbeans.test.examples.ExampleTest.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/reporter-output.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/reporter-output.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/reporter-output.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1 @@
+<h2>Reporter output</h2><table></table>
\ No newline at end of file
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/reporter-output.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/testng-failed.xml
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/testng-failed.xml (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/testng-failed.xml 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,17 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite thread-count="5" skipfailedinvocationCounts="false" verbose="1" name="Failed suite [webbeans-core-tests]" junit="false" annotations="JDK">
+ <test name="org.jboss.webbeans.test.examples.ExampleTest(failed)" junit="false" annotations="JDK">
+ <classes>
+ <class name="org.jboss.webbeans.test.examples.ExampleTest">
+ <methods>
+ <include name="afterClass"/>
+ <include name="testSentenceTranslator"/>
+ <include name="beforeClass"/>
+ <include name="afterSuite"/>
+ <include name="testGameGenerator"/>
+ <include name="beforeSuite"/>
+ </methods>
+ </class>
+ </classes>
+ </test>
+</suite>
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/testng-failed.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/testng.xml.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/testng.xml.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/testng.xml.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1 @@
+<html><head><title>testng.xml for webbeans-core-tests</title></head><body><tt><!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"><br/><suite thread-count="5" skipfailedinvocationCounts="false" verbose="1" name="webbeans-core-tests" junit="false" annotations="JDK"><br/> <test verbose="2" name="org.jboss.webbeans.test.examples.ExampleTest" junit="false" annotations="JDK"><br/> <classes><br/> <class name="org.jboss.webbeans.test.examples.ExampleTest"/><br/> </classes><br/> </test><br/></suite><br/></tt></body></html>
\ No newline at end of file
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/testng.xml.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/test-output/webbeans-core-tests/toc.html
===================================================================
--- ri/trunk/tests/test-output/webbeans-core-tests/toc.html (rev 0)
+++ ri/trunk/tests/test-output/webbeans-core-tests/toc.html 2009-03-18 01:38:30 UTC (rev 2079)
@@ -0,0 +1,30 @@
+<html>
+<head>
+<title>Results for webbeans-core-tests</title>
+<link href="../testng.css" rel="stylesheet" type="text/css" />
+<link href="../my-testng.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<h3><p align="center">Results for<br/><em>webbeans-core-tests</em></p></h3>
+<table border='1' width='100%'>
+<tr valign='top'>
+<td>1 test</td>
+<td><a target='mainFrame' href='classes.html'>1 class</a></td>
+<td>2 methods:<br/>
+ <a target='mainFrame' href='methods.html'>chronological</a><br/>
+ <a target='mainFrame' href='methods-alphabetical.html'>alphabetical</a><br/>
+ <a target='mainFrame' href='methods-not-run.html'>not run (0)</a></td>
+</tr>
+<tr>
+<td><a target='mainFrame' href='groups.html'>0 group</a></td>
+<td><a target='mainFrame' href='reporter-output.html'>reporter output</a></td>
+<td><a target='mainFrame' href='testng.xml.html'>testng.xml</a></td>
+</tr></table>
+<table width='100%' class='test-passed'>
+<tr><td>
+<table style='width: 100%'><tr><td valign='top'>org.jboss.webbeans.test.examples.ExampleTest (2/0/0)</td><td valign='top' align='right'>
+ <a href='org.jboss.webbeans.test.examples.ExampleTest.html' target='mainFrame'>Results</a>
+</td></tr></table>
+</td></tr><p/>
+</table>
+</body></html>
\ No newline at end of file
Property changes on: ri/trunk/tests/test-output/webbeans-core-tests/toc.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2078 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-03-17 18:20:19 -0400 (Tue, 17 Mar 2009)
New Revision: 2078
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/ComplicatedTuna.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Elephant.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ElephantLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Antelope_NotBean.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ejb-jar.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Added a few more tests and fixed some mappings.
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-03-17 20:30:59 UTC (rev 2077)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-03-17 22:20:19 UTC (rev 2078)
@@ -124,7 +124,24 @@
@SpecAssertion(section = "2.2", id = "g")
public void testFinalApiType()
{
- getCurrentManager().resolveByType(DependentFinalTuna.class);
+ assert !getCurrentManager().resolveByType(DependentFinalTuna.class).isEmpty();
}
+ @Test
+ @SpecAssertion(section = "3.2.3", id = "bd")
+ public void testMultipleStereotypes()
+ {
+ Bean<ComplicatedTuna> tunaBean = getCurrentManager().resolveByType(ComplicatedTuna.class).iterator().next();
+ assert tunaBean.getScopeType().equals(RequestScoped.class);
+ assert tunaBean.getName().equals("complicatedTuna");
+ }
+
+ @Test
+ @SpecAssertion(section = "3.2.3", id = "c")
+ public void testBeanExtendsAnotherBean()
+ {
+ assert !getCurrentManager().resolveByType(Spider.class).isEmpty();
+ assert !getCurrentManager().resolveByType(Tarantula.class).isEmpty();
+ }
+
}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/ComplicatedTuna.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/ComplicatedTuna.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/ComplicatedTuna.java 2009-03-17 22:20:19 UTC (rev 2078)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.definition.bean;
+
+import javax.context.RequestScoped;
+
+@FishStereotype
+@AnimalStereotype
+@RequestScoped
+class ComplicatedTuna implements Animal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/ComplicatedTuna.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Elephant.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Elephant.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Elephant.java 2009-03-17 22:20:19 UTC (rev 2078)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+public class Elephant implements ElephantLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Elephant.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ElephantLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ElephantLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ElephantLocal.java 2009-03-17 22:20:19 UTC (rev 2078)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+
+public interface ElephantLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ElephantLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-03-17 20:30:59 UTC (rev 2077)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-03-17 22:20:19 UTC (rev 2078)
@@ -80,6 +80,7 @@
@Test(groups = { "enterpriseBeans" })
@SpecAssertions( {
+ @SpecAssertion(section = "3.2.1", id = "f"),
@SpecAssertion(section = "3.3.3", id = "a"),
@SpecAssertion(section = "3.3.4", id = "c") } )
public void testBeanTypesAreLocalInterfacesWithoutWildcardTypesOrTypeVariablesWithSuperInterfaces()
@@ -87,6 +88,7 @@
Bean<DogLocal> dogBean = getCurrentManager().resolveByType(DogLocal.class).iterator().next();
assert dogBean.getTypes().contains(DogLocal.class);
assert dogBean.getTypes().contains(PitbullLocal.class);
+ assert !dogBean.getTypes().contains(Pitbull.class);
}
/**
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java 2009-03-17 22:20:19 UTC (rev 2078)
@@ -0,0 +1,53 @@
+/*
+ * 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.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.inject.manager.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.testng.annotations.Test;
+
+/**
+ * These tests are any that involve ejb-jar.xml resources.
+ *
+ * @author David Allen
+ */
+@Artifact
+(a)Packaging(PackagingType.EAR)
+@IntegrationTest
+@Resource(source="ejb-jar.xml", destination="META-INF/ejb-jar.xml")
+public class EnterpriseBeanViaXmlTest extends AbstractJSR299Test
+{
+ //TODO Once EJBs can be deployed in a WAR (3.1), this test should work
+ @Test(groups = { "enterpriseBeans", "broken" })
+ @SpecAssertions( { @SpecAssertion(section = "3.2.1", id = "n") })
+ public void testEjbDeclaredInXmlNotSimpleBean()
+ {
+ Bean<ElephantLocal> elephantBean = getCurrentManager().resolveByType(ElephantLocal.class).iterator().next();
+ // The interface is a known type but the class should not be
+ assert elephantBean.getTypes().contains(ElephantLocal.class);
+ assert !elephantBean.getTypes().contains(Elephant.class);
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-03-17 20:30:59 UTC (rev 2077)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-03-17 22:20:19 UTC (rev 2078)
@@ -14,6 +14,13 @@
{
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
+ @SpecAssertion(section = "3.3.1", id = "a")
+ public void applicationMayCallAnyRemoveMethodOnDependentScopedSessionEnterpriseBeans()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
@SpecAssertion(section = "3.3.1", id = "da")
public void applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButNoParametersArePassed()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Antelope_NotBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Antelope_NotBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Antelope_NotBean.java 2009-03-17 22:20:19 UTC (rev 2078)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition;
+
+public class Antelope_NotBean
+{
+ public Antelope_NotBean(String name)
+ {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Antelope_NotBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-03-17 20:30:59 UTC (rev 2077)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-03-17 22:20:19 UTC (rev 2078)
@@ -113,6 +113,29 @@
assert getCurrentManager().resolveByType(MockUIComponent.class).size() == 0;
}
+ @Test
+ @SpecAssertion(section="3.2.1", id="p")
+ public void testSimpleBeanOnlyIfConstructorParameterless()
+ {
+ assert getCurrentManager().resolveByType(Antelope_NotBean.class).isEmpty();
+ assert !getCurrentManager().resolveByType(Donkey.class).isEmpty();
+ }
+
+ @Test
+ @SpecAssertion(section="3.2.1", id="q")
+ public void testSimpleBeanOnlyIfConstructorIsInitializer()
+ {
+ assert getCurrentManager().resolveByType(Antelope_NotBean.class).isEmpty();
+ assert !getCurrentManager().resolveByType(Sheep.class).isEmpty();
+ }
+
+ @Test(groups = { "stub", "webbeansxml" })
+ @SpecAssertion(section = "3.2.1", id = "r")
+ public void testAdditionalSimpleBeansFromSameClassViaXml()
+ {
+ assert false;
+ }
+
@Test(expectedExceptions = DefinitionException.class, groups = { "stub", "webbeansxml" })
@SpecAssertion(section = "3.2.4", id = "e")
public void testAbstractClassDeclaredInXmlIsNotAllowed()
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ejb-jar.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ejb-jar.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ejb-jar.xml 2009-03-17 22:20:19 UTC (rev 2078)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+ version="3.0">
+ <description>JSR-299 Enterprise Bean Definition Test</description>
+ <display-name>JSR-299 Enterprise Bean Definition Test</display-name>
+ <enterprise-beans>
+ <session>
+ <ejb-name>Elephant</ejb-name>
+ <local>org.jboss.jsr299.tck.tests.implementation.enterprise.definition.ElephantLocal</local>
+ <ejb-class>org.jboss.jsr299.tck.tests.implementation.enterprise.definition.Elephant</ejb-class>
+ <session-type>Stateless</session-type>
+ <transaction-type>Container</transaction-type>
+ </session>
+ </enterprise-beans>
+</ejb-jar>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ejb-jar.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-17 20:30:59 UTC (rev 2077)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-17 22:20:19 UTC (rev 2078)
@@ -1037,15 +1037,15 @@
</section>
<section id="3.2.8" title="Default name for a simple bean">
- <assertion id="a" testable="false">
+ <assertion id="a">
<text>The default name for a simple bean is the unqualified class name of the bean class, after converting the first character to lower case</text>
- <note>This is a reference to the EJB specification</note>
</assertion>
</section>
<section id="3.3" title="Session beans">
- <assertion id="a">
+ <assertion id="a" testable="false">
<text>A session bean is a bean that is implemented by an EJB 3-style session bean</text>
+ <note>This is a reference to the EJB specification</note>
</assertion>
<assertion id="b">
15 years, 10 months