Author: jharting
Date: 2009-07-23 08:48:02 -0400 (Thu, 23 Jul 2009)
New Revision: 3150
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbRemote.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EnabledEjb.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/NotEnabledEjb.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/SessionBeanPolicyTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/enterprise/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/enterprise/beans.xml
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Added test for policy enablement of session beans
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbRemote.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbRemote.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbRemote.java 2009-07-23
12:48:02 UTC (rev 3150)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.policy.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+interface EjbRemote
+{
+ String hello();
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EnabledEjb.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EnabledEjb.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EnabledEjb.java 2009-07-23
12:48:02 UTC (rev 3150)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.policy.enterprise;
+
+import javax.ejb.Stateless;
+import javax.enterprise.inject.Policy;
+
+@Stateless
+@Policy
+class EnabledEjb implements EjbRemote
+{
+ public String hello() {
+ return "Hello world!";
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/NotEnabledEjb.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/NotEnabledEjb.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/NotEnabledEjb.java 2009-07-23
12:48:02 UTC (rev 3150)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.policy.enterprise;
+
+import javax.ejb.Stateless;
+import javax.enterprise.inject.Policy;
+
+@Stateless
+@Policy
+class NotEnabledEjb implements EjbRemote
+{
+ public String hello() {
+ return "Hi!";
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/SessionBeanPolicyTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/SessionBeanPolicyTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/SessionBeanPolicyTest.java 2009-07-23
12:48:02 UTC (rev 3150)
@@ -0,0 +1,47 @@
+/*
+ * 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.policy.enterprise;
+
+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.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+(a)Packaging(PackagingType.EAR)
+@IntegrationTest
+(a)BeansXml("beans.xml")
+public class SessionBeanPolicyTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "policy", "ri-broken" })
+ @SpecAssertion(section = "5.2", id = "eb")
+ public void testEnabledPolicyAvailable()
+ {
+ assert getBeans(EjbRemote.class).size() == 1;
+ assert
getBeans(EjbRemote.class).iterator().next().getTypes().contains(EnabledEjb.class);
+ }
+}
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/enterprise/beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/enterprise/beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/policy/enterprise/beans.xml 2009-07-23
12:48:02 UTC (rev 3150)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans>
+ <policies>
+ <class>org.jboss.jsr299.tck.tests.policy.enterprise.EnabledEjb</class>
+ </policies>
+</beans>
\ No newline at end of file
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-23 12:36:32 UTC (rev 3149)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-23 12:48:02 UTC (rev 3150)
@@ -1674,9 +1674,13 @@
<text>The <policies> element contains a list of bean classes
and stereotypes. </text>
</assertion>
- <assertion id="e">
- <text>A policy is enabled for the bean deployment archive if the policy is a
managed bean or session bean and the bean class of the bean is listed.</text>
+ <assertion id="ea">
+ <text>A policy is enabled for the bean deployment archive if the policy is a
_managed bean_ or ~session bean~ and the bean class of the bean is listed.</text>
</assertion>
+
+ <assertion id="eb">
+ <text>A policy is enabled for the bean deployment archive if the policy is a
~managed bean~ or _session bean_ and the bean class of the bean is listed.</text>
+ </assertion>
<assertion id="f">
<text>A policy is enabled for the bean deployment archive if the policy is a
producer method, field or resource, and the bean class that declares the method or field
is listed.</text>
@@ -1946,7 +1950,7 @@
<text>If the scope is not active, as specified in Section 6.5.1, "The
active context object for a scope", the client proxy rethrows
|ContextNotActiveException| or |IllegalStateException|.</text>
</assertion>
- <assertion id="b">
+ <assertion id="b" testable="false">
<text>The behavior of all methods declared by |java.lang.Object|, except for
|toString()|, is undefined for a client proxy</text>
</assertion>
@@ -2006,7 +2010,7 @@
<text>A reference to a bean injected into a disposer method or observer
method is valid until the invocation of the method completes.</text>
</assertion>
- <assertion id="g">
+ <assertion id="g" testable="false">
<text>The application should not invoke a method of an invalid reference. If
the application invokes a method of an invalid injected reference, the behavior is
undefined.</text>
</assertion>
</section>