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
+(a)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">