Skip to content

Commit

Permalink
Update tck-audit to match latest spec changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Azquelt committed Feb 5, 2024
1 parent b51345e commit 8e948cc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static WebArchive createTestArchive() {

@Test
@SpecAssertion(section = BM_BEAN_EVENT_ASSIGNABILITY, id = "aa")
@SpecAssertion(section = BM_BEAN_EVENT_ASSIGNABILITY, id = "af")
public void testBeanMatching() {
Set<Type> beanTypes = Set.of(MyBean.class, MyBeanInterface.class, Object.class);

Expand Down Expand Up @@ -181,7 +182,7 @@ public void testEventMatching() {
}

@Test
@SpecAssertion(section = BM_BEAN_EVENT_ASSIGNABILITY, id = "ba")
@SpecAssertion(section = BM_BEAN_EVENT_ASSIGNABILITY, id = "bf")
public void testEventMatchingDefaultQualifier() {
assertTrue(getCurrentBeanContainer().isMatchingEvent(MyEvent.class, Set.of(), MyEvent.class, Set.of(Default.Literal.INSTANCE)),
"Event with no qualifiers should match when @Default required");
Expand Down Expand Up @@ -239,7 +240,7 @@ public <X> void testEventMatchingTypeVarException() {
@Test
@SpecAssertion(section = BM_BEAN_EVENT_ASSIGNABILITY, id = "be")
public void testEventMatchingNonQualifiersException() {
assertThrows("An eventQualfiers annotation not a qualifier", IllegalArgumentException.class,
assertThrows("A specifiedQualifiers annotation not a qualifier", IllegalArgumentException.class,
() -> getCurrentBeanContainer().isMatchingEvent(MyEvent.class, Set.of(Qualifier1.Literal.INSTANCE, NonQualifier.Literal.INSTANCE), MyEvent.class, Set.of()));

assertThrows("An observedEventQualfiers annotation not a qualifier", IllegalArgumentException.class,
Expand Down
32 changes: 20 additions & 12 deletions impl/src/main/resources/tck-audit-cdi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7027,43 +7027,51 @@
</assertion>
<assertion id="ab">
<text>
Callers of |BeanManager.isMatchingBean| do not need to include implied qualifiers |Default|, |Any|. These will be automatically added where
applicable.
The set of |beanQualifiers| is considered to always include |@Any| and also include |@Default| when it contains no other qualifier but
|@Any| and |@Named|.
</text>
</assertion>
<assertion id="ac">
<text>|BeanManager.isMatchingBean| throws |IllegalArgumentException| if any of the arguments are null.</text>
</assertion>
<assertion id="ad">
<text>|BeanManager.isMatchingBean| throws |IllegalArgumentException| if any of the |beanQualifiers| or |requiredQualifiers| is not a qualifier annotation.</text>
<text>
|BeanManager.isMatchingBean| throws |IllegalArgumentException| if any of the |beanQualifiers| or |requiredQualifiers| is not a qualifier
annotation.
</text>
</assertion>
<assertion id="ae">
<text>Types in |beanTypes| that are not legal bean types are ignored.</text>
</assertion>
<assertion id="af">
<text>The set of |beanTypes| is considered to always include |java.lang.Object|.</text>
</assertion>
</group>
<group>
<text>The method |BeanContainer.isMatchingEvent()| provides access to assignability rules defined in Observer Resolution.</text>
<assertion id="ba">
<text>
The method |BeanManager.isMatchingEvent| returns true if an event object with given type and qualifiers would match an observer method with
given observed event type and observed event qualifiers, false otherwise.
|BeanManager.isMatchingEvent| returns |true| if an event with given specified type and specified qualifiers would match an observer method
with given observed event type and observed event qualifiers, |false| otherwise.
</text>
</assertion>
<assertion id="bb">
<text>
Callers of |BeanManager.isMatchingEvent| do not need to include the implied qualifier |Any|. It will be automatically added where
applicable.
</text>
<text>The set of event qualifiers is considered to always include |@Any|</text>
</assertion>
<assertion id="bc">
<text>|BeanManager.isMatchingEvent| throws |IllegalArgumentException| if any of the arguments are null.</text>
</assertion>
<assertion id="bd">
<text>|BeanManager.isMatchingEvent| throws |IllegalArgumentException| if |eventObjectType| contains an unresolved type variable.</text>
<text>|BeanManager.isMatchingEvent| throws |IllegalArgumentException| if |specifiedType| contains a type variable.</text>
</assertion>
<assertion id="be">
<text>|BeanManager.isMatchingEvent| throws |IllegalArgumentException| if any of |eventQualifiers| or |observedEventQualifiers| is not a
qualifier annotation.</text>
<text>
|BeanManager.isMatchingEvent| throws |IllegalArgumentException| if any of |specifiedQualifiers| or |observedEventQualifiers| is not a
qualifier annotation.
</text>
</assertion>
<assertion id="bf">
<text>An empty set of |specifiedQualifiers| is considered to match the set of |observedEventQualifiers| which contains |@Default|.</text>
</assertion>
</group>
</section>
Expand Down

0 comments on commit 8e948cc

Please sign in to comment.