Author: akazakov
Date: 2010-04-05 14:18:07 -0400 (Mon, 05 Apr 2010)
New Revision: 21270
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 Core tests for Scope
definitions.
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-05
17:29:18 UTC (rev 21269)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ScopeDefinitionTest.java 2010-04-05
18:18:07 UTC (rev 21270)
@@ -23,15 +23,50 @@
/**
* section 2.4 c)
- * @throws JavaModelException
+ *
+ * @throws JavaModelException
*/
public void testScopeTypesAreExtensible() throws JavaModelException {
Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.Mullet");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
- assertEquals("Wrong scope type",
"org.jboss.jsr299.tck.tests.definition.scope.AnotherScopeType",
bean.getScope().getSourceType().getFullyQualifiedName());
+ assertEquals("Wrong scope type",
+ "org.jboss.jsr299.tck.tests.definition.scope.AnotherScopeType",
+ bean.getScope().getSourceType().getFullyQualifiedName());
Set<IScopeDeclaration> declarations = bean.getScopeDeclarations();
- assertEquals("Wrong number of scope declarations", 1, declarations.size());
+ assertEquals("Wrong number of scope declarations", 1, declarations
+ .size());
assertLocationEquals(declarations, 848, 17);
}
+
+ /**
+ * section 2.4.3 a)
+ *
+ * @throws JavaModelException
+ */
+ public void testScopeDeclaredInJava() throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.SeaBass");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ Set<IScopeDeclaration> declarations = bean.getScopeDeclarations();
+ assertEquals("Wrong number of scope declarations", 1, declarations
+ .size());
+ assertLocationEquals(declarations, 898, 14);
+ }
+
+ /**
+ * section 2.4.4 aa)
+ *
+ * @throws JavaModelException
+ */
+ public void testDefaultScope() throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.Order");
+ 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