Author: dan.j.allen
Date: 2009-06-17 13:23:43 -0400 (Wed, 17 Jun 2009)
New Revision: 2845
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/TestFilter.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/TestFilter.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/TestFilter.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/ResolvedIncompatibleStereotypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/Scallop.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/DefaultNamedTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/FallowDeer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/StereotypeWithEmptyNamed.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/Deer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/ResolvedMultipleStereotypesWithMultipleScopeTypesTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/beans.xml
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/FilterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/FilterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/FilterTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/IncompatibleStereotypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/Scallop_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/tooMany/BeanWithTooManyScopeTypes_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/tooMany/TooManyScopesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleDeploymentTypes/MultipleStereotypesWithMultipleDeploymentTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/MultipleStereotypesWithMultipleScopeTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/nonEmptyNamed/NonEmptyNamedTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
Log:
align select TCK tests to 20090519 spec
rename FilterTest to TestFilter to reflect its purpose as a fixture
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -82,7 +82,7 @@
}
@Test(groups = { "contexts" })
- @SpecAssertion(section = "unknown", id = "unknown")
+ @SpecAssertion(section = "unknown", id = "unknown") // combination
of 2.4.1 and 11.3.18
//@SpecAssertion(section = "8.5", id = "a")
public void testBuiltInContexts()
{
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -10,6 +10,9 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ * Spec version: 20090519
+ */
@Artifact
public class GetOnInactiveContextTest extends AbstractJSR299Test
{
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/FilterTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/FilterTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/FilterTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -1,55 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.application;
-
-import java.io.IOException;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Current;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-public class FilterTest implements Filter
-{
- @Current
- private BeanManager jsr299Manager;
-
- public void destroy()
- {
- jsr299Manager = null;
- }
-
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain
chain) throws IOException, ServletException
- {
- if (!jsr299Manager.getContext(ApplicationScoped.class).isActive())
- {
- throw new ServletException("Application context is not active");
- }
- else
- {
- chain.doFilter(request, response);
- }
- }
-
- public void init(FilterConfig filterConfig) throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- if (jsr299Manager == null)
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/Manager");
- }
- }
- catch (Exception e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/TestFilter.java
(from rev 2834,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/FilterTest.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/TestFilter.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/TestFilter.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,55 @@
+package org.jboss.jsr299.tck.tests.context.application;
+
+import java.io.IOException;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.naming.InitialContext;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+public class TestFilter implements Filter
+{
+ @Current
+ private BeanManager jsr299Manager;
+
+ public void destroy()
+ {
+ jsr299Manager = null;
+ }
+
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain
chain) throws IOException, ServletException
+ {
+ if (!jsr299Manager.getContext(ApplicationScoped.class).isActive())
+ {
+ throw new ServletException("Application context is not active");
+ }
+ else
+ {
+ chain.doFilter(request, response);
+ }
+ }
+
+ public void init(FilterConfig filterConfig) throws ServletException
+ {
+ //TODO Remove init code once injection works in servlet container
+ try
+ {
+ if (jsr299Manager == null)
+ {
+ InitialContext ic = new InitialContext();
+ jsr299Manager = (BeanManager) ic.lookup("java:app/Manager");
+ }
+ }
+ catch (Exception e)
+ {
+ throw new ServletException("Error looking up manager", e);
+ }
+ }
+
+}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/FilterTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/FilterTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/FilterTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -1,55 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.request;
-
-import java.io.IOException;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Current;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-public class FilterTest implements Filter
-{
- @Current
- private BeanManager jsr299Manager;
-
- public void destroy()
- {
- jsr299Manager = null;
- }
-
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain
chain) throws IOException, ServletException
- {
- if (!jsr299Manager.getContext(ApplicationScoped.class).isActive())
- {
- throw new ServletException("Application context is not active");
- }
- else
- {
- chain.doFilter(request, response);
- }
- }
-
- public void init(FilterConfig filterConfig) throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- if (jsr299Manager == null)
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/Manager");
- }
- }
- catch (Exception e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/TestFilter.java
(from rev 2834,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/FilterTest.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/TestFilter.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/TestFilter.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,55 @@
+package org.jboss.jsr299.tck.tests.context.request;
+
+import java.io.IOException;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.naming.InitialContext;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+public class TestFilter implements Filter
+{
+ @Current
+ private BeanManager jsr299Manager;
+
+ public void destroy()
+ {
+ jsr299Manager = null;
+ }
+
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain
chain) throws IOException, ServletException
+ {
+ if (!jsr299Manager.getContext(ApplicationScoped.class).isActive())
+ {
+ throw new ServletException("Application context is not active");
+ }
+ else
+ {
+ chain.doFilter(request, response);
+ }
+ }
+
+ public void init(FilterConfig filterConfig) throws ServletException
+ {
+ //TODO Remove init code once injection works in servlet container
+ try
+ {
+ if (jsr299Manager == null)
+ {
+ InitialContext ic = new InitialContext();
+ jsr299Manager = (BeanManager) ic.lookup("java:app/Manager");
+ }
+ }
+ catch (Exception e)
+ {
+ throw new ServletException("Error looking up manager", e);
+ }
+ }
+
+}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/FilterTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/FilterTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/FilterTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -1,55 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.session;
-
-import java.io.IOException;
-
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.inject.Current;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-public class FilterTest implements Filter
-{
- @Current
- private BeanManager jsr299Manager;
-
- public void destroy()
- {
- jsr299Manager = null;
- }
-
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain
chain) throws IOException, ServletException
- {
- if (!jsr299Manager.getContext(SessionScoped.class).isActive())
- {
- throw new ServletException("Session is not active");
- }
- else
- {
- chain.doFilter(request, response);
- }
- }
-
- public void init(FilterConfig filterConfig) throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- if (jsr299Manager == null)
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/Manager");
- }
- }
- catch (Exception e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/TestFilter.java
(from rev 2834,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/FilterTest.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/TestFilter.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/TestFilter.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,55 @@
+package org.jboss.jsr299.tck.tests.context.session;
+
+import java.io.IOException;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.naming.InitialContext;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+public class TestFilter implements Filter
+{
+ @Current
+ private BeanManager jsr299Manager;
+
+ public void destroy()
+ {
+ jsr299Manager = null;
+ }
+
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain
chain) throws IOException, ServletException
+ {
+ if (!jsr299Manager.getContext(SessionScoped.class).isActive())
+ {
+ throw new ServletException("Session is not active");
+ }
+ else
+ {
+ chain.doFilter(request, response);
+ }
+ }
+
+ public void init(FilterConfig filterConfig) throws ServletException
+ {
+ //TODO Remove init code once injection works in servlet container
+ try
+ {
+ if (jsr299Manager == null)
+ {
+ InitialContext ic = new InitialContext();
+ jsr299Manager = (BeanManager) ic.lookup("java:app/Manager");
+ }
+ }
+ catch (Exception e)
+ {
+ throw new ServletException("Error looking up manager", e);
+ }
+ }
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/IncompatibleStereotypesTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/IncompatibleStereotypesTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/IncompatibleStereotypesTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -5,20 +5,22 @@
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.Classes;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
-@Artifact
+/**
+ * Spec version: 20090519
+ */
+@Artifact(addCurrentPackage = false)
+@Classes( { AnimalStereotype.class, FishStereotype.class, Scallop_Broken.class })
@ExpectedDeploymentException(DefinitionException.class)
public class IncompatibleStereotypesTest extends AbstractJSR299Test
{
-
-
- @Test
- @SpecAssertion(section="2.4.5", id = "d")
+ @Test
+ @SpecAssertion(section = "2.4.4", id = "da")
public void testMutipleIncompatibleScopeStereotypes()
{
assert false;
}
-
}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/ResolvedIncompatibleStereotypesTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/ResolvedIncompatibleStereotypesTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/ResolvedIncompatibleStereotypesTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.definition.scope.incompatibleStereotypes;
+
+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.Classes;
+import org.testng.annotations.Test;
+
+/**
+ * Spec version: 20090519
+ */
+@Artifact(addCurrentPackage = false)
+@Classes( { AnimalStereotype.class, FishStereotype.class, Scallop.class })
+public class ResolvedIncompatibleStereotypesTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions( { @SpecAssertion(section = "2.4.4", id = "da"),
@SpecAssertion(section = "2.4.4", id = "e") })
+ public void testMutipleIncompatibleScopeStereotypesWithOverride()
+ {
+ assert true;
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/Scallop.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/Scallop.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/Scallop.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.definition.scope.incompatibleStereotypes;
+
+import javax.enterprise.context.RequestScoped;
+
+/**
+ * This bean definition is valid because it declares two stereotypes that have
+ * different default scopes yet the bean explictly defines a scope to resolve
+ * the conflict.
+ */
+@AnimalStereotype
+@FishStereotype
+@RequestScoped
+class Scallop
+{
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/Scallop_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/Scallop_Broken.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/incompatibleStereotypes/Scallop_Broken.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -1,6 +1,10 @@
package org.jboss.jsr299.tck.tests.definition.scope.incompatibleStereotypes;
-
+/**
+ * This bean definition is invalid because it declares two stereotypes
+ * that have different default scopes and the bean does not explictly
+ * define a scope to resolve the conflict.
+ */
@AnimalStereotype
@FishStereotype
class Scallop_Broken
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/tooMany/BeanWithTooManyScopeTypes_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/tooMany/BeanWithTooManyScopeTypes_Broken.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/tooMany/BeanWithTooManyScopeTypes_Broken.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -7,5 +7,4 @@
@ConversationScoped
class BeanWithTooManyScopeTypes_Broken
{
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/tooMany/TooManyScopesTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/tooMany/TooManyScopesTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/tooMany/TooManyScopesTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -8,16 +8,19 @@
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
+/**
+ * Spec version: 20090519
+ */
@Artifact
@ExpectedDeploymentException(DefinitionException.class)
public class TooManyScopesTest extends AbstractJSR299Test
{
-
- @Test
- @SpecAssertion(section="2.4.3", id = "b")
+
+ @Test
+ @SpecAssertion(section = "2.4.3", id = "ba")
public void testTooManyScopesSpecifiedInJava()
{
assert false;
}
-
+
}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/DefaultNamedTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/DefaultNamedTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/DefaultNamedTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed;
+
+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.testng.annotations.Test;
+
+/**
+ * Spec version: 20090519
+ */
+@Artifact
+public class DefaultNamedTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "2.7.1.3", id = "b"),
+ @SpecAssertion(section = "2.6.2", id = "e")
+ })
+ public void testStereotypeWithEmptyNamed()
+ {
+ assert getBeans(FallowDeer.class).size() == 1;
+ assert
"fallowDeer".equals(getBeans(FallowDeer.class).iterator().next().getName());
+ }
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/FallowDeer.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/FallowDeer.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/FallowDeer.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed;
+
+
+@StereotypeWithEmptyNamed
+class FallowDeer
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/StereotypeWithEmptyNamed.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/StereotypeWithEmptyNamed.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/defaultNamed/StereotypeWithEmptyNamed.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Stereotype;
+
+@Stereotype
+@Target( { TYPE })
+@Retention(RUNTIME)
+@Named
+@interface StereotypeWithEmptyNamed
+{
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -12,8 +12,7 @@
import org.testng.annotations.Test;
/**
- *
- * Spec version: PRD2
+ * Spec version: 20090519
*/
@IntegrationTest
@Artifact
@@ -31,20 +30,20 @@
@SpecAssertion(section = "4.1", id = "ak")
public void testStereotypeDeclaredInheritedIsIndirectlyInherited()
{
- assert
getBeans(EnglishBorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
- }
+ assert
getBeans(EnglishBorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ }
@Test
@SpecAssertion(section = "4.1", id = "dba")
public void testStereotypeScopeIsOverriddenByInheritedScope()
{
- assert
getBeans(ChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
+ assert
getBeans(ChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
}
@Test
@SpecAssertion(section = "4.1", id = "dda")
public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
{
- assert
getBeans(MexicanChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
- }
+ assert
getBeans(MexicanChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
+ }
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleDeploymentTypes/MultipleStereotypesWithMultipleDeploymentTypesTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleDeploymentTypes/MultipleStereotypesWithMultipleDeploymentTypesTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleDeploymentTypes/MultipleStereotypesWithMultipleDeploymentTypesTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -14,10 +14,10 @@
@ExpectedDeploymentException(DefinitionException.class)
public class MultipleStereotypesWithMultipleDeploymentTypesTest extends
AbstractJSR299Test
{
-
+ // TODO remove me - I don't think this is needed any more since satisfying
restrictions of a stereotype is no longer mentioned in the spec
+ // or if the case isn't cover, this test should ensure that the highest
precendence deployment type specified by the stereotypes is choosen
@Test(groups="stub")
- @SpecAssertions( { @SpecAssertion(section = "2.7.2", id = "e"),
- @SpecAssertion(section = "2.7.4", id = "c") })
+ @SpecAssertions( { @SpecAssertion(section = "2.7.2", id = "e"),
@SpecAssertion(section = "2.5.4", id = "da") })
public void testMultipleStereotypesWithMultipleDeploymentTypes()
{
assert false;
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/Deer.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/Deer.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/Deer.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,12 @@
+package
org.jboss.jsr299.tck.tests.definition.stereotype.multipleStereotypesWithMultipleScopeTypes;
+
+import javax.enterprise.context.RequestScoped;
+
+
+@ApplicationScopedHornedMammalStereotype
+@SessionScopedHornedMammalStereotype
+@RequestScoped
+public class Deer
+{
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/MultipleStereotypesWithMultipleScopeTypesTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/MultipleStereotypesWithMultipleScopeTypesTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/MultipleStereotypesWithMultipleScopeTypesTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -6,18 +6,24 @@
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.Classes;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
-@Artifact
+/**
+ * Spec version: 20090519
+ */
+@Artifact(addCurrentPackage = false)
+@Classes( { ApplicationScopedHornedMammalStereotype.class,
SessionScopedHornedMammalStereotype.class, Deer_Broken.class })
+(a)BeansXml("beans.xml")
@ExpectedDeploymentException(DefinitionException.class)
public class MultipleStereotypesWithMultipleScopeTypesTest extends AbstractJSR299Test
{
@Test
- @SpecAssertions( { @SpecAssertion(section = "2.7.2", id = "e"),
- @SpecAssertion(section = "2.7.4", id = "c") })
- public void testMultipleStereotypesWithMultipleScopeTypes()
+ @SpecAssertions( { @SpecAssertion(section = "2.7.2", id = "e"),
@SpecAssertion(section = "2.4.4", id = "da") })
+ public void testMultipleStereotypesResultingInMultipleScopeTypes()
{
assert false;
}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/ResolvedMultipleStereotypesWithMultipleScopeTypesTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/ResolvedMultipleStereotypesWithMultipleScopeTypesTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/ResolvedMultipleStereotypesWithMultipleScopeTypesTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,28 @@
+package
org.jboss.jsr299.tck.tests.definition.stereotype.multipleStereotypesWithMultipleScopeTypes;
+
+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.Classes;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * Spec version: 20090519
+ */
+@Artifact(addCurrentPackage = false)
+@Classes( { ApplicationScopedHornedMammalStereotype.class,
SessionScopedHornedMammalStereotype.class, Deer.class })
+(a)BeansXml("beans.xml")
+public class ResolvedMultipleStereotypesWithMultipleScopeTypesTest extends
AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertions( { @SpecAssertion(section = "2.7.2", id = "e"),
@SpecAssertion(section = "2.4.4", id = "e") })
+ public void testOverrideAllDefaultScopesFromMultipleStereotypes()
+ {
+ assert true;
+ }
+
+}
+
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/nonEmptyNamed/NonEmptyNamedTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/nonEmptyNamed/NonEmptyNamedTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/nonEmptyNamed/NonEmptyNamedTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -9,16 +9,18 @@
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
+/**
+ * Spec version: 20090519
+ */
@Artifact
@ExpectedDeploymentException(DefinitionException.class)
public class NonEmptyNamedTest extends AbstractJSR299Test
{
-
@Test
@SpecAssertions({
- @SpecAssertion(section = "2.7.1.3", id = "a"),
- @SpecAssertion(section = "2.6.3", id = "e")
+ @SpecAssertion(section = "2.7.1.3", id = "aa"),
+ @SpecAssertion(section = "2.6.2", id = "e")
})
public void testStereotypeWithNonEmptyNamed()
{
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-17
17:21:15 UTC (rev 2844)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-17
17:23:43 UTC (rev 2845)
@@ -21,8 +21,8 @@
/**
* Sections
*
- * 6.5. Lifecycle of stateful session beans
- * 6.6. Lifecycle of stateless session and singleton beans
+ * 6.5. Lifecycle of stateful session beans
+ * 6.6. Lifecycle of stateless session and singleton beans
* 6.11. Lifecycle of EJBs
*
* Mostly overlapping with other tests...
@@ -40,7 +40,7 @@
{
@Test(groups = {"enterpriseBeans", "clientProxy",
"lifecycle", "integration" })
- @SpecAssertions( {
+ @SpecAssertions( {
@SpecAssertion(section = "3.3.8", id = "a"),
@SpecAssertion(section = "3.3.9", id = "a"),
@SpecAssertion(section = "6", id = "a"),
@@ -62,14 +62,14 @@
assert anotherStadtInstance != stadtInstance : "create() should not return
same bean as before";
// Verify that the instance returned is a proxy by checking for all local
interfaces
- Set<Class<?>> interfaces = new
HashSet<Class<?>>(Arrays.asList(stadtInstance.getClass().getInterfaces()));
+ Set<Class> interfaces = new
HashSet<Class>(Arrays.asList(stadtInstance.getClass().getInterfaces()));
assert interfaces.contains(KleinStadt.class);
assert interfaces.contains(SchoeneStadt.class);
}
@Test(groups = { "ri-broken", "enterpriseBeans",
"clientProxy", "lifecycle", "integration" })
- @SpecAssertions( {
+ @SpecAssertions( {
@SpecAssertion(section = "3.3.9", id = "b")
})
public void testSerializeSFSB() throws Exception
@@ -132,7 +132,7 @@
assert stadtInstance != null : "Expected instance to be created by
container";
// Verify that the instance returned is a proxy by checking for all local
interfaces
- Set<Class<?>> interfaces = new
HashSet<Class<?>>(Arrays.asList(stadtInstance.getClass().getInterfaces()));
+ Set<Class> interfaces = new
HashSet<Class>(Arrays.asList(stadtInstance.getClass().getInterfaces()));
assert interfaces.contains(NeueStadt.class);
assert interfaces.contains(GeschichtslosStadt.class);
}
@@ -182,7 +182,7 @@
}
}.run();
assert OrderProcessor.postConstructCalled;
- }
+ }
@Test
@SpecAssertion(section = "4.2", id = "bad")
@@ -199,7 +199,7 @@
}
}.run();
assert OrderProcessor.postConstructCalled;
- }
+ }
@Test(groups = "ri-broken")
@SpecAssertion(section = "4.2", id = "bbb")
@@ -211,7 +211,7 @@
{
@Override
protected void execute() throws Exception
- {
+ {
Bean<DirectOrderProcessorLocal> bean =
getBeans(DirectOrderProcessorLocal.class).iterator().next();
DirectOrderProcessorLocal instance =
getInstanceByType(DirectOrderProcessorLocal.class);
destroyAndRemoveBeanInstance(bean, instance);
@@ -230,12 +230,12 @@
{
@Override
protected void execute() throws Exception
- {
+ {
Bean<IndirectOrderProcessor> bean =
getBeans(IndirectOrderProcessor.class).iterator().next();
IndirectOrderProcessor instance =
getInstanceByType(IndirectOrderProcessor.class);
destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
assert OrderProcessor.preDestroyCalled;
- }
+ }
}
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesWithMultipleScopeTypes/beans.xml 2009-06-17
17:23:43 UTC (rev 2845)
@@ -0,0 +1,8 @@
+<beans>
+ <deploy>
+ <type>javax.enterprise.inject.deployment.Standard</type>
+ <type>javax.enterprise.inject.deployment.Production</type>
+
<type>org.jboss.jsr299.tck.tests.definition.stereotype.multipleStereotypesWithMultipleScopeTypes.ApplicationScopedHornedMammalStereotype</type>
+
<type>org.jboss.jsr299.tck.tests.definition.stereotype.multipleStereotypesWithMultipleScopeTypes.SessionScopedHornedMammalStereotype</type>
+ </deploy>
+</beans>
\ No newline at end of file