Author: akazakov
Date: 2010-04-06 12:29:41 -0400 (Tue, 06 Apr 2010)
New Revision: 21293
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.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-06
15:48:59 UTC (rev 21292)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java 2010-04-06
16:29:41 UTC (rev 21293)
@@ -19,6 +19,7 @@
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;
+import org.jboss.tools.cdi.core.test.tck.StereotypeDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.ValidationTest;
/**
@@ -34,6 +35,7 @@
suite.addTestSuite(EnterpriseQualifierDefinitionTest.class);
suite.addTestSuite(ScopeDefinitionTest.class);
suite.addTestSuite(EnterpriseScopeDefinitionTest.class);
+ suite.addTestSuite(StereotypeDefinitionTest.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/StereotypeDefinitionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.java 2010-04-06
16:29:41 UTC (rev 21293)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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;
+import org.jboss.tools.cdi.core.IStereotypeDeclaration;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class StereotypeDefinitionTest extends TCKTest {
+
+ /**
+ * section 2.7.1.1 aa)
+ * section 2.4.3 c)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeWithScopeType() throws JavaModelException {
+ Set<IBean> beans =
getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Moose");
+ 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<IStereotypeDeclaration> declarations = bean
+ .getStereotypeDeclarations();
+ assertEquals("Wrong number of stereotype declarations", 1, declarations
+ .size());
+ assertLocationEquals(declarations, 835, 17);
+ }
+}
\ 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/StereotypeDefinitionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain