-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add coverage for case where alternative bean contains non-alternative…
… producer declaring its own priority
- Loading branch information
Showing
7 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...i/tck/tests/alternative/selection/priority/AltBeanProducingPrioritizedNonAlternative.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.jboss.cdi.tck.tests.alternative.selection.priority; | ||
|
||
import jakarta.annotation.Priority; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.enterprise.inject.Alternative; | ||
import jakarta.enterprise.inject.Produces; | ||
|
||
@ApplicationScoped | ||
@Alternative | ||
@Priority(1) | ||
public class AltBeanProducingPrioritizedNonAlternative { | ||
|
||
@Priority(20) // should override class-level priority value and hence end up having the highest priority | ||
@Produces | ||
@ProducedByMethod | ||
Delta producer1() { | ||
return new Delta(ProducerExplicitPriorityTest.ALT2); | ||
} | ||
|
||
@Priority(20) // should override class-level priority value and hence end up having the highest priority | ||
@Produces | ||
@ProducedByField | ||
Delta producer2 = new Delta(ProducerExplicitPriorityTest.ALT2); | ||
} |
14 changes: 14 additions & 0 deletions
14
impl/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/priority/Delta.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.jboss.cdi.tck.tests.alternative.selection.priority; | ||
|
||
public class Delta { | ||
|
||
private String s; | ||
|
||
public Delta(String s) { | ||
this.s = s; | ||
} | ||
|
||
public String ping() { | ||
return s; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters