-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cdi2] Correctly cast the UnmanagedInstance values (#2244)
Co-authored-by: Daniel Beland <daniel.beland@ca.thalesgroup.com> Co-authored-by: M.P. Korstanje <rien.korstanje@gmail.com>
- Loading branch information
1 parent
873cd45
commit 95dddd5
Showing
21 changed files
with
101 additions
and
263 deletions.
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
cdi2/src/test/java/io/cucumber/cdi2/ApplicationScopedBean.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,8 @@ | ||
package io.cucumber.cdi2; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
|
||
@ApplicationScoped | ||
public class ApplicationScopedBean { | ||
|
||
} |
19 changes: 0 additions & 19 deletions
19
cdi2/src/test/java/io/cucumber/cdi2/BellyStepDefinitions.java
This file was deleted.
Oops, something went wrong.
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
21 changes: 0 additions & 21 deletions
21
cdi2/src/test/java/io/cucumber/cdi2/CdiBellyStepDefinitions.java
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
package io.cucumber.cdi2; | ||
|
||
public class UnmanagedBean { | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
package io.cucumber.cdi2; | ||
|
||
import javax.enterprise.inject.Vetoed; | ||
|
||
@Vetoed | ||
public class VetoedBean { | ||
} |
32 changes: 32 additions & 0 deletions
32
cdi2/src/test/java/io/cucumber/cdi2/example/BellyStepDefinitions.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,32 @@ | ||
package io.cucumber.cdi2.example; | ||
|
||
import io.cucumber.cdi2.Belly; | ||
import io.cucumber.java.en.Given; | ||
import io.cucumber.java.en.Then; | ||
|
||
import javax.inject.Inject; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class BellyStepDefinitions { | ||
|
||
@Inject | ||
private Belly belly; | ||
|
||
@Given("I have {int} cukes in my belly") | ||
public void haveCukes(int n) { | ||
belly.setCukes(n); | ||
} | ||
|
||
@Given("I eat {int} more cukes") | ||
public void addCukes(int n) { | ||
belly.setCukes(belly.getCukes() + n); | ||
} | ||
|
||
@Then("there are {int} cukes in my belly") | ||
public void checkCukes(int n) { | ||
assertEquals(n, belly.getCukes()); | ||
} | ||
|
||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...ava/io/cucumber/cdi2/RunCucumberTest.java → ...ucumber/cdi2/example/RunCucumberTest.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
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://java.sun.com/xml/ns/javaee" | ||
xsi:schemaLocation=" | ||
http://java.sun.com/xml/ns/javaee | ||
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> | ||
|
||
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd" | ||
bean-discovery-mode="all" version="2.0"> | ||
<!-- Exclude the class to force it to be loaded as an unmanaged dependency --> | ||
<scan> | ||
<exclude | ||
name="io.cucumber.cdi2.UnmanagedBean" /> | ||
</scan> | ||
</beans> |
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
22 changes: 0 additions & 22 deletions
22
deltaspike/src/test/java/io/cucumber/deltaspike/UnusedGlue.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
guice/src/test/java/io/cucumber/guice/integration/UnusedGlue.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
jakarta-cdi/src/test/java/io/cucumber/jakarta/cdi/UnusedGlue.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
java/src/test/java/io/cucumber/java/annotation/UnusedGlue.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
picocontainer/src/test/java/io/cucumber/picocontainer/UnusedGlue.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.