Author: akazakov
Date: 2010-04-06 11:12:15 -0400 (Tue, 06 Apr 2010)
New Revision: 21291
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ScopeDefinitionTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5808 Added new CDI tests for Scope types.
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ScopeDefinitionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ScopeDefinitionTest.java 2010-04-06
14:31:53 UTC (rev 21290)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ScopeDefinitionTest.java 2010-04-06
15:12:15 UTC (rev 21291)
@@ -153,4 +153,71 @@
"javax.enterprise.context.RequestScoped", bean.getScope()
.getSourceType().getFullyQualifiedName());
}
+
+ /**
+ * section 4.1 baa)
+ *
+ * @throws JavaModelException
+ */
+ public void testScopeTypeNotDeclaredInheritedIsNotInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.ShetlandPony");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
"javax.enterprise.context.Dependent",
+ bean.getScope().getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 ba)
+ *
+ * @throws JavaModelException
+ */
+ public void
testScopeTypeDeclaredInheritedIsBlockedByIntermediateScopeTypeMarkedInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.GoldenRetriever");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ }
+
+ /**
+ * section 4.1 ba)
+ *
+ * @throws JavaModelException
+ */
+ public void
testScopeTypeDeclaredInheritedIsBlockedByIntermediateScopeTypeNotMarkedInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.GoldenLabrador");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
"javax.enterprise.context.Dependent",
+ bean.getScope().getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 bc)
+ *
+ * @throws JavaModelException
+ */
+ public void testScopeTypeDeclaredInheritedIsIndirectlyInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.EnglishBorderCollie");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 bca)
+ *
+ * @throws JavaModelException
+ */
+ public void testScopeTypeNotDeclaredInheritedIsNotIndirectlyInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.MiniatureClydesdale");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
"javax.enterprise.context.Dependent",
+ bean.getScope().getSourceType().getFullyQualifiedName());
+ }
}
\ No newline at end of file