Author: dallen6
Date: 2009-06-01 17:14:29 -0400 (Mon, 01 Jun 2009)
New Revision: 2740
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
Log:
Fixed some of the currently broken tests
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-06-01
09:37:06 UTC (rev 2739)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-06-01
21:14:29 UTC (rev 2740)
@@ -12,6 +12,8 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
+import org.jboss.jsr299.tck.tests.event.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -27,8 +29,9 @@
public void testDefaultBindingDeclaredInJava()
{
Bean<Order> order =
getCurrentManager().getBeans(Order.class).iterator().next();
- assert order.getBindings().size() == 1;
- order.getBindings().iterator().next().annotationType().equals(Production.class);
+ assert order.getBindings().size() == 2;
+ assert order.getBindings().contains(new CurrentLiteral());
+ assert order.getBindings().contains(new AnyBinding());
}
@Test
@@ -37,7 +40,7 @@
{
Bean<Order> order =
getCurrentManager().getBeans(Order.class).iterator().next();
InjectionPoint injectionPoint = order.getInjectionPoints().iterator().next();
- assert
injectionPoint.getBean().getBindings().iterator().next().annotationType().equals(Current.class);
+ assert injectionPoint.getBean().getBindings().contains(new CurrentLiteral());
}
@Test(groups = { "annotationDefinition" })
@@ -52,7 +55,7 @@
public void testBindingsDeclaredInJava()
{
Bean<Cat> cat = getCurrentManager().getBeans(Cat.class, new
SynchronousBinding()).iterator().next();
- assert cat.getBindings().size() == 1;
+ assert cat.getBindings().size() == 2;
assert cat.getBindings().contains(new SynchronousBinding());
}
@@ -64,7 +67,7 @@
public void testMultipleBindings()
{
Bean<?> model = getCurrentManager().getBeans(Cod.class, new
ChunkyBinding(true), new WhitefishBinding()).iterator().next();
- assert model.getBindings().size() == 2;
+ assert model.getBindings().size() == 3;
}
@Test(groups = { "injection", "producerMethod" })
@@ -101,8 +104,9 @@
public void testBindingDeclaredInheritedIsInherited() throws Exception
{
Set<? extends Annotation> bindings =
getCurrentManager().getBeans(BorderCollie.class, new
HairyBinding(false)).iterator().next().getBindings();
- assert bindings.size() == 1;
- assert bindings.iterator().next().annotationType().equals(Hairy.class);
+ assert bindings.size() == 2;
+ assert bindings.contains(new HairyBinding(false));
+ assert bindings.contains(new AnyBinding());
}
@Test
@@ -110,8 +114,9 @@
public void testBindingNotDeclaredInheritedIsNotInherited()
{
Set<? extends Annotation> bindings =
getCurrentManager().getBeans(ShetlandPony.class).iterator().next().getBindings();
- assert bindings.size() == 1;
- assert bindings.iterator().next().annotationType().equals(Current.class);
+ assert bindings.size() == 2;
+ assert bindings.contains(new CurrentLiteral());
+ assert bindings.contains(new AnyBinding());
}
@Test
@@ -119,11 +124,10 @@
public void testBindingDeclaredInheritedIsBlockedByIntermediateClass()
{
Set<? extends Annotation> bindings =
getCurrentManager().getBeans(ClippedBorderCollie.class, new
HairyBinding(true)).iterator().next().getBindings();
- assert bindings.size() == 1;
- Annotation binding = bindings.iterator().next();
- assert binding.annotationType().equals(Hairy.class);
- Hairy hairy = (Hairy) binding;
- assert hairy.clipped();
+ assert bindings.size() == 2;
+ Annotation hairyLiteral = new HairyBinding(true);
+ assert bindings.contains(hairyLiteral);
+ assert bindings.contains(new AnyBinding());
}
@Test
@@ -131,8 +135,8 @@
public void testBindingDeclaredInheritedIsIndirectlyInherited()
{
Set<? extends Annotation> bindings =
getCurrentManager().getBeans(EnglishBorderCollie.class, new
HairyBinding(false)).iterator().next().getBindings();
- assert bindings.size() == 1;
- assert bindings.iterator().next().annotationType().equals(Hairy.class);
+ assert bindings.size() == 2;
+ assert bindings.contains(new HairyBinding(false));
}
}
\ No newline at end of file
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-06-01
09:37:06 UTC (rev 2739)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-06-01
21:14:29 UTC (rev 2740)
@@ -146,8 +146,8 @@
Set<Bean<Tarantula>> tarantulaBeans =
getCurrentManager().getBeans(Tarantula.class, new TameAnnotationLiteral());
assert tarantulaBeans.size() == 1;
Bean<Tarantula> tarantulaModel = tarantulaBeans.iterator().next();
- assert tarantulaModel.getBindings().size() == 1;
- assert
tarantulaModel.getBindings().iterator().next().annotationType().equals(Tame.class);
+ assert tarantulaModel.getBindings().size() == 2;
+ assert tarantulaModel.getBindings().contains(TAME_LITERAL);
}
@Test(groups = "producerField")
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-01
09:37:06 UTC (rev 2739)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-01
21:14:29 UTC (rev 2740)
@@ -4,15 +4,15 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.Current;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
+import org.jboss.jsr299.tck.tests.event.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -91,8 +91,9 @@
public void testDefaultBindingType() throws Exception
{
assert getCurrentManager().getBeans(Tarantula.class).size() == 1;
- assert
getCurrentManager().getBeans(Tarantula.class).iterator().next().getBindings().size() ==
1;
- assert
getCurrentManager().getBeans(Tarantula.class).iterator().next().getBindings().iterator().next().annotationType().equals(Current.class);
+ assert
getCurrentManager().getBeans(Tarantula.class).iterator().next().getBindings().size() ==
2;
+ assert
getCurrentManager().getBeans(Tarantula.class).iterator().next().getBindings().contains(new
CurrentLiteral());
+ assert
getCurrentManager().getBeans(Tarantula.class).iterator().next().getBindings().contains(new
AnyBinding());
}
@Test(groups = "producerMethod")
@@ -159,8 +160,8 @@
{
assert getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL).size() == 1;
Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class,
TAME_LITERAL).iterator().next();
- assert tarantula.getBindings().size() == 1;
- assert
tarantula.getBindings().iterator().next().annotationType().equals(Tame.class);
+ assert tarantula.getBindings().size() == 2;
+ assert tarantula.getBindings().contains(TAME_LITERAL);
}
@Test(groups = "producerMethod")
Show replies by date