-
-
Save Maldivia/8a95340d22d08603a3120cdcdf52f3a9 to your computer and use it in GitHub Desktop.
WeldJUnit
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
package com.test.weld; | |
import javax.ejb.Stateless; | |
@Stateless | |
public class FooBean { | |
public void foo() { | |
System.out.println(this.getClass() + " - " + this.toString()); | |
} | |
} |
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
package com.test.weld; | |
import org.jboss.weld.junit5.EnableWeld; | |
import org.jboss.weld.junit5.WeldInitiator; | |
import org.jboss.weld.junit5.WeldSetup; | |
import org.junit.jupiter.api.Test; | |
import javax.enterprise.inject.Instance; | |
import javax.inject.Inject; | |
@EnableWeld | |
public class FooTest { | |
@WeldSetup public WeldInitiator weld = WeldInitiator.of(FooBean.class, SubFooBean.class); | |
@Inject | |
Instance<FooBean> fooInstances; | |
@Test | |
public void myTest() { | |
for (FooBean foo : fooInstances) { | |
foo.foo(); | |
} | |
} | |
} |
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
jan. 15, 2021 1:27:25 PM org.jboss.weld.bootstrap.WeldStartup <clinit> | |
INFO: WELD-000900: 3.1.6 (Final) | |
WARNING: An illegal reflective access operation has occurred | |
WARNING: Illegal reflective access by org.jboss.weld.util.bytecode.ClassFileUtils$1 (file:/C:/Users/Michael/.m2/repository/org/jboss/weld/weld-core-impl/3.1.6.Final/weld-core-impl-3.1.6.Final.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) | |
WARNING: Please consider reporting this to the maintainers of org.jboss.weld.util.bytecode.ClassFileUtils$1 | |
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations | |
WARNING: All illegal access operations will be denied in a future release | |
jan. 15, 2021 1:27:25 PM org.jboss.weld.bootstrap.WeldStartup startContainer | |
INFO: WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously. | |
jan. 15, 2021 1:27:26 PM org.jboss.weld.environment.se.WeldContainer fireContainerInitializedEvent | |
INFO: WELD-ENV-002003: Weld SE container 5138d548-dc88-462b-83d6-035725893be3 initialized | |
class com.test.weld.SubFooBean - com.test.weld.SubFooBean@319dead1 | |
class com.test.weld.FooBean - com.test.weld.FooBean@a7e2d9d | |
jan. 15, 2021 1:27:26 PM org.jboss.weld.environment.se.WeldContainer shutdown | |
INFO: WELD-ENV-002001: Weld SE container 5138d548-dc88-462b-83d6-035725893be3 shut down |
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
package com.test.weld; | |
import javax.ejb.Stateless; | |
@Stateless | |
public class SubFooBean extends FooBean { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment