forked from jakartaee/cdi-tck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtck-audit-cdi.xml
11935 lines (9943 loc) · 552 KB
/
tck-audit-cdi.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<specification xmlns="http://jboss.com/products/weld/tck/audit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/weld/tck/audit /Users/pmuir/workspace/jboss-test-audit/api/src/main/resources/tck-audit.xsd"
name="Jakarta Contexts and Dependency Injection 3.0" id="cdi" version="3.0" generateSectionIds="true">
<section id="architecture" title="Architecture" level="1"/>
<section id="concepts" title="Concepts" level="1">
<assertion id="a">
<text>A bean comprises of a (nonempty) set of bean types.</text>
</assertion>
<assertion id="b">
<text>A bean comprises of a (nonempty) set of qualifiers.</text>
</assertion>
<assertion id="c">
<text>A bean comprises of a scope.</text>
</assertion>
<assertion id="e">
<text>A bean comprises of an optional bean name.</text>
</assertion>
<assertion id="f">
<text>A bean comprises of a set of interceptor bindings.</text>
<note>This may only be tested indirectly</note>
</assertion>
<assertion id="g">
<text>A bean comprises of a bean implementation.</text>
</assertion>
<assertion id="h" testable="false">
<text>A bean may or may not be an alternative.</text>
</assertion>
</section>
<section id="capabilities" title="Functionality provided by the container to the bean" level="2">
</section>
<section id="bean_types" title="Bean types" level="2">
<assertion id="a">
<text>A bean may have multiple bean types.</text>
</assertion>
<assertion id="l">
<text>All beans have the bean type |java.lang.Object|.</text>
</assertion>
</section>
<section id="legal_bean_types" title="Legal bean types" level="3">
<assertion id="a">
<text>A bean type may be an interface.</text>
</assertion>
<assertion id="b">
<text>A bean type may be a concrete class.</text>
</assertion>
<assertion id="c">
<text>A bean type may be an abstract class.</text>
</assertion>
<assertion id="d">
<text>A bean type may be declared final.</text>
</assertion>
<assertion id="e">
<text>A bean type may have final methods.</text>
</assertion>
<assertion id="f">
<text>A bean type may be a parameterized type with actual type parameters.</text>
</assertion>
<assertion id="g">
<text>A bean type may be a parameterized type with type variables.</text>
</assertion>
<assertion id="i">
<text>A bean type may be an array type. Two array types are considered identical only if the element type is identical.</text>
</assertion>
<assertion id="j">
<text>A bean type may be a primitive type. Primitive types are considered to be identical to their corresponding wrapper types in |java.lang|.
</text>
</assertion>
<assertion id="k">
<text>A bean type may be a raw type.</text>
</assertion>
<assertion id="la">
<text>A type variable is not a legal bean type.</text>
</assertion>
<assertion id="lb">
<text>A parameterized type that contains a wildcard type parameter is not a legal bean type.</text>
</assertion>
<group>
<text>An array type whose component type is not a legal bean type.</text>
<assertion id="lc">
<text>An array type whose component type is a type variable is not a legal bean type.</text>
</assertion>
<assertion id="ld">
<text>An array type whose component type is a parameterized type that contains a wildcard type parameter is not a legal bean type.</text>
</assertion>
</group>
</section>
<section id="restricting_bean_types" title="Restricting the bean types of a bean" level="3">
<group>
<text>The bean types of a bean may be restricted by annotating the bean class or producer method or field with the annotation
|@jakarta.enterprise.inject.Typed|. When a |@Typed| annotation is explicitly specified, only the types whose classes are explicitly listed using
the |value| member, together with |java.lang.Object| are bean types of the bean.
</text>
<assertion id="a">
<text>Check managed bean</text>
</assertion>
<assertion id="c">
<text>Check producer method</text>
</assertion>
<assertion id="d">
<text>Check producer field</text>
</assertion>
<assertion id="e">
<text>Check generic managed bean</text>
</assertion>
<assertion id="g">
<text>Check generic producer method</text>
</assertion>
<assertion id="h">
<text>Check generic producer field</text>
</assertion>
</group>
<group>
<text>If a bean class or producer method or field specifies a |@Typed| annotation, and the |value| member specifies a class which does not
correspond to a type in the unrestricted set of bean types of a bean, the container automatically detects the problem and treats it as a
definition error.
</text>
<assertion id="j">
<text>Check managed bean</text>
</assertion>
<assertion id="l">
<text>Check producer method</text>
</assertion>
<assertion id="m">
<text>Check producer field</text>
</assertion>
</group>
</section>
<section id="typecasting_between_bean_types" title="Typecasting between bean types" level="3">
<assertion id="a">
<text>A client of a bean may typecast its contextual reference to a bean to any bean type of the bean which is a Java interface. However, the client
may not in general typecast its contextual reference to an arbitrary concrete bean type of the bean.
</text>
</assertion>
</section>
<section id="qualifiers" title="Qualifiers" level="2">
</section>
<section id="builtin_qualifiers" title="Built-in qualifier types" level="3">
<assertion id="aa">
<text>Every bean has the built-in qualifier |@Any|, even if it does not explicitly declare this qualifier, ~except for the special |@New| qualified
beans defined in Section 3.14, "@New qualified beans"~.
</text>
<note>@New qualified beans cannot be checked since @New beans aren't required to be available via programmatic lookup</note>
</assertion>
<assertion id="ab">
<text>If a bean does not explicitly declare a qualifier other than |@Named| or |@Any|, the bean has exactly one additional qualifier, of type
|@Default|. This
is called the default qualifier.
</text>
</assertion>
<assertion id="b">
<text>The default qualifier is also assumed for any injection point that does not explicitly declare a qualifier.</text>
</assertion>
</section>
<section id="defining_qualifier_types" title="Defining new qualifier types" level="3">
<assertion id="aa" testable="false">
<text>A qualifier type is a Java annotation defined as |@Target({METHOD, FIELD, PARAMETER, TYPE})|~ and |@Retention(RUNTIME)|~.</text>
<note>Non-runtime retention annotations are discarded by the compiler</note>
</assertion>
<assertion id="ba">
<text>A qualifier type may be declared by specifying the |@jakarta.inject.Qualifier| meta-annotation.</text>
</assertion>
<assertion id="d" testable="false">
<text>A qualifier type may define annotation members.</text>
<note>This is true by default in the JLS</note>
</assertion>
</section>
<section id="declaring_bean_qualifiers" title="Declaring the qualifiers of a bean" level="3">
<group>
<text>The qualifiers of a bean are declared by annotating the bean class or producer method or field with the qualifier types.</text>
<assertion id="a">
<text>Test by annotating a bean class.</text>
</assertion>
<assertion id="b">
<text>Test by annotating a producer method.</text>
</assertion>
<assertion id="c">
<text>Test by annotating a producer field.</text>
</assertion>
</group>
<assertion id="d">
<text>Any bean may declare multiple qualifier types.</text>
</assertion>
</section>
<section id="injected_field_qualifiers" title="Specifying qualifiers of an injected field" level="3">
<assertion id="a">
<text>Qualifier types may be applied to injected fields (see Section 3.8, "Injected fields") to determine the bean that is injected, according to
the rules of typesafe resolution defined in Section 5.3, "Typesafe resolution".
</text>
</assertion>
<assertion id="b">
<text>A bean may only be injected to an injection point if it has all the qualifiers of the injection point.</text>
</assertion>
</section>
<section id="method_constructor_parameter_qualifiers" title="Specifying qualifiers of a method or constructor parameter" level="3">
<group>
<text>Qualifier types may be applied to parameters of producer methods, initializer methods, disposer methods, observer methods or bean constructors
(see Chapter 3, Bean implementation) to determine the bean instance that is passed when the method is called by the container.
</text>
<assertion id="a">
<text>Test producer method.</text>
</assertion>
<assertion id="b">
<text>Test initializer method.</text>
</assertion>
<assertion id="c">
<text>Test disposer method.</text>
</assertion>
<assertion id="ca">
<text>Test observer method.</text>
</assertion>
<assertion id="d">
<text>Test bean constructor.</text>
</assertion>
</group>
</section>
<section id="repeating_qualifiers" title="Repeating qualifiers" level="3">
<assertion id="a">
<text>A repeated qualifier behaves just as any other qualifier does</text>
</assertion>
</section>
<section id="scopes" title="Scopes" level="2">
<assertion id="a">
<text>All beans have a scope.</text>
</assertion>
<assertion id="b" testable="false">
<text>A scope type is represented by an annotation type.</text>
<note>This is a statement of intent</note>
</assertion>
<assertion id="c">
<text>The set of scope types is extensible.</text>
</assertion>
</section>
<section id="builtin_scopes" title="Built-in scope types" level="3">
<group>
<text>There are five standard scope types defined by this specification, all defined in the package |jakarta.enterprise.context|.</text>
<assertion id="a">
<text>The container must provide an implementation of the @RequestScoped, @ApplicationScoped and @SessionScoped annotations defined in Section
6.7, “Context management for built-in scopes”.
</text>
</assertion>
<assertion id="ba">
<text>The |@ConversationScoped| annotation represents the conversation scope defined in Section 6.7.4, "Conversation context lifecycle".</text>
</assertion>
<assertion id="ca">
<text>The |@Dependent| pseudo-scope is for dependent objects, as defined in Section 6.4, "Dependent pseudo-scope"</text>
</assertion>
<assertion id="e" testable="false">
<text>If an interceptor or decorator has any scope other than |@Dependent|, non-portable behavior results.</text>
</assertion>
</group>
</section>
<section id="defining_new_scope_type" title="Defining new scope types" level="3">
<assertion id="aa">
<text>A scope type is a Java annotation defined as |@Target({TYPE, METHOD, FIELD})|~ and |@Retention(RUNTIME)|~.</text>
</assertion>
<assertion id="ab" testable="false">
<text>A scope type is a Java annotation defined as ~|@Target({TYPE, METHOD, FIELD})| and ~|@Retention(RUNTIME)|.</text>
<note>Non-runtime retention annotations are discarded by the compiler</note>
</assertion>
<assertion id="ac" testable="false">
<text>A scope type must not have any attributes. If a scope type has attributes non-portable behavior results.</text>
</assertion>
<assertion id="ba">
<text>All scope types must specify the |@jakarta.inject.Scope| or |@jakarta.enterprise.context.NormalScope| meta-annotation.</text>
</assertion>
</section>
<section id="declaring_bean_scope" title="Declaring the bean scope" level="3">
<assertion id="a">
<text>The scope of a bean is defined by annotating the bean class or producer method or field with a scope type.</text>
</assertion>
<group>
<text>A bean class or producer method or field may specify at most one scope type annotation. If a bean class or producer method or field specifies
multiple scope type annotations, the container automatically detects the problem and treats it as a definition error.
</text>
<assertion id="ba">
<text>Test with a bean class.</text>
</assertion>
<assertion id="bb">
<text>Test with a producer method.</text>
</assertion>
<assertion id="bc">
<text>Test with a producer field.</text>
</assertion>
</group>
<assertion id="c">
<text>A scope type may be specified using a stereotype annotation, as defined in Section 2.7.2, "Declaring the stereotypes for a bean"</text>
</assertion>
</section>
<section id="default_scope" title="Default scope" level="3">
<assertion id="aa">
<text>When no scope is explicitly declared by annotating the bean class or producer method or field the scope of a bean is defaulted.</text>
</assertion>
<assertion id="b">
<text>If the bean does not declare any stereotype with a declared default scope, the default scope for the bean is |@Dependent|.</text>
</assertion>
<assertion id="c">
<text>If all stereotypes declared by the bean that have some declared default scope have the same default scope, then that scope is the default
scope for the bean.
</text>
</assertion>
<assertion id="da">
<text>If there are two different stereotypes present on the bean, directly, indirectly, or transitively, that declare different default scopes,
then there is no default scope and the bean must explicitly declare a scope. If it does not explicitly declare a scope, the container automatically
detects the problem and treats it as a definition error.
</text>
</assertion>
<assertion id="e">
<text>If a bean explicitly declares a scope, any default scopes declared by stereotypes are ignored.</text>
</assertion>
</section>
<section id="default_bean_discovery" title="Default bean discovery mode" level="2">
<group>
<text>If the bean discovery mode is annotated then:</text>
<assertion id="a">
<text>bean classes that don’t have bean defining annotation (as defined in Section 2.5.1, “Bean defining annotations”) are not discovered</text>
</assertion>
<assertion id="b">
<text>producer methods (as defined in Section 3.3, “Producer methods”) whose bean class does not have a bean defining annotation are not
discovered
</text>
</assertion>
<assertion id="c">
<text>producer fields (as defined in Section 3.4, “Producer fields”) whose bean class does not have a bean defining annotation are not
discovered
</text>
</assertion>
<assertion id="d">
<text>disposer methods (as defined in Section 3.5, “Disposer methods”) whose bean class does not have a bean defining annotation are not
discovered
</text>
</assertion>
<assertion id="e">
<text>observer methods (as defined in Section 10.4.2, “Declaring an observer method”) whose bean class does not have a bean defining annotation
are not discovered
</text>
</assertion>
</group>
</section>
<section id="bean_defining_annotations" title="Bean defining annotations" level="3">
<assertion id="a" testable="false">
<text>A bean class may have a bean defining annotation, allowing it to be placed anywhere in an application, as defined in Section 12.1. A bean
class with a bean defining annotation is said to be an implicit bean.
</text>
<note>This is a statement of intent</note>
</assertion>
<group>
<text>The set of bean defining annotations contains:</text>
<assertion id="ba">
<text>@ApplicationScoped, @SessionScoped, @ConversationScoped and @RequestScoped annotations</text>
</assertion>
<assertion id="bb">
<text>all other normal scope types</text>
</assertion>
<assertion id="bc">
<text>@Interceptor annotation</text>
</assertion>
<assertion id="bd">
<text>@Decorator annotation</text>
</assertion>
<assertion id="be">
<text>all stereotype annotations (i.e. annotations annotated with @Stereotype)</text>
</assertion>
<assertion id="bf">
<text>the @Dependent scope annotation</text>
</assertion>
</group>
<assertion id="ca">
<text>Note that to ensure compatibility with other JSR-330 implementations, all pseudo-scope annotations except @Dependent are not bean defining
annotations.
</text>
</assertion>
<assertion id="cb">
<text>However, a stereotype annotation including a pseudo-scope annotation is a bean defining annotation.</text>
</assertion>
</section>
<section id="names" title="Bean names" level="2">
<assertion id="a">
<text>A valid bean name is a period-separated list of valid EL identifiers</text>
</assertion>
</section>
<section id="declaring_bean_name" title="Declaring the bean name" level="3">
<group>
<text>To specify the name of a bean, the qualifier |@jakarta.inject.Named| is applied to the bean class or producer method or field.</text>
<assertion id="a">
<text>Test with a bean class.</text>
</assertion>
<assertion id="b">
<text>Test with a producer method.</text>
</assertion>
<assertion id="c">
<text>Test with a producer field.</text>
</assertion>
</group>
</section>
<section id="default_name" title="Default bean names" level="3">
<group>
<text>A default name must be assigned by the container when a bean class or producer method or field of a bean declares a |@Named| annotation and no
bean name is explicitly specified by the |value| member.
</text>
<assertion id="a">
<text>Test with a bean class.</text>
</assertion>
<assertion id="b">
<text>Test with a producer method.</text>
</assertion>
<assertion id="c">
<text>Test with a producer field.</text>
</assertion>
</group>
<assertion id="e">
<text>A default name must be assigned by the container when a bean declares a stereotype that declares an empty |@Named| annotation, and the bean
does not explicitly specify an bean name.
</text>
</assertion>
<group>
<text>If a bean class or producer method or field of a bean declares a |@Named| annotation and no bean name is explicitly specified the value of the
|value| member is defaulted.
</text>
<assertion id="fa">
<text>Test with a bean class.</text>
</assertion>
<assertion id="fb">
<text>Test with a producer method.</text>
</assertion>
<assertion id="fc">
<text>Test with a producer field.</text>
</assertion>
</group>
</section>
<section id="beans_with_no_name" title="Beans with no name" level="3">
<assertion id="a">
<text>If |@Named| is not declared by the bean, nor by its stereotypes, a bean has no name.</text>
</assertion>
<assertion id="b" testable="false">
<text>If an interceptor or decorator has a name, non-portable behavior results.</text>
</assertion>
</section>
<section id="alternatives" title="Alternatives" level="2">
<assertion id="a" testable="false">
<text>An alternative is a bean that must be explicitly selected if it should be available for lookup, injection or EL resolution.</text>
<note>Tested in section 5.1.1 Declaring selected alternatives.</note>
</assertion>
</section>
<section id="declaring_alternative" title="Declaring an alternative" level="3">
<group>
<text>An alternative may be declared by annotating the bean class or producer method or field with the |@Alternative| annotation.</text>
<assertion id="aa">
<text>Test with a bean class.</text>
</assertion>
<assertion id="ab">
<text>Test with a producer method.</text>
</assertion>
<assertion id="ac">
<text>Test with a producer field.</text>
</assertion>
</group>
<group>
<text>An alternative may be declared by annotating a bean, producer method or producer field with a stereotype that declares an |@Alternative|
annotation.
</text>
<assertion id="ba">
<text>Test with a bean.</text>
</assertion>
<assertion id="bb">
<text>Test with a producer method.</text>
</assertion>
<assertion id="bc">
<text>Test with a producer field.</text>
</assertion>
</group>
<assertion id="c" testable="false">
<text>If an interceptor or decorator is an alternative, non-portable behavior results.</text>
<note>Non-portable behavior.</note>
</assertion>
</section>
<section id="stereotypes" title="Stereotypes" level="2">
<assertion id="a">
<text>A stereotype may specify that all beans with the stereotype have defaulted bean names.</text>
</assertion>
<assertion id="aa">
<text>A stereotype may specify that all beans with the stereotype are alternatives.</text>
</assertion>
<group>
<text>A bean may declare zero, one or multiple stereotypes.</text>
<assertion id="b" testable="false">
<text>A bean may declare zero stereotypes.</text>
<note>Not testable through API</note>
</assertion>
<assertion id="c">
<text>Test with one stereotype.</text>
</assertion>
<assertion id="d">
<text>Test with multiple stereotypes.</text>
</assertion>
</group>
</section>
<section id="defining_new_stereotype" title="Defining new stereotypes" level="3">
<group>
<text>A beans stereotype is a Java annotation defined as |@Target({TYPE, METHOD, FIELD})|, |@Target(TYPE)|, |@Target(METHOD)|, |@Target(FIELD)| or
|@Target({METHOD, FIELD})| and |@Retention(RUNTIME)|.
</text>
<assertion id="aa" testable="false">
<text>Test |@Target({TYPE, METHOD, FIELD})|.</text>
</assertion>
<assertion id="ab" testable="false">
<text>Test |@Target(TYPE)|.</text>
</assertion>
<assertion id="ac" testable="false">
<text>Test |@Target(FIELD)|.</text>
</assertion>
<assertion id="ad" testable="false">
<text>Test |@Target({METHOD, FIELD})|.</text>
</assertion>
<assertion id="ae" testable="false">
<text>|@Retention(RUNTIME)| - untestable.</text>
<note>Non-runtime retention annotations are discarded by the compiler</note>
</assertion>
</group>
<assertion id="b">
<text>A stereotype may be declared by specifying the |@jakarta.enterprise.inject.Stereotype| meta-annotation.</text>
</assertion>
</section>
<section id="stereotype_default_scope" title="Declaring the default scope for a stereotype" level="4">
<group>
<text>The default scope of a stereotype is defined by annotating the stereotype with a scope type. A stereotype may declare at most one scope. If a
stereotype declares more than one scope, the container automatically detects the problem and treats it as a definition error.
</text>
<assertion id="aa">
<text>Test with one scope.</text>
</assertion>
<assertion id="ab">
<text>Test that a stereotype with multiple scopes throws an exception.</text>
</assertion>
</group>
</section>
<section id="specify_stereotype_interceptor_bindings" title="Specifying interceptor bindings for a stereotype" level="4">
<assertion id="aa">
<text>The interceptor bindings of a stereotype are defined by annotating the stereotype with the interceptor binding types.</text>
</assertion>
<assertion id="a">
<text>A stereotype may declare zero interceptor bindings.</text>
</assertion>
<assertion id="b">
<text>A stereotype may declare one interceptor bindings.</text>
</assertion>
<assertion id="c">
<text>A stereotype may declare multiple interceptor bindings.</text>
</assertion>
</section>
<section id="named_stereotype" title="Declaring a @Named stereotype" level="4">
<assertion id="aa">
<text>A stereotype may declare an empty |@Named| annotation, which specifies that every bean with the stereotype has a defaulted name when a name is
not explicitly specified by the bean.
</text>
</assertion>
<assertion id="ab">
<text>A |@Named| qualifier declared by a stereotype is not added to the qualifiers of a bean with the stereotype.</text>
</assertion>
<assertion id="ac">
<text>If a stereotype declares a non-empty |@Named| annotation, the container automatically detects the problem and treats it as a definition
error.
</text>
</assertion>
<assertion id="b" testable="false">
<text>A stereotype should not declare any qualifier annotation other than |@Named|. If a stereotype declares any other qualifier annotation,
non-portable behavior results.
</text>
<note>The behavior here is undefined.</note>
</assertion>
<assertion id="c" testable="false">
<text>A stereotype should not be annotated |@Typed|. If a stereotype is annotated |@Typed|, non-portable behavior results.</text>
</assertion>
</section>
<section id="alternative_stereotype" title="Declaring an @Alternative stereotype" level="4">
<assertion id="a">
<text>A stereotype may declare an |@Alternative| annotation, which specifies that every bean with the stereotype is an alternative.</text>
</assertion>
</section>
<section id="declaring_stereotype_with_priority" title="Declaring stereotype with @Priority" level="4">
<assertion id="a">
<text>A stereotype may declare a @Priority annotation which functions as a means of enabling and ordering affected beans.</text>
</assertion>
<assertion id="b">
<text>If there are two different stereotypes present on a bean, directly, indirectly, or transitively, that declare
different priority values, then the bean must explicitly declare a @Priority annotation. If the bean does not
explicitly declare priority, the container automatically detects the problem and treats it as a definition error.
</text>
</assertion>
</section>
<section id="stereotypes_with_additional_stereotypes" title="Stereotypes with additional stereotypes" level="4">
<assertion id="a">
<text>A stereotype may declare other stereotypes.</text>
</assertion>
<assertion id="b">
<text>Stereotype declarations are transitive - a stereotype declared by a second stereotype is inherited by all beans and other stereotypes that
declare the second stereotype.
</text>
</assertion>
<assertion id="c" testable="false">
<text>Stereotypes declared |@Target(TYPE)| may not be applied to stereotypes declared |@Target({TYPE, METHOD, FIELD})|, |@Target(METHOD)|,
|@Target(FIELD)|, |@Target({METHOD, FIELD})|.
</text>
<note>No definition of what happens if you do this</note>
</assertion>
</section>
<section id="declaring_stereotypes" title="Declaring the stereotypes for a bean" level="3">
<group>
<text>Stereotype annotations may be applied to a bean class or producer method or field.</text>
<assertion id="a">
<text>Test with a bean class.</text>
</assertion>
<assertion id="b">
<text>Test with a producer method.</text>
</assertion>
<assertion id="c">
<text>Test with a producer field.</text>
</assertion>
</group>
<assertion id="db">
<text>The default scope declared by the stereotype may be overridden by the bean.</text>
</assertion>
<assertion id="e">
<text>Multiple stereotypes may be applied to the same bean.</text>
</assertion>
</section>
<section id="builtin_stereotypes" title="Built-in stereotypes" level="3">
<assertion id="aa" testable="false">
<text>The built-in stereotype |@jakarta.enterprise.inject.Model| is intended for use with beans that define the model layer of an MVC web application
architecture such as JSF.
</text>
<note>Tested by API signature test</note>
</assertion>
</section>
<section id="exceptions" title="Problems detected automatically by the container" level="2">
<assertion id="a" testable="false">
<text>When the application violates a rule defined by this specification, the container automatically detects the problem. There are three kinds of
problem - definition errors occur when a single bean definition violates the rules of this specification, deployment problems occur when there
are problems resolving dependencies, or inconsistent specialization, in a particular deployment, and exceptions occur at runtime.
</text>
<note>Generalization</note>
</assertion>
<assertion id="b">
<text>Definition errors are developer errors. They may be detected by tooling at development time, and are also detected by the container at
initialization time. If a definition error exists in a deployment, initialization will be aborted by the container.
</text>
</assertion>
<assertion id="ba">
<text>If a definition error exists, the container must throw a subclass of |jakarta.enterprise.inject.spi.DefinitionException|.</text>
</assertion>
<assertion id="c">
<text>Deployment problems are detected by the container at initialization time. If a deployment problem exists in a deployment, initialization will
be aborted by the container.
</text>
</assertion>
<assertion id="ca">
<text>If a deployment problem occurs, the container must throw a subclass of |jakarta.enterprise.inject.spi.DeploymentException|.</text>
</assertion>
<assertion id="d" testable="false">
<text>The container is permitted to define a non-portable mode, for use at development time, in which some definition errors and deployment problems
do not cause application initialization to abort.
</text>
</assertion>
<assertion id="e" testable="false">
<text>Exceptions represent problems that may not be detected until they actually occur at runtime. All exceptions defined by this specification are
unchecked exceptions. All exceptions defined by this specification may be safely caught and handled by the application.
</text>
</assertion>
</section>
<section id="priorities" title="Priority ordering" level="2">
</section>
<section id="implementation" title="Programming model" level="1">
</section>
<section id="managed_beans" title="Managed beans" level="2">
<assertion id="a">
<text>If the bean class of a managed bean is annotated with both the |@Interceptor| and |@Decorator| stereotypes, the container automatically
detects the problem and treats it as a definition error.
</text>
</assertion>
<group>
<text>If a managed bean has a non-static public field, its scope must be a pseudo-scope.
If a managed bean with a non-static public field declares a normal scope, the container automatically detects the problem and treats it as a definition error.
</text>
<assertion id="fa">
<text>Check a pseudo-scoped bean with a public field.</text>
</assertion>
<assertion id="fb">
<text>Check a managed bean with a static public field which declares a normal scope.</text>
</assertion>
<assertion id="fc">
<text>Check a managed bean with a non-static public field which declares a normal scope.</text>
</assertion>
</group>
<assertion id="g">
<text>If the managed bean class is a generic type, it must have scope |@Dependent|. If a managed bean with a parameterized bean class declares any
scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error.
</text>
</assertion>
</section>
<section id="what_classes_are_beans" title="Which Java classes are managed beans?" level="3">
<assertion id="b">
<text>A Java class is not a managed bean if it is an inner class.</text>
</assertion>
<assertion id="ba">
<text>A Java class that is a static nested class can be a managed bean.</text>
<note>Implied as the inverse of assertion 3.1.1.b</note>
</assertion>
<assertion id="ca">
<text>A Java class is not a managed bean if it is an abstract class, unless it is annotated |@Decorator|.</text>
</assertion>
<assertion id="cb">
<text>A Java class is not a managed bean if it is an interface, unless it is annotated |@Decorator|.</text>
</assertion>
<assertion id="g">
<text>A Java class is not a managed bean if it implements |jakarta.enterprise.inject.spi.Extension|.</text>
</assertion>
<assertion id="h">
<text>A Java class is not a managed bean if it is annotated |@Vetoed| or placed in a package annotated |@Vetoed|.</text>
</assertion>
<assertion id="p">
<text>A Java class is only a managed bean if it has an appropriate constructor - a constructor with no parameters.</text>
</assertion>
<assertion id="q">
<text>A Java class is only a managed bean if it has an appropriate constructor - a constructor annotated |@Inject|.</text>
</assertion>
<assertion id="r" testable="false">
<text>If packages annotated |@Vetoed| are split across classpath entries, non-portable behavior results. An application can prevent packages being
split across jars by sealing the package as defined by the Extension Mechanism Architecture.
</text>
<note>Non-portable behavior.</note>
</assertion>
</section>
<section id="managed_bean_types" title="Bean types of a managed bean" level="3">
<assertion id="a">
<text>The unrestricted set of bean types for a managed bean contains the bean class, every superclass and all interfaces it implements directly or
indirectly.
</text>
</assertion>
<assertion id="b">
<text>
The resulting set of bean types for a managed bean consists only of legal bean types, all other types are
removed from the set of bean types.
</text>
</assertion>
</section>
<section id="declaring_managed_bean" title="Declaring a managed bean" level="3">
<assertion id="a">
<text>A managed bean with a constructor that takes no parameters does not require any special annotations</text>
</assertion>
<assertion id="ab" testable="false">
<text>If the managed bean does not have a constructor that takes no parameters, it must have a constructor annotated |@Inject|. No additional
special annotations are required.
</text>
</assertion>
<group>
<text>A bean class may also specify a scope, name, stereotypes and/or qualifiers.</text>
<assertion id="ba">
<text>Test a bean with a scope.</text>
</assertion>
<assertion id="bb">
<text>Test a bean with a name.</text>
</assertion>
<assertion id="bd">
<text>Test a bean with a stereotype.</text>
</assertion>
<assertion id="be">
<text>Test a bean with a qualifier.</text>
</assertion>
</group>
<assertion id="c">
<text>A managed bean may extend another managed bean.</text>
</assertion>
</section>
<section id="specialize_managed_bean" title="Specializing a managed bean" level="3">
<group>
<text>If a bean class of a managed bean X is annotated |@Specializes|, then the bean class of X must directly extend the bean class of another
managed bean Y. Then X directly specializes Y, as defined in Section 4.3, "Specialization".
</text>
<assertion id="aa">
<text>Test that a specializing bean has all its own qualifiers and the qualifiers of the specialized bean.</text>
</assertion>
<assertion id="ab">
<text>Test that a specializing bean has the name of the specialized bean.</text>
</assertion>
<assertion id="ac">
<text>Test a specialized bean extending a managed bean.</text>
</assertion>
</group>
<group>
<text>If the bean class of X does not directly extend the bean class of another managed bean, the container automatically detects the problem and
treats it as a definition error.
</text>
<assertion id="da">
<text>Test a specializing bean extending a non simple bean.</text>
</assertion>
<assertion id="db">
<text>Test a specializing bean extending nothing.</text>
</assertion>