Author: akazakov
Date: 2010-04-07 09:08:14 -0400 (Wed, 07 Apr 2010)
New Revision: 21303
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.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 Stereotypes.
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-07
12:38:56 UTC (rev 21302)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java 2010-04-07
13:08:14 UTC (rev 21303)
@@ -17,6 +17,7 @@
import org.jboss.tools.cdi.core.test.tck.DefaultNamedTest;
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.EnterpriseStereotypeDefinitionTest;
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;
@@ -38,6 +39,7 @@
suite.addTestSuite(EnterpriseScopeDefinitionTest.class);
suite.addTestSuite(StereotypeDefinitionTest.class);
suite.addTestSuite(DefaultNamedTest.class);
+ suite.addTestSuite(EnterpriseStereotypeDefinitionTest.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/EnterpriseStereotypeDefinitionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java 2010-04-07
13:08:14 UTC (rev 21303)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * 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 EnterpriseStereotypeDefinitionTest extends TCKTest {
+
+ /**
+ * section 4.1 am)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeDeclaredInheritedIsInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.BorderCollieLocal");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 ama)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeNotDeclaredInheritedIsNotInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.BarracudaLocal");
+ IBean bean = beans.iterator().next();
+ assertFalse("Wrong scope type",
+ "javax.enterprise.context.RequestScoped".equals(bean.getScope()
+ .getSourceType().getFullyQualifiedName()));
+ }
+
+ /**
+ * section 4.1 aq)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeDeclaredInheritedIsIndirectlyInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.EnglishBorderCollieLocal");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 aqa)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeNotDeclaredInheritedIsNotIndirectlyInherited()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.TameBarracudaLocal");
+ IBean bean = beans.iterator().next();
+ assertFalse("Wrong scope type",
+ "javax.enterprise.context.RequestScoped".equals(bean.getScope()
+ .getSourceType().getFullyQualifiedName()));
+ }
+
+ /**
+ * section 4.1 hhj)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeScopeIsOverriddenByInheritedScope()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.ChihuahuaLocal");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.SessionScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 hhk)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
+ throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.MexicanChihuahuaLocal");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.SessionScoped", 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/EnterpriseStereotypeDefinitionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain