Author: akazakov
Date: 2010-03-02 10:34:47 -0500 (Tue, 02 Mar 2010)
New Revision: 20567
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5808
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF 2010-03-02 14:27:15
UTC (rev 20566)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF 2010-03-02 15:34:47
UTC (rev 20567)
@@ -12,6 +12,7 @@
org.jboss.tools.cdi.core,
org.jboss.tools.common,
org.eclipse.ui,
- org.eclipse.jdt.core
+ org.eclipse.jdt.core,
+ org.jboss.tools.common.el.core
Export-Package: org.jboss.tools.cdi.core.test,
org.jboss.tools.cdi.core.test.tck
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java 2010-03-02
14:27:15 UTC (rev 20566)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefinitionTest.java 2010-03-02
15:34:47 UTC (rev 20567)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IFile;
import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IScope;
import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.common.text.ITextSourceReference;
@@ -35,7 +36,6 @@
assertTrue("No legal types were found for
org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.",
bean.getLegalTypes().size() > 0);
Set<ITypeDeclaration> declarations = bean.getAllTypeDeclarations();
assertEquals("There should be two type declarations in
org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.", declarations.size(),
2);
- // TODO use correct start position instead of 0.
assertLocationEquals(declarations, 936, 10);
assertLocationEquals(declarations, 958, 6);
}
@@ -49,6 +49,19 @@
assertTrue("No qualifiers were found for
org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.",
beans.iterator().next().getQualifiers().size() > 0);
}
+ /**
+ * c) A bean comprises of a scope.
+ */
+ public void testHasScopeType() {
+ IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/bean/RedSnapper.java");
+ Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ IBean bean = beans.iterator().next();
+ IScope scope = bean.getScope();
+ assertNotNull("org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean
desn't have a scope.", scope);
+ assertNotNull("Scope of org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean
doesn't have a link to IType.", scope.getSourceType());
+ assertEquals("Wrong scope type for
org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.",
"javax.enterprise.context.RequestScoped",
scope.getSourceType().getFullyQualifiedName());
+ }
+
private void assertLocationEquals(Set<? extends ITextSourceReference> references,
int startPosition, int length) {
for (ITextSourceReference reference : references) {
if(reference.getStartPosition()==startPosition) {