[webbeans-commits] Webbeans SVN: r2212 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Thu Mar 26 03:45:19 EDT 2009
Author: shane.bryzak at jboss.com
Date: 2009-03-26 03:45:19 -0400 (Thu, 26 Mar 2009)
New Revision: 2212
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
Log:
tests for 2.5.2.a, 2.5.2.c
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-03-26 03:53:58 UTC (rev 2211)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-03-26 07:45:19 UTC (rev 2212)
@@ -1,6 +1,12 @@
package org.jboss.jsr299.tck.tests.definition.deployment;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+import java.util.Arrays;
+import java.util.List;
+
import javax.inject.DeploymentException;
+import javax.inject.DeploymentType;
import javax.inject.Production;
import javax.inject.UnsatisfiedDependencyException;
import javax.inject.manager.Bean;
@@ -21,27 +27,31 @@
@BeansXml("beans.xml")
public class DeploymentTypeDefinitionTest extends AbstractJSR299Test
{
-
- /**
- *
- * TODO This text is not really a testable assertion
- */
- @Test(groups = { "stub", "annotationDefinition", "deploymentType" })
+ @Test(groups = { "annotationDefinition", "deploymentType" })
@SpecAssertion(section = "2.5.2", id = "a")
public void testDeploymentTypeHasCorrectTarget()
{
- assert false;
+ assert getCurrentManager().resolveByType(BlackWidow.class).size() == 1;
+ Bean<BlackWidow> blackWidowSpiderModel = getCurrentManager().resolveByType(BlackWidow.class).iterator().next();
+
+ Target target = blackWidowSpiderModel.getScopeType().getAnnotation(Target.class);
+ List<ElementType> elements = Arrays.asList(target.value());
+ assert elements.contains(ElementType.TYPE);
+ assert elements.contains(ElementType.METHOD);
+ assert elements.contains(ElementType.FIELD);
}
/**
*
* TODO This text is not really a testable assertion
*/
- @Test(groups = { "stub", "annotationDefinition", "deploymentType" })
+ @Test(groups = { "annotationDefinition", "deploymentType" })
@SpecAssertion(section = "2.5.2", id = "c")
public void testDeploymentTypeDeclaresDeploymentTypeAnnotation()
{
- assert false;
+ assert getCurrentManager().resolveByType(BlackWidow.class).size() == 1;
+ Bean<BlackWidow> blackWidowSpiderModel = getCurrentManager().resolveByType(BlackWidow.class).iterator().next();
+ assert blackWidowSpiderModel.getDeploymentType().getAnnotation(DeploymentType.class) != null;
}
@Test(groups = { "deploymentType" })
More information about the weld-commits
mailing list