[webbeans-commits] Webbeans SVN: r3209 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event: eventTypes and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-25 07:19:40 -0400 (Sat, 25 Jul 2009)
New Revision: 3209
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
Log:
Marked some tests broken which are not properly testing the assertions for events
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-25 11:18:51 UTC (rev 3208)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-25 11:19:40 UTC (rev 3209)
@@ -90,22 +90,24 @@
getCurrentManager().fireEvent("string event", new AnnotationLiteral<NotABindingType>(){});
}
- @Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
+ @Test(groups = { "events", "broken" }, expectedExceptions = { IllegalArgumentException.class })
@SpecAssertions({
@SpecAssertion(section = "10.1", id = "aa"),
@SpecAssertion(section = "11.3.10", id = "c")
})
+ //TODO This test does not have a template variable nor is there a way to write that in Java
public void testManagerFireEventWithEventTypeParametersFails()
{
ATemplatedEventType<String> anEvent = new ATemplatedEventType<String>();
getCurrentManager().fireEvent(anEvent);
}
- @Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertions({
- @SpecAssertion(section = "10.1", id = "aa"),
- @SpecAssertion(section = "11.3.10", id = "c")
- })
+// @Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
+// @SpecAssertions({
+// @SpecAssertion(section = "10.1", id = "aa"),
+// @SpecAssertion(section = "11.3.10", id = "c")
+// })
+ // The spec no longer prohibits wildcards
public void testBeanManagerFireEventWithEventTypeWildcardsFails()
{
ATemplatedEventType<?> anEventOnAnyType = new ATemplatedEventType<String>();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java 2009-07-25 11:18:51 UTC (rev 3208)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java 2009-07-25 11:19:40 UTC (rev 3209)
@@ -57,15 +57,17 @@
assert observer.getTotalEventsObserved() == 4;
}
- @Test(groups = { "event", "review" }, expectedExceptions = IllegalArgumentException.class)
+ @Test(groups = { "event", "broken", "review" }, expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = "10.1", id = "cb")
+ //TODO There is still no type variable involved in this test nor is there a way to write this in Java
public void testEventTypeFiredByEventInterfaceMayNotContainTypeVariable()
{
getInstanceByType(TuneSelect.class).soloArtistPlaying(new Artist<Solo>());
}
- @Test(groups = { "event", "review" }, expectedExceptions = IllegalArgumentException.class)
+ @Test(groups = { "event", "review", "broken" }, expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = "10.1", id = "cb")
+ //TODO There is still no type variable involved in this test nor is there a way to write this in Java
public void testEventTypeFiredByBeanManagerMayNotContainTypeVariable()
{
getCurrentManager().fireEvent(new Artist<Solo>());
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java 2009-07-25 11:18:51 UTC (rev 3208)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java 2009-07-25 11:19:40 UTC (rev 3209)
@@ -34,7 +34,7 @@
* This test verifies that the {@link Event} object capable of firing
* {@link Item} objects can be injected with the {@link @Any} binding type
* and that the injected object can be used to fire an event. The
- * functionality is verified by checking that the cooresponding observer gets
+ * functionality is verified by checking that the corresponding observer gets
* invoked.
*/
@Test(groups = "events")
@@ -199,8 +199,9 @@
assert housekeeping.getItemsTainted().contains(water);
}
- @Test(groups = "events", expectedExceptions = IllegalArgumentException.class)
+ @Test(groups = {"events", "broken"}, expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = "10.3.1", id = "f")
+ //TODO There does not seem to be any way to write code that compiles and tests this assertion
public void testEventFireThrowsExceptionIfEventObjectContainsTypeVariable()
{
MiniBar miniBar = getInstanceByType(MiniBar.class);
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3208 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: event and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-25 07:18:51 -0400 (Sat, 25 Jul 2009)
New Revision: 3208
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java
Log:
Changed exception conditions on the event objects
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-07-25 00:56:08 UTC (rev 3207)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-07-25 11:18:51 UTC (rev 3208)
@@ -791,11 +791,17 @@
*/
public void fireEvent(Object event, Annotation... bindings)
{
- // Check the event object for template parameters which are not allowed by
- // the spec.
+ // Make sure the event object above is not parameterized with a type
+ // variable
if (Reflections.isParameterizedType(event.getClass()))
{
- throw new IllegalArgumentException("Event type " + event.getClass().getName() + " is not allowed because it is a generic");
+ for (Type type : Reflections.getActualTypeArguments(event.getClass()))
+ {
+ if (type instanceof TypeVariable<?>)
+ {
+ throw new IllegalArgumentException("Cannot use a type variable " + type + " in an parameterized type " + toString());
+ }
+ }
}
// Also check that the binding types are truly binding types
for (Annotation binding : bindings)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-07-25 00:56:08 UTC (rev 3207)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-07-25 11:18:51 UTC (rev 3208)
@@ -23,7 +23,6 @@
import java.util.Set;
import javax.enterprise.event.Event;
-import javax.enterprise.event.Observer;
import javax.enterprise.inject.TypeLiteral;
import org.jboss.webbeans.BeanManagerImpl;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java 2009-07-25 00:56:08 UTC (rev 3207)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java 2009-07-25 11:18:51 UTC (rev 3208)
@@ -111,7 +111,7 @@
{
for (Type type : eventParam.getActualTypeArguments())
{
- if (type instanceof TypeVariable)
+ if (type instanceof TypeVariable<?>)
{
throw new DefinitionException("Cannot use a type variable " + type + " in an parameterized type " + toString());
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3207 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event: implicit and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-24 20:56:08 -0400 (Fri, 24 Jul 2009)
New Revision: 3207
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Artist.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/ComplexEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/HonorsLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeABinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeBBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeCBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/AnotherFooObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/Foo.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/FooObserver.java
Log:
remove unnecessary public modifiers on class definition
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Artist.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Artist.java 2009-07-25 00:44:37 UTC (rev 3206)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Artist.java 2009-07-25 00:56:08 UTC (rev 3207)
@@ -1,5 +1,5 @@
package org.jboss.jsr299.tck.tests.event.eventTypes;
-public class Artist<T>
+class Artist<T>
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/ComplexEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/ComplexEvent.java 2009-07-25 00:44:37 UTC (rev 3206)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/ComplexEvent.java 2009-07-25 00:56:08 UTC (rev 3207)
@@ -22,6 +22,6 @@
*
* @author David Allen
*/
-public class ComplexEvent extends AbstractEvent implements GeneralEvent
+class ComplexEvent extends AbstractEvent implements GeneralEvent
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/HonorsLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/HonorsLiteral.java 2009-07-25 00:44:37 UTC (rev 3206)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/HonorsLiteral.java 2009-07-25 00:56:08 UTC (rev 3207)
@@ -2,6 +2,6 @@
import javax.enterprise.inject.AnnotationLiteral;
-public class HonorsLiteral extends AnnotationLiteral<Honors>
+class HonorsLiteral extends AnnotationLiteral<Honors>
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeABinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeABinding.java 2009-07-25 00:44:37 UTC (rev 3206)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeABinding.java 2009-07-25 00:56:08 UTC (rev 3207)
@@ -2,6 +2,6 @@
import javax.enterprise.inject.AnnotationLiteral;
-public class BindingTypeABinding extends AnnotationLiteral<BindingTypeA> implements BindingTypeA
+class BindingTypeABinding extends AnnotationLiteral<BindingTypeA> implements BindingTypeA
{
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeBBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeBBinding.java 2009-07-25 00:44:37 UTC (rev 3206)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeBBinding.java 2009-07-25 00:56:08 UTC (rev 3207)
@@ -2,6 +2,6 @@
import javax.enterprise.inject.AnnotationLiteral;
-public class BindingTypeBBinding extends AnnotationLiteral<BindingTypeB> implements BindingTypeB
+class BindingTypeBBinding extends AnnotationLiteral<BindingTypeB> implements BindingTypeB
{
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeCBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeCBinding.java 2009-07-25 00:44:37 UTC (rev 3206)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeCBinding.java 2009-07-25 00:56:08 UTC (rev 3207)
@@ -2,7 +2,7 @@
import javax.enterprise.inject.AnnotationLiteral;
-public class BindingTypeCBinding extends AnnotationLiteral<BindingTypeC> implements BindingTypeC
+class BindingTypeCBinding extends AnnotationLiteral<BindingTypeC> implements BindingTypeC
{
private String value;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/AnotherFooObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/AnotherFooObserver.java 2009-07-25 00:44:37 UTC (rev 3206)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/AnotherFooObserver.java 2009-07-25 00:56:08 UTC (rev 3207)
@@ -2,7 +2,7 @@
import javax.enterprise.event.Observes;
-public class AnotherFooObserver
+class AnotherFooObserver
{
public void observe(@Observes Foo<Integer> foo)
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/Foo.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/Foo.java 2009-07-25 00:44:37 UTC (rev 3206)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/Foo.java 2009-07-25 00:56:08 UTC (rev 3207)
@@ -1,6 +1,6 @@
package org.jboss.jsr299.tck.tests.event.resolve.typeWithParameters;
-public class Foo<T>
+class Foo<T>
{
private boolean observed;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/FooObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/FooObserver.java 2009-07-25 00:44:37 UTC (rev 3206)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/FooObserver.java 2009-07-25 00:56:08 UTC (rev 3207)
@@ -2,7 +2,7 @@
import javax.enterprise.event.Observes;
-public class FooObserver
+class FooObserver
{
public void observe(@Observes Foo<String> foo)
{
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3206 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event: bindingTypes and 8 other directories.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-24 20:44:37 -0400 (Fri, 24 Jul 2009)
New Revision: 3206
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Animal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/AnimalAssessment.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/DiscerningObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventEmitter.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonBindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonRuntimeBindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/TameAnnotationLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Wild.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/WildAnnotationLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/AbstractBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/ConcreteBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/AbstractEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Artist.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Broadcast.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/ComplexEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypeFamilyObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/GeneralEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Listener.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Solo.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Song.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/TuneSelect.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnEventType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherEventType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherObserver.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/Egg.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/EventInjectionWithUndefinedTypeVariableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/JavaSparrow_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/EventInjectionWithWildcardTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/EventInjectionWithoutTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/NonManagedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/ObserverMethodOnIncorrectBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java
Log:
wrote additional event tests and updated assertions for 20090625 (event section not yet complete)
repackaged many of the existing tests (no tests were removed unless duplicates)
corrected tests regarding type variables, but may need to be reviewed
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Animal.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+class Animal
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/AnimalAssessment.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/AnimalAssessment.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/AnimalAssessment.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
+
+class AnimalAssessment
+{
+ @Any Event<Animal> animalEvent;
+
+ @Tame Event<Animal> tameAnimalEvent;
+
+ @Any @Wild Event<Animal> wildAnimalEvent;
+
+ public void classifyAsTame(Animal animal)
+ {
+ tameAnimalEvent.fire(animal);
+ }
+
+ public void classifyAsWild(Animal animal)
+ {
+ wildAnimalEvent.fire(animal);
+ }
+
+ public void assess(Animal animal)
+ {
+ animalEvent.fire(animal);
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/DiscerningObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/DiscerningObserver.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/DiscerningObserver.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,37 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+
+@RequestScoped class DiscerningObserver
+{
+ private int numTimesAnyBindingTypeEventObserved = 0;
+ private int numTimesNonRuntimeBindingTypeObserved = 0;
+
+ public void observeAny(@Observes @Any String event)
+ {
+ numTimesAnyBindingTypeEventObserved++;
+ }
+
+ public void observeNonRuntime(@Observes @Any @NonRuntimeBindingType String event)
+ {
+ numTimesNonRuntimeBindingTypeObserved++;
+ }
+
+ public int getNumTimesAnyBindingTypeEventObserved()
+ {
+ return numTimesAnyBindingTypeEventObserved;
+ }
+
+ public int getNumTimesNonRuntimeBindingTypeObserved()
+ {
+ return numTimesNonRuntimeBindingTypeObserved;
+ }
+
+ public void reset()
+ {
+ numTimesAnyBindingTypeEventObserved = 0;
+ numTimesNonRuntimeBindingTypeObserved = 0;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,86 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.TypeLiteral;
+import javax.enterprise.inject.spi.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyLiteral;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Spec version: 20090625
+ *
+ * @author Dan Allen
+ */
+@Artifact
+public class EventBindingTypesTest extends AbstractJSR299Test
+{
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "10.1", id = "d")
+ public void testEventBindingTypeTargetsMethodFieldParameterElementTypes()
+ {
+ Animal animal = new Animal();
+ getCurrentManager().fireEvent(animal, new TameAnnotationLiteral());
+ getInstanceByType(AnimalAssessment.class).classifyAsTame(animal);
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "10.1", id = "e")
+ public void testEventBindingTypeTargetsFieldParameterElementTypes()
+ {
+ Animal animal = new Animal();
+ getCurrentManager().fireEvent(animal, new WildAnnotationLiteral());
+ getInstanceByType(AnimalAssessment.class).classifyAsWild(animal);
+ }
+
+ /**
+ * This test ensures that an event binding type without runtime retention is effectively invisible
+ */
+ @Test(groups = "events")
+ @SpecAssertion(section = "10.1", id = "f")
+ public void testNonRuntimeBindingTypeIsNotAnEventBindingType()
+ {
+ DiscerningObserver observer = getInstanceByType(DiscerningObserver.class);
+ observer.reset();
+ EventEmitter emitter = getInstanceByType(EventEmitter.class);
+ assert emitter.isEventWithOnlyNonRuntimeBindingTypeNotInjected();
+ emitter.fireEvent();
+ assert observer.getNumTimesAnyBindingTypeEventObserved() == 1;
+ assert observer.getNumTimesNonRuntimeBindingTypeObserved() == 1;
+ emitter.fireEventWithNonRuntimeBindingType();
+ assert observer.getNumTimesAnyBindingTypeEventObserved() == 2;
+ assert observer.getNumTimesNonRuntimeBindingTypeObserved() == 2;
+ }
+
+ @Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class } )
+ @SpecAssertion(section = "10.1", id = "f")
+ public void testFireEventWithNonRuntimeBindingTypeFails()
+ {
+ getCurrentManager().fireEvent(new Animal(), new AnnotationLiteral<NonRuntimeBindingType>(){});
+ }
+
+ @Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class } )
+ @SpecAssertion(section = "10.1", id = "g")
+ public void testFireEventWithNonBindingAnnotationsFails()
+ {
+ getCurrentManager().fireEvent(new Animal(), new AnnotationLiteral<NonBindingType>(){});
+ }
+
+ @Test(groups = "events")
+ @SpecAssertion(section = "10.1", id = "i")
+ public void testEventAlwaysHasAnyBinding()
+ {
+ Bean<Event<Animal>> animalEventBean = getUniqueBean(new TypeLiteral<Event<Animal>>() {}, new WildAnnotationLiteral());
+ assert animalEventBean.getBindings().contains(new AnyLiteral());
+
+ Bean<Event<Animal>> tameAnimalEventBean = getUniqueBean(new TypeLiteral<Event<Animal>>() {}, new TameAnnotationLiteral());
+ assert tameAnimalEventBean.getBindings().contains(new AnyLiteral());
+
+ Bean<Event<Animal>> wildAnimalEventBean = getUniqueBean(new TypeLiteral<Event<Animal>>() {}, new WildAnnotationLiteral());
+ assert wildAnimalEventBean.getBindings().contains(new AnyLiteral());
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventEmitter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventEmitter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventEmitter.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
+
+class EventEmitter
+{
+ @Any Event<String> stringEvent;
+
+ @Any @NonRuntimeBindingType Event<String> stringEventWithAnyAndNonRuntimeBindingType;
+
+ @NonRuntimeBindingType Event<String> stringEventWithOnlyNonRuntimeBindingType;
+
+ public void fireEvent()
+ {
+ stringEvent.fire("event");
+ }
+
+ public void fireEventWithNonRuntimeBindingType()
+ {
+ stringEventWithAnyAndNonRuntimeBindingType.fire("event");
+ }
+
+ public boolean isEventWithOnlyNonRuntimeBindingTypeNotInjected()
+ {
+ return stringEventWithOnlyNonRuntimeBindingType == null;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonBindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonBindingType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonBindingType.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target( { FIELD, PARAMETER })
+@Retention(RUNTIME)
+@interface NonBindingType
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonRuntimeBindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonRuntimeBindingType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonRuntimeBindingType.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { FIELD, PARAMETER })
+@BindingType
+@interface NonRuntimeBindingType
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Tame.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/TameAnnotationLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/TameAnnotationLiteral.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/TameAnnotationLiteral.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+class TameAnnotationLiteral extends AnnotationLiteral<Tame> implements Tame
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Wild.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Wild.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Wild.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Wild
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/WildAnnotationLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/WildAnnotationLiteral.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/WildAnnotationLiteral.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.event.bindingTypes;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+class WildAnnotationLiteral extends AnnotationLiteral<Wild> implements Wild
+{
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/Egg.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/Egg.java 2009-07-24 20:17:55 UTC (rev 3205)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/Egg.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -2,5 +2,4 @@
class Egg
{
-
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/EventInjectionWithUndefinedTypeVariableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/EventInjectionWithUndefinedTypeVariableTest.java 2009-07-24 20:17:55 UTC (rev 3205)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/EventInjectionWithUndefinedTypeVariableTest.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -17,7 +17,7 @@
package org.jboss.jsr299.tck.tests.event.broken.inject.withTypeVariable;
-
+import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.testharness.impl.packaging.Artifact;
@@ -28,16 +28,17 @@
* Tests an Event templated with an undefined type variable and annotated
* with {@link @Any} fails.
*
+ * Spec version: 20090625
+ *
* @author David Allen
*/
@Artifact
@ExpectedDeploymentException(DefinitionError.class)
public class EventInjectionWithUndefinedTypeVariableTest extends AbstractJSR299Test
{
- @Test(groups = { "events", "ri-broken" })
- // TODO need spec assertion (see 10.3.1)
- // I'm confused whether or not this should fail
- public void testAnyAnnotationOnEventInjectionPointWithUndefinedTypeVariableFails()
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "10.1", id = "cb", note = "Failure case")
+ public void testEventInjectionPointWithUndefinedTypeVariableIsDefinitionError()
{
assert false;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/JavaSparrow_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/JavaSparrow_Broken.java 2009-07-24 20:17:55 UTC (rev 3205)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/JavaSparrow_Broken.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -2,12 +2,14 @@
import javax.enterprise.event.Event;
import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Produces;
class JavaSparrow_Broken
{
- public <T> Egg produce(@Any Event<T> event)
+ public @Produces <T> Egg produce(@Any Event<T> event)
{
- // event might be fired here in real code
+ // event might be fired here to react to the producer method firing
+ // just return canned data for test
return new Egg();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/EventInjectionWithWildcardTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/EventInjectionWithWildcardTypeTest.java 2009-07-24 20:17:55 UTC (rev 3205)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/EventInjectionWithWildcardTypeTest.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -14,10 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.jboss.jsr299.tck.tests.event.broken.inject.withWildcardType;
-
+import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.testharness.impl.packaging.Artifact;
@@ -28,6 +27,8 @@
* Tests that an injection point for an Event object with a wildcard
* type parameter is treated as a definition error.
*
+ * Spec version: 20090625
+ *
* @author David Allen
*/
@Artifact
@@ -35,8 +36,8 @@
public class EventInjectionWithWildcardTypeTest extends AbstractJSR299Test
{
@Test(groups = { "events" })
- // FIXME need spec assertion (see 10.3.1)
- public void testAnyAnnotationOnEventInjectionPointWithWildcardTypeParameterFails()
+ @SpecAssertion(section = "10.1", id = "cb", note = "Failure case")
+ public void testEventInjectionPointWithWildcardTypeParameterIsDefinitionError()
{
assert false;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/EventInjectionWithoutTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/EventInjectionWithoutTypeTest.java 2009-07-24 20:17:55 UTC (rev 3205)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/EventInjectionWithoutTypeTest.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -34,7 +34,7 @@
public class EventInjectionWithoutTypeTest extends AbstractJSR299Test
{
@Test(groups = { "events" })
- // FIXME need spec assertion (see 10.4.1)
+ // FIXME need spec assertion, probably in the section that defines the Event interface
public void testAnyAnnotationOnEventInjectionPointWithoutTypeParameterFails()
{
assert false;
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/AbstractBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/AbstractBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/AbstractBean.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.event.broken.observer.beanNotManaged;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+
+abstract class AbstractBean
+{
+ public abstract void observer(@Observes @Any String event);
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/ConcreteBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/ConcreteBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/ConcreteBean.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.event.broken.observer.beanNotManaged;
+
+class ConcreteBean extends AbstractBean
+{
+ @Override
+ public void observer(String event)
+ {
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/NonManagedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/NonManagedBean.java 2009-07-24 20:17:55 UTC (rev 3205)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/NonManagedBean.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -17,6 +17,7 @@
package org.jboss.jsr299.tck.tests.event.broken.observer.beanNotManaged;
import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
/**
* This class is not a bean since it does not have a default constructor
@@ -31,7 +32,7 @@
{
}
- public void observe(@Observes String event)
+ public void observe(@Observes @Any String event)
{
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/ObserverMethodOnIncorrectBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/ObserverMethodOnIncorrectBeanTest.java 2009-07-24 20:17:55 UTC (rev 3205)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/beanNotManaged/ObserverMethodOnIncorrectBeanTest.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -25,7 +25,7 @@
* Tests an observer method on something that is not a managed bean
* or a session bean.
*
- * Spec version: 20090519
+ * Spec version: 20090625
*
* @author David Allen
*/
@@ -33,9 +33,9 @@
public class ObserverMethodOnIncorrectBeanTest extends AbstractJSR299Test
{
@Test(groups = { "events" })
- @SpecAssertion(section = "10.5", id = "b")
- public void testObserverMethodNotOnSimpleOrSessionBeanFails()
+ @SpecAssertion(section = "10.4", id = "aa")
+ public void testObserverMethodNotOnManagedOrSessionBeanFails()
{
- assert getCurrentManager().resolveObserverMethods("event").isEmpty();
+ assert getCurrentManager().resolveObserverMethods(new String()).isEmpty();
}
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/AbstractEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/AbstractEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/AbstractEvent.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+/**
+ * Abstract level of event hierarchy used to test firing a concrete type and
+ * observing each of the event types associated with that concrete type.
+ *
+ * @author David Allen
+ */
+abstract class AbstractEvent implements GeneralEvent
+{
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Artist.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Artist.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Artist.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+public class Artist<T>
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Broadcast.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Broadcast.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Broadcast.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+abstract class Broadcast
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/ComplexEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/ComplexEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/ComplexEvent.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+/**
+ * An event type with a class/interface hierarchy complex enough to test
+ * observing all event types.
+ *
+ * @author David Allen
+ */
+public class ComplexEvent extends AbstractEvent implements GeneralEvent
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypeFamilyObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypeFamilyObserver.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypeFamilyObserver.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+import javax.enterprise.event.Observes;
+
+/**
+ * This class declares observer methods for every superclass and interface
+ * contained in the hierarchy for the {@link ComplexEvent} event type.
+ *
+ * @author David Allen
+ */
+class EventTypeFamilyObserver
+{
+ private static int objectEventQuantity = 0;
+ private static int generalEventQuantity = 0;
+ private static int abstractEventQuantity = 0;
+ private static int complexEventQuantity = 0;
+
+ public void observeObject(@Observes Object event)
+ {
+ // Avoid counting implicit container events
+ if (event instanceof ComplexEvent)
+ {
+ objectEventQuantity++;
+ }
+ }
+
+ public void observeGeneralEvent(@Observes GeneralEvent event)
+ {
+ generalEventQuantity++;
+ }
+
+ public void observeAbstractEvent(@Observes AbstractEvent event)
+ {
+ abstractEventQuantity++;
+ }
+
+ public void observeComplexEvent(@Observes ComplexEvent event)
+ {
+ complexEventQuantity++;
+ }
+
+ public int getGeneralEventQuantity()
+ {
+ return generalEventQuantity;
+ }
+
+ public int getAbstractEventQuantity()
+ {
+ return abstractEventQuantity;
+ }
+
+ public int getComplexEventQuantity()
+ {
+ return complexEventQuantity;
+ }
+
+ public int getObjectEventQuantity()
+ {
+ return objectEventQuantity;
+ }
+
+ public int getTotalEventsObserved()
+ {
+ return objectEventQuantity + generalEventQuantity + abstractEventQuantity + complexEventQuantity;
+ }
+
+ public void reset()
+ {
+ objectEventQuantity = 0;
+ generalEventQuantity = 0;
+ abstractEventQuantity = 0;
+ complexEventQuantity = 0;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/EventTypesTest.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,73 @@
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Spec version: 20090625
+ *
+ * @author Dan Allen
+ */
+@Artifact
+public class EventTypesTest extends AbstractJSR299Test
+{
+ @Test(groups = "event")
+ @SpecAssertions({
+ @SpecAssertion(section = "10.1", id = "aa"),
+ @SpecAssertion(section = "10.1", id = "j")
+ })
+ public void testEventTypeIsConcreteTypeWithNoTypeVariables()
+ {
+ Listener listener = getInstanceByType(Listener.class);
+ listener.reset();
+ // typical concrete type
+ Song s = new Song();
+ getInstanceByType(TuneSelect.class).songPlaying(s);
+ assert listener.getObjectsFired().size() == 1;
+ assert listener.getObjectsFired().get(0) == s;
+ getCurrentManager().fireEvent(s);
+ assert listener.getObjectsFired().size() == 2;
+ assert listener.getObjectsFired().get(1) == s;
+ // anonymous instance
+ Broadcast b = new Broadcast() {};
+ getInstanceByType(TuneSelect.class).broadcastPlaying(b);
+ assert listener.getObjectsFired().size() == 3;
+ assert listener.getObjectsFired().get(2) == b;
+ // boxed primitive
+ getCurrentManager().fireEvent(1);
+ assert listener.getObjectsFired().size() == 4;
+ assert listener.getObjectsFired().get(3).equals(1);
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "10.1", id = "c")
+ public void testEventTypeIncludesAllSuperclassesAndInterfacesOfEventObject()
+ {
+ // we have to use a dependent-scoped observer here because we it is observing the Object event type
+ // and a request-scoped object would get called outside of when the request scope is active in this situation
+ EventTypeFamilyObserver observer = getInstanceByType(EventTypeFamilyObserver.class);
+ getCurrentManager().fireEvent(new ComplexEvent());
+ assert observer.getGeneralEventQuantity() == 1;
+ assert observer.getAbstractEventQuantity() == 1;
+ assert observer.getComplexEventQuantity() == 1;
+ assert observer.getObjectEventQuantity() == 1;
+ assert observer.getTotalEventsObserved() == 4;
+ }
+
+ @Test(groups = { "event", "review" }, expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section = "10.1", id = "cb")
+ public void testEventTypeFiredByEventInterfaceMayNotContainTypeVariable()
+ {
+ getInstanceByType(TuneSelect.class).soloArtistPlaying(new Artist<Solo>());
+ }
+
+ @Test(groups = { "event", "review" }, expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section = "10.1", id = "cb")
+ public void testEventTypeFiredByBeanManagerMayNotContainTypeVariable()
+ {
+ getCurrentManager().fireEvent(new Artist<Solo>());
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/GeneralEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/GeneralEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/GeneralEvent.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,26 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+/**
+ * Arbitrary interface to test firing events and observing all event types.
+ *
+ * @author David Allen
+ */
+interface GeneralEvent
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Listener.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Listener.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Listener.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,39 @@
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+
+@RequestScoped class Listener
+{
+ List<Object> objectsFired = new ArrayList<Object>();
+
+ public void registerNumberFired(@Observes @Any Integer i)
+ {
+ objectsFired.add(i);
+ }
+
+ public void registerSongFired(@Observes @Any Song s)
+ {
+ objectsFired.add(s);
+ }
+
+ public void registerBroadcastFired(@Observes @Any Broadcast b)
+ {
+ objectsFired.add(b);
+ }
+
+ public List<Object> getObjectsFired()
+ {
+ return objectsFired;
+ }
+
+ public void reset()
+ {
+ objectsFired.clear();
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Solo.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Solo.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Solo.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+class Solo
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Song.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Song.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/Song.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+class Song
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/TuneSelect.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/TuneSelect.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/eventTypes/TuneSelect.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.event.eventTypes;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
+
+class TuneSelect
+{
+ @Any Event<Artist<Solo>> soloArtistEvent;
+
+ @Any Event<Song> songEvent;
+
+ @Any Event<Broadcast> broadcastEvent;
+
+ public void songPlaying(Song s)
+ {
+ songEvent.fire(s);
+ }
+
+ public void broadcastPlaying(Broadcast b)
+ {
+ broadcastEvent.fire(b);
+ }
+
+ public void soloArtistPlaying(Artist<Solo> soloArtist)
+ {
+ soloArtistEvent.fire(soloArtist);
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java 2009-07-24 20:17:55 UTC (rev 3205)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -13,6 +13,7 @@
import javax.enterprise.inject.spi.InjectionPoint;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.literals.AnyLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
@@ -67,9 +68,12 @@
/**
* This test verifies that the fire() method of the injected {@link Event}
* object accepts an event object and that the event object's type is the
- * same as the the paraterized type on the event field.
+ * same as the the parameterized type on the event field.
**/
- @SpecAssertion(section = "10.3", id = "b")
+ @SpecAssertions({
+ @SpecAssertion(section = "10.3", id = "b"),
+ @SpecAssertion(section = "10.3.1", id = "cb")
+ })
@Test(groups = "events")
public void testInjectedEventAcceptsEventObject() throws SecurityException, NoSuchFieldException, NoSuchMethodException
{
@@ -124,7 +128,10 @@
* verified by checking that the cooresponding observer gets invoked.
*/
@Test(groups = "events")
- @SpecAssertion(section = "10.3", id = "c")
+ @SpecAssertions({
+ @SpecAssertion(section = "10.3", id = "c"),
+ @SpecAssertion(section = "10.3.1", id = "cb")
+ })
public void testInjectedEventCanHaveBindings()
{
Billing billing = getInstanceByType(Billing.class);
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnEventType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnEventType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnEventType.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.observer;
+
+class AnEventType
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnObserver.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnObserver.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.event.observer;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+
+class AnObserver
+{
+ static boolean wasNotified = false;
+
+ public void observer(@Observes @Any AnEventType event)
+ {
+ wasNotified = true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherEventType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherEventType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherEventType.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.observer;
+
+class AnotherEventType<T>
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherObserver.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherObserver.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.event.observer;
+
+import javax.enterprise.event.Observes;
+
+class AnotherObserver
+{
+ static boolean wasNotified = false;
+
+ void observer(@Observes @Role("Admin") AnEventType event)
+ {
+ wasNotified = true;
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java 2009-07-24 20:17:55 UTC (rev 3205)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java 2009-07-25 00:44:37 UTC (rev 3206)
@@ -2,8 +2,6 @@
import java.lang.annotation.Annotation;
-import javax.enterprise.event.Observes;
-
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -16,31 +14,7 @@
@Artifact
public class ObserverTest extends AbstractJSR299Test
{
- public static class AnEventType
- {
- }
-
- public static class AnObserver
- {
- public static boolean wasNotified = false;
-
- public void observer(@Observes AnEventType event)
- {
- wasNotified = true;
- }
- }
-
- public static class AnotherObserver
- {
- public static boolean wasNotified = false;
-
- public void observer(@Observes @Role("Admin") AnEventType event)
- {
- wasNotified = true;
- }
- }
-
- @Test(groups = { "events", "ri-broken" })
+ @Test(groups = { "events" })
@SpecAssertions( {
@SpecAssertion(section = "10.2", id = "h"),
@SpecAssertion(section = "10.5", id = "aa")
@@ -52,7 +26,7 @@
// Fire an event that will be delivered to the two above observers
AnEventType anEvent = new AnEventType();
getCurrentManager().fireEvent(anEvent, roleBinding);
-
+
assert AnObserver.wasNotified;
assert AnotherObserver.wasNotified;
AnObserver.wasNotified = false;
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3205 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/lookup/injectionpoint and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-24 16:17:55 -0400 (Fri, 24 Jul 2009)
New Revision: 3205
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/BasicLogger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectableReferenceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Logger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/LoggerConsumer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/TimestampLogger.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/OldSPIBridge.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Minor mods on injection point tests and new injectable reference tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/OldSPIBridge.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/OldSPIBridge.java 2009-07-24 19:04:31 UTC (rev 3204)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/OldSPIBridge.java 2009-07-24 20:17:55 UTC (rev 3205)
@@ -41,7 +41,7 @@
}
else if (beans.size() > 1)
{
- throw new AmbiguousResolutionException("More than one bean available");
+ throw new AmbiguousResolutionException("More than one bean available for type " + type);
}
return beans.iterator().next();
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/BasicLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/BasicLogger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/BasicLogger.java 2009-07-24 20:17:55 UTC (rev 3205)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+class BasicLogger implements Logger
+{
+ @Current
+ private InjectionPoint injectionPoint;
+
+ private static String message;
+
+ public InjectionPoint getInjectionPoint()
+ {
+ return injectionPoint;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public void log(String message)
+ {
+ BasicLogger.message = message;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/BasicLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java 2009-07-24 19:04:31 UTC (rev 3204)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Cat.java 2009-07-24 20:17:55 UTC (rev 3205)
@@ -1,12 +1,15 @@
package org.jboss.jsr299.tck.tests.lookup.injectionpoint;
import javax.enterprise.inject.Current;
+import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
class Cat
{
@Current private InjectionPoint injectionPoint;
+ @Current private BeanManager beanManager;
+
public String hello() {
return "hello";
}
@@ -14,4 +17,9 @@
public InjectionPoint getInjectionPoint() {
return injectionPoint;
}
+
+ public BeanManager getBeanManager()
+ {
+ return beanManager;
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectableReferenceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectableReferenceTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectableReferenceTest.java 2009-07-24 20:17:55 UTC (rev 3205)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+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.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * InjectableReference tests for the bean manager. These tests are
+ * only here due to the fact that InjectionPoints are always needed
+ * too.
+ *
+ * @author David Allen
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+public class InjectableReferenceTest extends AbstractJSR299Test
+{
+ @SuppressWarnings("unchecked")
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.2", id = "a"),
+ @SpecAssertion(section = "11.3.3", id = "a")
+ })
+ public void testGetInjectableReferenceOnBeanManager()
+ {
+ // Get an instance of the bean which has another bean injected into it
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ InjectionPoint ip = beanWithInjectionPoint.getInjectedMetadata();
+ assert ip != null;
+ CreationalContext<BeanWithInjectionPointMetadata> creationalContext = getCurrentManager().createCreationalContext((Bean<BeanWithInjectionPointMetadata>)ip.getBean());
+ Object beanInstance = getCurrentManager().getInjectableReference(ip, creationalContext);
+ assert beanInstance instanceof BeanWithInjectionPointMetadata;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.2", id = "b")
+ })
+ public void testGetInjectableReferenceReturnsDelegateForDelegateInjectionPoint()
+ {
+ // Get the consumer of the logger and work back from there to get the injection point
+ LoggerConsumer loggerConsumer = getInstanceByType(LoggerConsumer.class);
+ loggerConsumer.doSomething();
+ BasicLogger delegateLogger = (BasicLogger) TimestampLogger.getLogger();
+ InjectionPoint loggerInjectionPoint = delegateLogger.getInjectionPoint();
+ CreationalContext<Logger> creationalContext = getCurrentManager().createCreationalContext((Bean<Logger>)loggerInjectionPoint.getBean());
+ Object injectedDelegateLogger = getCurrentManager().getInjectableReference(loggerInjectionPoint, creationalContext);
+ assert injectedDelegateLogger instanceof BasicLogger;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectableReferenceTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-24 19:04:31 UTC (rev 3204)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-24 20:17:55 UTC (rev 3205)
@@ -52,272 +52,173 @@
@Test(groups = { "injectionPoint" })
@SpecAssertion(section = "5.6.9", id = "aa")
- public void testGetBean() throws Exception
+ public void testGetBean()
{
// Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
-
- Set<Bean<FieldInjectionPointBean>> resolvedBeans = getBeans(FieldInjectionPointBean.class);
- assert resolvedBeans.size() == 1;
- assert beanWithInjectionPoint.getInjectedMetadata().getBean().equals(resolvedBeans.iterator().next());
- }
- }.run();
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+
+ Set<Bean<FieldInjectionPointBean>> resolvedBeans = getBeans(FieldInjectionPointBean.class);
+ assert resolvedBeans.size() == 1;
+ assert beanWithInjectionPoint.getInjectedMetadata().getBean().equals(resolvedBeans.iterator().next());
}
@Test(groups = { "injectionPoint" })
@SpecAssertion(section = "5.6.9", id = "ba")
- public void testGetType() throws Exception
+ public void testGetType()
{
// Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
- }
- }.run();
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
}
@Test(groups = { "injectionPoint" })
@SpecAssertion(section = "5.6.9", id = "bc")
- public void testGetBindingTypes() throws Exception
+ public void testGetBindingTypes()
{
// Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- Set<Annotation> bindingTypes = beanWithInjectionPoint.getInjectedMetadata().getBindings();
- assert bindingTypes.size() == 1;
- assert Current.class.isAssignableFrom(bindingTypes.iterator().next().annotationType());
- }
- }.run();
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ Set<Annotation> bindingTypes = beanWithInjectionPoint.getInjectedMetadata().getBindings();
+ assert bindingTypes.size() == 1;
+ assert Current.class.isAssignableFrom(bindingTypes.iterator().next().annotationType());
}
@Test(groups = { "injectionPoint" })
@SpecAssertion(section = "5.6.9", id = "ca")
- public void testGetMemberField() throws Exception
+ public void testGetMemberField()
{
// Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert Field.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
- }
- }.run();
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert Field.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
}
@Test(groups = { "injectionPoint" })
@SpecAssertion(section = "5.6.9", id = "cb")
- public void testGetMemberMethod() throws Exception
+ public void testGetMemberMethod()
{
// Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- MethodInjectionPointBean beanWithInjectedBean = getInstanceByType(MethodInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert Method.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
-
- // Since the type and bindings must correspond to the parameter, check
- // them
- assert beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
- assert beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new CurrentLiteral());
- }
- }.run();
+ MethodInjectionPointBean beanWithInjectedBean = getInstanceByType(MethodInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert Method.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
+
+ // Since the type and bindings must correspond to the parameter, check
+ // them
+ assert beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
+ assert beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new CurrentLiteral());
}
@Test(groups = { "injectionPoint" })
@SpecAssertion(section = "5.6.9", id = "cc")
- public void testGetMemberConstructor() throws Exception
+ public void testGetMemberConstructor()
{
// Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- ConstructorInjectionPointBean beanWithInjectedBean = getInstanceByType(ConstructorInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert Constructor.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
-
- // Since the type and bindings must correspond to the parameter, check
- // them
- assert beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
- assert beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new CurrentLiteral());
- }
- }.run();
+ ConstructorInjectionPointBean beanWithInjectedBean = getInstanceByType(ConstructorInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert Constructor.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
+
+ // Since the type and bindings must correspond to the parameter, check
+ // them
+ assert beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
+ assert beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new CurrentLiteral());
}
@Test(groups = { "injectionPoint", "ri-broken" })
@SpecAssertion(section = "5.6.9", id = "daa")
- public void testGetAnnotatedField() throws Exception
+ public void testGetAnnotatedField()
{
// Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated() instanceof AnnotatedField;
- assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated().isAnnotationPresent(AnimalStereotype.class);
- }
- }.run();
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated() instanceof AnnotatedField;
+ assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated().isAnnotationPresent(AnimalStereotype.class);
}
-
+
@Test(groups = { "injectionPoint", "ri-broken" })
- @SpecAssertion(section = "5.6.9", id = "daa")
- public void testGetAnnotatedParameter() throws Exception
+ @SpecAssertion(section = "5.6.9", id = "daa")
+ public void testGetAnnotatedParameter()
{
// Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- MethodInjectionPointBean beanWithInjectedBean = getInstanceByType(MethodInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated() instanceof AnnotatedParameter;
- assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated().isAnnotationPresent(Current.class);
- }
- }.run();
+ MethodInjectionPointBean beanWithInjectedBean = getInstanceByType(MethodInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated() instanceof AnnotatedParameter;
+ assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated().isAnnotationPresent(Current.class);
}
@Test(groups = { "injectionPoint" })
@SpecAssertion(section = "5.6.9", id = "e")
- public void testDependentScope() throws Exception
+ public void testDependentScope()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- assert getBeans(InjectionPoint.class).size() == 1;
- assert getBeans(InjectionPoint.class).iterator().next().getScopeType().equals(Dependent.class);
- }
-
- }.run();
+ assert getBeans(InjectionPoint.class).size() == 1;
+ assert getBeans(InjectionPoint.class).iterator().next().getScopeType().equals(Dependent.class);
}
@Test(groups = { "injectionPoint" })
@SpecAssertions({
@SpecAssertion(section = "5.6.9", id = "e")
})
- public void testApiTypeInjectionPoint() throws Exception
+ public void testApiTypeInjectionPoint()
{
// Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert InjectionPoint.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getClass());
- }
- }.run();
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert InjectionPoint.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getClass());
}
@Test(groups = { "injectionPoint" })
@SpecAssertions({
@SpecAssertion(section = "5.6.9", id = "e")
})
- public void testCurrentBinding() throws Exception
+ public void testCurrentBinding()
{
// Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new CurrentLiteral());
- }
- }.run();
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
+ BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
+ assert beanWithInjectionPoint.getInjectedMetadata() != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new CurrentLiteral());
}
-
+
@Test(groups = { "injectionPoint" })
@SpecAssertion(section = "5.6.9", id = "dca")
- public void testIsTransient() throws Exception
+ public void testIsTransient()
{
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean bean1 = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- TransientFieldInjectionPointBean bean2 = getInstanceByType(TransientFieldInjectionPointBean.class,new CurrentLiteral());
- InjectionPoint ip1 = bean1.getInjectedBean().getInjectedMetadata();
- InjectionPoint ip2 = bean2.getInjectedBean().getInjectedMetadata();
- assert !ip1.isTransient();
- assert ip2.isTransient();
- }
- }.run();
+ FieldInjectionPointBean bean1 = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
+ TransientFieldInjectionPointBean bean2 = getInstanceByType(TransientFieldInjectionPointBean.class,new CurrentLiteral());
+ InjectionPoint ip1 = bean1.getInjectedBean().getInjectedMetadata();
+ InjectionPoint ip2 = bean2.getInjectedBean().getInjectedMetadata();
+ assert !ip1.isTransient();
+ assert ip2.isTransient();
}
-
+
@Test(groups = { "injectionPoint", "ri-broken" })
@SpecAssertion(section = "5.6.9", id="dba")
- public void testIsDelegate() throws Exception {
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- assert !getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral()).getInjectedBean().getInjectedMetadata().isDelegate();
-
- Cat cat = getInstanceByType(Cat.class, new CurrentLiteral());
- assert cat.hello().equals("hello world!");
- assert cat.getInjectionPoint() != null;
- assert cat.getInjectionPoint().isDelegate();
- }
- }.run();
+ public void testIsDelegate()
+ {
+ assert !getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral()).getInjectedBean().getInjectedMetadata().isDelegate();
+
+ Cat cat = getInstanceByType(Cat.class, new CurrentLiteral());
+ assert cat.hello().equals("hello world!");
+ assert cat.getBeanManager() != null;
+ assert cat.getInjectionPoint() != null;
+ assert cat.getInjectionPoint().isDelegate();
}
-
+
@Test(groups = { "ri-broken", "resolution" })
@SpecAssertion(section = "5.3", id = "hb")
- public void testDecoratorNotResolved() {
+ public void testDecoratorNotResolved()
+ {
Cat cat = getInstanceByType(Cat.class);
assert cat != null;
assert cat.getClass().equals(Cat.class);
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Logger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Logger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Logger.java 2009-07-24 20:17:55 UTC (rev 3205)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint;
+
+interface Logger
+{
+ public void log(String message);
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/Logger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/LoggerConsumer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/LoggerConsumer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/LoggerConsumer.java 2009-07-24 20:17:55 UTC (rev 3205)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint;
+
+import javax.enterprise.inject.Current;
+
+class LoggerConsumer
+{
+ @Current
+ private Logger logger;
+
+ public Logger getLogger()
+ {
+ return logger;
+ }
+
+ public void doSomething()
+ {
+ logger.log("Test message");
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/LoggerConsumer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/TimestampLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/TimestampLogger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/TimestampLogger.java 2009-07-24 20:17:55 UTC (rev 3205)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint;
+
+import java.util.Date;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+
+@Decorator
+class TimestampLogger implements Logger
+{
+ @Decorates
+ private Logger logger;
+
+ private static Logger staticLogger;
+
+ public void log(String message)
+ {
+ staticLogger = logger;
+ logger.log(new Date().toString() + ": " + message);
+ }
+
+ public static Logger getLogger()
+ {
+ return staticLogger;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/TimestampLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java 2009-07-24 19:04:31 UTC (rev 3204)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java 2009-07-24 20:17:55 UTC (rev 3205)
@@ -1,5 +1,7 @@
package org.jboss.jsr299.tck.tests.lookup.manager;
+import java.io.Serializable;
+
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.Current;
@@ -22,30 +24,21 @@
{
@Test(groups={"manager", "injection", "deployment"})
@SpecAssertion(section="11.3", id = "c")
- public void testInjectingManager() throws Exception
+ public void testInjectingManager()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FishFarmOffice fishFarmOffice = getInstanceByType(FishFarmOffice.class);
- assert fishFarmOffice.beanManager != null;
- }
-
- }.run();
+ FishFarmOffice fishFarmOffice = getInstanceByType(FishFarmOffice.class);
+ assert fishFarmOffice.beanManager != null;
}
@Test
- @SpecAssertion(section = "11.3", id = "a")
+ @SpecAssertion(section = "11.3", id = "aa")
public void testContainerProvidesManagerBean()
{
assert getBeans(BeanManager.class).size() > 0;
}
@Test
- @SpecAssertion(section = "11.3", id = "a")
+ @SpecAssertion(section = "11.3", id = "ab")
public void testManagerBeanIsDependentScoped()
{
Bean<BeanManager> beanManager = getBeans(BeanManager.class).iterator().next();
@@ -53,7 +46,7 @@
}
@Test
- @SpecAssertion(section = "11.3", id = "a")
+ @SpecAssertion(section = "11.3", id = "ac")
public void testManagerBeanHasCurrentBinding()
{
Bean<BeanManager> beanManager = getBeans(BeanManager.class).iterator().next();
@@ -61,6 +54,13 @@
}
@Test
+ @SpecAssertion(section = "11.3", id = "b")
+ public void testManagerBeanIsPassivationCapable()
+ {
+ assert isSerializable(getCurrentManager().getClass());
+ }
+
+ @Test
@SpecAssertions({
@SpecAssertion(section = "11.3.1", id = "a"),
@SpecAssertion(section = "11.3.1", id = "b")
@@ -70,4 +70,10 @@
Bean<FishFarmOffice> bean = getBeans(FishFarmOffice.class).iterator().next();
assert getCurrentManager().getReference(bean,FishFarmOffice.class, getCurrentManager().createCreationalContext(bean)) instanceof FishFarmOffice;
}
+
+ private boolean isSerializable(Class<?> clazz)
+ {
+ return clazz.isPrimitive() || Serializable.class.isAssignableFrom(clazz);
+ }
+
}
Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml 2009-07-24 19:04:31 UTC (rev 3204)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injectionpoint/beans.xml 2009-07-24 20:17:55 UTC (rev 3205)
@@ -1,5 +1,6 @@
<beans>
<decorators>
+ <class>org.jboss.jsr299.tck.tests.lookup.injectionpoint.TimestampLogger</class>
<class>org.jboss.jsr299.tck.tests.lookup.injectionpoint.CatDecorator</class>
</decorators>
</beans>
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-24 19:04:31 UTC (rev 3204)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-24 20:17:55 UTC (rev 3205)
@@ -4087,10 +4087,18 @@
</section>
<section id="11.3" title="The BeanManager object">
- <assertion id="a">
- <text>The container provides a built-in bean with bean type |BeanManager|, scope |@Dependent| and binding |@Current|.</text>
+ <assertion id="aa">
+ <text>The container provides a built-in bean with bean type |BeanManager|~, scope |@Dependent| and binding |@Current|~.</text>
</assertion>
+ <assertion id="ab">
+ <text>The container provides a built-in bean with ~bean type |BeanManager|,~ scope |@Dependent|~ and binding |@Current|~.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>The container provides a built-in bean with ~bean type |BeanManager|, scope |@Dependent| and~ binding |@Current|.</text>
+ </assertion>
+
<assertion id="b">
<text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
</assertion>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3204 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-24 15:04:31 -0400 (Fri, 24 Jul 2009)
New Revision: 3204
Modified:
tck/trunk/doc/reference/en-US/eclipse-running.xml
Log:
ws
Modified: tck/trunk/doc/reference/en-US/eclipse-running.xml
===================================================================
--- tck/trunk/doc/reference/en-US/eclipse-running.xml 2009-07-24 18:57:25 UTC (rev 3203)
+++ tck/trunk/doc/reference/en-US/eclipse-running.xml 2009-07-24 19:04:31 UTC (rev 3204)
@@ -1,19 +1,55 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]>
<chapter id="eclipse-running">
- <title>Running Tests in Eclipse</title>
- <para>This chapter explains how to run individual tests using the Eclipse TestNG plugin. It covers running non-integration tests in standalone mode and integration tests (as well as non-integration tests) in in-container mode. You should be able to use the lessons learned here to debug tests in an alternate IDE.</para>
- <section>
- <title>Leveraging Eclipse's plugin ecosystem</title>
- <para>The primary motivation for building the test harness on top of an existing testing framework is to allow the tests to be executed and debugged in an Integrated Development Environment (IDE) using availalbe plugins. It's also the easiest way to execute a test class in isolation.</para>
- <para>The TCK can be executed in any IDE for which there is a TestNG plugin available. Running a test in Eclipse is almost as simple as running the test with the Eclipse TestNG plugin. You can also use the plugin to debug a test, which is described in the next chapter.</para>
- <para>Before running a test from the TCK test suite in Eclipse, you must have the Eclipse <ulink url="http://testng.org">TestNG plugin</ulink> and the m2eclipse plugin installed. Refer to section 2.2.2 for more information on these plugins.</para>
- <para>With the m2eclipse plugin installed, Eclipse should recognize the JSR-299 TCK projects as valid Eclipse projects (or any Web Beans project for that matter). Import them into the Eclipse workspace at this time. You should also import the JSR-299 RI projects if you want to debug into that code, which is covered later.</para>
- </section>
- <section>
- <title>Readying the Eclipse workspace</title>
- <para>When setting up your Ecilpse workspace, I recommend creating three workings sets: one for the JSR-299 RI (Web Beans), one for the JSR-299 TCK and one for the JBoss TCK Runner. The dependencies between the projects will be established automatically by the m2eclipse plugin based on the dependency information in the pom.xml files. Your workspace should appear as follows:</para>
- <programlisting>JSR-299 RI
+ <title>Running Tests in Eclipse</title>
+ <para>
+ This chapter explains how to run individual tests using the Eclipse
+ TestNG plugin. It covers running non-integration tests in standalone mode
+ and integration tests (as well as non-integration tests) in in-container
+ mode. You should be able to use the lessons learned here to debug tests in
+ an alternate IDE.
+ </para>
+ <section>
+ <title>Leveraging Eclipse's plugin ecosystem</title>
+ <para>
+ The primary motivation for building the test harness on top of an
+ existing testing framework is to allow the tests to be executed and
+ debugged in an Integrated Development Environment (IDE) using available
+ plugins. It's also the easiest way to execute a test class in
+ isolation.
+ </para>
+ <para>
+ The TCK can be executed in any IDE for which there is a TestNG
+ plugin available. Running a test in Eclipse is almost as simple as
+ running the test with the Eclipse TestNG plugin. You can also use the
+ plugin to debug a test, which is described in the next chapter.
+ </para>
+ <para>
+ Before running a test from the TCK test suite in Eclipse, you must have
+ the Eclipse
+ <ulink url="http://testng.org">TestNG plugin</ulink>
+ and the m2eclipse plugin installed. Refer to section 2.2.2 for more
+ information on these plugins.
+ </para>
+ <para>
+ With the m2eclipse plugin installed, Eclipse should recognize the
+ JSR-299 TCK projects as valid Eclipse projects (or any Web Beans
+ project for that matter). Import them into the Eclipse workspace at
+ this time. You should also import the JSR-299 RI projects if you want
+ to debug into that code, which is covered later.
+ </para>
+ </section>
+ <section>
+ <title>Readying the Eclipse workspace</title>
+ <para>
+ When setting up your Ecilpse workspace, I recommend creating three
+ workings sets: one for the JSR-299 RI (Web Beans), one for the JSR-299
+ TCK and one for the JBoss TCK Runner. The dependencies between the
+ projects will be established automatically by the m2eclipse plugin
+ based on the dependency information in the pom.xml files. Your
+ workspace should appear as follows:
+ </para>
+ <programlisting>JSR-299 RI
jsr299-api
webbeans-api
webbeans-core
@@ -29,126 +65,299 @@
Web Beans JBoss TCK Runner
webbeans-jboss-tck-runner
webbeans-porting-package</programlisting>
- <para>The tests in the TCK test suite are located in the jsr299-tck-impl project. You'll be working within this project in Eclipse when you are developing tests. However, you learned earlier, there are no references to a JSR-299 implementation in the TCK. So how can you execute an individual test in Eclipse? The secret is that you need to establish a link in Eclipse (not in Maven) between the jsr299-tck-impl project and your TCK runner project, which in this case is webbeans-jboss-tck-runner. Here are the steps to establish the link:</para>
- <orderedlist>
- <listitem>
- <para>Right click on the jsr299-tck-impl project</para>
- </listitem>
- <listitem>
- <para>Select Build Path > Configure Build Path...</para>
- </listitem>
- <listitem>
- <para>Click on the Projects tab</para>
- </listitem>
- <listitem>
- <para>Click the Add... button on the right</para>
- </listitem>
- <listitem>
- <para>Check the TCK runner project (e.g., webbeans-jboss-tck-runner)</para>
- </listitem>
- <listitem>
- <para>Click the OK button on the Required Project Selection dialog window</para>
- </listitem>
- <listitem>
- <para>Click the OK button on the Java Build Path window</para>
- </listitem>
- </orderedlist>
- <para>The TCK runner project should pull in the JSR-299 implementation, the TCK porting package and any additional properties that must be defined to execute the TCK test suite.</para>
- </section>
- <section>
- <title>Running a test in standalone mode</title>
- <para>Your now ready to execute an individual test class (a class which extends AbstractJSR299Test and is annotated with @Artifact). Select a test class that is <emphasis role="italic">not</emphasis> annotated with <literal>@IntegrationTest</literal> and open it in the Eclipse editor. Right click in the editor view and select TestNG > Run as test. The TestNG view should pop out and you should see all the tests pass (hopefully).</para>
- <note>
- <para>If the TCK complains that there is a property missing, close all the projects, open them again, and rebuild. The m2eclipse plugin can be finicky getting everything built correctly the first time.</para>
- </note>
- <para>So far you have executed a test in standalone mode. That's not sufficient to pass the TCK. The test must be executed in in-container mode. Using in-container mode also the only way to execute a test annotated with <literal>@IntegrationTest</literal> as it requires container resources. So let's see what has to be done to execute an integration test. This will result in the artifact being deployed to the container, which is JBoss AS 5.1 if you are using the JBoss TCK runner.</para>
- </section>
- <section>
- <title>Running integration tests</title>
- <para>As you have learned, the JBoss test harness determines how to behave based on the values of numerous system properties or properties defined in META-INF/jboss-test-harness.properties classpath resources. If the property named <literal>org.jboss.testharness.standalone</literal> is not defined, the harness assumes that the test is to be run in standalone mode. In order to run the tests in the container, you need to add a properties file to the classpath that sets the standalone property to false and provides values for other properties required to run an in-container test.</para>
- <para>The JBoss TCK runner project conveniently provides the properties file src/test/debug-resources/META-INF/jboss-test-harness.properties that contains all of the necessary properties. You may have to tune the <literal>org.jboss.testharness.container.extraConfigurationDir</literal> and <literal>org.jboss.testharness.libraryDirectory</literal> properties to point to the relative location of the related projects. The properties should be defined as follows:</para>
- <itemizedlist>
- <listitem>
- <para><literal>org.jboss.testharness.container.extraConfigurationDir</literal> - the relative path from the jboss-tck-impl project to a directory that contains a build.properties or local.build.properties file defining the location of a JBoss AS 5.1 installation in the <literal>jboss.home</literal> property</para>
- </listitem>
- <listitem>
- <para><literal>org.jboss.testharness.libraryDirectory</literal> - the relative path from the jboss-tck-impl project to the target/dependency/lib directory in the TCK runner project.</para>
- </listitem>
- </itemizedlist>
- <para>The other properties in that file are defined as follows:</para>
- <programlisting>org.jboss.testharness.standalone=false
+ <para>
+ The tests in the TCK test suite are located in the jsr299-tck-impl
+ project. You'll be working within this project in Eclipse when you are
+ developing tests. However, you learned earlier, there are no references
+ to a JSR-299 implementation in the TCK. So how can you execute an
+ individual test in Eclipse? The secret is that you need to establish a
+ link in Eclipse (not in Maven) between the jsr299-tck-impl project and
+ your TCK runner project, which in this case is
+ webbeans-jboss-tck-runner. Here are the steps to establish the link:
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Right click on the jsr299-tck-impl project
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select Build Path > Configure Build Path...
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click on the Projects tab
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the Add... button on the right
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Check the TCK runner project (e.g., webbeans-jboss-tck-runner)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the OK button on the Required Project Selection dialog
+ window
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the OK button on the Java Build Path window
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ The TCK runner project should pull in the JSR-299 implementation,
+ the TCK porting package and any additional properties that must be
+ defined to execute the TCK test suite.
+ </para>
+ </section>
+ <section>
+ <title>Running a test in standalone mode</title>
+ <para>
+ Your now ready to execute an individual test class (a class which
+ extends AbstractJSR299Test and is annotated with @Artifact). Select a
+ test class that is
+ <emphasis role="italic">not</emphasis>
+ annotated with
+ <literal>@IntegrationTest</literal>
+ and open it in the Eclipse editor. Right click in the editor view and
+ select TestNG > Run as test. The TestNG view should pop out and you
+ should see all the tests pass (hopefully).
+ </para>
+ <note>
+ <para>
+ If the TCK complains that there is a property missing, close all
+ the projects, open them again, and rebuild. The m2eclipse plugin can
+ be finicky getting everything built correctly the first time.
+ </para>
+ </note>
+ <para>
+ So far you have executed a test in standalone mode. That's not
+ sufficient to pass the TCK. The test must be executed in in-container
+ mode. Using in-container mode also the only way to execute a test
+ annotated with
+ <literal>@IntegrationTest</literal>
+ as it requires container resources. So let's see what has to be done to
+ execute an integration test. This will result in the artifact being
+ deployed to the container, which is JBoss AS 5.1 if you are using the
+ JBoss TCK runner.
+ </para>
+ </section>
+ <section>
+ <title>Running integration tests</title>
+ <para>
+ As you have learned, the JBoss test harness determines how to behave
+ based on the values of numerous system properties or properties defined
+ in META-INF/jboss-test-harness.properties classpath resources. If the
+ property named
+ <literal>org.jboss.testharness.standalone</literal>
+ is not defined, the harness assumes that the test is to be run in
+ standalone mode. In order to run the tests in the container, you need
+ to add a properties file to the classpath that sets the standalone
+ property to false and provides values for other properties required to
+ run an in-container test.
+ </para>
+ <para>
+ The JBoss TCK runner project conveniently provides the properties file
+ src/test/debug-resources/META-INF/jboss-test-harness.properties that
+ contains all of the necessary properties. You may have to tune the
+ <literal>org.jboss.testharness.container.extraConfigurationDir
+ </literal>
+ and
+ <literal>org.jboss.testharness.libraryDirectory</literal>
+ properties to point to the relative location of the related projects.
+ The properties should be defined as follows:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>org.jboss.testharness.container.extraConfigurationDir
+ </literal>
+ - the relative path from the jboss-tck-impl project to a
+ directory that contains a build.properties or
+ local.build.properties file defining the location of a JBoss AS
+ 5.1 installation in the
+ <literal>jboss.home</literal>
+ property
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>org.jboss.testharness.libraryDirectory</literal>
+ - the relative path from the jboss-tck-impl project to the
+ target/dependency/lib directory in the TCK runner project.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The other properties in that file are defined as follows:
+ </para>
+ <programlisting>org.jboss.testharness.standalone=false
orjboss.testharness.container.forceRestart=false
orjboss.testharness.runIntegrationTests=true</programlisting>
- <para>You're now ready to execute an integration test. Select an integration test (a class that extends <literal>AbstractJSR299Test</literal> and is annotated with both <literal>@Artifact</literal> and <literal>@IntegrationTest</literal>) and open it in your Eclipse editor. Follow these steps to execute the class with the TestNG plugin:</para>
- <orderedlist>
- <listitem>
- <para>Right click in the editor view and select TestNG > Run as test</para>
- </listitem>
- <listitem>
- <para>Observe the test fail because of missing dependencies</para>
- </listitem>
- <listitem>
- <para>Select the Run > Run Configurations... menu from the main menubar</para>
- </listitem>
- <listitem>
- <para>Select the name of the test class under the TestNG category</para>
- </listitem>
- <listitem>
- <para>Select the Classpath tab</para>
- </listitem>
- <listitem>
- <para>Select User Entries in the tree</para>
- </listitem>
- <listitem>
- <para>Click the Advanced... button on the right</para>
- </listitem>
- <listitem>
- <para>Select Add Folders and click the OK button</para>
- </listitem>
- <listitem>
- <para>Select the webbeans-jboss-tck-runner/src/test/debug-resources folder</para>
- </listitem>
- <listitem>
- <para>Click the OK button on the Folder Selection dialog window</para>
- </listitem>
- <listitem>
- <para>Click on the webbeans-jboss-tck-runner entry</para>
- </listitem>
- <listitem>
- <para>Move the webbeans-jboss-tck-runner to the first entry using the Up button</para>
- </listitem>
- <listitem>
- <para>Click the Run button on the Run Configurations dialog window</para>
- </listitem>
- </orderedlist>
- <para>When you run the test this time, it should pass. If you get a failure that the container (e.g., JBoss AS 5.1) must be run with assertions enabled, you need to stop the container and start it with the -ea flag (or just leave it stopped and the test will start it appropriately). </para>
- <para>You can simply right click and select TestNG > Run as test for all subsequent runs for the reason cited earlier, the run configuration for a class is retained indefinitely.</para>
- <para>Alternatively, you can configure TestNG to execute all tests in-container by default by adding the properties file in the debug-resources folder to the project's classpath as follows:</para>
- <orderedlist>
- <listitem>
- <para>Right click on the jsr299-tck-impl project</para>
- </listitem>
- <listitem>
- <para>Select Build Path > Configure Build Path...</para>
- </listitem>
- <listitem>
- <para>Click on the Libraries tab</para>
- </listitem>
- <listitem>
- <para>Click the Add Class Folder... button on the right</para>
- </listitem>
- <listitem>
- <para>Check the webbeans-jboss-tck-runner/src/test/debug-resources folder</para>
- </listitem>
- <listitem>
- <para>Click the OK button on the Class Folder Selection dialog window</para>
- </listitem>
- <listitem>
- <para>Click the OK button on the Java Build Path window</para>
- </listitem>
- </orderedlist>
- <para>Now you don't have to do any special configuration for each test class.</para>
- <para>You can stop the individual tests from running in-container by reversing the steps above to remove the debug-resources folder from the Eclipse classpath. </para>
- <para>You have now mastered running the JSR-299 TCK against the JSR-299 RI using both Maven 2 and within Eclipse. Now you're likely interested in how to debug a test so that you can efficiently investigate test failures.</para>
- </section>
+ <para>
+ You're
+ now ready to execute an integration test. Select an integration
+ test (a
+ class that extends
+ <literal>AbstractJSR299Test</literal>
+ and is annotated with both
+ <literal>@Artifact</literal>
+ and
+ <literal>@IntegrationTest</literal>
+ ) and open it in your Eclipse editor. Follow these steps to execute the
+ class with the TestNG plugin:
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Right click in the editor view and select TestNG > Run as
+ test
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Observe the test fail because of missing dependencies
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the Run > Run Configurations... menu from the main
+ menubar
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the name of the test class under the TestNG category
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the Classpath tab
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select User Entries in the tree
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the Advanced... button on the right
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select Add Folders and click the OK button
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the webbeans-jboss-tck-runner/src/test/debug-resources
+ folder
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the OK button on the Folder Selection dialog window
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click on the webbeans-jboss-tck-runner entry
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Move the webbeans-jboss-tck-runner to the first entry using
+ the Up button
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the Run button on the Run Configurations dialog window
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ When you run the test this time, it should pass. If you get a
+ failure that the container (e.g., JBoss AS 5.1) must be run with
+ assertions enabled, you need to stop the container and start it with
+ the -ea flag (or just leave it stopped and the test will start it
+ appropriately).
+ </para>
+ <para>
+ You can simply right click and select TestNG > Run as test for
+ all subsequent runs for the reason cited earlier, the run configuration
+ for a class is retained indefinitely.
+ </para>
+ <para>
+ Alternatively, you can configure TestNG to execute all tests
+ in-container by default by adding the properties file in the
+ debug-resources folder to the project's classpath as follows:
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Right click on the jsr299-tck-impl project
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select Build Path > Configure Build Path...
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click on the Libraries tab
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the Add Class Folder... button on the right
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Check the webbeans-jboss-tck-runner/src/test/debug-resources
+ folder
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the OK button on the Class Folder Selection dialog
+ window
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the OK button on the Java Build Path window
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ Now you don't have to do any special configuration for each
+ test
+ class.
+ </para>
+ <para>
+ You can stop the individual tests from running in-container by
+ reversing the steps above to remove the debug-resources folder from the
+ Eclipse classpath.
+ </para>
+ <para>
+ You have now mastered running the JSR-299 TCK against the JSR-299 RI
+ using both Maven 2 and within Eclipse. Now you're likely interested in
+ how to debug a test so that you can efficiently investigate test
+ failures.
+ </para>
+ </section>
</chapter>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3203 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-24 14:57:25 -0400 (Fri, 24 Jul 2009)
New Revision: 3203
Removed:
tck/trunk/doc/reference/en-US/part-setup.xml
Modified:
tck/trunk/doc/reference/en-US/executing.xml
tck/trunk/doc/reference/en-US/master.xml
tck/trunk/doc/reference/en-US/part-background.xml
tck/trunk/doc/reference/en-US/part-test-harness.xml
Log:
Create an executing chapter for the harness guide
Modified: tck/trunk/doc/reference/en-US/executing.xml
===================================================================
--- tck/trunk/doc/reference/en-US/executing.xml 2009-07-24 18:45:06 UTC (rev 3202)
+++ tck/trunk/doc/reference/en-US/executing.xml 2009-07-24 18:57:25 UTC (rev 3203)
@@ -17,9 +17,12 @@
phase of the Maven 2 life cycle. The execution happens within a TCK
runner project (as opposed to the TCK project itself). Web Beans
includes a TCK runner project that executes the CDI TCK on the
- Web Beans running inside JBoss AS 5.1. To execute the
- CDI TCK on your own JSR-299 implementation, you could modify the TCK
- runner project included with Web Beans to use your JSR-299
+ Web Beans
+ running inside JBoss AS 5.1. To execute the
+ CDI TCK on your own JSR-299
+ implementation, you could modify the TCK
+ runner project included with
+ Web Beans to use your JSR-299
implementation as described in
<xref linkend="configuration" />
</para>
@@ -29,7 +32,8 @@
<title>Running the Tests In Standalone Mode</title>
<para>
To execute the TCK test suite against the Web Beans, first switch
- to the jboss-tck-runner directory in the extracted Web Beans
+ to
+ the jboss-tck-runner directory in the extracted Web Beans
distribution:
</para>
@@ -55,7 +59,9 @@
<title>Running the Tests In the Container</title>
<para>
To execute the test suite using in-container mode with the JBoss TCK
- runner, you first have to setup JBoss AS as described in <xref linkend="tck-in-jboss-as"/>.
+ runner, you first have to setup JBoss AS as described in
+ <xref linkend="tck-in-jboss-as" />
+ .
</para>
<para>
Then, execute the TCK runner:
@@ -93,9 +99,11 @@
</para>
<para>
Since in-container tests are executed in a remote JVM, the results
- of the test must be communicated back to the runner over a
+ of
+ the test must be communicated back to the runner over a
container-supported protocol. The JBoss Test Harness provides
- servlet-based communication over HTTP as described in <xref linkend="incontainer-communication"/>
+ servlet-based communication over HTTP as described in
+ <xref linkend="incontainer-communication" />
</para>
</section>
<section>
@@ -110,44 +118,21 @@
this type of inspection by "dumping" the generated artifact to disk.
</para>
<para>
- If the
+ This behavior is activated in the jboss-tck-runner project by appending
+ the
<literal>dumpArtifacts</literal>
- is defined as a system property or defined in the classpath resource
- META-INF/jboss-test-harness.properties and has a value of
- <literal>true</literal>
- , the JBoss Test Harness will write the artifact to an output directory
- prior to deploying it to the server. This behavior is activated in the
- jboss-tck-runner project by appending the
- <literal>dumpArtifacts</literal>
command line property to the end of the command that invokes the Maven
test phase.
</para>
- <programlisting>mvn test -Dincontainer -DdumpArtifacts</programlisting>
- <para>
- If you only want to write the artifacts to disk, and avoid executing
- the test suite, you can simply execute the main method of the class
- <literal>org.jboss.testharness.api.TCK</literal>
- . This execution is configured as a Maven profile that is activated
- when the
- <literal>dumpArtifacts</literal>
- command line property is defined:
- </para>
<programlisting>mvn test-compile -DdumpArtifacts</programlisting>
<para>
- The output directory where the artifacts are written is defined by the
- property
- <literal>org.jboss.testharness.outputDirectory</literal>
- . The jboss-tck-runner project is configured to dump the artifacts to
- the target/jsr299-artifacts directory.
+ The output directory where the artifacts are written is configured to
+ dump the artifacts to the
+ <literal>target/jsr299-artifacts</literal>
+ directory.
</para>
<para>
- Once the artifact is written to disk, you have an option of manually
- deploying it to the container. You can execute the tests in the artfact
- by requesting the context path of the application in the browser. If
- you want to execute an individual test method, specify the method name
- in the
- <literal>methodName</literal>
- request parameter (e.g., ?methodName=testMethodName).
+ You can read more about this in <xref linkend="dumping-test-artifacts"/>.
</para>
</section>
</chapter>
Modified: tck/trunk/doc/reference/en-US/master.xml
===================================================================
--- tck/trunk/doc/reference/en-US/master.xml 2009-07-24 18:45:06 UTC (rev 3202)
+++ tck/trunk/doc/reference/en-US/master.xml 2009-07-24 18:57:25 UTC (rev 3203)
@@ -4,7 +4,6 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Book_Info.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Book_Preface.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="part-background.xml"/>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="part-setup.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="part-execution.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="part-test-harness.xml" />
</book>
Modified: tck/trunk/doc/reference/en-US/part-background.xml
===================================================================
--- tck/trunk/doc/reference/en-US/part-background.xml 2009-07-24 18:45:06 UTC (rev 3202)
+++ tck/trunk/doc/reference/en-US/part-background.xml 2009-07-24 18:57:25 UTC (rev 3203)
@@ -2,14 +2,22 @@
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]>
<part>
<title>Getting Acquainted with the TCK</title>
-
+
<partintro>
<para>
- The CDI TCK must be used to ensure that your implementation
- conforms to the CDI specification. This part introduces the TCK,
- gives some background about its purpose and states the requirements for
- passing the TCK.
+ The CDI TCK must be used to ensure that your implementation conforms
+ to the CDI specification. This part introduces the TCK, gives some
+ background about its purpose and states the requirements for passing
+ the TCK.
</para>
+ <para>
+ In this part you will learn where to obtain the JSR-299 TCK and
+ supporting software. You are then presented with recommendations of how
+ to organize and configure the software so that you are ready to execute
+ the TCK.
+ </para>
</partintro>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml" />
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="installation.xml" />
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="configuration.xml" />
</part>
Deleted: tck/trunk/doc/reference/en-US/part-setup.xml
===================================================================
--- tck/trunk/doc/reference/en-US/part-setup.xml 2009-07-24 18:45:06 UTC (rev 3202)
+++ tck/trunk/doc/reference/en-US/part-setup.xml 2009-07-24 18:57:25 UTC (rev 3203)
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]>
-<part>
- <title>Installation and Setup</title>
- <partintro>
- <para>
- In this part you learn where to obtain the JSR-299 TCK and supporting software.
- You are then presented with recommendations of how to organize and
- configure the software so that you are ready to execute the TCK.
- </para>
- </partintro>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="installation.xml" />
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="configuration.xml" />
-</part>
Modified: tck/trunk/doc/reference/en-US/part-test-harness.xml
===================================================================
--- tck/trunk/doc/reference/en-US/part-test-harness.xml 2009-07-24 18:45:06 UTC (rev 3202)
+++ tck/trunk/doc/reference/en-US/part-test-harness.xml 2009-07-24 18:57:25 UTC (rev 3203)
@@ -11,4 +11,5 @@
</partintro>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="harness/introduction.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="harness/configuration.xml" />
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="harness/executing.xml" />
</part>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3202 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-24 14:45:06 -0400 (Fri, 24 Jul 2009)
New Revision: 3202
Modified:
tck/trunk/doc/reference/en-US/executing.xml
tck/trunk/doc/reference/en-US/installation.xml
Log:
Shift a few things around in executing
Modified: tck/trunk/doc/reference/en-US/executing.xml
===================================================================
--- tck/trunk/doc/reference/en-US/executing.xml 2009-07-24 18:28:01 UTC (rev 3201)
+++ tck/trunk/doc/reference/en-US/executing.xml 2009-07-24 18:45:06 UTC (rev 3202)
@@ -11,33 +11,24 @@
</para>
<section>
<title>The Test Suite Runner</title>
+
<para>
- Each test class is treated as an individual artifact (hence the
- <literal>@Artifact</literal>
- annotation on the class). All test methods (i.e., methods annotated
- with
- <literal>@Test</literal>
- ) in the test class are run in the same JSR-299 root context, meaning
- bean discovery occurs exactly once per artifact and the same
- BeanManager is used by each test method in the class.
- </para>
- <para>
The test suite is executed by the Maven 2 TestNG plugin during the test
phase of the Maven 2 life cycle. The execution happens within a TCK
runner project (as opposed to the TCK project itself). Web Beans
- includes a TCK runner project that executes the JSR-299 TCK on the
- JSR-299 RI (Web Beans) running inside JBoss AS 5.1. To execute the
- JSR-299 TCK on your own JSR-299 implementation, you must modify the TCK
+ includes a TCK runner project that executes the CDI TCK on the
+ Web Beans running inside JBoss AS 5.1. To execute the
+ CDI TCK on your own JSR-299 implementation, you could modify the TCK
runner project included with Web Beans to use your JSR-299
implementation as described in
- <xref linkend="tck-harness-properties" />
+ <xref linkend="configuration" />
</para>
</section>
<section>
<title>Running the Tests In Standalone Mode</title>
<para>
- To execute the TCK test suite against the JSR-299 RI, first switch
+ To execute the TCK test suite against the Web Beans, first switch
to the jboss-tck-runner directory in the extracted Web Beans
distribution:
</para>
@@ -64,17 +55,10 @@
<title>Running the Tests In the Container</title>
<para>
To execute the test suite using in-container mode with the JBoss TCK
- runner, you first have to set the property
- <literal>jboss.home</literal>
- to the location of a JBoss AS 5.1 installation. This property is set in
- the following Java properties file within the extracted Web Beans
- distribution:
+ runner, you first have to setup JBoss AS as described in <xref linkend="tck-in-jboss-as"/>.
</para>
- <programlisting>webbeans_install_dir/jboss-as/local.build.properties</programlisting>
<para>
- Then, add the
- <literal>incontainer</literal>
- property to the command that launches the Maven 2 life cycle:
+ Then, execute the TCK runner:
</para>
<programlisting>mvn test -Dincontainer</programlisting>
<para>
@@ -97,12 +81,8 @@
<literal>org.jboss.testharness.container.forceRestart</literal>
to
<literal>true</literal>
- . If you want to connect to an instance that is already running,
- activate in-container mode using the
- <literal>incontainer-debug</literal>
- command line property instead.
+ .
</para>
- <programlisting>mvn test -Dincontainer-debug</programlisting>
<para>
The in-container mode uses the
<literal>Containers</literal>
@@ -115,55 +95,18 @@
Since in-container tests are executed in a remote JVM, the results
of the test must be communicated back to the runner over a
container-supported protocol. The JBoss Test Harness provides
- servlet-based communication over HTTP as described in section 3.3.
+ servlet-based communication over HTTP as described in <xref linkend="incontainer-communication"/>
</para>
</section>
<section>
- <title>Running a Subset of Tests</title>
- <para>
- The TCK test suite is controlled by a TestNG descriptor. The TestNG
- descriptor tck-tests.xml, located in the src/main/resources directory
- of the jsr299-tck-impl project, defines the TCK test suite. The main
- configuration in this file is the packages filter, shown below, which
- instructs TestNG to look in the
- <literal>org.jboss.jsr299.tck.tests</literal>
- package to find the test classes.
- </para>
- <programlisting><![CDATA[<packages>
- <package name="org.jboss.jsr299.tck.tests"/>
-</packages>]]></programlisting>
- <para>
- The descriptor also includes configuration of a method selector
- implementation, shown below, that allows integration tests to be
- skipped when the test suite is executed in standalone mode.
- </para>
- <programlisting><![CDATA[<method-selectors>
- <method-selector>
- <selector-class name="org.jboss.testharness.impl.testng.DisableIntegrationTestsMethodSelector" />
- </method-selector>
-</method-selectors>]]></programlisting>
- <para>
- You may also notice other filters in this class, which are used to
- disable broken tests while the JSR-299 RI and the TCK are being
- developed. When both are final, you can expect these filters to be
- removed. However, you may want to use similar filters to disable tests
- while you are working on an implementation. Alternatively, you can
- explicity list the classes that you want to have executed if you are
- focusing on a specific area of the TCK. See the
- <ulink url="http://testng.org/doc/documentation-main.html">TestNG reference guide</ulink>
- for more information about how you can control which classes are
- selected to be run when the test suite is executed.
- </para>
- </section>
- <section>
<title>Dumping the Test Artifacts</title>
<para>
As you have learned, when the test suite is executing using
in-container mode, each test class is packaged as a deployable artifact
and deployed to the container. The test is then executed within the
context of the deployed application. This leaves room for errors in
- packaging. When investingating a test failure, it's helpful to be able
- to inspect the artifact after it is generated. The TCK can accomodate
+ packaging. When investigating a test failure, it's helpful to be able
+ to inspect the artifact after it is generated. The TCK can accommodate
this type of inspection by "dumping" the generated artifact to disk.
</para>
<para>
Modified: tck/trunk/doc/reference/en-US/installation.xml
===================================================================
--- tck/trunk/doc/reference/en-US/installation.xml 2009-07-24 18:28:01 UTC (rev 3201)
+++ tck/trunk/doc/reference/en-US/installation.xml 2009-07-24 18:45:06 UTC (rev 3202)
@@ -62,15 +62,9 @@
</section>
<section>
- <title>Installing the Software</title>
+ <title>The TCK Environment</title>
<para>
- Installing Java software is a bit of a misnomer. The only software
- you have to "install" are the runtime environments. The
- remaining software is merely extracted in a workspace directory of your
- choice.
- </para>
- <para>
The TCK requires the following two Java runtime environments:
</para>
<itemizedlist>
@@ -107,7 +101,18 @@
webbeans/
tck/]]></programlisting>
- <tip>
+ <para>
+ Each test class is treated as an individual artifact (hence the
+ <literal>@Artifact</literal>
+ annotation on the class). All test methods (i.e., methods annotated
+ with
+ <literal>@Test</literal>
+ ) in the test class are run in the same JSR-299 root context, meaning
+ bean discovery occurs exactly once per artifact and the same
+ BeanManager is used by each test method in the class.
+ </para>
+
+ <tip id="tck-in-jboss-as">
<title>
Running the TCK against the CDI RI (Web Beans) and JBoss AS
</title>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3201 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-24 14:28:01 -0400 (Fri, 24 Jul 2009)
New Revision: 3201
Modified:
tck/trunk/doc/reference/en-US/executing.xml
Log:
ws
Modified: tck/trunk/doc/reference/en-US/executing.xml
===================================================================
--- tck/trunk/doc/reference/en-US/executing.xml 2009-07-24 18:18:19 UTC (rev 3200)
+++ tck/trunk/doc/reference/en-US/executing.xml 2009-07-24 18:28:01 UTC (rev 3201)
@@ -1,196 +1,210 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]>
<chapter id="executing">
- <title>Executing the Test Suite</title>
- <para>This chapter explains how to run the TCK on the JSR-299 RI as well as your own implementation. The JSR-299 TCK uses the Maven 2 TestNG plugin and the JBoss Test Harness to execute the test suite. Learning to execute the test suite from Maven 2 is prerequisite knowlege for running the tests in an IDE, such as Eclipse.</para>
- <section>
- <title>The Test Suite Runner</title>
- <para>Each test class is treated as an individual artifact (hence the <literal>@Artifact</literal> annotation on the class). All test methods (i.e., methods annotated with <literal>@Test</literal>) in the test class are run in the same JSR-299 root context, meaning bean discovery occurs exactly once per artifact and the same BeanManager is used by each test method in the class.</para>
- <para>The test suite is executed by the Maven 2 TestNG plugin during the test phase of the Maven 2 life cycle. The execution happens within a TCK runner project (as opposed to the TCK project itself). Web Beans includes a TCK runner project that executes the JSR-299 TCK on the JSR-299 RI (Web Beans) running inside JBoss AS 5.1. To execute the JSR-299 TCK on your own JSR-299 implementation, you must modify the TCK runner project included with Web Beans to use your JSR-299 implementation as described in section 4.2.</para>
- </section>
- <section>
- <title>Running the Tests In Standalone Mode</title>
- <para>To execute the TCK test suite against the JSR-299 RI, first switch to the jboss-tck-runner directory in the extracted Web Beans distribution:</para>
- <programlisting>cd <webbeans_install_dir>/jboss-tck-runner</programlisting>
- <para>Then execute the Maven 2 life cycle through the test phase:</para>
- <programlisting>mvn test</programlisting>
- <para>Without any command-line flags, the test suite is run in standalone mode, which means that any test class with the <literal>@org.jboss.testharness.impl.packaging.IntegrationTest</literal> annotation is skipped. This mode uses the <literal>StandaloneContainers</literal> SPI to invoke the test artifact within a mock Java EE life cycle and capture the results of the test. However, passing the suite in this mode is not sufficient to pass the TCK as a whole. The suite must be passed while executing in in-container mode.</para>
- </section>
- <section>
- <title>Running the Tests In the Container</title>
- <para>To execute the test suite using in-container mode with the JBoss TCK runner, you first have to set the property <literal>jboss.home</literal> to the location of a JBoss AS 5.1 installation. This property is set in the following Java properties file within the extracted Web Beans distribution:</para>
- <programlisting><webbeans_install_dir>/jboss-as/local.build.properties</programlisting>
- <para>Then, add the <literal>incontainer</literal> property to the command that launches the Maven 2 life cycle:</para>
- <programlisting>mvn test -Dincontainer</programlisting>
- <para>The presence of the <literal>incontainer</literal> property activates a Maven 2 profile that assigns the <literal>org.jboss.testharness.standalone</literal> system property to <literal>false</literal> and the <literal>org.jboss.testharness.runIntegrationTests</literal> system property to <literal>true</literal>, hence activing the in-container test mode. This time, all the test artifacts in the test suite are executed.</para>
- <para>The in-container profile will also start and stop the application server automatically by setting the <literal>org.jboss.testharness.container.forceRestart</literal> to <literal>true</literal>. If you want to connect to an instance that is already running, activate in-container mode using the <literal>incontainer-debug</literal> command line property instead.</para>
- <programlisting>mvn test -Dincontainer-debug</programlisting>
- <para>The in-container mode uses the <literal>Containers</literal> SPI to deploy the test artifact to the container and execute the test in a true Java EE life cycle. The JBoss TCK runner has a dependency on the library that provides an implementation of this interface for JBoss AS 5.1.</para>
- <para>Since in-container tests are executed in a remote JVM, the results of the test must be communicated back to the runner over a container-supported protocol. The JBoss Test Harness provides servlet-based communication over HTTP as described in section 3.3.</para>
- </section>
- <section>
- <title>Running a Subset of Tests</title>
- <para>The TCK test suite is controlled by a TestNG descriptor. The TestNG descriptor tck-tests.xml, located in the src/main/resources directory of the jsr299-tck-impl project, defines the TCK test suite. The main configuration in this file is the packages filter, shown below, which instructs TestNG to look in the <literal>org.jboss.jsr299.tck.tests</literal> package to find the test classes.</para>
- <programlisting><packages>
- <package name="org.jboss.jsr299.tck.tests"/>
-</packages></programlisting>
- <para>The descriptor also includes configuration of a method selector implementation, shown below, that allows integration tests to be skipped when the test suite is executed in standalone mode.</para>
- <programlisting><method-selectors>
- <method-selector>
- <selector-class name="org.jboss.testharness.impl.
-testng.DisableIntegrationTestsMethodSelector" />
- </method-selector>
-</method-selectors></programlisting>
- <para>You may also notice other filters in this class, which are used to disable broken tests while the JSR-299 RI and the TCK are being developed. When both are final, you can expect these filters to be removed. However, you may want to use similar filters to disable tests while you are working on an implementation. Alternatively, you can explicity list the classes that you want to have executed if you are focusing on a specific area of the TCK. See the <ulink url="http://testng.org/doc/documentation-main.html">TestNG reference guide</ulink> for more information about how you can control which classes are selected to be run when the test suite is executed.</para>
- </section>
- <section>
- <title>Dumping the Test Artifacts</title>
- <para>As you have learned, when the test suite is executing using in-container mode, each test class is packaged as a deployable artifact and deployed to the container. The test is then executed within the context of the deployed application. This leaves room for errors in packaging. When investingating a test failure, it's helpful to be able to inspect the artifact after it is generated. The TCK can accomodate this type of inspection by "dumping" the generated artifact to disk.</para>
- <para>If the <literal>dumpArtifacts</literal> is defined as a system property or defined in the classpath resource META-INF/jboss-test-harness.properties and has a value of <literal>true</literal>, the JBoss Test Harness will write the artifact to an output directory prior to deploying it to the server. This behavior is activated in the jboss-tck-runner project by appending the <literal>dumpArtifacts</literal> command line property to the end of the command that invokes the Maven test phase.</para>
- <programlisting>mvn test -Dincontainer -DdumpArtifacts</programlisting>
- <para>If you only want to write the artifacts to disk, and avoid executing the test suite, you can simply execute the main method of the class <literal>org.jboss.testharness.api.TCK</literal>. This execution is configured as a Maven profile that is activated when the <literal>dumpArtifacts</literal> command line property is defined:</para>
- <programlisting>mvn test-compile -DdumpArtifacts</programlisting>
- <para>The output directory where the artifacts are written is defined by the property <literal>org.jboss.testharness.outputDirectory</literal>. The jboss-tck-runner project is configured to dump the artifacts to the target/jsr299-artifacts directory.</para>
- <para>Once the artifact is written to disk, you have an option of manually deploying it to the container. You can execute the tests in the artfact by requesting the context path of the application in the browser. If you want to execute an individual test method, specify the method name in the <literal>methodName</literal> request parameter (e.g., ?methodName=testMethodName).</para>
- </section>
- <section>
- <title>Running a Test in Eclipse</title>
- <para>The primary motivation for building the test harness on top of an existing testing framework is to allow the tests to be executed and debugged in an Integrated Development Environment (IDE) using availalbe plugins. It's also the easiest way to execute a test class in isolation.</para>
- <para>The TCK can be executed in any IDE for which there is a TestNG plugin available. Running a test in Eclipse is almost as simple as running the test with the Eclipse TestNG plugin. You can also use the TestNG plugin to debug a test, which is described in the next chapter.</para>
- <para>Before running a test from the TCK test suite in Eclipse, you must have the Eclipse <ulink url="http://testng.org">TestNG plugin</ulink> installed. Instructions for using the TestNG update site to add the TestNG plugin to Eclipse are provided on the TestNG <ulink url="http://testng.org/doc/download.html">download page</ulink>. You can find a tutorial that explains how to use the TestNG plugin on the TestNG <ulink url="http://testng.org/doc/eclipse.html">Eclipse page</ulink>.</para>
- <para>You should also have the <ulink url="http://m2eclipse.codehaus.org">m2eclipse plugin</ulink> installed. This plugin absolutely essential for working with Maven 2 projects, which both the JSR-299 RI and the TCK are. Instructions for using the m2eclipse update site to add the m2eclipse plugin to Eclipse are provided on the m2eclipse home page. Sonatype, the company that maintains the m2eclipse plugin and is a strong supporter of Maven, publishes an entire <ulink url="http://www.sonatype.com/books/m2eclipse-book/reference">reference guide</ulink> dedicated to the plugin on their website.</para>
- <para>Once you have the m2eclipse plugin installed, import the JSR-299 TCK projects. You should also import the JSR-299 RI projects if you want to debug into that code.</para>
- <para>When setting up your Ecilpse workspace, I recommend creating three workings sets: one for the JSR-299 RI (Web Beans), one for the JSR-299 TCK and one for the JBoss TCK Runner. The dependencies between the projects will be established automatically by the m2eclipse plugin based on the dependency information in the pom.xml files. Your workspace should appear as follows:</para>
- <programlisting>JSR-299 RI
- jsr299-api
- webbeans-api
- webbeans-core
- webbeans-core-test
- webbeans-logging
- webbeans-parent
- webbeans-spi
- webbeans-version-matrix
-JSR-299 TCK
- jsr299-tck-api
- jsr299-tck-impl
- parent
-Web Beans JBoss TCK Runner
- webbeans-jboss-tck-runner
- webbeans-porting-package</programlisting>
- <para>The tests in the TCK test suite are located in the jsr299-tck-impl project. You'll be working within this project in Eclipse when you are developing tests. However, you learned earlier, there are no references to a JSR-299 implementation in the TCK. So how can you execute an individual test in Eclipse? The secret is that you need to establish a link in Eclipse (not in Maven) between the jsr299-tck-impl project and your TCK runner project, which in this case is webbeans-jboss-tck-runner. Here are the steps to establish the link:</para>
- <orderedlist>
- <listitem>
- <para>Right click on the jsr299-tck-impl project</para>
- </listitem>
- <listitem>
- <para>Select Build Path > Configure Build Path...</para>
- </listitem>
- <listitem>
- <para>Click on the Projects tab</para>
- </listitem>
- <listitem>
- <para>Click the Add... button on the right</para>
- </listitem>
- <listitem>
- <para>Check the TCK runner project (e.g., webbeans-jboss-tck-runner)</para>
- </listitem>
- <listitem>
- <para>Click the OK button on the Required Project Selection dialog window</para>
- </listitem>
- <listitem>
- <para>Click the OK button on the Java Build Path window</para>
- </listitem>
- </orderedlist>
- <para>The TCK runner project should pull in the JSR-299 implementation, the TCK porting package and any additional properties that must be defined to execute the TCK test suite.</para>
- <para>Your now ready to execute an individual test class (a class which extends AbstractJSR299Test and is annotated with @Artifact). Select a test class that is <emphasis role="italic">not</emphasis> annotated with <literal>@IntegrationTest</literal> and open it in the Eclipse editor. Right click in the editor view and select TestNG > Run as test. The TestNG view should pop out and you should see all the tests pass (hopefully).</para>
- <note>
- <para>If the TCK complains that there is a property missing, close all the projects, open them again, and rebuild. The m2eclipse plugin can be finicky getting everything built correctly the first time.</para>
- </note>
- <para>So far you have executed a test in standalone mode. That's not sufficient to pass the TCK. The test must be executed in in-container mode. Using in-container mode also the only way to execute a test annotated with <literal>@IntegrationTest</literal> as it requires container resources. So let's see what has to be done to execute an integration test. This will result in the artifact being deployed to the container, which is JBoss AS 5.1 if you are using the JBoss TCK runner.</para>
- <para>As you have learned, the JBoss test harness determines how to behave based on the values of numerous system properties or properties defined in META-INF/jboss-test-harness.properties classpath resources. If the property named <literal>org.jboss.testharness.standalone</literal> is not defined, the harness assumes that the test is to be run in standalone mode. In order to run the tests in the container, you need to add a properties file to the classpath that sets the standalone property to false and provides values for other properties required to run an in-container test.</para>
- <para>The JBoss TCK runner project conveniently provides the properties file src/test/debug-resources/META-INF/jboss-test-harness.properties that contains all of the necessary properties. You may have to tune the <literal>org.jboss.testharness.container.extraConfigurationDir</literal> and <literal>org.jboss.testharness.libraryDirectory</literal> properties to point to the relative location of the related projects. The properties should be defined as follows:</para>
- <itemizedlist>
- <listitem>
- <para><literal>org.jboss.testharness.container.extraConfigurationDir</literal> - the relative path from the jboss-tck-impl project to a directory that contains a build.properties or local.build.properties file defining the location of a JBoss AS 5.1 installation in the <literal>jboss.home</literal> property</para>
- </listitem>
- <listitem>
- <para><literal>org.jboss.testharness.libraryDirectory</literal> - the relative path from the jboss-tck-impl project to the target/dependency/lib directory in the TCK runner project.</para>
- </listitem>
- </itemizedlist>
- <para>The other properties in that file are defined as follows:</para>
- <programlisting>org.jboss.testharness.standalone=false
-org.oss.testharness.container.forceRestart=false
-org.oss.testharness.runIntegrationTests=true</programlisting>
- <para>You're now ready to execute an integration test. Select an integration test (a class that extends <literal>AbstractJSR299Test</literal> and is annotated with both <literal>@Artifact</literal> and <literal>@IntegrationTest</literal>) and open it in your Eclipse editor. Follow these steps to execute the class with the TestNG plugin:</para>
- <orderedlist>
- <listitem>
- <para>Right click in the editor view and select TestNG > Run as test</para>
- </listitem>
- <listitem>
- <para>Observe the test fail because of missing dependencies</para>
- </listitem>
- <listitem>
- <para>Select the Run > Run Configurations... menu from the main menubar</para>
- </listitem>
- <listitem>
- <para>Select the name of the test class under the TestNG category</para>
- </listitem>
- <listitem>
- <para>Select the Classpath tab</para>
- </listitem>
- <listitem>
- <para>Select User Entries in the tree</para>
- </listitem>
- <listitem>
- <para>Click the Advanced... button on the right</para>
- </listitem>
- <listitem>
- <para>Select Add Folders and click the OK button</para>
- </listitem>
- <listitem>
- <para>Select the webbeans-jboss-tck-runner/src/test/debug-resources folder</para>
- </listitem>
- <listitem>
- <para>Click the OK button on the Folder Selection dialog window</para>
- </listitem>
- <listitem>
- <para>Click on the webbeans-jboss-tck-runner entry</para>
- </listitem>
- <listitem>
- <para>Move the webbeans-jboss-tck-runner to the first entry using the Up button</para>
- </listitem>
- <listitem>
- <para>Click the Run button on the Run Configurations dialog window</para>
- </listitem>
- </orderedlist>
- <para>When you run the test this time, it should pass. If you get a failure that the container (e.g., JBoss AS 5.1) must be run with assertions enabled, you need to stop the container and start it with the -ea flag (or just leave it stopped and the test will start it appropriately). </para>
- <para>You can simply right click and select TestNG > Run as test for all subsequent runs for the reason cited earlier, the run configuration for a class is retained indefinitely.</para>
- <para>Alternatively, you can configure TestNG to execute all tests in-container by default by adding the properties file in the debug-resources folder to the project's classpath as follows:</para>
- <orderedlist>
- <listitem>
- <para>Right click on the jsr299-tck-impl project</para>
- </listitem>
- <listitem>
- <para>Select Build Path > Configure Build Path...</para>
- </listitem>
- <listitem>
- <para>Click on the Libraries tab</para>
- </listitem>
- <listitem>
- <para>Click the Add Class Folder... button on the right</para>
- </listitem>
- <listitem>
- <para>Check the webbeans-jboss-tck-runner/src/test/debug-resources folder</para>
- </listitem>
- <listitem>
- <para>Click the OK button on the Class Folder Selection dialog window</para>
- </listitem>
- <listitem>
- <para>Click the OK button on the Java Build Path window</para>
- </listitem>
- </orderedlist>
- <para>Now you don't have to do any special configuration for each test class.</para>
- <para>You can stop the individual tests from running in-container by reversing the steps above to remove the debug-resources folder from the Eclipse classpath. </para>
- <para>You have now mastered running the JSR-299 TCK against the JSR-299 RI using both Maven 2 and within Eclipse. Now you're likely interested in how to debug a test so that you can efficiently investigate test failures.</para>
- </section>
+ <title>Executing the Test Suite</title>
+ <para>
+ This chapter explains how to run the TCK on the JSR-299 RI as well as
+ your own implementation. The JSR-299 TCK uses the Maven 2 TestNG plugin
+ and the JBoss Test Harness to execute the test suite. Learning to execute
+ the test suite from Maven 2 is prerequisite knowlege for running the tests
+ in an IDE, such as Eclipse.
+ </para>
+ <section>
+ <title>The Test Suite Runner</title>
+ <para>
+ Each test class is treated as an individual artifact (hence the
+ <literal>@Artifact</literal>
+ annotation on the class). All test methods (i.e., methods annotated
+ with
+ <literal>@Test</literal>
+ ) in the test class are run in the same JSR-299 root context, meaning
+ bean discovery occurs exactly once per artifact and the same
+ BeanManager is used by each test method in the class.
+ </para>
+ <para>
+ The test suite is executed by the Maven 2 TestNG plugin during the test
+ phase of the Maven 2 life cycle. The execution happens within a TCK
+ runner project (as opposed to the TCK project itself). Web Beans
+ includes a TCK runner project that executes the JSR-299 TCK on the
+ JSR-299 RI (Web Beans) running inside JBoss AS 5.1. To execute the
+ JSR-299 TCK on your own JSR-299 implementation, you must modify the TCK
+ runner project included with Web Beans to use your JSR-299
+ implementation as described in
+ <xref linkend="tck-harness-properties" />
+ </para>
+ </section>
+
+ <section>
+ <title>Running the Tests In Standalone Mode</title>
+ <para>
+ To execute the TCK test suite against the JSR-299 RI, first switch
+ to the jboss-tck-runner directory in the extracted Web Beans
+ distribution:
+ </para>
+
+ <programlisting>cd webbeans/jboss-tck-runner</programlisting>
+ <para>
+ Then execute the Maven 2 life cycle through the test phase:
+ </para>
+ <programlisting>mvn test</programlisting>
+ <para>
+ Without any command-line flags, the test suite is run in standalone
+ mode, which means that any test class with the
+ <literal>@org.jboss.testharness.impl.packaging.IntegrationTest
+ </literal>
+ annotation is skipped. This mode uses the
+ <literal>StandaloneContainers</literal>
+ SPI to invoke the test artifact within a mock Java EE life cycle and
+ capture the results of the test. However, passing the suite in this
+ mode is not sufficient to pass the TCK as a whole. The suite must be
+ passed while executing in in-container mode.
+ </para>
+ </section>
+ <section>
+ <title>Running the Tests In the Container</title>
+ <para>
+ To execute the test suite using in-container mode with the JBoss TCK
+ runner, you first have to set the property
+ <literal>jboss.home</literal>
+ to the location of a JBoss AS 5.1 installation. This property is set in
+ the following Java properties file within the extracted Web Beans
+ distribution:
+ </para>
+ <programlisting>webbeans_install_dir/jboss-as/local.build.properties</programlisting>
+ <para>
+ Then, add the
+ <literal>incontainer</literal>
+ property to the command that launches the Maven 2 life cycle:
+ </para>
+ <programlisting>mvn test -Dincontainer</programlisting>
+ <para>
+ The presence of the
+ <literal>incontainer</literal>
+ property activates a Maven 2 profile that assigns the
+ <literal>org.jboss.testharness.standalone</literal>
+ system property to
+ <literal>false</literal>
+ and the
+ <literal>org.jboss.testharness.runIntegrationTests</literal>
+ system property to
+ <literal>true</literal>
+ , hence activating the in-container test mode. This time, all the test
+ artifacts in the test suite are executed.
+ </para>
+ <para>
+ The in-container profile will also start and stop the application
+ server automatically by setting the
+ <literal>org.jboss.testharness.container.forceRestart</literal>
+ to
+ <literal>true</literal>
+ . If you want to connect to an instance that is already running,
+ activate in-container mode using the
+ <literal>incontainer-debug</literal>
+ command line property instead.
+ </para>
+ <programlisting>mvn test -Dincontainer-debug</programlisting>
+ <para>
+ The in-container mode uses the
+ <literal>Containers</literal>
+ SPI to deploy the test artifact to the container and execute the test
+ in a true Java EE life cycle. The JBoss TCK runner has a dependency on
+ the library that provides an implementation of this interface for JBoss
+ AS 5.1.
+ </para>
+ <para>
+ Since in-container tests are executed in a remote JVM, the results
+ of the test must be communicated back to the runner over a
+ container-supported protocol. The JBoss Test Harness provides
+ servlet-based communication over HTTP as described in section 3.3.
+ </para>
+ </section>
+ <section>
+ <title>Running a Subset of Tests</title>
+ <para>
+ The TCK test suite is controlled by a TestNG descriptor. The TestNG
+ descriptor tck-tests.xml, located in the src/main/resources directory
+ of the jsr299-tck-impl project, defines the TCK test suite. The main
+ configuration in this file is the packages filter, shown below, which
+ instructs TestNG to look in the
+ <literal>org.jboss.jsr299.tck.tests</literal>
+ package to find the test classes.
+ </para>
+ <programlisting><![CDATA[<packages>
+ <package name="org.jboss.jsr299.tck.tests"/>
+</packages>]]></programlisting>
+ <para>
+ The descriptor also includes configuration of a method selector
+ implementation, shown below, that allows integration tests to be
+ skipped when the test suite is executed in standalone mode.
+ </para>
+ <programlisting><![CDATA[<method-selectors>
+ <method-selector>
+ <selector-class name="org.jboss.testharness.impl.testng.DisableIntegrationTestsMethodSelector" />
+ </method-selector>
+</method-selectors>]]></programlisting>
+ <para>
+ You may also notice other filters in this class, which are used to
+ disable broken tests while the JSR-299 RI and the TCK are being
+ developed. When both are final, you can expect these filters to be
+ removed. However, you may want to use similar filters to disable tests
+ while you are working on an implementation. Alternatively, you can
+ explicity list the classes that you want to have executed if you are
+ focusing on a specific area of the TCK. See the
+ <ulink url="http://testng.org/doc/documentation-main.html">TestNG reference guide</ulink>
+ for more information about how you can control which classes are
+ selected to be run when the test suite is executed.
+ </para>
+ </section>
+ <section>
+ <title>Dumping the Test Artifacts</title>
+ <para>
+ As you have learned, when the test suite is executing using
+ in-container mode, each test class is packaged as a deployable artifact
+ and deployed to the container. The test is then executed within the
+ context of the deployed application. This leaves room for errors in
+ packaging. When investingating a test failure, it's helpful to be able
+ to inspect the artifact after it is generated. The TCK can accomodate
+ this type of inspection by "dumping" the generated artifact to disk.
+ </para>
+ <para>
+ If the
+ <literal>dumpArtifacts</literal>
+ is defined as a system property or defined in the classpath resource
+ META-INF/jboss-test-harness.properties and has a value of
+ <literal>true</literal>
+ , the JBoss Test Harness will write the artifact to an output directory
+ prior to deploying it to the server. This behavior is activated in the
+ jboss-tck-runner project by appending the
+ <literal>dumpArtifacts</literal>
+ command line property to the end of the command that invokes the Maven
+ test phase.
+ </para>
+ <programlisting>mvn test -Dincontainer -DdumpArtifacts</programlisting>
+ <para>
+ If you only want to write the artifacts to disk, and avoid executing
+ the test suite, you can simply execute the main method of the class
+ <literal>org.jboss.testharness.api.TCK</literal>
+ . This execution is configured as a Maven profile that is activated
+ when the
+ <literal>dumpArtifacts</literal>
+ command line property is defined:
+ </para>
+ <programlisting>mvn test-compile -DdumpArtifacts</programlisting>
+ <para>
+ The output directory where the artifacts are written is defined by the
+ property
+ <literal>org.jboss.testharness.outputDirectory</literal>
+ . The jboss-tck-runner project is configured to dump the artifacts to
+ the target/jsr299-artifacts directory.
+ </para>
+ <para>
+ Once the artifact is written to disk, you have an option of manually
+ deploying it to the container. You can execute the tests in the artfact
+ by requesting the context path of the application in the browser. If
+ you want to execute an individual test method, specify the method name
+ in the
+ <literal>methodName</literal>
+ request parameter (e.g., ?methodName=testMethodName).
+ </para>
+ </section>
</chapter>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3200 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-24 14:18:19 -0400 (Fri, 24 Jul 2009)
New Revision: 3200
Modified:
tck/trunk/doc/reference/en-US/
tck/trunk/doc/reference/en-US/configuration.xml
tck/trunk/doc/reference/en-US/master.xml
tck/trunk/doc/reference/en-US/part-execution.xml
tck/trunk/doc/reference/en-US/part-test-harness.xml
Log:
Split out JBoss Test Harness config chapter
Property changes on: tck/trunk/doc/reference/en-US
___________________________________________________________________
Name: svn:externals
-
harness http://anonsvn.jboss.org/repos/test-utils/jboss-test-harness/trunk/doc/re...
+
harness https://svn.jboss.org/repos/test-utils/jboss-test-harness/trunk/doc/refer...
Modified: tck/trunk/doc/reference/en-US/configuration.xml
===================================================================
--- tck/trunk/doc/reference/en-US/configuration.xml 2009-07-24 16:24:33 UTC (rev 3199)
+++ tck/trunk/doc/reference/en-US/configuration.xml 2009-07-24 18:18:19 UTC (rev 3200)
@@ -3,50 +3,37 @@
<chapter id="configuration">
<title>Configuration</title>
<para>
- This chapter lays out how to configure the JBoss Test Harness by
- specifying the SPI implementation classes, defining the target container
- connection information, and various other switches. You then learn how to
- setup a TCK runner project that executes the the TCK test suite, putting
- these settings into practice. Finally, a detailed account of how the JBoss
- Test Harness negotiates the execution of the tests in the container is
- given.
+ This chapter lays out how to configure the TCK Harness by specifying
+ the SPI implementation classes, defining the target container connection
+ information, and various other switches. You then learn how to setup a TCK
+ runner project that executes the the TCK test suite, putting these
+ settings into practice. Finally, a detailed account of how the JBoss Test
+ Harness negotiates the execution of the tests in the container is given.
</para>
- <section id="test-harness-properties">
- <title>JBoss Test Harness Properties</title>
+
+ <para>
+ This guide does not discuss in detail how to use the TCK in standalone
+ mode. The JBoss Test Harness guide provides more on running in standalone
+ mode.
+ </para>
+ <section id="tck-harness-properties">
+ <title>TCK Harness Properties</title>
<para>
The JBoss Test Harness allows the test suite to be launched in a
pluggable fashion. In order to execute the TCK, the JBoss Test Harness
must be configured by specifying implementations of the test launcher
- and container APIs. All the required configuration that pertains to the
- JBoss Test Harness is applicable to the TCK as well.
+ and container APIs.
</para>
<para>
System properties and/or the resource
<code>META-INF/jboss-test-harness.properties</code>
, a Java properties file, are used to configure the JBoss Test Harness.
- The bootstrap configuration builder looks to the property
- <literal>org.jboss.testharness.api.ConfigurationBuilder</literal>
- , the first property listed in table 3.1, for the fully qualified class
- name (FQCN) of a concrete configuration builder implementation to get
- started. This implementation loads the remaining configuration settings
- and produces a JBoss Test Harness configuration.
+ You can read more about configuring the JBoss Test Harness in
+ <xref linkend="test-harness-properties" />
</para>
<para>
- For you convenience, the default configuration builder implementation
- <literal>org.jboss.testharness.impl.PropertiesBasedConfigurationBuilder
- </literal>
- is provided, which collects all the JBoss Test Harness configuration
- settings from Java properties. It does so by aggregating the system
- properties with the properties defined in the
- META-INF/jboss-test-harness.properties resource in any classpath entry
- under a single properties map, allowing you to partition the
- configuration settings as needed.
+ You should set the following properties
</para>
- <para>
- A complete list of configuration properties for the JBoss Test
- Harness has been itemized in table 2.1.1, accompanied by the default
- value (if any) and a description for each property.
- </para>
<table frame="all">
<title />
<tgroup cols="2">
@@ -54,225 +41,81 @@
<colspec colnum="2" colname="description" colwidth="2*" />
<thead>
<row>
- <entry>Property = Default Value</entry>
+ <entry>Property = Required/Example Value</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>
- <literal>org.jboss.testharness.api.ConfigurationBuilder=
+ <literal>org.jboss.testharness.libraryDirectory=/path/to/extra/libraries
</literal>
- <literal>o.j.t.impl.PropertiesBasedConfigurationBuilder
- </literal>
</entry>
<entry>
- The configuration bootstrap class for the JBoss Test
- Harness.
+ Directory containing extra JARs you want placed in
+ artifact library directory such as the porting package
+ implementation.
</entry>
</row>
<row>
<entry>
- <literal>org.jboss.testharness.testPackage=</literal>
+ <literal>org.jboss.testharness.standalone=false</literal>
</entry>
<entry>
- The top-level Java package containing the classes to be
- tested.
+ You must run the tests in-container to pass the TCK
</entry>
</row>
<row>
<entry>
- <literal>org.jboss.testharness.libraryDirectory=</literal>
+ <literal>org.jboss.testharness.runIntegrationTests=true
+ </literal>
</entry>
<entry>
- Directory containing extra JARs.
+ You must run the integration tests to pass the TCK
</entry>
</row>
<row>
<entry>
- <literal>org.jboss.testharness.standalone=true</literal>
- </entry>
- <entry>
- Tests are run using standalone mode if true or using
- in-container mode if false.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.testharness.runIntegrationTests=false
+ <literal>org.jboss.testharness.spi.Containers=com.acme.AcmeContainer
</literal>
</entry>
<entry>
- If true, integration tests are run. In-container mode
- must be activated.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.testharness.spi.Containers=</literal>
- </entry>
- <entry>
The container implementation for deploying and
- executing in-container tests.
+ executing
+ in-container tests. See
+ <xref linkend="deployment-api-contributions" />
</entry>
</row>
<row>
<entry>
- <literal>org.jboss.testharness.host=localhost:8080
+ <literal>org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
</literal>
</entry>
<entry>
- The host and port on which the container is running.
+ You should use the
+ <literal>ServletTestLauncher</literal>
+ for Java EE6 and Java EE6 Web Profile.
</entry>
</row>
- <row>
- <entry>
- <literal>org.jboss.testharness.connectDelay=5000</literal>
- </entry>
- <entry>
- The timeout (ms) when attempting to connect to the
- container.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.testharness.connectRetries=2</literal>
- </entry>
- <entry>
- The number of connection retries used when connecting
- the the container.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.testharness.api.TestLauncher=</literal>
- </entry>
- <entry>
- The in-container test launcher.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.testharness.container.\</literal>
- <literal>deploymentExceptionTransformer=</literal>
- </entry>
- <entry>
- A class which maps deployment exceptions to expected
- exceptions declared in test case. Returns original
- exception by default.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.testharness.container.forceRestart=false
- </literal>
- </entry>
- <entry>
- Whether the container should be restarted before the
- tests are executed.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.testharness.container.extraConfigurationDir=
- </literal>
- </entry>
- <entry>
- A directory containing a build.properties or
- local.build.properties files that define additional
- properties.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.testharness.spi.StandaloneContainers=
- </literal>
- </entry>
- <entry>
- The container implementation for executing standalone
- tests.
- </entry>
- </row>
- <row>
- <entry>
- <literal>dumpArtifacts=false</literal>
- </entry>
- <entry>
- Whether the test artifacts should be written to disk
- for inspection.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.testharness.outputDirectory=</literal>
- <literal>%java.io.tmpdir%/jsr-299-tck/</literal>
- </entry>
- <entry>
- Directory where test artifacts will be written to disk, if
- <literal>dumpArtifacts</literal>
- is true.
- </entry>
- </row>
</tbody>
</tgroup>
</table>
<para>
- The TCK also relies on implementations of the interfaces in the
- porting package. These implementations are also specified using system
- properties or the classpath resource
- META-INF/jboss-test-harness.properties. The implementation of each
- porting package SPI must be specified using the fully-qualified domain
- name (FQDN) of the interface mapped to a Java property. The properties
- that correspond to the interface which must be implemented are listed
- in table 3.2.
+ To run the full TCK you must additionally implement
+ <literal>org.jboss.testharness.spi.Containers</literal>
+ , which handles deploying the test artifact to the container. An
+ implementations of this API is already available for JBoss AS 5.1.
+ Therefore, you only need to implement this part of the porting package
+ if you wish to use another container.
</para>
- <table frame="all">
- <title />
- <tgroup cols="2">
- <colspec colname="property" />
- <colspec colname="description" />
- <thead>
- <row>
- <entry>Property</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <literal>org.jboss.jsr299.tck.spi.Managers</literal>
- </entry>
- <entry>
- Operations pertaining to the BeanManager.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.jsr299.tck.spi.Beans</literal>
- </entry>
- <entry>
- Operations pertaining to bean types.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.jsr299.tck.spi.Contexts</literal>
- </entry>
- <entry>
- Operations pertaining to Java EE contexts.
- </entry>
- </row>
- <row>
- <entry>
- <literal>org.jboss.jsr299.tck.spi.EL</literal>
- </entry>
- <entry>
- Operations pertaining to the Unified EL.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ <note id="deployment-api-contributions">
+ <para>
+ Red Hat Middleware LLC encourages CDI implementators to
+ contribute JBoss Test Harness Deployment API implementations for
+ other containers under the ASL license. Please contact the CDI TCK
+ lead.
+ </para>
+ </note>
</section>
<section>
<title>The Porting Package</title>
@@ -322,355 +165,59 @@
provided.
</para>
- <para>
- To run the full TCK you must additionally implement
- <literal>org.jboss.testharness.spi.Containers</literal>
- , which handles deploying the test artifact to the container. An
- implementations of this API is already available for JBoss AS 5.1.
- Therefore, you only need to implement this part of the porting package
- if you wish to use another container.
- </para>
- <note>
- <para>
- Red Hat Middleware LLC encourages CDI implementators to
- contribute JBoss Test Harness Deployment API implementations for
- other containers under the ASL license. Please contact the CDI TCK
- lead.
- </para>
- </note>
- <para>
- If you wish to run the TCK in standalone mode, a CDI implementation
- must provide an implementation of
- <literal>org.jboss.testharness.spi.StandaloneContainers</literal>
- . The CDI RI provides an implementation of this API; see the RI
- reference guide.
- </para>
- <para>
- The default configuration for the TCK uses Java properties files. The
- implementation class for all of these SPIs is placed in this properties
- file. Optionally, you can use system properties to configure the TCK.
- Details are provided in
- <xref linkend="test-harness-properties" />
- .
- </para>
</section>
+
<section>
- <title>Setting up the TCK runner project</title>
+ <title>Configuring TestNG to execute the TCK</title>
<para>
- The TCK runner project is the magic that makes everything come
- together and allows you to execute the TCK against a JSR-299
- implementation. If you fully understand how the JBoss Test Harness
- functions, and have a good grasp on Maven 2, then it's not to
- difficult to understand how the TCK runner project works. Regardless of
- your background, this guide covers what you need to know to get up and
- running by studying the TCK runner that tests the JSR-299 RI.
+ The JBoss Test Harness is built on top of TestNG, and it is TestNG that
+ is responsible for selecting the tests to execute, the order of
+ execution, and reporting the results. Detailed TestNG documentation can
+ be found at
+ <ulink url="http://testng.org/doc/documentation-main.html">testng.org</ulink>
+ .
</para>
<para>
- The TCK runner for the JSR-299 RI can be found in the
- jboss-tck-runner directory in the Web Beans distribution. The
- dependencies of the TCK runner project for the JSR-299 RI are listed in
- table 2.2.3.
+ The
+ <literal>tck-tests.xml</literal>
+ artifact provided in the TCK distribution must be run by TestNG 5.9
+ (described by the TestNG documenation as "with a
+ <literal>testng.xml</literal>
+ file") unmodified for an implementation to pass the TCK. This file also
+ allows test to be excluded from a run:
</para>
- <table frame="all">
- <title />
- <tgroup cols="3">
- <colspec colname="c1" />
- <colspec colname="c2" />
- <colspec colname="c3" />
- <thead>
- <row>
- <entry>Group ID</entry>
- <entry>Artifact ID</entry>
- <entry>Version</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>org.jboss.webbeans</entry>
- <entry>jsr299-api</entry>
- <entry>1.0.0-SNAPSHOT</entry>
- </row>
- <row>
- <entry>org.jboss.jsr299.tck</entry>
- <entry>jsr299-tck-api</entry>
- <entry>1.0.0-SNAPSHOT</entry>
- </row>
- <row>
- <entry>org.jboss.jsr299.tck</entry>
- <entry>jsr299-tck-impl</entry>
- <entry>1.0.0-SNAPSHOT</entry>
- </row>
- <row>
- <entry>org.jboss.webbeans</entry>
- <entry>webbeans-core</entry>
- <entry>1.0.0-SNAPSHOT</entry>
- </row>
- <row>
- <entry>org.jboss.webbeans</entry>
- <entry>webbeans-porting-package</entry>
- <entry>1.0.0-SNAPSHOT</entry>
- </row>
- <row>
- <entry>org.testng</entry>
- <entry>testng (classifier: jdk15)</entry>
- <entry>5.8</entry>
- </row>
- <row>
- <entry>org.jboss.test-harness</entry>
- <entry>jboss-test-harness-jboss-as-51</entry>
- <entry>1.0.0.BETA3</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ <programlisting><![CDATA[<suite name="JSR-299 TCK" verbose="2" >
+ <test name="JSR-299 TCK" >
+ ...
+ <classes>
+ <class name="org.jboss.jsr299.tck.tests.context.application.ApplicationContextTest">
+ <methods>
+ <exclude name=" testApplicationScopeActiveDuringServiceMethod" />
+ </methods>
+ </class>
+ </classes>
+ ...
+ </test>
+</suite>]]></programlisting>
+
<para>
- You can install these dependencies manually into your local Maven
- respository using the following command template:
+ TestNG provides extensive reporting information; depending on the
+ build tool or IDE you use the reporting will take a different format.
+ Please consult the TestNG documentation and the tool documentation for
+ more information.
</para>
- <programlisting>mvn install:install-file \
--Dfile=jsr299-tck-api.jar \
--DgroupId=org.jboss.jsr299.tck \
--DartifactId=jsr29-tck-api \
--Dversion=1.0.0-SNAPSHOT \
--Dpackaging=jar</programlisting>
- <para>
- You should substituate the webbeans-core and webbeans-porting-package
- artifacts from table 2.2.3 if you are running the TCK against your
- JSR-299 implementation. You'll also need to replace the
- jboss-test-harness-jboss-as-51 artifact if you are not testing your
- implementation on JBoss AS 5.1. The jboss-test-harness-jboss-as-51
- artifact contains implementations of the
- <literal>Containers</literal>
- SPI for the JBoss Test Harness.
- </para>
- <note>
- <para>
- When running the TCK in the in-container mode, the tests will run
- against the JSR-299 implementation installed in the container. The
- version of the implementation declared as a Maven dependency is only
- used when running the TCK in standalone mode.
- </para>
- </note>
- <para>
- The TestNG test suite for the TCK is also retrieved from the local
- Maven repository (groupId=org.jboss.jsr299.tck,
- artifactId=jsr299-tck-impl, classifier=suite, type=xml,
- version=1.0.0-SNAPSHOT), but it's not declared as a regular Maven
- dependency. That's because the test suite must be available to
- both the client JVM and the container JVM. The maven-dependency-plugin
- is used to copy it to the target/dependencies/lib directory. Any JARs
- in this folder are added to any test artifact that is generated. The
- Maven plugin execution is defined in the TCK runner project as follows:
- </para>
- <programlisting><![CDATA[<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <stripVersion>true</stripVersion>
- <artifactItems>
- <artifactItem>
- <groupId>org.jboss.jsr299.tck</groupId>
- <artifactId>jsr299-tck-impl</artifactId>
- <type>xml</type>
- <classifier>suite</classifier>
- <overWrite>true</overWrite>
- </artifactItem>
- <artifactItem>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>
- webbeans-porting-package
- </artifactId>
- <overWrite>true</overWrite>
- <outputDirectory>
- ${project.build.directory}/dependency/lib
- </outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core-test</artifactId>
- <overWrite>true</overWrite>
- <outputDirectory>
- ${project.build.directory}/dependency/lib
- </outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>javax.el</groupId>
- <artifactId>el-ri</artifactId>
- <overWrite>true</overWrite>
- <outputDirectory>
- ${project.build.directory}/dependency/lib
- </outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
-</plugin>]]></programlisting>
- <para>
- The target folder is declared as the JBoss Test Harness library
- directory so
- that the JARs are added to the test artifact using the
- following
- property assignment:
- </para>
- <programlisting>org.jboss.testharness.libraryDirectory=target/dependency/lib</programlisting>
- <para>
- The TCK is executed using the Maven TestNG plugin. Maven 2 profiles are
- used to control the properties that are set at the time of the
- execution. For instance, the
- <literal>incontainer</literal>
- profile enables integration tests and disables standalone mode,
- changing the default settings.
- </para>
- <para>
- The jboss-tck-runner project also defines the JBoss Test Harness
- extra configuration directory using the following property:
- </para>
- <programlisting>org.jboss.testharness.container.extraConfigurationDir=../jboss-as</programlisting>
- <para>
- The JBoss Test Harness looks in this directory for either a
- build.properties or local.build.properties file that declares
- additional configuration properties. In particular, the JBoss AS
- Containers implementation looks here to find the
- <literal>jboss.home</literal>
- property for starting and stopping JBoss AS.
- </para>
</section>
+
<section>
- <title>Negotiating the execution of an in-container test</title>
+ <title>Configuring your build environment to execute the TCK</title>
<para>
- The basic procedure of an in-container test is as follows. The JBoss
- Test Harness produces a deployable artifact from an
- <literal>@Artifact</literal>
- test class and any declared dependent classes, descriptors or other
- resources. Then it deploys the artifact to the container using the
- <literal>Containers</literal>
- SPI, negotiates with the container to execute the test and return the
- result and, lastly, undeploys the artifact. TestNG collects the results
- of all the tests run in the typical way and produces a report.
+ It is beyond the scope of this guide to describe in how to set up your
+ build environment to run the TCK. The JBoss Test Harness guide
+ describes how to Web Beans uses Maven 2 to execute the CDI TCK. See
+ <xref linkend="testsuite-runner" />
+ . The TestNG provides extensive information on launching TestNG using
+ the Java, ant, Eclipse or IntellJ IDEA.
</para>
- <graphic fileref="images/in-container-execution.png" align="center" />
- <para>
- The question is, how does the JBoss Test Harness negotiate with the
- container to execute the test when TestNG is being invoked locally?
- Technially the mechanism is pluggable, but JBoss Test Harness provides
- a default implementation that uses HTTP communication that you will
- likely use. Here's how the default implementation works.
- </para>
- <para>
- The artifact generator bundles and registers (in the web.xml
- descriptor) an
- <literal>HttpServlet</literal>
- ,
- <literal>org.jboss.testharness.impl.runner.servlet.ServletTestRunner
- </literal>
- , that responds to test execution GET requests. TestNG running on the
- client side delegates to a test launcher (more on that in a moment)
- which originates these text execution requests to transfer control to
- the container JVM. The name of the test method to be executed is
- specified in a request query parameter named
- <literal>methodName</literal>
- .
- </para>
- <para>
- When the test execution request is received, the servlet delegates to
- an instance of
- <literal>org.jboss.testharness.impl.runner.TestRunner</literal>
- , passing it the name of the test method.
- <literal>TestRunner</literal>
- reads the name of the test class from the resource
- META-INF/jboss-test-harness.properties, which is bundled in the
- artifact by the artifact generator. It then combines the class name
- with the method name to produce a TestNG test suite and runs the suite
- (in the context of the container).
- </para>
- <para>
- TestNG returns the results of the run as an
- <literal>ITestResult</literal>
- object.
- <literal>ServletTestRunner</literal>
- translates this object into a
- <literal>org.jboss.testharness.api.TestResult</literal>
- and passes it back to the test launcher on the client side by encoding
- the translated object into the response. The object gets encoded as
- either html or a serialized object, depending on the value of the
- <literal>outputMode</literal>
- request parameter that was passed to the servlet. Once the result has
- been transfered to the client-side TestNG, TestNG wraps up the run of
- the test as though it had been executed in the same JVM.
- </para>
- <para>
- There's
- one piece missing. How does TestNG on the client side know
- to submit a
- request to the
- <literal>ServletTestRunner</literal>
- servlet to get TestNG to execute the test in the container JVM?
- That's the role of the test launcher.
- </para>
- <para>
- The test launcher is the API that allows test suite to launch the test
- in a pluggable fashion.
- <literal>AbstractTest</literal>
- , the super class of
- <literal>AbtractJSR299Test</literal>
- , implements
- <literal>IHookable</literal>
- , a TestNG interface which allows the execution of the test method to
- be intercepted. Using that mechanism, AbstractTest delegates execution
- of the test method (a method annotated with
- <literal>@Test</literal>
- in an
- <literal>@Artifact</literal>
- class) to an implementation of
- <literal>org.jboss.testharness.api.TestLauncher</literal>
- if the tests are being executed in-container. As you might anticipate,
- the implementation is specified using a property with the same name as
- the interface in a META-INF/jboss-test-launcher.properties resource.
- The JBoss Test Harness provides a default implementation,
- <literal>org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
- </literal>
- , that hooks into the HTTP communication infrastructure described
- above. It invokes the
- <literal>ServletTestRunner</literal>
- servlet for each method annotated with
- <literal>@Test</literal>
- in the
- <literal>@Artifact</literal>
- that is not otherwise disabled.
- </para>
- <para>
- If you wish to implement the runner yourself, you must return a
- <literal>TestResult</literal>
- as a result of executing the method in the container. You must also
- ensure that any exception which occurs during deployment is wrapped as
- a
- <literal>org.jboss.testharness.api.DeploymentException</literal>
- , and that any communication problem is rethrown as an
- <literal>IOException</literal>
- . The deployment exception may be transformed by an implementation of
- the
- <literal>org.jboss.testharness.api.DeploymentExceptionTransformer
- </literal>
- interface, which is specified using the
- <literal>org.jboss.testharness.container.deploymentExceptionTransformer
- </literal>
- property. The default implementation passes on the original exception
- unchanged.
- </para>
- <para>
- So in short, JBoss Test Harness takes care of all the interfaces you
- need to execute tests in-container except for the implementation of the
- <literal>Containers</literal>
- SPI. That is, unless you are deploying to one of the containers
- supported by the JBoss Test Harness.
- </para>
+
</section>
</chapter>
Modified: tck/trunk/doc/reference/en-US/master.xml
===================================================================
--- tck/trunk/doc/reference/en-US/master.xml 2009-07-24 16:24:33 UTC (rev 3199)
+++ tck/trunk/doc/reference/en-US/master.xml 2009-07-24 18:18:19 UTC (rev 3200)
@@ -4,7 +4,7 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Book_Info.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Book_Preface.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="part-background.xml"/>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="part-test-harness.xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="part-setup.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="part-execution.xml"/>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="part-test-harness.xml" />
</book>
Modified: tck/trunk/doc/reference/en-US/part-execution.xml
===================================================================
--- tck/trunk/doc/reference/en-US/part-execution.xml 2009-07-24 16:24:33 UTC (rev 3199)
+++ tck/trunk/doc/reference/en-US/part-execution.xml 2009-07-24 18:18:19 UTC (rev 3200)
@@ -4,12 +4,12 @@
<title>Executing and Debugging Tests</title>
<partintro>
<para>
- In this part you learn how to execute the JSR-299 TCK on a given
- JSR-299 implementation. First, you are walked through the steps
- necessary to execute the test suite on the JSR-299 RI (Web Beans). Then
- you discover how to modify the TCK runner to execute the test suite on
- your own implementation. Finally, you learn how to debug tests from the
- test suite in Eclipse.
+ In this part you learn how to execute the CDI TCK on the CDI
+ reference implementation (Web Beans). First, you are walked through the
+ steps necessary to execute the test suite on the Web Beans. Then you
+ discover how to modify the TCK runner to execute the test suite on your
+ own implementation. Finally, you learn how to debug tests from the test
+ suite in Eclipse.
</para>
</partintro>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="executing.xml" />
Modified: tck/trunk/doc/reference/en-US/part-test-harness.xml
===================================================================
--- tck/trunk/doc/reference/en-US/part-test-harness.xml 2009-07-24 16:24:33 UTC (rev 3199)
+++ tck/trunk/doc/reference/en-US/part-test-harness.xml 2009-07-24 18:18:19 UTC (rev 3200)
@@ -4,9 +4,11 @@
<title>JBoss Test Harness</title>
<partintro>
<para>
- In this part you learn about the JBoss Test Harness. You can view the
+ In this part you learn about the JBoss Test Harness through selected
+ chapters from the JBoss Test Harness Reference Guide. You can view the
entire JBoss Test Harness Reference Guide at <ulink url="">TODO</ulink>.
</para>
</partintro>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="harness/introduction.xml" />
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="harness/configuration.xml" />
</part>
15 years, 4 months