Author: akazakov
Date: 2010-04-06 11:48:59 -0400 (Tue, 06 Apr 2010)
New Revision: 21292
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseScopeDefinitionTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.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/CDICoreTestSuite.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java 2010-04-06
15:12:15 UTC (rev 21291)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java 2010-04-06
15:48:59 UTC (rev 21292)
@@ -15,6 +15,7 @@
import org.jboss.tools.cdi.core.test.tck.BeanDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.EnterpriseQualifierDefinitionTest;
+import org.jboss.tools.cdi.core.test.tck.EnterpriseScopeDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.NameDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.QualifierDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.ScopeDefinitionTest;
@@ -32,6 +33,7 @@
suite.addTestSuite(QualifierDefinitionTest.class);
suite.addTestSuite(EnterpriseQualifierDefinitionTest.class);
suite.addTestSuite(ScopeDefinitionTest.class);
+ suite.addTestSuite(EnterpriseScopeDefinitionTest.class);
suite.addTestSuite(ValidationTest.class);
return suite;
}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseScopeDefinitionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseScopeDefinitionTest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseScopeDefinitionTest.java 2010-04-06
15:48:59 UTC (rev 21292)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.test.tck;
+
+import java.util.Set;
+
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.IBean;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class EnterpriseScopeDefinitionTest extends TCKTest {
+
+ /**
+ * section 4.1 be)
+ *
+ * @throws JavaModelException
+ */
+ public void testScopeTypeDeclaredInheritedIsInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.BorderCollieLocal");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 bea)
+ *
+ * @throws JavaModelException
+ */
+ public void testScopeTypeNotDeclaredInheritedIsNotInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.SiameseLocal");
+ IBean bean = beans.iterator().next();
+ assertFalse("Wrong scope type",
+ "org.jboss.jsr299.tck.tests.definition.scope.enterprise.FooScoped"
+ .equals(bean.getScope().getSourceType()
+ .getFullyQualifiedName()));
+ }
+
+ /**
+ * section 4.1 bh)
+ *
+ * @throws JavaModelException
+ */
+ public void testScopeTypeDeclaredInheritedIsIndirectlyInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.EnglishBorderCollieLocal");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 bha)
+ *
+ * @throws JavaModelException
+ */
+ public void testScopeTypeNotDeclaredInheritedIsNotIndirectlyInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.BengalTigerLocal");
+ IBean bean = beans.iterator().next();
+ assertFalse("Wrong scope type",
+ "org.jboss.jsr299.tck.tests.definition.scope.enterprise.FooScoped"
+ .equals(bean.getScope().getSourceType()
+ .getFullyQualifiedName()));
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseScopeDefinitionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain