diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index fbc187a5..79ad06b3 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -6,7 +6,7 @@ on: jobs: build-weld-junit: - name: "Weld Testing build, JDK ${{matrix.java.name}}" + name: "Weld Testing build, JDK ${{matrix.java.name}}, JUnit ${{matrix.junit.name}}" runs-on: ubuntu-latest strategy: fail-fast: false @@ -20,6 +20,15 @@ jobs: name: "21", java-version: 21, } + junit: + - { + name: "5.x", + profile: "junit5", + } + - { + name: "6.x", + profile: "junit6", + } steps: - uses: actions/checkout@v5 - name: Set up JDK @{} @@ -40,8 +49,8 @@ jobs: # Caching is an automated pre/post action that installs the cache if the key exists and exports the cache # after the job is done. In this case we refresh the cache monthly (by changing key) to avoid unlimited growth. key: q2maven-master-${{ steps.get-date.outputs.date }} - - name: Build with Maven - run: WELD_JUNIT_DEBUG=spotbugs mvn clean install -Dno-format -Dspotbugs.failOnError=true + - name: Build with Maven (JUnit ${{matrix.junit.name}}) + run: WELD_JUNIT_DEBUG=spotbugs mvn clean install -P${{matrix.junit.profile}} -Dno-format -Dspotbugs.failOnError=true - name: Delete Local Artifacts From Cache shell: bash run: rm -r ~/.m2/repository/org/jboss/weld/weld-junit* @@ -53,5 +62,5 @@ jobs: uses: actions/upload-artifact@v4 if: failure() with: - name: test-reports-jdk${{matrix.java.name}} + name: test-reports-jdk${{matrix.java.name}}-junit${{matrix.junit.name}} path: 'test-reports.tgz' diff --git a/JUNIT_VERSION_COMPATIBILITY.md b/JUNIT_VERSION_COMPATIBILITY.md new file mode 100644 index 00000000..e86b448e --- /dev/null +++ b/JUNIT_VERSION_COMPATIBILITY.md @@ -0,0 +1,113 @@ +# JUnit Version Compatibility + +## Overview + +The `weld-junit-jupiter` module **supports both JUnit Jupiter 5.x and 6.x** through a `provided` scope dependency strategy. + +## How It Works + +### Dependency Scope Strategy + +JUnit dependencies in `weld-junit-jupiter` are declared with `provided` scope: + +```xml + + org.junit.jupiter + junit-jupiter-api + provided + +``` + +This means: +- **weld-junit-jupiter does NOT bundle JUnit** - users must provide their own JUnit version +- Users can choose to use **JUnit Jupiter 5.x OR 6.x** based on their project needs +- No version conflicts with user's own JUnit dependency + +### Supported Versions + +- ✅ **JUnit Jupiter 5.0+** through **6.x** +- ✅ **JUnit Platform 5.0+** through **6.x** + +### User Configuration + +Users simply add `weld-junit-jupiter` and their preferred JUnit version: + +```xml + + + org.jboss.weld + weld-junit-jupiter + 6.0.0 + test + + + + + org.junit.jupiter + junit-jupiter + 6.0.0 + test + +``` + +## Testing Strategy + +The weld-testing project is tested against **both JUnit 5.x and 6.x**: +- **JUnit 6.0.0** (primary/default): 140/140 tests passing ✅ +- **JUnit 5.13.4** (backward compatibility): 140/140 tests passing ✅ + +### Running Tests with Different JUnit Versions + +To test with JUnit 5.x: +```bash +mvn test -Pjunit5 +``` + +To test with JUnit 6.x (default): +```bash +mvn test -Pjunit6 +# or simply: +mvn test +``` + +### Maven Profiles + +The project includes two Maven profiles for dual version testing: + +- **`junit6`** (active by default): Tests with JUnit Jupiter 6.0.0 and JUnit Platform 6.0.0 +- **`junit5`**: Tests with JUnit Jupiter 5.13.4 and JUnit Platform 1.12.2 + +## Migration from JUnit 5 to JUnit 6 + +Users can migrate from JUnit 5 to JUnit 6 independently of upgrading weld-testing: + +1. Upgrade to weld-testing 6.0.0 while staying on JUnit 5.x +2. Later, upgrade to JUnit 6.x when ready + +OR + +1. Upgrade to JUnit 6.x first +2. Then upgrade to weld-testing 6.0.0 + +Both paths are supported! + +## API Compatibility + +The weld-junit-jupiter module: +- Uses only stable JUnit APIs available in both 5.x and 6.x +- Avoids deprecated APIs that were removed in JUnit 6 +- Has been updated for JUnit 6 API changes: + - `MethodOrderer.Alphanumeric` → `MethodOrderer.MethodName` + - `CollectionUtils.toUnmodifiableList()` → `Stream.toList()` + +## Version Support Policy + +- **Minimum supported version**: JUnit Jupiter 5.0.0 +- **Maximum supported version**: JUnit Jupiter 6.x (latest) +- **Java baseline**: Java 17+ (required by JUnit 6) + +## Known Limitations + +- The Spock module currently has compatibility issues with JUnit Platform 6.0.0 due to upstream changes +- This is a known issue being tracked in the Spock project +- Spock users should continue using JUnit Platform 5.x until Spock 2.5+ is released diff --git a/README.md b/README.md index 82ec4a87..6acaf71d 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Weld Testing Extensions -[![Maven Central](http://img.shields.io/maven-central/v/org.jboss.weld/weld-junit4.svg)](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22weld-junit4%22) +[![Maven Central](http://img.shields.io/maven-central/v/org.jboss.weld/weld-junit-jupiter.svg)](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22weld-junit-jupiter%22) [![License](https://img.shields.io/badge/license-Apache%20License%202.0-yellow.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) The primary goal of this project is to provide simple and fast tools for CDI *unit/component* testing. -The tools are implemented as JUnit 4, JUnit 5 and Spock extensions. +The tools are implemented as JUnit Jupiter and Spock extensions. -:warning: **Version 5.x of this extension supports Weld 6.0 (CDI 4.1) along with `jakarta` namespace** +:warning: **Version 6.x of this extension supports Weld 6.0 (CDI 4.1) with `jakarta` namespace, JUnit Jupiter 5.x and 6.x, and requires Java 17+** ## The What @@ -24,18 +24,16 @@ Simulating field injection to start with, then interceptors and/or decorators - There are frameworks to make this easier such as [Mockito](http://site.mockito.org/); but use too many mocks and things get tangled real quick. So we came with JUnit/Spock extensions which allow you to use actual CDI container instead of complex simulations. There is no need to change the way you develop your CDI components if you have a real container to test it with. -Besides, it's easy to combine this approach with mocking frameworks (see for instance [Adding mock beans](junit5/README.md#adding-mock-beans)). +Besides, it's easy to combine this approach with mocking frameworks (see for instance [Adding mock beans](junit-jupiter/README.md#adding-mock-beans)). ## How To Use Each Extension This project consists of three modules. Below is a list with links to detailed README of each extension: -* JUnit 4 extension - * [JUnit 4 extension using `@Rule` and `@ClassRule` mechanism](junit4/README.md) -* JUnit 5 - * [JUnit 5 extension using the `@ExtendWith` mechanism](junit5/README.md) -* JUnit-common - * Houses the parts of code shared by both Junit extensions +* JUnit Jupiter (JUnit 5 & 6) + * [JUnit Jupiter extension using the `@ExtendWith` mechanism](junit-jupiter/README.md) +* Weld Common + * Houses the shared testing utilities used by both JUnit Jupiter and Spock extensions * Spock * [Spock framework extension](spock/README.md) diff --git a/junit-common/.gitignore b/junit-jupiter/.gitignore similarity index 100% rename from junit-common/.gitignore rename to junit-jupiter/.gitignore diff --git a/junit5/README.md b/junit-jupiter/README.md similarity index 90% rename from junit5/README.md rename to junit-jupiter/README.md index 08afbc2d..71bbe410 100644 --- a/junit5/README.md +++ b/junit-jupiter/README.md @@ -1,7 +1,7 @@ -# Weld JUnit 5 (Jupiter) Extensions +# Weld JUnit Jupiter Extensions -There are two extension here, both of which follow the extension mechanism introduced in JUnit 5. -Therefore, in order to use this extension in your test, you have to annotate your test class with `@ExtendWith(WeldJunit5Extension.class)` or `@ExtendWith(WeldJunit5AutoExtension.class)` respectively. +There are two extensions here, both of which follow the extension mechanism introduced in JUnit 5 (Jupiter). +Therefore, in order to use this extension in your test, you have to annotate your test class with `@ExtendWith(WeldJUnitJupiterExtension.class)` or `@ExtendWith(WeldJUnitJupiterAutoExtension.class)` respectively. In their default behaviour, the extensions will automatically start/stop Weld SE container and inject into all your `@Inject` fields and method parameters in the given test instance. Furthermore, you can provide configuration and modify Weld bootstrapping process in various ways - extensions, scope activation, interception, ... @@ -20,7 +20,7 @@ Requirements are JUnit 5 and Java 17. * [Maven Artifact](#maven-artifact) * [Configuration Versus Automagic](#configuration-versus-automagic) -* [WeldJunit5Extension](#weldjunit5extension) +* [WeldJUnitJupiterExtension](#weldjunitjupiterextension) * [WeldInitiator](#weldinitiator) * [Convenient Starting Points](#convenient-starting-points) * [Test Class Injection](#test-class-injection) @@ -30,7 +30,7 @@ Requirements are JUnit 5 and Java 17. * [Mock injection services](#mock-injection-services) * [Inheritance](#inheritance-of-test-classes) * [Nested test classes](#nested-test-classes) -* [WeldJunit5AutoExtension](#weldjunit5autoextension) +* [WeldJUnitJupiterAutoExtension](#weldjunitjupiterautoextension) * [`@ActivateScopes`](#activatescopes) * [`@AddBeanClasses`](#addbeanclasses) * [`@AddEnabledDecorators`](#addenableddecorators) @@ -50,7 +50,7 @@ Requirements are JUnit 5 and Java 17. ```xml org.jboss.weld - weld-junit5 + weld-junit-jupiter ${version.weld-junit} ``` @@ -60,12 +60,12 @@ Requirements are JUnit 5 and Java 17. There are two extensions you can choose from. While both are ultimately achieving the same thing, each opts for a different approach. -`WeldJunit5Extension.class` is the original one where you declaratively configure the container, much like booting Weld SE itself. +`WeldJUnitJupiterExtension.class` is the original one where you declaratively configure the container, much like booting Weld SE itself. There are some additional builder patterns on top of that allowing for easy addition of mocked beans and such. The advantage of this approach is that you have complete control over what gets into the Weld container and can easily change that. On the other hand, it may be rather verbose and requires you to add a specifically annotated field to every test (described below). -`WeldJunit5AutoExtension.class` is more of an annotation based approach where you don't need any special field in your test class. +`WeldJUnitJupiterAutoExtension.class` is more of an annotation based approach where you don't need any special field in your test class. In fact, you don't need anything except the JUnit `@ExtendWith` and our extension will try its best to find out what classes should be added to the Weld container as beans. This of course makes some assumptions on your tests which may not always be met, hence there is a bunch of annotations which allow you to configure the container further. Advantages of this approach are quick setup for basic cases, less verbose code and that eerie feeling that things are happening automagically. @@ -74,9 +74,9 @@ Last but not least, overly complex test scenarios may mean loads of annotations, No matter what extension you choose, do not mix them together! -## WeldJunit5Extension +## WeldJUnitJupiterExtension -The simplest way to use this extension is to annotate your test class with `@ExtendWith(WeldJunit5Extension.class)`. +The simplest way to use this extension is to annotate your test class with `@ExtendWith(WeldJUnitJupiterExtension.class)`. If you are in for shorter annotations, you can also use `@EnableWeld`. With just these annotations, the Weld container will be started before each test is run and stopped afterwards. @@ -94,11 +94,11 @@ This default behaviour includes: * Shut down the container after test is done ```java -import org.jboss.weld.junit5.WeldJunit5Extension; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) class BasicUsageTest { @Inject @@ -113,23 +113,23 @@ class BasicUsageTest { ### WeldInitiator -`org.jboss.weld.junit5.WeldInitiator` is an entry point you will want to define if you wish to customize how we bootstrap Weld. +`org.jboss.weld.junit.jupiter.WeldInitiator` is an entry point you will want to define if you wish to customize how we bootstrap Weld. The container is configured through a provided `org.jboss.weld.environment.se.Weld` instance. By default, the container is optimized for testing purposes, i.e. with automatic discovery and concurrent deployment disabled (see also `WeldInitiator.createWeld()`). However, it is possible to provide a customized `Weld` instance - see also `WeldInitiator.of(Weld)` and `WeldInitiator.from(Weld)` methods. `WeldInitiator` also implements `jakarta.enterprise.inject.Instance` and therefore might be used to perform programmatic lookup of bean instances. -`WeldInitiator` should be available in a field annotated with `@org.jboss.weld.junit5.WeldSetup`. +`WeldInitiator` should be available in a field annotated with `@org.jboss.weld.junit.jupiter.WeldSetup`. From there you can use static methods: ```java -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) class MyNewTest { @WeldSetup @@ -146,7 +146,7 @@ A convenient static method `WeldInitiator.of(Class...)` is also provided - in ```java -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) class SimpleTest { @WeldSetup @@ -170,7 +170,7 @@ It's also possible to use `WeldInitiator.ofTestPackage()` - the container is opt ```java -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) class AnotherSimpleTest { @WeldSetup @@ -189,10 +189,10 @@ Furthermore, `WeldInitiator.Builder` can be used to customize the final `WeldIni ##### Test Class Injection -Everytime `WeldJunit5Extension` processes your test instance, it will automatically resolve all `@Inject` fields as well as attempt to resolve any test method parameters, should they be injectable beans. +Everytime `WeldJUnitJupiterExtension` processes your test instance, it will automatically resolve all `@Inject` fields as well as attempt to resolve any test method parameters, should they be injectable beans. ```java -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) class InjectTest { @WeldSetup @@ -216,7 +216,7 @@ class InjectTest { `WeldInitiator.Builder.activate(Class...)` makes it possible to activate and deactivate contexts for the specified normal scopes for each test method execution: ```java -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) class ContextsActivatedTest { @WeldSetup @@ -256,7 +256,7 @@ class Foo { } } -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) class TestClassProducerTest { @WeldSetup @@ -278,8 +278,8 @@ class TestClassProducerTest { This should work in most of the cases (assuming the test class [meets some conditions](https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html#what_classes_are_beans)) although it's a little bit cumbersome. The second option is `WeldInitiator.Builder.addBeans(Bean...)` which makes it possible to add beans during `AfterBeanDiscovery` phase easily. -You can provide your own `jakarta.enterprise.inject.spi.Bean` implementation or, for most use cases, a convenient `org.jboss.weld.junit.MockBean` should be sufficient. -Use `org.jboss.weld.junit.MockBean.builder()` to obtain a new builder instance. +You can provide your own `jakarta.enterprise.inject.spi.Bean` implementation or, for most use cases, a convenient `org.jboss.weld.testing.MockBean` should be sufficient. +Use `org.jboss.weld.testing.MockBean.builder()` to obtain a new builder instance. ```java interface Bar { @@ -295,7 +295,7 @@ class Foo { } } -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) class AddBeanTest { @WeldSetup @@ -321,7 +321,7 @@ class AddBeanTest { ##### Adding mock interceptors Sometimes it might be useful to add a mock interceptor, e.g. if an interceptor implementation requires some environment-specific features. -For this use case the `org.jboss.weld.junit.MockInterceptor` is a perfect match: +For this use case the `org.jboss.weld.testing.MockInterceptor` is a perfect match: ```java @@ -488,9 +488,9 @@ class OuterTest { } ``` -## WeldJunit5AutoExtension +## WeldJUnitJupiterAutoExtension -To use this approach, annotate your test class with `@ExtendWith(WeldJunit5AutoExtension.class)` or just `@EnableAutoWeld`. +To use this approach, annotate your test class with `@ExtendWith(WeldJUnitJupiterAutoExtension.class)` or just `@EnableAutoWeld`. By default, the extension will: * Inspect your test class and try to figure out what bean classes it needs based on injection points (field and parameter injection both work) @@ -513,8 +513,8 @@ By default, the extension will: Here is a simple example using the default plus one additional annotation (`@AddPackages`): ```java -import org.jboss.weld.junit5.auto.beans.Engine; -import org.jboss.weld.junit5.auto.beans.V8; +import org.jboss.weld.junit.jupiter.auto.beans.Engine; +import org.jboss.weld.junit.jupiter.auto.beans.V8; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -600,8 +600,8 @@ It will not exclude beans of the implied type that are defined by `@Produces` pr Also, the current implementation excludes beans based on type, disregarding any qualifiers that are specified. ```java -import org.jboss.weld.junit5.auto.ExcludeBean; -import org.jboss.weld.junit5.auto.WeldJunit5AutoExtension; +import org.jboss.weld.junit.jupiter.auto.ExcludeBean; +import org.jboss.weld.junit.jupiter.auto.EnableAutoWeld; import org.junit.jupiter.api.Test; import jakarta.enterprise.inject.Produces; @@ -652,8 +652,8 @@ This is mainly for usability, as it would be annoying to constantly type additio However, we are aware that this might cause trouble if more extensions are competing for parameter resolution. In such case, you can turn on explicit parameter resolution and Weld will only resolve parameters which have at least one `jakarta.inject.Qualifier` annotation on them. There are two ways to enable it: -* First option is enabling this globally through a system property - `org.jboss.weld.junit5.explicitParamInjection=true` -This property is also available as a constant in our extension class; you can therefore refer to it via `org.jboss.weld.junit5.WeldJunit5Extension.GLOBAL_EXPLICIT_PARAM_INJECTION`. +* First option is enabling this globally through a system property - `org.jboss.weld.junit.jupiter.explicitParamInjection=true` +This property is also available as a constant in our extension class; you can therefore refer to it via `org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension.GLOBAL_EXPLICIT_PARAM_INJECTION`. * The other approach is to use `@ExplicitParamInjection(boolean)` on either test method, or test class. In case of test class this annotation will enforce the presence on qualifiers on all methods. diff --git a/junit5/pom.xml b/junit-jupiter/pom.xml similarity index 80% rename from junit5/pom.xml rename to junit-jupiter/pom.xml index 8ee4f709..9a27d505 100644 --- a/junit5/pom.xml +++ b/junit-jupiter/pom.xml @@ -2,15 +2,15 @@ 4.0.0 - Weld JUnit 5 Extensions + Weld JUnit Jupiter Extension org.jboss.weld weld-junit-parent - 5.0.3-SNAPSHOT + 6.0.0-SNAPSHOT - weld-junit5 + weld-junit-jupiter @@ -21,21 +21,25 @@ org.jboss.weld - weld-junit-common + weld-common - + + org.junit.jupiter junit-jupiter-api + provided org.junit.jupiter - junit-jupiter-engine + junit-jupiter-params + provided org.junit.jupiter - junit-jupiter-params + junit-jupiter-engine + test diff --git a/junit5/src/main/java/org/jboss/weld/junit5/EnableWeld.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/EnableWeld.java similarity index 90% rename from junit5/src/main/java/org/jboss/weld/junit5/EnableWeld.java rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/EnableWeld.java index 03889e85..38cb7a94 100644 --- a/junit5/src/main/java/org/jboss/weld/junit5/EnableWeld.java +++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/EnableWeld.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5; +package org.jboss.weld.junit.jupiter; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; @@ -27,7 +27,7 @@ /** * Meta-annotation that allows test classes to be extended with {@code @EnableWeld} - * instead of {@code @ExtendWith(WeldJunit5Extension.class)}. + * instead of {@code @ExtendWith(WeldJUnitJupiterExtension.class)}. * *
  * 
@@ -47,13 +47,13 @@ *
* * @author Steve Moyer - * @see WeldJunit5Extension + * @see WeldJUnitJupiterExtension */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE, ElementType.METHOD }) @Documented @Inherited -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public @interface EnableWeld { } diff --git a/junit5/src/main/java/org/jboss/weld/junit5/ExplicitParamInjection.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/ExplicitParamInjection.java similarity index 98% rename from junit5/src/main/java/org/jboss/weld/junit5/ExplicitParamInjection.java rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/ExplicitParamInjection.java index 8748b2c7..97578cf6 100644 --- a/junit5/src/main/java/org/jboss/weld/junit5/ExplicitParamInjection.java +++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/ExplicitParamInjection.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5; +package org.jboss.weld.junit.jupiter; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/junit5/src/main/java/org/jboss/weld/junit5/ExtensionContextUtils.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/ExtensionContextUtils.java similarity index 96% rename from junit5/src/main/java/org/jboss/weld/junit5/ExtensionContextUtils.java rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/ExtensionContextUtils.java index 124049ce..4159b812 100644 --- a/junit5/src/main/java/org/jboss/weld/junit5/ExtensionContextUtils.java +++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/ExtensionContextUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5; +package org.jboss.weld.junit.jupiter; import java.util.List; @@ -50,7 +50,7 @@ private ExtensionContextUtils() { */ private static synchronized ExtensionContext.Store getRootExtensionStore(ExtensionContext context) { if (EXTENSION_NAMESPACE == null) { - EXTENSION_NAMESPACE = Namespace.create(WeldJunit5Extension.class); + EXTENSION_NAMESPACE = Namespace.create(WeldJUnitJupiterExtension.class); } return context.getRoot().getStore(EXTENSION_NAMESPACE); } @@ -63,7 +63,7 @@ private static synchronized ExtensionContext.Store getRootExtensionStore(Extensi * @return {@link ExtensionContext.Store} based on {@link ExtensionContext} and the required test class */ private static ExtensionContext.Store getTestStore(ExtensionContext context) { - return context.getStore(Namespace.create(WeldJunit5Extension.class, context.getRequiredTestClass())); + return context.getStore(Namespace.create(WeldJUnitJupiterExtension.class, context.getRequiredTestClass())); } /** diff --git a/junit5/src/main/java/org/jboss/weld/junit5/WeldInitiator.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldInitiator.java similarity index 97% rename from junit5/src/main/java/org/jboss/weld/junit5/WeldInitiator.java rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldInitiator.java index 41447b05..7f5640d6 100644 --- a/junit5/src/main/java/org/jboss/weld/junit5/WeldInitiator.java +++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldInitiator.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5; +package org.jboss.weld.junit.jupiter; import java.lang.annotation.Annotation; import java.util.List; @@ -28,16 +28,16 @@ import org.jboss.weld.environment.se.Weld; import org.jboss.weld.environment.se.WeldContainer; -import org.jboss.weld.junit.AbstractWeldInitiator; +import org.jboss.weld.testing.AbstractWeldInitiator; /** - * JUnit 5 initiator - can be used to customize the Weld SE container started by {@link WeldJunit5Extension}. + * JUnit 5 initiator - can be used to customize the Weld SE container started by {@link WeldJUnitJupiterExtension}. * *

* Example: * *

- * @ExtendWith(WeldJunit5Extension.class)
+ * @ExtendWith(WeldJUnitJupiterExtension.class)
  * public class SimpleTest {
  *
  *     @WeldSetup
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/WeldJunit5Extension.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldJUnitJupiterExtension.java
similarity index 94%
rename from junit5/src/main/java/org/jboss/weld/junit5/WeldJunit5Extension.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldJUnitJupiterExtension.java
index 3cfb829b..89af1442 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/WeldJunit5Extension.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldJUnitJupiterExtension.java
@@ -14,17 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5;
-
-import static org.jboss.weld.junit5.ExtensionContextUtils.getContainerFromStore;
-import static org.jboss.weld.junit5.ExtensionContextUtils.getEnrichersFromStore;
-import static org.jboss.weld.junit5.ExtensionContextUtils.getExplicitInjectionInfoFromStore;
-import static org.jboss.weld.junit5.ExtensionContextUtils.getInitiatorFromStore;
-import static org.jboss.weld.junit5.ExtensionContextUtils.removeContainerFromStore;
-import static org.jboss.weld.junit5.ExtensionContextUtils.setContainerToStore;
-import static org.jboss.weld.junit5.ExtensionContextUtils.setEnrichersToStore;
-import static org.jboss.weld.junit5.ExtensionContextUtils.setExplicitInjectionInfoToStore;
-import static org.jboss.weld.junit5.ExtensionContextUtils.setInitiatorToStore;
+package org.jboss.weld.junit.jupiter;
+
+import static org.jboss.weld.junit.jupiter.ExtensionContextUtils.getContainerFromStore;
+import static org.jboss.weld.junit.jupiter.ExtensionContextUtils.getEnrichersFromStore;
+import static org.jboss.weld.junit.jupiter.ExtensionContextUtils.getExplicitInjectionInfoFromStore;
+import static org.jboss.weld.junit.jupiter.ExtensionContextUtils.getInitiatorFromStore;
+import static org.jboss.weld.junit.jupiter.ExtensionContextUtils.removeContainerFromStore;
+import static org.jboss.weld.junit.jupiter.ExtensionContextUtils.setContainerToStore;
+import static org.jboss.weld.junit.jupiter.ExtensionContextUtils.setEnrichersToStore;
+import static org.jboss.weld.junit.jupiter.ExtensionContextUtils.setExplicitInjectionInfoToStore;
+import static org.jboss.weld.junit.jupiter.ExtensionContextUtils.setInitiatorToStore;
 import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;
 import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_METHOD;
 
@@ -73,7 +73,7 @@
  * 

* *
- * @ExtendWith(WeldJunit5Extension.class)
+ * @ExtendWith(WeldJUnitJupiterExtension.class)
  * public class SimpleTest {
  *
  *     // Injected automatically
@@ -92,11 +92,11 @@
  * @see EnableWeld
  * @see WeldJunitEnricher
  */
-public class WeldJunit5Extension implements AfterAllCallback, BeforeAllCallback,
+public class WeldJUnitJupiterExtension implements AfterAllCallback, BeforeAllCallback,
         BeforeEachCallback, AfterEachCallback, ParameterResolver {
 
     // global system property
-    public static final String GLOBAL_EXPLICIT_PARAM_INJECTION = "org.jboss.weld.junit5.explicitParamInjection";
+    public static final String GLOBAL_EXPLICIT_PARAM_INJECTION = "org.jboss.weld.junit.jupiter.explicitParamInjection";
 
     private static void storeExplicitParamResolutionInformation(ExtensionContext ec) {
         // check system property which may have set the global explicit param injection
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/WeldJunitEnricher.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldJunitEnricher.java
similarity index 95%
rename from junit5/src/main/java/org/jboss/weld/junit5/WeldJunitEnricher.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldJunitEnricher.java
index c4e69c13..a202ffdf 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/WeldJunitEnricher.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldJunitEnricher.java
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5;
+package org.jboss.weld.junit.jupiter;
 
 import org.jboss.weld.environment.se.Weld;
-import org.jboss.weld.junit5.WeldInitiator.Builder;
+import org.jboss.weld.junit.jupiter.WeldInitiator.Builder;
 import org.junit.jupiter.api.extension.ExtensionContext;
 
 /**
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/WeldSetup.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldSetup.java
similarity index 91%
rename from junit5/src/main/java/org/jboss/weld/junit5/WeldSetup.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldSetup.java
index 3ee7a597..481da0d6 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/WeldSetup.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/WeldSetup.java
@@ -14,13 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5;
+package org.jboss.weld.junit.jupiter;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 
 /**
- * An annotation used to denote a WeldInitiator field. This is then picked up by {@link WeldJunit5Extension} and used for
+ * An annotation used to denote a WeldInitiator field. This is then picked up by {@link WeldJUnitJupiterExtension} and used for
  * configuration.
  *
  * @author Matej Novotny
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/ActivateScopes.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ActivateScopes.java
similarity index 97%
rename from junit5/src/main/java/org/jboss/weld/junit5/auto/ActivateScopes.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ActivateScopes.java
index f55abcbb..4b8c431f 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/auto/ActivateScopes.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ActivateScopes.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5.auto;
+package org.jboss.weld.junit.jupiter.auto;
 
 import java.lang.annotation.Annotation;
 import java.lang.annotation.ElementType;
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/AddBeanClasses.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddBeanClasses.java
similarity index 97%
rename from junit5/src/main/java/org/jboss/weld/junit5/auto/AddBeanClasses.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddBeanClasses.java
index d2f7f59f..2aaac0f2 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/auto/AddBeanClasses.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddBeanClasses.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5.auto;
+package org.jboss.weld.junit.jupiter.auto;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/AddEnabledDecorators.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddEnabledDecorators.java
similarity index 97%
rename from junit5/src/main/java/org/jboss/weld/junit5/auto/AddEnabledDecorators.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddEnabledDecorators.java
index 6e82b769..157dfa57 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/auto/AddEnabledDecorators.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddEnabledDecorators.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5.auto;
+package org.jboss.weld.junit.jupiter.auto;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/AddEnabledInterceptors.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddEnabledInterceptors.java
similarity index 97%
rename from junit5/src/main/java/org/jboss/weld/junit5/auto/AddEnabledInterceptors.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddEnabledInterceptors.java
index 76be3e9c..d9fd8980 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/auto/AddEnabledInterceptors.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddEnabledInterceptors.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5.auto;
+package org.jboss.weld.junit.jupiter.auto;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/AddExtensions.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddExtensions.java
similarity index 97%
rename from junit5/src/main/java/org/jboss/weld/junit5/auto/AddExtensions.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddExtensions.java
index 1667a20e..ed2e3819 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/auto/AddExtensions.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddExtensions.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5.auto;
+package org.jboss.weld.junit.jupiter.auto;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/AddPackages.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddPackages.java
similarity index 97%
rename from junit5/src/main/java/org/jboss/weld/junit5/auto/AddPackages.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddPackages.java
index db788244..58633e36 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/auto/AddPackages.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/AddPackages.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5.auto;
+package org.jboss.weld.junit.jupiter.auto;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/ClassScanning.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ClassScanning.java
similarity index 98%
rename from junit5/src/main/java/org/jboss/weld/junit5/auto/ClassScanning.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ClassScanning.java
index f371b442..1f07097f 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/auto/ClassScanning.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ClassScanning.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5.auto;
+package org.jboss.weld.junit.jupiter.auto;
 
 import static java.util.Arrays.asList;
 import static java.util.Arrays.stream;
@@ -57,7 +57,6 @@
 import org.junit.jupiter.api.Test;
 import org.junit.platform.commons.support.AnnotationSupport;
 import org.junit.platform.commons.support.HierarchyTraversalMode;
-import org.junit.platform.commons.util.CollectionUtils;
 import org.junit.platform.commons.util.Preconditions;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -315,13 +314,13 @@ private static boolean isFieldShadowedBy(Field upper, Field lower) {
     private static List findAnnotatedDeclaredFields(Class clazz, Class annotationType) {
         return getDeclaredFields(clazz).stream()
                 .filter((field) -> isAnnotated(field, annotationType))
-                .collect(CollectionUtils.toUnmodifiableList());
+                .toList();
     }
 
     private static List findAnnotatedDeclaredMethods(Class clazz, Class annotationType) {
         return getDeclaredMethods(clazz).stream()
                 .filter((field) -> isAnnotated(field, annotationType))
-                .collect(CollectionUtils.toUnmodifiableList());
+                .toList();
     }
 
     private static List> getDeclaredConstructors(Class clazz) {
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/EnableAlternativeStereotypes.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/EnableAlternativeStereotypes.java
similarity index 97%
rename from junit5/src/main/java/org/jboss/weld/junit5/auto/EnableAlternativeStereotypes.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/EnableAlternativeStereotypes.java
index 75175d1b..b5db0e4b 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/auto/EnableAlternativeStereotypes.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/EnableAlternativeStereotypes.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5.auto;
+package org.jboss.weld.junit.jupiter.auto;
 
 import java.lang.annotation.Annotation;
 import java.lang.annotation.ElementType;
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/EnableAlternatives.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/EnableAlternatives.java
similarity index 97%
rename from junit5/src/main/java/org/jboss/weld/junit5/auto/EnableAlternatives.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/EnableAlternatives.java
index bb374c64..6fdefd1c 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/auto/EnableAlternatives.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/EnableAlternatives.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5.auto;
+package org.jboss.weld.junit.jupiter.auto;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/EnableAutoWeld.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/EnableAutoWeld.java
similarity index 88%
rename from junit5/src/main/java/org/jboss/weld/junit5/auto/EnableAutoWeld.java
rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/EnableAutoWeld.java
index a3571343..46c73036 100644
--- a/junit5/src/main/java/org/jboss/weld/junit5/auto/EnableAutoWeld.java
+++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/EnableAutoWeld.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.weld.junit5.auto;
+package org.jboss.weld.junit.jupiter.auto;
 
 import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
@@ -27,7 +27,7 @@
 
 /**
  * Meta-annotation that allows test classes to be extended with {@code @EnableAutoWeld}
- * instead of {@code @ExtendWith(WeldJunit5AutoExtension.class)}.
+ * instead of {@code @ExtendWith(WeldJUnitJupiterAutoExtension.class)}.
  *
  * 
  * 
@@ -46,13 +46,13 @@ * } *
* - * @see WeldJunit5AutoExtension + * @see WeldJUnitJupiterAutoExtension */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE, ElementType.METHOD }) @Documented @Inherited -@ExtendWith(WeldJunit5AutoExtension.class) +@ExtendWith(WeldJUnitJupiterAutoExtension.class) public @interface EnableAutoWeld { } diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/ExcludeBean.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ExcludeBean.java similarity index 97% rename from junit5/src/main/java/org/jboss/weld/junit5/auto/ExcludeBean.java rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ExcludeBean.java index 2030204f..4f033845 100644 --- a/junit5/src/main/java/org/jboss/weld/junit5/auto/ExcludeBean.java +++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ExcludeBean.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/ExcludeBeanClasses.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanClasses.java similarity index 97% rename from junit5/src/main/java/org/jboss/weld/junit5/auto/ExcludeBeanClasses.java rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanClasses.java index b9f69acf..4dd4a135 100644 --- a/junit5/src/main/java/org/jboss/weld/junit5/auto/ExcludeBeanClasses.java +++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanClasses.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/ExcludedBeansExtension.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ExcludedBeansExtension.java similarity index 97% rename from junit5/src/main/java/org/jboss/weld/junit5/auto/ExcludedBeansExtension.java rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ExcludedBeansExtension.java index f424c584..d73fac2c 100644 --- a/junit5/src/main/java/org/jboss/weld/junit5/auto/ExcludedBeansExtension.java +++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/ExcludedBeansExtension.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import java.lang.reflect.Type; import java.util.Set; diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/SetBeanDiscoveryMode.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/SetBeanDiscoveryMode.java similarity index 95% rename from junit5/src/main/java/org/jboss/weld/junit5/auto/SetBeanDiscoveryMode.java rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/SetBeanDiscoveryMode.java index 99e94aff..6ba319fd 100644 --- a/junit5/src/main/java/org/jboss/weld/junit5/auto/SetBeanDiscoveryMode.java +++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/SetBeanDiscoveryMode.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/TestInstanceInjectionExtension.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/TestInstanceInjectionExtension.java similarity index 95% rename from junit5/src/main/java/org/jboss/weld/junit5/auto/TestInstanceInjectionExtension.java rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/TestInstanceInjectionExtension.java index a8bad21f..355c0c65 100644 --- a/junit5/src/main/java/org/jboss/weld/junit5/auto/TestInstanceInjectionExtension.java +++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/TestInstanceInjectionExtension.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import jakarta.enterprise.context.spi.CreationalContext; import jakarta.enterprise.event.Observes; @@ -30,7 +30,7 @@ /** * Extension that makes a test instance appear like a regular bean even though instantiated by JUnit. * Injection into all test instances, also {@link org.junit.jupiter.api.Nested @Nested} ones, is handled in - * {@link org.jboss.weld.junit5.WeldInitiator#addObjectsToInjectInto} and related. + * {@link org.jboss.weld.junit.jupiter.WeldInitiator#addObjectsToInjectInto} and related. * Proper handling of all other CDI annotations such as {@link jakarta.enterprise.inject.Produces @Produces} is supported * only on top level test classes. */ diff --git a/junit5/src/main/java/org/jboss/weld/junit5/auto/WeldJunit5AutoExtension.java b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/WeldJUnitJupiterAutoExtension.java similarity index 84% rename from junit5/src/main/java/org/jboss/weld/junit5/auto/WeldJunit5AutoExtension.java rename to junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/WeldJUnitJupiterAutoExtension.java index 0ff109ef..37808cf7 100644 --- a/junit5/src/main/java/org/jboss/weld/junit5/auto/WeldJunit5AutoExtension.java +++ b/junit-jupiter/src/main/java/org/jboss/weld/junit/jupiter/auto/WeldJUnitJupiterAutoExtension.java @@ -14,25 +14,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static java.lang.String.format; import static java.util.stream.Collectors.joining; -import static org.jboss.weld.junit5.ExtensionContextUtils.getExplicitInjectionInfoFromStore; +import static org.jboss.weld.junit.jupiter.ExtensionContextUtils.getExplicitInjectionInfoFromStore; import java.lang.reflect.Field; import java.util.List; import java.util.stream.Collectors; import org.jboss.weld.environment.se.Weld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldJunitEnricher; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJunitEnricher; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.platform.commons.support.AnnotationSupport; /** - * An alternative to {@link WeldJunit5Extension} allowing to fully leverage an annotation based configuration approach. + * An alternative to {@link WeldJUnitJupiterExtension} allowing to fully leverage an annotation based configuration approach. * When used, the extension will attempt to resolve all beans used in your test class and automatically adds them to * the Weld container while bootstrapping it. * @@ -43,7 +43,7 @@ * Furthermore, all discovered {@link WeldJunitEnricher}s are invoked after the annotations are processed. * *

- * Note that this approach cannot be combined with {@link WeldJunit5Extension}, choose one or the other approach, not both. + * Note that this approach cannot be combined with {@link WeldJUnitJupiterExtension}, choose one or the other approach, not both. * * @see ActivateScopes * @see AddBeanClasses @@ -59,7 +59,7 @@ * @see SetBeanDiscoveryMode * @see WeldJunitEnricher */ -public class WeldJunit5AutoExtension extends WeldJunit5Extension { +public class WeldJUnitJupiterAutoExtension extends WeldJUnitJupiterExtension { @Override protected void validateInitiator(List foundInitiatorFields) { if (foundInitiatorFields.size() > 0) { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/alternative/AlternativeAsSoleBeanInSyntheticArchiveTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/alternative/AlternativeAsSoleBeanInSyntheticArchiveTest.java similarity index 80% rename from junit5/src/test/java/org/jboss/weld/junit5/alternative/AlternativeAsSoleBeanInSyntheticArchiveTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/alternative/AlternativeAsSoleBeanInSyntheticArchiveTest.java index 48f473b5..385ebd5e 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/alternative/AlternativeAsSoleBeanInSyntheticArchiveTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/alternative/AlternativeAsSoleBeanInSyntheticArchiveTest.java @@ -1,13 +1,13 @@ -package org.jboss.weld.junit5.alternative; +package org.jboss.weld.junit.jupiter.alternative; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.inject.spi.Bean; import jakarta.inject.Inject; -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.testing.MockBean; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/alternative/Fish.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/alternative/Fish.java similarity index 78% rename from junit5/src/test/java/org/jboss/weld/junit5/alternative/Fish.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/alternative/Fish.java index 6d06cc59..683fd3b8 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/alternative/Fish.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/alternative/Fish.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.alternative; +package org.jboss.weld.junit.jupiter.alternative; public class Fish { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ActivateScopesInheritanceTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ActivateScopesInheritanceTest.java similarity index 90% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ActivateScopesInheritanceTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ActivateScopesInheritanceTest.java index 0cc0e5c6..6b02ad47 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ActivateScopesInheritanceTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ActivateScopesInheritanceTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -12,9 +12,9 @@ import jakarta.enterprise.inject.spi.BeanManager; import jakarta.inject.Named; -import org.jboss.weld.junit5.auto.beans.Engine; -import org.jboss.weld.junit5.auto.beans.V6; -import org.jboss.weld.junit5.auto.beans.V8; +import org.jboss.weld.junit.jupiter.auto.beans.Engine; +import org.jboss.weld.junit.jupiter.auto.beans.V6; +import org.jboss.weld.junit.jupiter.auto.beans.V8; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ActivateScopesTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ActivateScopesTest.java similarity index 89% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ActivateScopesTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ActivateScopesTest.java index f45ec312..933e54cc 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ActivateScopesTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ActivateScopesTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -12,9 +12,9 @@ import jakarta.enterprise.inject.spi.BeanManager; import jakarta.inject.Named; -import org.jboss.weld.junit5.auto.beans.Engine; -import org.jboss.weld.junit5.auto.beans.V6; -import org.jboss.weld.junit5.auto.beans.V8; +import org.jboss.weld.junit.jupiter.auto.beans.Engine; +import org.jboss.weld.junit.jupiter.auto.beans.V6; +import org.jboss.weld.junit.jupiter.auto.beans.V8; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/AddBeanClassesTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddBeanClassesTest.java similarity index 75% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/AddBeanClassesTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddBeanClassesTest.java index 78913e70..93de44e6 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/AddBeanClassesTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddBeanClassesTest.java @@ -1,11 +1,11 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.inject.Inject; -import org.jboss.weld.junit5.auto.beans.Engine; -import org.jboss.weld.junit5.auto.beans.V8; +import org.jboss.weld.junit.jupiter.auto.beans.Engine; +import org.jboss.weld.junit.jupiter.auto.beans.V8; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/AddDecoratorTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddDecoratorTest.java similarity index 87% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/AddDecoratorTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddDecoratorTest.java index 61acb1f6..2c3f2a75 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/AddDecoratorTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddDecoratorTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import jakarta.inject.Inject; -import org.jboss.weld.junit5.auto.interceptorAndDecorator.DecoratedBean; -import org.jboss.weld.junit5.auto.interceptorAndDecorator.TestDecorator; +import org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator.DecoratedBean; +import org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator.TestDecorator; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/AddExtensionsTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddExtensionsTest.java similarity index 77% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/AddExtensionsTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddExtensionsTest.java index 132ac094..a2bd7415 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/AddExtensionsTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddExtensionsTest.java @@ -1,8 +1,8 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.jboss.weld.junit5.auto.extension.AddedExtension; +import org.jboss.weld.junit.jupiter.auto.extension.AddedExtension; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/AddInterceptorTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddInterceptorTest.java similarity index 87% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/AddInterceptorTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddInterceptorTest.java index 7748dd83..56bf6998 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/AddInterceptorTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddInterceptorTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import jakarta.inject.Inject; -import org.jboss.weld.junit5.auto.interceptorAndDecorator.InterceptedBean; -import org.jboss.weld.junit5.auto.interceptorAndDecorator.TestInterceptor; +import org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator.InterceptedBean; +import org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator.TestInterceptor; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/AddPackagesTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddPackagesTest.java similarity index 76% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/AddPackagesTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddPackagesTest.java index ac59e3dc..425ce7cc 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/AddPackagesTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AddPackagesTest.java @@ -1,11 +1,11 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.inject.Inject; -import org.jboss.weld.junit5.auto.beans.Engine; -import org.jboss.weld.junit5.auto.beans.V8; +import org.jboss.weld.junit.jupiter.auto.beans.Engine; +import org.jboss.weld.junit.jupiter.auto.beans.V8; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/AnnotationsInheritanceTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AnnotationsInheritanceTest.java similarity index 82% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/AnnotationsInheritanceTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AnnotationsInheritanceTest.java index 7fe66937..2aab836c 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/AnnotationsInheritanceTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AnnotationsInheritanceTest.java @@ -1,17 +1,17 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import jakarta.inject.Inject; -import org.jboss.weld.junit5.auto.beans.Engine; -import org.jboss.weld.junit5.auto.beans.V8; -import org.jboss.weld.junit5.auto.extension.AddedExtension; -import org.jboss.weld.junit5.auto.interceptorAndDecorator.DecoratedBean; -import org.jboss.weld.junit5.auto.interceptorAndDecorator.InterceptedBean; -import org.jboss.weld.junit5.auto.interceptorAndDecorator.TestDecorator; -import org.jboss.weld.junit5.auto.interceptorAndDecorator.TestInterceptor; +import org.jboss.weld.junit.jupiter.auto.beans.Engine; +import org.jboss.weld.junit.jupiter.auto.beans.V8; +import org.jboss.weld.junit.jupiter.auto.extension.AddedExtension; +import org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator.DecoratedBean; +import org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator.InterceptedBean; +import org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator.TestDecorator; +import org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator.TestInterceptor; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/AutoConfigWithWeldSetupTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AutoConfigWithWeldSetupTest.java similarity index 90% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/AutoConfigWithWeldSetupTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AutoConfigWithWeldSetupTest.java index e2df7dee..14b08ab5 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/AutoConfigWithWeldSetupTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/AutoConfigWithWeldSetupTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertInstanceOf; @@ -7,8 +7,8 @@ import java.lang.reflect.Field; import java.util.Optional; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.AfterEachCallback; @@ -55,7 +55,7 @@ public void afterEach(ExtensionContext context) throws NoSuchFieldException, Ill Throwable throwable = executionException.get(); assertInstanceOf(IllegalStateException.class, throwable); assertEquals("When using automagic mode, no @WeldSetup annotated field should be present! Fields found:\n" - + "Field 'weld' with type class org.jboss.weld.junit5.WeldInitiator which is in class org.jboss.weld.junit5.auto.AutoConfigWithWeldSetupTest", + + "Field 'weld' with type class org.jboss.weld.junit.jupiter.WeldInitiator which is in class org.jboss.weld.junit.jupiter.auto.AutoConfigWithWeldSetupTest", throwable.getMessage()); } } diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/BasicAutoConfigTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/BasicAutoConfigTest.java similarity index 80% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/BasicAutoConfigTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/BasicAutoConfigTest.java index 68307dbd..3dc700d9 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/BasicAutoConfigTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/BasicAutoConfigTest.java @@ -1,12 +1,12 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.inject.Inject; -import org.jboss.weld.junit5.basic.Foo; -import org.jboss.weld.junit5.explicitInjection.Bar; +import org.jboss.weld.junit.jupiter.basic.Foo; +import org.jboss.weld.junit.jupiter.explicitInjection.Bar; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanClassesDepsTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanClassesDepsTest.java similarity index 82% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanClassesDepsTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanClassesDepsTest.java index 22adcb87..2d6e77ef 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanClassesDepsTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanClassesDepsTest.java @@ -1,11 +1,11 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.enterprise.inject.Produces; -import org.jboss.weld.junit5.basic.unsatisfied.FooDeps; -import org.jboss.weld.junit5.basic.unsatisfied.SomeFooDeps; +import org.jboss.weld.junit.jupiter.basic.unsatisfied.FooDeps; +import org.jboss.weld.junit.jupiter.basic.unsatisfied.SomeFooDeps; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanClassesTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanClassesTest.java similarity index 81% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanClassesTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanClassesTest.java index b1094561..97ddb5c5 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanClassesTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanClassesTest.java @@ -1,12 +1,12 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.enterprise.inject.Produces; -import org.jboss.weld.junit5.basic.Foo; -import org.jboss.weld.junit5.basic.SomeFoo; +import org.jboss.weld.junit.jupiter.basic.Foo; +import org.jboss.weld.junit.jupiter.basic.SomeFoo; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanDepsTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanDepsTest.java similarity index 81% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanDepsTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanDepsTest.java index fa17af05..931cdc44 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanDepsTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanDepsTest.java @@ -1,11 +1,11 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.enterprise.inject.Produces; -import org.jboss.weld.junit5.basic.unsatisfied.FooDeps; -import org.jboss.weld.junit5.basic.unsatisfied.SomeFooDeps; +import org.jboss.weld.junit.jupiter.basic.unsatisfied.FooDeps; +import org.jboss.weld.junit.jupiter.basic.unsatisfied.SomeFooDeps; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanHierarchyTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanHierarchyTest.java similarity index 76% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanHierarchyTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanHierarchyTest.java index bffd4c7c..9e7ff9e4 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanHierarchyTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanHierarchyTest.java @@ -1,13 +1,13 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.enterprise.inject.Produces; -import org.jboss.weld.junit5.basic.Foo; -import org.jboss.weld.junit5.basic.IFoo; -import org.jboss.weld.junit5.basic.SomeIFoo; +import org.jboss.weld.junit.jupiter.basic.Foo; +import org.jboss.weld.junit.jupiter.basic.IFoo; +import org.jboss.weld.junit.jupiter.basic.SomeIFoo; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanMetaAnnotationTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanMetaAnnotationTest.java similarity index 90% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanMetaAnnotationTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanMetaAnnotationTest.java index 1e6f40bc..b238a61f 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanMetaAnnotationTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanMetaAnnotationTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -10,8 +10,8 @@ import jakarta.enterprise.inject.Produces; -import org.jboss.weld.junit5.basic.Foo; -import org.jboss.weld.junit5.basic.SomeFoo; +import org.jboss.weld.junit.jupiter.basic.Foo; +import org.jboss.weld.junit.jupiter.basic.SomeFoo; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanTest.java similarity index 80% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanTest.java index 4f5f1b07..4c0a5e03 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExcludeBeanTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExcludeBeanTest.java @@ -1,12 +1,12 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.enterprise.inject.Produces; -import org.jboss.weld.junit5.basic.Foo; -import org.jboss.weld.junit5.basic.SomeFoo; +import org.jboss.weld.junit.jupiter.basic.Foo; +import org.jboss.weld.junit.jupiter.basic.SomeFoo; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExplicitParametersAutoConfigTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExplicitParametersAutoConfigTest.java similarity index 73% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ExplicitParametersAutoConfigTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExplicitParametersAutoConfigTest.java index d736b47f..ee4596e4 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ExplicitParametersAutoConfigTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ExplicitParametersAutoConfigTest.java @@ -1,14 +1,14 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.enterprise.inject.Default; -import org.jboss.weld.junit5.ExplicitParamInjection; -import org.jboss.weld.junit5.basic.Foo; -import org.jboss.weld.junit5.explicitInjection.Bar; -import org.jboss.weld.junit5.explicitInjection.CustomExtension; +import org.jboss.weld.junit.jupiter.ExplicitParamInjection; +import org.jboss.weld.junit.jupiter.basic.Foo; +import org.jboss.weld.junit.jupiter.explicitInjection.Bar; +import org.jboss.weld.junit.jupiter.explicitInjection.CustomExtension; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/InheritedInjectedTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InheritedInjectedTest.java similarity index 96% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/InheritedInjectedTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InheritedInjectedTest.java index 0f3a0860..e680f7ee 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/InheritedInjectedTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InheritedInjectedTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/InheritedProducerFieldTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InheritedProducerFieldTest.java similarity index 96% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/InheritedProducerFieldTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InheritedProducerFieldTest.java index 6c73028e..8c719b73 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/InheritedProducerFieldTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InheritedProducerFieldTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/InheritedProducerMethodTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InheritedProducerMethodTest.java similarity index 96% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/InheritedProducerMethodTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InheritedProducerMethodTest.java index 7c1da6dc..73c65b6b 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/InheritedProducerMethodTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InheritedProducerMethodTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/InjectInstanceTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectInstanceTest.java similarity index 91% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/InjectInstanceTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectInstanceTest.java index 199f346c..bab81440 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/InjectInstanceTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectInstanceTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/InjectMethodParamTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectMethodParamTest.java similarity index 91% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/InjectMethodParamTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectMethodParamTest.java index 9f98b388..b2ad0619 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/InjectMethodParamTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectMethodParamTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/InjectParameterizedInstanceTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectParameterizedInstanceTest.java similarity index 91% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/InjectParameterizedInstanceTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectParameterizedInstanceTest.java index c1174701..e53a8907 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/InjectParameterizedInstanceTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectParameterizedInstanceTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/InjectParameterizedTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectParameterizedTest.java similarity index 89% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/InjectParameterizedTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectParameterizedTest.java index a87e6333..1fc7c5e3 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/InjectParameterizedTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/InjectParameterizedTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ParametersAutoConfigTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ParametersAutoConfigTest.java similarity index 79% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ParametersAutoConfigTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ParametersAutoConfigTest.java index 316868ac..b5977a88 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ParametersAutoConfigTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ParametersAutoConfigTest.java @@ -1,10 +1,10 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.jboss.weld.junit5.basic.Foo; -import org.jboss.weld.junit5.explicitInjection.Bar; +import org.jboss.weld.junit.jupiter.basic.Foo; +import org.jboss.weld.junit.jupiter.explicitInjection.Bar; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ProducerMethodParametersScanningTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ProducerMethodParametersScanningTest.java similarity index 83% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ProducerMethodParametersScanningTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ProducerMethodParametersScanningTest.java index 3e319f10..37ef3fa9 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ProducerMethodParametersScanningTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ProducerMethodParametersScanningTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -6,8 +6,8 @@ import jakarta.enterprise.inject.Produces; import jakarta.inject.Named; -import org.jboss.weld.junit5.auto.beans.Engine; -import org.jboss.weld.junit5.auto.beans.V6; +import org.jboss.weld.junit.jupiter.auto.beans.Engine; +import org.jboss.weld.junit.jupiter.auto.beans.V6; import org.junit.jupiter.api.Test; @EnableAutoWeld diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ProducesBeforeTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ProducesBeforeTest.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ProducesBeforeTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ProducesBeforeTest.java index 65cb5582..32de9a8c 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ProducesBeforeTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ProducesBeforeTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ScannedClassesAreNotForcedBeansTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ScannedClassesAreNotForcedBeansTest.java similarity index 85% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ScannedClassesAreNotForcedBeansTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ScannedClassesAreNotForcedBeansTest.java index cf9c4385..2891d0fa 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ScannedClassesAreNotForcedBeansTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ScannedClassesAreNotForcedBeansTest.java @@ -1,11 +1,11 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.enterprise.inject.Produces; -import org.jboss.weld.junit5.auto.beans.unsatisfied.InjectedV8NoAnnotation; -import org.jboss.weld.junit5.auto.beans.unsatisfied.V8NoAnnotation; +import org.jboss.weld.junit.jupiter.auto.beans.unsatisfied.InjectedV8NoAnnotation; +import org.jboss.weld.junit.jupiter.auto.beans.unsatisfied.V8NoAnnotation; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/ScannedParameterClassesAreNotForcedBeansTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ScannedParameterClassesAreNotForcedBeansTest.java similarity index 85% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/ScannedParameterClassesAreNotForcedBeansTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ScannedParameterClassesAreNotForcedBeansTest.java index 114f803a..a498a26a 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/ScannedParameterClassesAreNotForcedBeansTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/ScannedParameterClassesAreNotForcedBeansTest.java @@ -1,11 +1,11 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.enterprise.inject.Produces; -import org.jboss.weld.junit5.auto.beans.unsatisfied.ConstructedV8NoAnnotation; -import org.jboss.weld.junit5.auto.beans.unsatisfied.V8NoAnnotation; +import org.jboss.weld.junit.jupiter.auto.beans.unsatisfied.ConstructedV8NoAnnotation; +import org.jboss.weld.junit.jupiter.auto.beans.unsatisfied.V8NoAnnotation; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/SetDiscoveryModeAllTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/SetDiscoveryModeAllTest.java similarity index 82% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/SetDiscoveryModeAllTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/SetDiscoveryModeAllTest.java index cd0e9306..1cd5884a 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/SetDiscoveryModeAllTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/SetDiscoveryModeAllTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto; +package org.jboss.weld.junit.jupiter.auto; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -7,8 +7,8 @@ import jakarta.inject.Inject; import org.jboss.weld.bootstrap.spi.BeanDiscoveryMode; -import org.jboss.weld.junit5.auto.discovery.WithBeanDefiningAnnotation; -import org.jboss.weld.junit5.auto.discovery.WithoutBeanDefiningAnnotation; +import org.jboss.weld.junit.jupiter.auto.discovery.WithBeanDefiningAnnotation; +import org.jboss.weld.junit.jupiter.auto.discovery.WithoutBeanDefiningAnnotation; import org.junit.jupiter.api.Test; @EnableAutoWeld diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/EnableAlternativeStereotypeInheritanceTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/EnableAlternativeStereotypeInheritanceTest.java similarity index 85% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/EnableAlternativeStereotypeInheritanceTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/EnableAlternativeStereotypeInheritanceTest.java index b5f7d278..f8668c7b 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/EnableAlternativeStereotypeInheritanceTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/EnableAlternativeStereotypeInheritanceTest.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.alternativeStereotype; +package org.jboss.weld.junit.jupiter.auto.alternativeStereotype; import jakarta.inject.Inject; -import org.jboss.weld.junit5.auto.AddBeanClasses; -import org.jboss.weld.junit5.auto.EnableAlternativeStereotypes; -import org.jboss.weld.junit5.auto.EnableAutoWeld; +import org.jboss.weld.junit.jupiter.auto.AddBeanClasses; +import org.jboss.weld.junit.jupiter.auto.EnableAlternativeStereotypes; +import org.jboss.weld.junit.jupiter.auto.EnableAutoWeld; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/EnableAlternativeStereotypeTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/EnableAlternativeStereotypeTest.java similarity index 84% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/EnableAlternativeStereotypeTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/EnableAlternativeStereotypeTest.java index 11eb7eb6..c8e219e1 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/EnableAlternativeStereotypeTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/EnableAlternativeStereotypeTest.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.alternativeStereotype; +package org.jboss.weld.junit.jupiter.auto.alternativeStereotype; import jakarta.inject.Inject; -import org.jboss.weld.junit5.auto.AddBeanClasses; -import org.jboss.weld.junit5.auto.EnableAlternativeStereotypes; -import org.jboss.weld.junit5.auto.EnableAutoWeld; +import org.jboss.weld.junit.jupiter.auto.AddBeanClasses; +import org.jboss.weld.junit.jupiter.auto.EnableAlternativeStereotypes; +import org.jboss.weld.junit.jupiter.auto.EnableAutoWeld; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/Foo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/Foo.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/Foo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/Foo.java index 49c44159..fd61e21d 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/Foo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/Foo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.alternativeStereotype; +package org.jboss.weld.junit.jupiter.auto.alternativeStereotype; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/FooAlternative.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/FooAlternative.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/FooAlternative.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/FooAlternative.java index 2f0e7ee2..9db0b257 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/FooAlternative.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/FooAlternative.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.alternativeStereotype; +package org.jboss.weld.junit.jupiter.auto.alternativeStereotype; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/SomeStereotype.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/SomeStereotype.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/SomeStereotype.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/SomeStereotype.java index 4c3aca33..387c98e9 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternativeStereotype/SomeStereotype.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternativeStereotype/SomeStereotype.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.alternativeStereotype; +package org.jboss.weld.junit.jupiter.auto.alternativeStereotype; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/EnableAlternativeTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/EnableAlternativeTest.java similarity index 85% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/EnableAlternativeTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/EnableAlternativeTest.java index 26e1f278..a1836f62 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/EnableAlternativeTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/EnableAlternativeTest.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.alternatives; +package org.jboss.weld.junit.jupiter.auto.alternatives; import jakarta.inject.Inject; -import org.jboss.weld.junit5.auto.AddBeanClasses; -import org.jboss.weld.junit5.auto.EnableAlternatives; -import org.jboss.weld.junit5.auto.EnableAutoWeld; +import org.jboss.weld.junit.jupiter.auto.AddBeanClasses; +import org.jboss.weld.junit.jupiter.auto.EnableAlternatives; +import org.jboss.weld.junit.jupiter.auto.EnableAutoWeld; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/EnableAlternativesInheritanceTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/EnableAlternativesInheritanceTest.java similarity index 86% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/EnableAlternativesInheritanceTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/EnableAlternativesInheritanceTest.java index ffd8c861..05d6b78a 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/EnableAlternativesInheritanceTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/EnableAlternativesInheritanceTest.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.alternatives; +package org.jboss.weld.junit.jupiter.auto.alternatives; import jakarta.inject.Inject; -import org.jboss.weld.junit5.auto.AddBeanClasses; -import org.jboss.weld.junit5.auto.EnableAlternatives; -import org.jboss.weld.junit5.auto.EnableAutoWeld; +import org.jboss.weld.junit.jupiter.auto.AddBeanClasses; +import org.jboss.weld.junit.jupiter.auto.EnableAlternatives; +import org.jboss.weld.junit.jupiter.auto.EnableAutoWeld; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/Foo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/Foo.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/Foo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/Foo.java index 19ee2aa9..e9973de4 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/Foo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/Foo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.alternatives; +package org.jboss.weld.junit.jupiter.auto.alternatives; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/FooAlternative.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/FooAlternative.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/FooAlternative.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/FooAlternative.java index e978e5f0..728f2285 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/alternatives/FooAlternative.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/alternatives/FooAlternative.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.alternatives; +package org.jboss.weld.junit.jupiter.auto.alternatives; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.inject.Alternative; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/Engine.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/Engine.java similarity index 64% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/beans/Engine.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/Engine.java index 9f6a26f2..d55fc1dc 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/Engine.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/Engine.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto.beans; +package org.jboss.weld.junit.jupiter.auto.beans; public interface Engine { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/V6.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/V6.java similarity index 87% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/beans/V6.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/V6.java index 14eb0eb1..5825f522 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/V6.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/V6.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto.beans; +package org.jboss.weld.junit.jupiter.auto.beans; import java.io.Serializable; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/V8.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/V8.java similarity index 87% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/beans/V8.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/V8.java index d818f0c3..58e5329e 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/V8.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/V8.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto.beans; +package org.jboss.weld.junit.jupiter.auto.beans; import java.io.Serializable; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/unsatisfied/ConstructedV8NoAnnotation.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/unsatisfied/ConstructedV8NoAnnotation.java similarity index 82% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/beans/unsatisfied/ConstructedV8NoAnnotation.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/unsatisfied/ConstructedV8NoAnnotation.java index 8f8ca27a..7081da23 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/unsatisfied/ConstructedV8NoAnnotation.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/unsatisfied/ConstructedV8NoAnnotation.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto.beans.unsatisfied; +package org.jboss.weld.junit.jupiter.auto.beans.unsatisfied; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/unsatisfied/InjectedV8NoAnnotation.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/unsatisfied/InjectedV8NoAnnotation.java similarity index 74% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/beans/unsatisfied/InjectedV8NoAnnotation.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/unsatisfied/InjectedV8NoAnnotation.java index 50f0109d..c63ba627 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/unsatisfied/InjectedV8NoAnnotation.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/unsatisfied/InjectedV8NoAnnotation.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto.beans.unsatisfied; +package org.jboss.weld.junit.jupiter.auto.beans.unsatisfied; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/unsatisfied/V8NoAnnotation.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/unsatisfied/V8NoAnnotation.java similarity index 74% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/beans/unsatisfied/V8NoAnnotation.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/unsatisfied/V8NoAnnotation.java index 84f396ec..7b3ce8b1 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/beans/unsatisfied/V8NoAnnotation.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/beans/unsatisfied/V8NoAnnotation.java @@ -1,8 +1,8 @@ -package org.jboss.weld.junit5.auto.beans.unsatisfied; +package org.jboss.weld.junit.jupiter.auto.beans.unsatisfied; import java.io.Serializable; -import org.jboss.weld.junit5.auto.beans.Engine; +import org.jboss.weld.junit.jupiter.auto.beans.Engine; // NOTE - deliberately missing bean defining annotation public class V8NoAnnotation implements Engine, Serializable { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/discovery/WithBeanDefiningAnnotation.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/discovery/WithBeanDefiningAnnotation.java similarity index 69% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/discovery/WithBeanDefiningAnnotation.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/discovery/WithBeanDefiningAnnotation.java index 17123076..9ea0080d 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/discovery/WithBeanDefiningAnnotation.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/discovery/WithBeanDefiningAnnotation.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto.discovery; +package org.jboss.weld.junit.jupiter.auto.discovery; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/discovery/WithoutBeanDefiningAnnotation.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/discovery/WithoutBeanDefiningAnnotation.java similarity index 66% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/discovery/WithoutBeanDefiningAnnotation.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/discovery/WithoutBeanDefiningAnnotation.java index aefada28..0f477b68 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/discovery/WithoutBeanDefiningAnnotation.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/discovery/WithoutBeanDefiningAnnotation.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto.discovery; +package org.jboss.weld.junit.jupiter.auto.discovery; // intentionally doesn't have any bean defining annotation public class WithoutBeanDefiningAnnotation { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/extension/AddedExtension.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/extension/AddedExtension.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/extension/AddedExtension.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/extension/AddedExtension.java index d804541e..25cccfdd 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/extension/AddedExtension.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/extension/AddedExtension.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.extension; +package org.jboss.weld.junit.jupiter.auto.extension; import jakarta.enterprise.event.Observes; import jakarta.enterprise.inject.spi.AfterBeanDiscovery; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/DecoratedBean.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/DecoratedBean.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/DecoratedBean.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/DecoratedBean.java index 043937d1..b3b9c9da 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/DecoratedBean.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/DecoratedBean.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.interceptorAndDecorator; +package org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator; import jakarta.enterprise.context.Dependent; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/DecoratedBeanInterface.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/DecoratedBeanInterface.java similarity index 93% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/DecoratedBeanInterface.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/DecoratedBeanInterface.java index 57675a8d..981a654a 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/DecoratedBeanInterface.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/DecoratedBeanInterface.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.interceptorAndDecorator; +package org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator; /** * diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/InterceptedBean.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/InterceptedBean.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/InterceptedBean.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/InterceptedBean.java index 7000ce61..34bf0596 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/InterceptedBean.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/InterceptedBean.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.interceptorAndDecorator; +package org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator; import jakarta.enterprise.context.Dependent; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/TestDecorator.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/TestDecorator.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/TestDecorator.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/TestDecorator.java index a9e797f8..f205915b 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/TestDecorator.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/TestDecorator.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.interceptorAndDecorator; +package org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator; import jakarta.decorator.Decorator; import jakarta.decorator.Delegate; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/TestInterceptor.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/TestInterceptor.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/TestInterceptor.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/TestInterceptor.java index 078751ac..e9ea74fb 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/TestInterceptor.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/TestInterceptor.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.interceptorAndDecorator; +package org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator; import jakarta.interceptor.AroundInvoke; import jakarta.interceptor.Interceptor; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/TestInterceptorBinding.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/TestInterceptorBinding.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/TestInterceptorBinding.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/TestInterceptorBinding.java index c36ca07e..af98d242 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/interceptorAndDecorator/TestInterceptorBinding.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/interceptorAndDecorator/TestInterceptorBinding.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.auto.interceptorAndDecorator; +package org.jboss.weld.junit.jupiter.auto.interceptorAndDecorator; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/auto/nested/OuterTestClassAndBeanSameInstanceTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/nested/OuterTestClassAndBeanSameInstanceTest.java similarity index 97% rename from junit5/src/test/java/org/jboss/weld/junit5/auto/nested/OuterTestClassAndBeanSameInstanceTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/nested/OuterTestClassAndBeanSameInstanceTest.java index 532a2dbc..7a1bed74 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/auto/nested/OuterTestClassAndBeanSameInstanceTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/auto/nested/OuterTestClassAndBeanSameInstanceTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.auto.nested; +package org.jboss.weld.junit.jupiter.auto.nested; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -12,7 +12,7 @@ import jakarta.enterprise.inject.Produces; import jakarta.inject.Inject; -import org.jboss.weld.junit5.auto.EnableAutoWeld; +import org.jboss.weld.junit.jupiter.auto.EnableAutoWeld; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/BeanManagerTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/BeanManagerTest.java similarity index 82% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/BeanManagerTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/BeanManagerTest.java index e75fce52..4969eabb 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/BeanManagerTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/BeanManagerTest.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -27,7 +27,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class BeanManagerTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/ContainerNotRunningTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/ContainerNotRunningTest.java similarity index 84% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/ContainerNotRunningTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/ContainerNotRunningTest.java index 1357a38e..5390ff41 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/ContainerNotRunningTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/ContainerNotRunningTest.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -27,7 +27,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class ContainerNotRunningTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/CustomWeldTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/CustomWeldTest.java similarity index 83% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/CustomWeldTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/CustomWeldTest.java index 73a347f7..0f72ae0a 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/CustomWeldTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/CustomWeldTest.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -27,7 +27,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class CustomWeldTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/DisabledMethodsTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/DisabledMethodsTest.java similarity index 81% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/DisabledMethodsTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/DisabledMethodsTest.java index 297a98ed..e61c428b 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/DisabledMethodsTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/DisabledMethodsTest.java @@ -1,12 +1,12 @@ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import org.jboss.weld.environment.se.WeldContainer; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; @@ -24,8 +24,8 @@ * @author Matej Novotny */ @Isolated -@ExtendWith(WeldJunit5Extension.class) -@TestMethodOrder(value = MethodOrderer.Alphanumeric.class) // enforces ordering of methods, required! +@ExtendWith(WeldJUnitJupiterExtension.class) +@TestMethodOrder(value = MethodOrderer.MethodName.class) // enforces ordering of methods, required! public class DisabledMethodsTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/EnableWeldTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/EnableWeldTest.java similarity index 84% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/EnableWeldTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/EnableWeldTest.java index 984e8a7c..f3923683 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/EnableWeldTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/EnableWeldTest.java @@ -1,11 +1,11 @@ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; import static org.junit.jupiter.api.Assertions.assertNotNull; import jakarta.enterprise.inject.spi.BeanManager; import jakarta.inject.Inject; -import org.jboss.weld.junit5.EnableWeld; +import org.jboss.weld.junit.jupiter.EnableWeld; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/Foo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/Foo.java similarity index 96% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/Foo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/Foo.java index e8c73e03..40b5e1b7 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/Foo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/Foo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/FooAlternative.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/FooAlternative.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/FooAlternative.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/FooAlternative.java index 85d98b7c..1aacdd9a 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/FooAlternative.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/FooAlternative.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; import jakarta.enterprise.inject.Alternative; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/IFoo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/IFoo.java similarity index 53% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/IFoo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/IFoo.java index 4f245a55..93fb880d 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/IFoo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/IFoo.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; public interface IFoo { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/SimpleTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/SimpleTest.java similarity index 86% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/SimpleTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/SimpleTest.java index 97977110..03d7bd4f 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/SimpleTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/SimpleTest.java @@ -14,17 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import jakarta.inject.Inject; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; -import org.jboss.weld.junit5.ofpackage.Alpha; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.junit.jupiter.ofpackage.Alpha; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -32,7 +32,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class SimpleTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/SomeFoo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/SomeFoo.java similarity index 78% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/SomeFoo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/SomeFoo.java index 4992bc52..ae945e78 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/SomeFoo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/SomeFoo.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/SomeIFoo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/SomeIFoo.java similarity index 79% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/SomeIFoo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/SomeIFoo.java index 3c089eb5..3f908f1e 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/SomeIFoo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/SomeIFoo.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.basic; +package org.jboss.weld.junit.jupiter.basic; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/unsatisfied/Baz.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/unsatisfied/Baz.java similarity index 83% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/unsatisfied/Baz.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/unsatisfied/Baz.java index 07234f6e..4caf41ea 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/unsatisfied/Baz.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/unsatisfied/Baz.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.basic.unsatisfied; +package org.jboss.weld.junit.jupiter.basic.unsatisfied; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/unsatisfied/FooDeps.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/unsatisfied/FooDeps.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/unsatisfied/FooDeps.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/unsatisfied/FooDeps.java index 7c2c14af..494d4d3c 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/unsatisfied/FooDeps.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/unsatisfied/FooDeps.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.basic.unsatisfied; +package org.jboss.weld.junit.jupiter.basic.unsatisfied; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/basic/unsatisfied/SomeFooDeps.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/unsatisfied/SomeFooDeps.java similarity index 75% rename from junit5/src/test/java/org/jboss/weld/junit5/basic/unsatisfied/SomeFooDeps.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/unsatisfied/SomeFooDeps.java index 00e16c46..2081e59f 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/basic/unsatisfied/SomeFooDeps.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/basic/unsatisfied/SomeFooDeps.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.basic.unsatisfied; +package org.jboss.weld.junit.jupiter.basic.unsatisfied; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/AddBeanTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AddBeanTest.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/AddBeanTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AddBeanTest.java index 88040b2e..6e612227 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/AddBeanTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AddBeanTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.bean; +package org.jboss.weld.junit.jupiter.bean; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; @@ -31,10 +31,10 @@ import jakarta.enterprise.inject.spi.Bean; import jakarta.enterprise.util.TypeLiteral; -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.testing.MockBean; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.Isolated; @@ -46,7 +46,7 @@ * @author Matej Novotny */ @Isolated -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class AddBeanTest { private static final AtomicInteger SEQUENCE = new AtomicInteger(0); diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/AddGloballyEnabledAlternativeTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AddGloballyEnabledAlternativeTest.java similarity index 88% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/AddGloballyEnabledAlternativeTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AddGloballyEnabledAlternativeTest.java index 3d31a294..431a37b9 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/AddGloballyEnabledAlternativeTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AddGloballyEnabledAlternativeTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.bean; +package org.jboss.weld.junit.jupiter.bean; import java.util.List; import java.util.Set; @@ -6,10 +6,10 @@ import jakarta.enterprise.inject.spi.Bean; import jakarta.enterprise.util.TypeLiteral; -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.testing.MockBean; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -22,7 +22,7 @@ * @author Matej Novotny */ @Isolated -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class AddGloballyEnabledAlternativeTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/AddPassivatingBeanTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AddPassivatingBeanTest.java similarity index 87% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/AddPassivatingBeanTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AddPassivatingBeanTest.java index 048d1197..150548fa 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/AddPassivatingBeanTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AddPassivatingBeanTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.bean; +package org.jboss.weld.junit.jupiter.bean; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -25,10 +25,10 @@ import jakarta.enterprise.inject.spi.Bean; import jakarta.enterprise.util.TypeLiteral; -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.testing.MockBean; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -37,7 +37,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class AddPassivatingBeanTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/AlternativeMockBeanTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AlternativeMockBeanTest.java similarity index 88% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/AlternativeMockBeanTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AlternativeMockBeanTest.java index 719537b1..ad7aad0e 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/AlternativeMockBeanTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/AlternativeMockBeanTest.java @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.bean; +package org.jboss.weld.junit.jupiter.bean; import jakarta.enterprise.context.Dependent; -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.testing.MockBean; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/Bar.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Bar.java similarity index 89% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/Bar.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Bar.java index f277548a..edc86c92 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/Bar.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Bar.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.bean; +package org.jboss.weld.junit.jupiter.bean; import java.util.List; diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/Blue.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Blue.java similarity index 96% rename from junit4/src/test/java/org/jboss/weld/junit4/bean/Blue.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Blue.java index 2d79497d..68e830fa 100644 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/Blue.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Blue.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit4.bean; +package org.jboss.weld.junit.jupiter.bean; import java.util.List; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/BlueToDiscover.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/BlueToDiscover.java similarity index 96% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/BlueToDiscover.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/BlueToDiscover.java index 0e9e73cc..a2f20e74 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/BlueToDiscover.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/BlueToDiscover.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.bean; +package org.jboss.weld.junit.jupiter.bean; import java.util.UUID; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/Foo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Foo.java similarity index 64% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/Foo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Foo.java index 2032697b..1779c395 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/Foo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Foo.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.bean; +package org.jboss.weld.junit.jupiter.bean; public class Foo { diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/Meaty.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Meaty.java similarity index 97% rename from junit4/src/test/java/org/jboss/weld/junit4/bean/Meaty.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Meaty.java index cdd459bb..d5306dae 100644 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/Meaty.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/Meaty.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit4.bean; +package org.jboss.weld.junit.jupiter.bean; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/MockBeanWithQualifiersTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/MockBeanWithQualifiersTest.java similarity index 75% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/MockBeanWithQualifiersTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/MockBeanWithQualifiersTest.java index 46be0655..21317807 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/MockBeanWithQualifiersTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/MockBeanWithQualifiersTest.java @@ -1,11 +1,11 @@ -package org.jboss.weld.junit5.bean; +package org.jboss.weld.junit.jupiter.bean; import jakarta.enterprise.inject.Any; -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.testing.MockBean; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/TestClassProducerTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/TestClassProducerTest.java similarity index 87% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/TestClassProducerTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/TestClassProducerTest.java index 999dc08d..11404235 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/TestClassProducerTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/TestClassProducerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.bean; +package org.jboss.weld.junit.jupiter.bean; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -25,9 +25,9 @@ import jakarta.enterprise.inject.Produces; import jakarta.enterprise.util.TypeLiteral; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -37,7 +37,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class TestClassProducerTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/extension/AddExtensionAsBeanClassWithFromMethodTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/AddExtensionAsBeanClassWithFromMethodTest.java similarity index 89% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/extension/AddExtensionAsBeanClassWithFromMethodTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/AddExtensionAsBeanClassWithFromMethodTest.java index 1c73b3ca..5c670b5d 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/extension/AddExtensionAsBeanClassWithFromMethodTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/AddExtensionAsBeanClassWithFromMethodTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.bean.extension; +package org.jboss.weld.junit.jupiter.bean.extension; import org.jboss.weld.inject.WeldInstance; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/extension/AddExtensionAsBeanClassWithOfMethodTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/AddExtensionAsBeanClassWithOfMethodTest.java similarity index 89% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/extension/AddExtensionAsBeanClassWithOfMethodTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/AddExtensionAsBeanClassWithOfMethodTest.java index 64cb24c8..b616bb7d 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/extension/AddExtensionAsBeanClassWithOfMethodTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/AddExtensionAsBeanClassWithOfMethodTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.bean.extension; +package org.jboss.weld.junit.jupiter.bean.extension; import org.jboss.weld.inject.WeldInstance; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/extension/GoodOldBean.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/GoodOldBean.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/extension/GoodOldBean.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/GoodOldBean.java index 4ab95fc4..dd77665f 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/extension/GoodOldBean.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/GoodOldBean.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.bean.extension; +package org.jboss.weld.junit.jupiter.bean.extension; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/extension/MyExtension.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/MyExtension.java similarity index 96% rename from junit5/src/test/java/org/jboss/weld/junit5/bean/extension/MyExtension.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/MyExtension.java index 6fd97e99..2891e0d7 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/extension/MyExtension.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/bean/extension/MyExtension.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.bean.extension; +package org.jboss.weld.junit.jupiter.bean.extension; import jakarta.enterprise.event.Observes; import jakarta.enterprise.inject.spi.Extension; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/compat/JunitParameterResolverAutoWeldTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/compat/JunitParameterResolverAutoWeldTest.java similarity index 51% rename from junit5/src/test/java/org/jboss/weld/junit5/compat/JunitParameterResolverAutoWeldTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/compat/JunitParameterResolverAutoWeldTest.java index e1440a9a..83587e88 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/compat/JunitParameterResolverAutoWeldTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/compat/JunitParameterResolverAutoWeldTest.java @@ -1,6 +1,6 @@ -package org.jboss.weld.junit5.compat; +package org.jboss.weld.junit.jupiter.compat; -import org.jboss.weld.junit5.auto.EnableAutoWeld; +import org.jboss.weld.junit.jupiter.auto.EnableAutoWeld; @EnableAutoWeld class JunitParameterResolverAutoWeldTest extends JunitParameterResolverReferenceTest { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/compat/JunitParameterResolverReferenceTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/compat/JunitParameterResolverReferenceTest.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/compat/JunitParameterResolverReferenceTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/compat/JunitParameterResolverReferenceTest.java index aac9265d..87556f7d 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/compat/JunitParameterResolverReferenceTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/compat/JunitParameterResolverReferenceTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.compat; +package org.jboss.weld.junit.jupiter.compat; import java.nio.file.Path; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/compat/JunitParameterResolverWeldTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/compat/JunitParameterResolverWeldTest.java similarity index 51% rename from junit5/src/test/java/org/jboss/weld/junit5/compat/JunitParameterResolverWeldTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/compat/JunitParameterResolverWeldTest.java index d6b34640..8ef97266 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/compat/JunitParameterResolverWeldTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/compat/JunitParameterResolverWeldTest.java @@ -1,6 +1,6 @@ -package org.jboss.weld.junit5.compat; +package org.jboss.weld.junit.jupiter.compat; -import org.jboss.weld.junit5.EnableWeld; +import org.jboss.weld.junit.jupiter.EnableWeld; @EnableWeld class JunitParameterResolverWeldTest extends JunitParameterResolverReferenceTest { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/contexts/ContextsActivatedTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/ContextsActivatedTest.java similarity index 87% rename from junit5/src/test/java/org/jboss/weld/junit5/contexts/ContextsActivatedTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/ContextsActivatedTest.java index 602f8838..b5a510c9 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/contexts/ContextsActivatedTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/ContextsActivatedTest.java @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.contexts; +package org.jboss.weld.junit.jupiter.contexts; import jakarta.enterprise.context.RequestScoped; import jakarta.enterprise.context.SessionScoped; import jakarta.inject.Inject; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -31,7 +31,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class ContextsActivatedTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/contexts/Foo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/Foo.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/contexts/Foo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/Foo.java index 7e03e106..4a3808c0 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/contexts/Foo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/Foo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.contexts; +package org.jboss.weld.junit.jupiter.contexts; import java.util.UUID; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/contexts/InvalidScopeTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/InvalidScopeTest.java similarity index 86% rename from junit5/src/test/java/org/jboss/weld/junit5/contexts/InvalidScopeTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/InvalidScopeTest.java index fcb1ec99..a9b34358 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/contexts/InvalidScopeTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/InvalidScopeTest.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.contexts; +package org.jboss.weld.junit.jupiter.contexts; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -26,7 +26,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class InvalidScopeTest { @Test diff --git a/junit4/src/test/java/org/jboss/weld/junit4/contexts/Oof.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/Oof.java similarity index 96% rename from junit4/src/test/java/org/jboss/weld/junit4/contexts/Oof.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/Oof.java index 42c7faea..0223cdc0 100644 --- a/junit4/src/test/java/org/jboss/weld/junit4/contexts/Oof.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/Oof.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit4.contexts; +package org.jboss.weld.junit.jupiter.contexts; import java.io.Serializable; import java.util.UUID; diff --git a/junit4/src/test/java/org/jboss/weld/junit4/contexts/RequestScopedProducer.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/RequestScopedProducer.java similarity index 86% rename from junit4/src/test/java/org/jboss/weld/junit4/contexts/RequestScopedProducer.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/RequestScopedProducer.java index 4543c28d..ec6bd752 100644 --- a/junit4/src/test/java/org/jboss/weld/junit4/contexts/RequestScopedProducer.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/RequestScopedProducer.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit4.contexts; +package org.jboss.weld.junit.jupiter.contexts; import jakarta.enterprise.context.Dependent; import jakarta.enterprise.context.RequestScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/contexts/SomeAnnotation.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/SomeAnnotation.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/contexts/SomeAnnotation.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/SomeAnnotation.java index e06966bc..729d5c7f 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/contexts/SomeAnnotation.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/SomeAnnotation.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.contexts; +package org.jboss.weld.junit.jupiter.contexts; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/contexts/events/ContextLifecycleEventsObserver.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/events/ContextLifecycleEventsObserver.java similarity index 97% rename from junit5/src/test/java/org/jboss/weld/junit5/contexts/events/ContextLifecycleEventsObserver.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/events/ContextLifecycleEventsObserver.java index f8b886bb..c0581569 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/contexts/events/ContextLifecycleEventsObserver.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/events/ContextLifecycleEventsObserver.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.contexts.events; +package org.jboss.weld.junit.jupiter.contexts.events; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/contexts/events/ContextLifecycleEventsTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/events/ContextLifecycleEventsTest.java similarity index 91% rename from junit5/src/test/java/org/jboss/weld/junit5/contexts/events/ContextLifecycleEventsTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/events/ContextLifecycleEventsTest.java index 56776e11..a45cc30b 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/contexts/events/ContextLifecycleEventsTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/contexts/events/ContextLifecycleEventsTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.contexts.events; +package org.jboss.weld.junit.jupiter.contexts.events; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -23,9 +23,9 @@ import jakarta.enterprise.context.RequestScoped; import jakarta.enterprise.context.SessionScoped; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/enricher/FooWeldJunitEnricher.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/enricher/FooWeldJunitEnricher.java similarity index 81% rename from junit5/src/test/java/org/jboss/weld/junit5/enricher/FooWeldJunitEnricher.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/enricher/FooWeldJunitEnricher.java index b2edd397..7f5cb1f2 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/enricher/FooWeldJunitEnricher.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/enricher/FooWeldJunitEnricher.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.enricher; +package org.jboss.weld.junit.jupiter.enricher; import org.jboss.weld.environment.se.Weld; -import org.jboss.weld.junit5.WeldInitiator.Builder; -import org.jboss.weld.junit5.WeldJunitEnricher; -import org.jboss.weld.junit5.basic.Foo; -import org.jboss.weld.junit5.enricher.disabled.WeldJunitEnricherDisabledTest; +import org.jboss.weld.junit.jupiter.WeldInitiator.Builder; +import org.jboss.weld.junit.jupiter.WeldJunitEnricher; +import org.jboss.weld.junit.jupiter.basic.Foo; +import org.jboss.weld.junit.jupiter.enricher.disabled.WeldJunitEnricherDisabledTest; import org.junit.jupiter.api.extension.ExtensionContext; public class FooWeldJunitEnricher implements WeldJunitEnricher { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/enricher/WeldJunitEnricherTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/enricher/WeldJunitEnricherTest.java similarity index 90% rename from junit5/src/test/java/org/jboss/weld/junit5/enricher/WeldJunitEnricherTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/enricher/WeldJunitEnricherTest.java index 75ecfa40..7ad609c5 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/enricher/WeldJunitEnricherTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/enricher/WeldJunitEnricherTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.enricher; +package org.jboss.weld.junit.jupiter.enricher; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.parallel.ResourceAccessMode.READ; @@ -22,8 +22,8 @@ import jakarta.inject.Inject; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.basic.Foo; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.basic.Foo; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.ResourceLock; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/enricher/disabled/WeldJunitEnricherDisabledTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/enricher/disabled/WeldJunitEnricherDisabledTest.java similarity index 88% rename from junit5/src/test/java/org/jboss/weld/junit5/enricher/disabled/WeldJunitEnricherDisabledTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/enricher/disabled/WeldJunitEnricherDisabledTest.java index 934d4441..7ce57c37 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/enricher/disabled/WeldJunitEnricherDisabledTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/enricher/disabled/WeldJunitEnricherDisabledTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.enricher.disabled; +package org.jboss.weld.junit.jupiter.enricher.disabled; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.parallel.Resources.SYSTEM_PROPERTIES; @@ -22,9 +22,9 @@ import jakarta.enterprise.inject.Instance; import jakarta.inject.Inject; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.basic.Foo; -import org.jboss.weld.junit5.enricher.FooWeldJunitEnricher; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.basic.Foo; +import org.jboss.weld.junit.jupiter.enricher.FooWeldJunitEnricher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/junit4/src/test/java/org/jboss/weld/junit4/event/DummyObserver.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/event/DummyObserver.java similarity index 92% rename from junit4/src/test/java/org/jboss/weld/junit4/event/DummyObserver.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/event/DummyObserver.java index 6724aec6..4ad0115c 100644 --- a/junit4/src/test/java/org/jboss/weld/junit4/event/DummyObserver.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/event/DummyObserver.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit4.event; +package org.jboss.weld.junit.jupiter.event; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; @@ -22,7 +22,7 @@ import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.event.Observes; -import org.jboss.weld.junit4.Foo; +import org.jboss.weld.junit.jupiter.basic.Foo; @ApplicationScoped public class DummyObserver { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/event/FireEventTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/event/FireEventTest.java similarity index 82% rename from junit5/src/test/java/org/jboss/weld/junit5/event/FireEventTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/event/FireEventTest.java index 16ea887d..b4bdab27 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/event/FireEventTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/event/FireEventTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.event; +package org.jboss.weld.junit.jupiter.event; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; -import org.jboss.weld.junit5.basic.Foo; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.junit.jupiter.basic.Foo; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -28,7 +28,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class FireEventTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/Bar.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/Bar.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/Bar.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/Bar.java index 0225e98e..bae26f51 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/Bar.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/Bar.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.explicitInjection; +package org.jboss.weld.junit.jupiter.explicitInjection; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/BeanWithQualifier.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/BeanWithQualifier.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/BeanWithQualifier.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/BeanWithQualifier.java index bf6df3e3..eb4afbeb 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/BeanWithQualifier.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/BeanWithQualifier.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.explicitInjection; +package org.jboss.weld.junit.jupiter.explicitInjection; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/CustomExtension.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/CustomExtension.java similarity index 97% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/CustomExtension.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/CustomExtension.java index e0477030..34528b5b 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/CustomExtension.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/CustomExtension.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.explicitInjection; +package org.jboss.weld.junit.jupiter.explicitInjection; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.ParameterContext; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionNestedClass2Test.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionNestedClass2Test.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionNestedClass2Test.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionNestedClass2Test.java index 3f83ff01..1e239e11 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionNestedClass2Test.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionNestedClass2Test.java @@ -1,15 +1,15 @@ -package org.jboss.weld.junit5.explicitInjection; +package org.jboss.weld.junit.jupiter.explicitInjection; import jakarta.enterprise.inject.Default; -import org.jboss.weld.junit5.ExplicitParamInjection; -import org.jboss.weld.junit5.WeldJunit5Extension; +import org.jboss.weld.junit.jupiter.ExplicitParamInjection; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) @ExplicitParamInjection(false) public class ExplicitParameterInjectionNestedClass2Test { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionNestedClassTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionNestedClassTest.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionNestedClassTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionNestedClassTest.java index 030255f5..19cd6d54 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionNestedClassTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionNestedClassTest.java @@ -1,9 +1,9 @@ -package org.jboss.weld.junit5.explicitInjection; +package org.jboss.weld.junit.jupiter.explicitInjection; import jakarta.enterprise.inject.Default; -import org.jboss.weld.junit5.ExplicitParamInjection; -import org.jboss.weld.junit5.WeldJunit5Extension; +import org.jboss.weld.junit.jupiter.ExplicitParamInjection; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -11,7 +11,7 @@ // Note that @ExtendWith(CustomExtension.class) has to be on each method separately. The inheritance of this would // otherwise cause failures for TwiceNestedTestClass2 and ThriceNestedClass where Weld claims all parameters. -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) @ExplicitParamInjection(true) public class ExplicitParameterInjectionNestedClassTest { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionViaClassAnnotationTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionViaClassAnnotationTest.java similarity index 88% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionViaClassAnnotationTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionViaClassAnnotationTest.java index 647a367e..27497b3c 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionViaClassAnnotationTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionViaClassAnnotationTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.explicitInjection; +package org.jboss.weld.junit.jupiter.explicitInjection; import jakarta.enterprise.inject.Default; -import org.jboss.weld.junit5.ExplicitParamInjection; -import org.jboss.weld.junit5.WeldJunit5Extension; +import org.jboss.weld.junit.jupiter.ExplicitParamInjection; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -28,7 +28,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) @ExplicitParamInjection public class ExplicitParameterInjectionViaClassAnnotationTest { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionViaMethodAnnotationTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionViaMethodAnnotationTest.java similarity index 91% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionViaMethodAnnotationTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionViaMethodAnnotationTest.java index f6986824..eda3dec6 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionViaMethodAnnotationTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionViaMethodAnnotationTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.explicitInjection; +package org.jboss.weld.junit.jupiter.explicitInjection; import jakarta.enterprise.inject.Default; -import org.jboss.weld.junit5.ExplicitParamInjection; -import org.jboss.weld.junit5.WeldJunit5Extension; +import org.jboss.weld.junit.jupiter.ExplicitParamInjection; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -28,7 +28,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class ExplicitParameterInjectionViaMethodAnnotationTest { @Test diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionViaPropertyTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionViaPropertyTest.java similarity index 85% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionViaPropertyTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionViaPropertyTest.java index 1d1cdabb..7800580e 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/ExplicitParameterInjectionViaPropertyTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/ExplicitParameterInjectionViaPropertyTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.explicitInjection; +package org.jboss.weld.junit.jupiter.explicitInjection; import jakarta.enterprise.inject.Default; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldJunit5Extension; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; @@ -37,7 +37,7 @@ public class ExplicitParameterInjectionViaPropertyTest { @BeforeAll public static void prepare() { - System.setProperty(WeldJunit5Extension.GLOBAL_EXPLICIT_PARAM_INJECTION, "true"); + System.setProperty(WeldJUnitJupiterExtension.GLOBAL_EXPLICIT_PARAM_INJECTION, "true"); } @Test @@ -56,6 +56,6 @@ public void testParametersNeedExtraAnnotation(@Default Foo foo, Bar bar, @MyQual @AfterAll public static void cleanUp() { - System.setProperty(WeldJunit5Extension.GLOBAL_EXPLICIT_PARAM_INJECTION, ""); + System.setProperty(WeldJUnitJupiterExtension.GLOBAL_EXPLICIT_PARAM_INJECTION, ""); } } diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/Foo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/Foo.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/Foo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/Foo.java index f211dd3c..0269b7cc 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/Foo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/Foo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.explicitInjection; +package org.jboss.weld.junit.jupiter.explicitInjection; import jakarta.enterprise.context.Dependent; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/MyQualifier.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/MyQualifier.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/MyQualifier.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/MyQualifier.java index 885a053e..a52e3380 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/MyQualifier.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/MyQualifier.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.explicitInjection; +package org.jboss.weld.junit.jupiter.explicitInjection; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/parameterizedTest/Foo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/parameterizedTest/Foo.java similarity index 77% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/parameterizedTest/Foo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/parameterizedTest/Foo.java index 8c686a9b..c73aef85 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/parameterizedTest/Foo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/parameterizedTest/Foo.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.explicitInjection.parameterizedTest; +package org.jboss.weld.junit.jupiter.explicitInjection.parameterizedTest; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.inject.Produces; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/parameterizedTest/ParameterizedTestExplicitInjectionTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/parameterizedTest/ParameterizedTestExplicitInjectionTest.java similarity index 90% rename from junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/parameterizedTest/ParameterizedTestExplicitInjectionTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/parameterizedTest/ParameterizedTestExplicitInjectionTest.java index a4f6b44e..b961b623 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/explicitInjection/parameterizedTest/ParameterizedTestExplicitInjectionTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/explicitInjection/parameterizedTest/ParameterizedTestExplicitInjectionTest.java @@ -1,16 +1,16 @@ -package org.jboss.weld.junit5.explicitInjection.parameterizedTest; +package org.jboss.weld.junit.jupiter.explicitInjection.parameterizedTest; import java.util.Set; import jakarta.enterprise.inject.Default; -import org.jboss.weld.junit5.WeldJunit5Extension; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class ParameterizedTestExplicitInjectionTest { public static final Set strings = Set.of("one", "two", "three"); diff --git a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/BarBean.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/BarBean.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/BarBean.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/BarBean.java index 7ccbf390..1f3dc6fb 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/BarBean.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/BarBean.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.extensionInjection; +package org.jboss.weld.junit.jupiter.extensionInjection; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/FooBean.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/FooBean.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/FooBean.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/FooBean.java index a789f0dc..1617d365 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/FooBean.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/FooBean.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.extensionInjection; +package org.jboss.weld.junit.jupiter.extensionInjection; import jakarta.enterprise.context.Dependent; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/MapProducer.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/MapProducer.java similarity index 89% rename from junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/MapProducer.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/MapProducer.java index 3018b508..6a1ad1f7 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/MapProducer.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/MapProducer.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.extensionInjection; +package org.jboss.weld.junit.jupiter.extensionInjection; import java.util.HashMap; import java.util.Map; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/MyQualifier.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/MyQualifier.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/MyQualifier.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/MyQualifier.java index e666e240..0401c2df 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/MyQualifier.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/MyQualifier.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.extensionInjection; +package org.jboss.weld.junit.jupiter.extensionInjection; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/SomeBean.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/SomeBean.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/SomeBean.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/SomeBean.java index f59ba08f..03618c87 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/SomeBean.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/SomeBean.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.extensionInjection; +package org.jboss.weld.junit.jupiter.extensionInjection; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/JUnit5ExtensionTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/WeldJUnitJupiterExtensionTest.java similarity index 90% rename from junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/JUnit5ExtensionTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/WeldJUnitJupiterExtensionTest.java index 3c58aa16..d1132aa0 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/extensionInjection/JUnit5ExtensionTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/extensionInjection/WeldJUnitJupiterExtensionTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.extensionInjection; +package org.jboss.weld.junit.jupiter.extensionInjection; import java.util.Map; @@ -22,19 +22,19 @@ import jakarta.enterprise.inject.Instance; import jakarta.inject.Inject; -import org.jboss.weld.junit5.WeldJunit5Extension; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; /** - * Basic test for JUnit 5 injection into parameter/field handled by Weld + * Basic test for JUnit Jupiter injection into parameter/field handled by Weld * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) -public class JUnit5ExtensionTest { +@ExtendWith(WeldJUnitJupiterExtension.class) +public class WeldJUnitJupiterExtensionTest { @Inject SomeBean bean; diff --git a/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/bean/Bar.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/bean/Bar.java new file mode 100644 index 00000000..4279b4ed --- /dev/null +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/bean/Bar.java @@ -0,0 +1,4 @@ +package org.jboss.weld.junit.jupiter.initiator.bean; + +public class Bar { +} diff --git a/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/bean/Foo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/bean/Foo.java new file mode 100644 index 00000000..184a26b8 --- /dev/null +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/bean/Foo.java @@ -0,0 +1,5 @@ +package org.jboss.weld.junit.jupiter.initiator.bean; + +public class Foo { + +} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/NestedClassesWeldInitiatorTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/NestedClassesWeldInitiatorTest.java similarity index 91% rename from junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/NestedClassesWeldInitiatorTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/NestedClassesWeldInitiatorTest.java index af570233..e8b37eeb 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/NestedClassesWeldInitiatorTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/NestedClassesWeldInitiatorTest.java @@ -1,13 +1,13 @@ -package org.jboss.weld.junit5.initiator.discovery; +package org.jboss.weld.junit.jupiter.initiator.discovery; import jakarta.inject.Inject; import org.jboss.weld.exceptions.UnsatisfiedResolutionException; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; -import org.jboss.weld.junit5.initiator.bean.Bar; -import org.jboss.weld.junit5.initiator.bean.Foo; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.junit.jupiter.initiator.bean.Bar; +import org.jboss.weld.junit.jupiter.initiator.bean.Foo; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/ObjectWeldInitiatorTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/ObjectWeldInitiatorTest.java similarity index 83% rename from junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/ObjectWeldInitiatorTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/ObjectWeldInitiatorTest.java index cfc5c630..204a044c 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/ObjectWeldInitiatorTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/ObjectWeldInitiatorTest.java @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.initiator.discovery; +package org.jboss.weld.junit.jupiter.initiator.discovery; import static org.junit.jupiter.api.Assertions.assertNotNull; import org.jboss.weld.environment.se.Weld; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; -import org.jboss.weld.junit5.initiator.bean.Foo; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.junit.jupiter.initiator.bean.Foo; import org.junit.jupiter.api.Test; /** diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/PrivateWeldInitiatorInSuperclassTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/PrivateWeldInitiatorInSuperclassTest.java similarity index 89% rename from junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/PrivateWeldInitiatorInSuperclassTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/PrivateWeldInitiatorInSuperclassTest.java index a770c4fd..da9329ab 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/PrivateWeldInitiatorInSuperclassTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/PrivateWeldInitiatorInSuperclassTest.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.initiator.discovery; +package org.jboss.weld.junit.jupiter.initiator.discovery; import static org.junit.jupiter.api.Assertions.assertNotNull; import org.jboss.weld.environment.se.WeldContainer; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.initiator.bean.Foo; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.initiator.bean.Foo; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Isolated; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/PrivateWeldInitiatorTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/PrivateWeldInitiatorTest.java similarity index 84% rename from junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/PrivateWeldInitiatorTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/PrivateWeldInitiatorTest.java index 1ac94b4c..eeaf0df5 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/PrivateWeldInitiatorTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/PrivateWeldInitiatorTest.java @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.initiator.discovery; +package org.jboss.weld.junit.jupiter.initiator.discovery; import static org.junit.jupiter.api.Assertions.assertNotNull; import org.jboss.weld.environment.se.Weld; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; -import org.jboss.weld.junit5.initiator.bean.Foo; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.junit.jupiter.initiator.bean.Foo; import org.junit.jupiter.api.Test; /** diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/ProtectedWeldInitiatorInSuperclassTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/ProtectedWeldInitiatorInSuperclassTest.java similarity index 88% rename from junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/ProtectedWeldInitiatorInSuperclassTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/ProtectedWeldInitiatorInSuperclassTest.java index 5d9af3c1..d1bf821c 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/ProtectedWeldInitiatorInSuperclassTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/ProtectedWeldInitiatorInSuperclassTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.initiator.discovery; +package org.jboss.weld.junit.jupiter.initiator.discovery; import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.initiator.bean.Foo; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.initiator.bean.Foo; import org.junit.jupiter.api.Test; /** diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SubclassWithWeldInitiatorTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SubclassWithWeldInitiatorTest.java similarity index 73% rename from junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SubclassWithWeldInitiatorTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SubclassWithWeldInitiatorTest.java index e6e05736..a94b3f92 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SubclassWithWeldInitiatorTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SubclassWithWeldInitiatorTest.java @@ -1,8 +1,8 @@ -package org.jboss.weld.junit5.initiator.discovery; +package org.jboss.weld.junit.jupiter.initiator.discovery; import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.jboss.weld.junit5.initiator.bean.Foo; +import org.jboss.weld.junit.jupiter.initiator.bean.Foo; import org.junit.jupiter.api.Test; public class SubclassWithWeldInitiatorTest extends SuperclassWithWeldInitiator { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SuperclassWithPrivateWeldInitiator.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SuperclassWithPrivateWeldInitiator.java similarity index 83% rename from junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SuperclassWithPrivateWeldInitiator.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SuperclassWithPrivateWeldInitiator.java index eb56d9ab..71c6129c 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SuperclassWithPrivateWeldInitiator.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SuperclassWithPrivateWeldInitiator.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.initiator.discovery; +package org.jboss.weld.junit.jupiter.initiator.discovery; import org.jboss.weld.environment.se.Weld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; -import org.jboss.weld.junit5.initiator.bean.Foo; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.junit.jupiter.initiator.bean.Foo; /** * diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SuperclassWithProtectedWeldInitiator.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SuperclassWithProtectedWeldInitiator.java similarity index 83% rename from junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SuperclassWithProtectedWeldInitiator.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SuperclassWithProtectedWeldInitiator.java index 3e218bf3..03f601cf 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SuperclassWithProtectedWeldInitiator.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SuperclassWithProtectedWeldInitiator.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.initiator.discovery; +package org.jboss.weld.junit.jupiter.initiator.discovery; import org.jboss.weld.environment.se.Weld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; -import org.jboss.weld.junit5.initiator.bean.Foo; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.junit.jupiter.initiator.bean.Foo; /** * diff --git a/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SuperclassWithWeldInitiator.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SuperclassWithWeldInitiator.java new file mode 100644 index 00000000..b767c435 --- /dev/null +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/initiator/discovery/SuperclassWithWeldInitiator.java @@ -0,0 +1,16 @@ +package org.jboss.weld.junit.jupiter.initiator.discovery; + +import org.jboss.weld.environment.se.Weld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.junit.jupiter.initiator.bean.Foo; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(WeldJUnitJupiterExtension.class) +public abstract class SuperclassWithWeldInitiator { + @WeldSetup + public WeldInitiator weld = WeldInitiator + .of(new Weld() + .addBeanClass(Foo.class)); +} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/interceptor/MockInterceptorTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/interceptor/MockInterceptorTest.java similarity index 93% rename from junit5/src/test/java/org/jboss/weld/junit5/interceptor/MockInterceptorTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/interceptor/MockInterceptorTest.java index b5437e9d..eac4c518 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/interceptor/MockInterceptorTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/interceptor/MockInterceptorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.interceptor; +package org.jboss.weld.junit.jupiter.interceptor; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.TYPE; @@ -33,10 +33,10 @@ import jakarta.enterprise.util.AnnotationLiteral; import jakarta.interceptor.InterceptorBinding; -import org.jboss.weld.junit.MockInterceptor; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.testing.MockInterceptor; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/nested/MyBean.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/nested/MyBean.java similarity index 79% rename from junit5/src/test/java/org/jboss/weld/junit5/nested/MyBean.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/nested/MyBean.java index 3772e293..85031c98 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/nested/MyBean.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/nested/MyBean.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.nested; +package org.jboss.weld.junit.jupiter.nested; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/nested/NestedTestClassTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/nested/NestedTestClassTest.java similarity index 83% rename from junit5/src/test/java/org/jboss/weld/junit5/nested/NestedTestClassTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/nested/NestedTestClassTest.java index 709133d7..ca5d6383 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/nested/NestedTestClassTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/nested/NestedTestClassTest.java @@ -1,10 +1,10 @@ -package org.jboss.weld.junit5.nested; +package org.jboss.weld.junit.jupiter.nested; import jakarta.inject.Inject; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; @@ -16,7 +16,7 @@ * {@code @BeforeEach} should still be invoked for nested classes. For the below scenario to work, * we need to make the parent class an injection target as well. */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class NestedTestClassTest { @WeldSetup diff --git a/junit5/src/test/java/org/jboss/weld/junit5/ofpackage/Alpha.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/ofpackage/Alpha.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/ofpackage/Alpha.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/ofpackage/Alpha.java index 44ec4c86..d14d1df7 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/ofpackage/Alpha.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/ofpackage/Alpha.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.ofpackage; +package org.jboss.weld.junit.jupiter.ofpackage; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.Dependent; diff --git a/junit4/src/test/java/org/jboss/weld/junit4/ofpackage/Bravo.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/ofpackage/Bravo.java similarity index 95% rename from junit4/src/test/java/org/jboss/weld/junit4/ofpackage/Bravo.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/ofpackage/Bravo.java index e048c9c2..4d8212b6 100644 --- a/junit4/src/test/java/org/jboss/weld/junit4/ofpackage/Bravo.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/ofpackage/Bravo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit4.ofpackage; +package org.jboss.weld.junit.jupiter.ofpackage; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.Dependent; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/ofpackage/OfPackageTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/ofpackage/OfPackageTest.java similarity index 81% rename from junit5/src/test/java/org/jboss/weld/junit5/ofpackage/OfPackageTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/ofpackage/OfPackageTest.java index 33bb2b1d..d74b9a0a 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/ofpackage/OfPackageTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/ofpackage/OfPackageTest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.ofpackage; +package org.jboss.weld.junit.jupiter.ofpackage; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; -import org.jboss.weld.junit5.basic.Foo; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; +import org.jboss.weld.junit.jupiter.basic.Foo; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -28,7 +28,7 @@ * * @author Matej Novotny */ -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) public class OfPackageTest { @WeldSetup diff --git a/junit4/src/test/java/org/jboss/weld/junit4/resources/DummySessionBean.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/DummySessionBean.java similarity index 72% rename from junit4/src/test/java/org/jboss/weld/junit4/resources/DummySessionBean.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/DummySessionBean.java index 17aed2e6..243fbd89 100644 --- a/junit4/src/test/java/org/jboss/weld/junit4/resources/DummySessionBean.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/DummySessionBean.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit4.resources; +package org.jboss.weld.junit.jupiter.resources; public class DummySessionBean { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/resources/FooEjbs.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/FooEjbs.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/resources/FooEjbs.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/FooEjbs.java index 42d500cd..131ef7e3 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/resources/FooEjbs.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/FooEjbs.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.resources; +package org.jboss.weld.junit.jupiter.resources; import jakarta.ejb.EJB; import jakarta.enterprise.context.Dependent; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/resources/FooJpa.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/FooJpa.java similarity index 96% rename from junit5/src/test/java/org/jboss/weld/junit5/resources/FooJpa.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/FooJpa.java index 55fd6f84..0cde78d8 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/resources/FooJpa.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/FooJpa.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.resources; +package org.jboss.weld.junit.jupiter.resources; import jakarta.enterprise.context.Dependent; import jakarta.persistence.EntityManager; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/resources/FooResources.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/FooResources.java similarity index 95% rename from junit5/src/test/java/org/jboss/weld/junit5/resources/FooResources.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/FooResources.java index 07c48914..13f1bfeb 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/resources/FooResources.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/FooResources.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.resources; +package org.jboss.weld.junit.jupiter.resources; import jakarta.annotation.Resource; import jakarta.enterprise.context.Dependent; diff --git a/junit5/src/test/java/org/jboss/weld/junit5/resources/InjectResourcesTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/InjectResourcesTest.java similarity index 98% rename from junit5/src/test/java/org/jboss/weld/junit5/resources/InjectResourcesTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/InjectResourcesTest.java index 9e798dfe..59942c7e 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/resources/InjectResourcesTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/resources/InjectResourcesTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.resources; +package org.jboss.weld.junit.jupiter.resources; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -43,9 +43,9 @@ import jakarta.persistence.criteria.CriteriaUpdate; import jakarta.persistence.metamodel.Metamodel; -import org.jboss.weld.junit5.EnableWeld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.EnableWeld; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Test; /** diff --git a/junit5/src/test/java/org/jboss/weld/junit5/testLifecycle/PerClassLifecycleChildTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/testLifecycle/PerClassLifecycleChildTest.java similarity index 89% rename from junit5/src/test/java/org/jboss/weld/junit5/testLifecycle/PerClassLifecycleChildTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/testLifecycle/PerClassLifecycleChildTest.java index 3a203599..0398fd49 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/testLifecycle/PerClassLifecycleChildTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/testLifecycle/PerClassLifecycleChildTest.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit5.testLifecycle; +package org.jboss.weld.junit.jupiter.testLifecycle; // all configuration is inherited, so are test methods // we should recognize this class as having per-class lifecycle and bootstrap Weld accordingly diff --git a/junit5/src/test/java/org/jboss/weld/junit5/testLifecycle/PerClassLifecycleTest.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/testLifecycle/PerClassLifecycleTest.java similarity index 89% rename from junit5/src/test/java/org/jboss/weld/junit5/testLifecycle/PerClassLifecycleTest.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/testLifecycle/PerClassLifecycleTest.java index ef159866..ba3c4f2e 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/testLifecycle/PerClassLifecycleTest.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/testLifecycle/PerClassLifecycleTest.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.testLifecycle; +package org.jboss.weld.junit.jupiter.testLifecycle; import org.jboss.weld.environment.se.Weld; import org.jboss.weld.environment.se.WeldContainer; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; +import org.jboss.weld.junit.jupiter.WeldInitiator; +import org.jboss.weld.junit.jupiter.WeldJUnitJupiterExtension; +import org.jboss.weld.junit.jupiter.WeldSetup; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; @@ -33,7 +33,7 @@ * @author Matej Novotny */ @Isolated -@ExtendWith(WeldJunit5Extension.class) +@ExtendWith(WeldJUnitJupiterExtension.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class PerClassLifecycleTest { diff --git a/junit5/src/test/java/org/jboss/weld/junit5/testLifecycle/PlainBean.java b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/testLifecycle/PlainBean.java similarity index 94% rename from junit5/src/test/java/org/jboss/weld/junit5/testLifecycle/PlainBean.java rename to junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/testLifecycle/PlainBean.java index 73b0de02..c581073d 100644 --- a/junit5/src/test/java/org/jboss/weld/junit5/testLifecycle/PlainBean.java +++ b/junit-jupiter/src/test/java/org/jboss/weld/junit/jupiter/testLifecycle/PlainBean.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit5.testLifecycle; +package org.jboss.weld.junit.jupiter.testLifecycle; import jakarta.enterprise.context.ApplicationScoped; diff --git a/junit-jupiter/src/test/resources/META-INF/services/org.jboss.weld.junit.jupiter.WeldJunitEnricher b/junit-jupiter/src/test/resources/META-INF/services/org.jboss.weld.junit.jupiter.WeldJunitEnricher new file mode 100644 index 00000000..bd77f22b --- /dev/null +++ b/junit-jupiter/src/test/resources/META-INF/services/org.jboss.weld.junit.jupiter.WeldJunitEnricher @@ -0,0 +1 @@ +org.jboss.weld.junit.jupiter.enricher.FooWeldJunitEnricher \ No newline at end of file diff --git a/junit5/src/test/resources/junit-platform.properties b/junit-jupiter/src/test/resources/junit-platform.properties similarity index 100% rename from junit5/src/test/resources/junit-platform.properties rename to junit-jupiter/src/test/resources/junit-platform.properties diff --git a/junit4/src/test/resources/logging.properties b/junit-jupiter/src/test/resources/logging.properties similarity index 100% rename from junit4/src/test/resources/logging.properties rename to junit-jupiter/src/test/resources/logging.properties diff --git a/junit4/README.md b/junit4/README.md deleted file mode 100644 index 68ee5efe..00000000 --- a/junit4/README.md +++ /dev/null @@ -1,315 +0,0 @@ -# Weld JUnit 4 Extension - -Weld JUnit 4 extension uses the original JUnit extension system via `@Rule` or `@ClassRule` annotation. -It requires JUnit 4.9+ and Java 17. - -## Table of contents - -* [Maven Artifact](#maven-artifact) -* [WeldInitiator](#weldinitiator) - * [Flat Deployment](#flat-deployment) - * [Convenient Starting Points](#convenient-starting-points) - * [Test class injection](#test-class-injection) - * [Activating context for a normal scope](#activating-context-for-a-normal-scope) - * [Adding mock beans](#adding-mock-beans) - * [Adding mock interceptors](#adding-mock-interceptors) - * [Mock injection services](#mock-injection-services) - -## Maven Artifact - -```xml - - org.jboss.weld - weld-junit4 - ${version.weld-junit} - -``` - -## WeldInitiator - -`org.jboss.weld.junit4.WeldInitiator` is a `TestRule` (JUnit 4.9+) which allows to *start/stop* -a Weld container per test method execution if used as `@Rule` or per test class if used as `@ClassRule`. -The container is configured through a provided `org.jboss.weld.environment.se.Weld` instance. -By default, the container is optimized for testing purposes, i.e. with automatic discovery and concurrent deployment disabled (see also `WeldInitiator.createWeld()`). -However, it is possible to provide a customized `Weld` instance - see also `WeldInitiator.of(Weld)` and `WeldInitiator.from(Weld)` methods. -`WeldInitiator` also implements `jakarta.enterprise.inject.Instance` and therefore might be used to perform programmatic lookup of bean instances. - -### Flat Deployment - -Unlike when using [Arquillian Weld embedded container](https://github.com/arquillian/arquillian-container-weld), bean archive isolation is enabled by default. -This behaviour can be changed by setting a system property `org.jboss.weld.se.archive.isolation` to `false` or through the `Weld.property()` method. -In that case, Weld will use a _"flat"_ deployment structure - all bean classes share the same bean archive and all beans.xml descriptors are automatically merged into one. -Thus alternatives, interceptors and decorators selected/enabled for a bean archive will be enabled for the whole application. - -### Convenient Starting Points - -A convenient static method `WeldInitiator.of(Class...)` is also provided - in this case, the container is optimized for testing purposes and only the given bean classes are considered. - -```java -import static org.junit.Assert.assertEquals; - -import org.junit.Rule; -import org.junit.Test; - -class SimpleTest { - - @Rule - public WeldInitiator weld = WeldInitiator.of(Foo.class); - - @Test - public void testFoo() { - // Note that Weld container is started automatically - - // WeldInitiator can be used to perform programmatic lookup of beans - assertEquals("baz", weld.select(Foo.class).get().getBaz()); - - // WeldInitiator can be used to fire a CDI event - weld.event().select(Baz.class).fire(new Baz()); - } - -} -``` - -It's also possible to use `WeldInitiator.ofTestPackage()` - the container is optimized for testing purposes and all the classes from the test class package are added automatically. - -```java - -class AnotherSimpleTest { - - @Rule - public WeldInitiator weld = WeldInitiator.ofTestPackage(); - - @Test - public void testFoo() { - // Alpha comes from the same package as AnotherSimpleTest - assertEquals(1, weld.select(Alpha.class).ping()); - } - -} -``` - -Furthermore, `WeldInitiator.Builder` can be used to customize the final `WeldInitiator` instance, e.g. to *activate a context for a given normal scope* or to *inject the test class*. - -#### Test class injection - -Sometimes, the programmatic lookup can imply unnecessary overhead, e.g. an annotation literal must be used for parameterized types and qualifiers with members. -`WeldInitiator.Builder.inject(Object)` instructs the rule to inject the given non-contextual instance once the container is started, i.e. during each test method execution: - -```java -class InjectTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(Foo.class).inject(this).build(); - - // Gets injected by WeldInitiator when testFoo() is about to be run - @Inject - @MyQualifier - Foo foo; - - @Test - public void testFoo() { - assertEquals(42, foo.getValue()); - } -} -``` - -When using the `WeldInitiator` as `@ClassRule` to only have one weld instance for the whole test class, -`inject(this)` cannot be used, as no `this` reference is available yet and it cannot be done on the `WeldInitiator` itself. -For this situation `WeldInitiator` provides the method `getTestClassInjectorRule()` that returns a `MethodRule` -which can be used as a `@Rule` and injects into the test instance automatically: - -```java -class InjectTest { - - @ClassRule - public static WeldInitiator weld = WeldInitiator.from(Foo.class).build(); - - @Rule - public MethodRule testClassInjectorRule = weld.getTestClassInjectorRule(); - - // Gets injected by testClassInjector when testFoo() is about to be run - @Inject - @MyQualifier - Foo foo; - - @Test - public void testFoo() { - assertEquals(42, foo.getValue()); - } -} -``` - -#### Activating context for a normal scope - -`WeldInitiator.Builder.activate(Object)` makes it possible to activate and deactivate contexts for the specified normal scopes for each test method execution: - -```java -class ContextsActivatedTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(Foo.class, Oof.class) - .activate(RequestScoped.class, SessionScoped.class).build(); - - @Test - public void testFoo() { - // Contexts for @RequestScoped and @SessionScoped are active! - // Foo is @RequestScoped - weld.select(Foo.class).get().doSomethingImportant(); - // Oof is @SessionScoped - weld.select(Oof.class).get().doSomethingVeryImportant(); - } -} -``` - -#### Adding mock beans - -Sometimes you might need to add a mock for a bean that cannot be part of the test deployment, e.g. the original bean implementation has dependencies which cannot be satisfied in the test environment. -Very often, it's an ideal use case for mocking libraries, ie. to create a bean instance with the desired behavior. -In this case, there are two options. -The first option is to add a [producer method](http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#producer_method) to the test class and add the test class to the deployment. -The test class will be recognized as a bean and therefore the producer will also be discovered. - -```java -interface Bar { - String ping(); -} - -class Foo { - @Inject - Bar bar; - - String ping() { - return bar.ping(); - } -} - -class TestClassProducerTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(Foo.class, TestClassProducerTest.class).build(); - - @ApplicationScoped - @Produces - Bar produceBar() { - // Mock object provided by Mockito - return Mockito.when(Mockito.mock(Bar.class).ping()).thenReturn("pong").getMock(); - } - - @Test - public void testFoo() { - Assert.assertEquals("pong", weld.select(Foo.class).get().ping()); - } -} -``` - -This should work in most of the cases (assuming the test class [meets some conditions](http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#what_classes_are_beans)) although it's a little bit cumbersome. -The second option is `WeldInitiator.Builder.addBeans(Bean...)` which makes it possible to add beans during `AfterBeanDiscovery` phase easily. -You can provide your own `jakarta.enterprise.inject.spi.Bean` implementation or make use of existing solutions such as DeltaSpike [BeanBuilder](https://github.com/apache/deltaspike/blob/master/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/bean/BeanBuilder.java) or for most use cases a convenient `org.jboss.weld.junit.MockBean` should be sufficient. -Use `org.jboss.weld.junit.MockBean.builder()` to obtain a new builder instance. - -```java -interface Bar { - String ping(); -} - -class Foo { - @Inject - Bar bar; - - String ping() { - return bar.ping(); - } -} - -class AddBeanTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(Foo.class).addBeans(createBarBean()).build(); - - static Bean createBarBean() { - return MockBean.builder() - .types(Bar.class) - .scope(ApplicationScoped.class) - .creating( - // Mock object provided by Mockito - Mockito.when(Mockito.mock(Bar.class).ping()).thenReturn("pong").getMock()) - .build(); - } - - @Test - public void testFoo() { - assertEquals("pong", weld.select(Foo.class).get().ping()); - } -} -``` - -#### Adding mock interceptors - -Sometimes it might be useful to add a mock interceptor, e.g. if an interceptor implementation requires some environment-specific features. -For this use case the `org.jboss.weld.junit.MockInterceptor` is a perfect match: - -```java -@FooBinding -class Foo { - boolean ping() { - return true; - } -} - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@InterceptorBinding -@interface FooBinding { - - @SuppressWarnings("serial") - static final class Literal extends AnnotationLiteral implements FooBinding { - public static final Literal INSTANCE = new Literal(); - }; - } -} - -class MockInterceptorTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(Foo.class).addBeans( - MockInterceptor.withBindings(FooBinding.Literal.INSTANCE).aroundInvoke((ctx, b) -> { - return false; - })).build(); - - - @Test - public void testInterception() { - Assert.assertFalse(weld.select(Foo.class).get().ping()); - } -} -``` - -#### Mock injection services - -If a bean under the test declares a non-CDI injection point (such as `@Resource`) a mock injection service must be installed. -`WeldInitiator` builder comes with several convenient methods which allow to easily mock the Weld SPI: - -* `bindResource()` - to handle `@Resource` -* `setEjbFactory()` - to handle `@EJB` -* `setPersistenceUnitFactory()` - to handle `@PersistenceUnit` -* `setPersistenceContextFactory()` - to handle `@PersistenceContext` - -```java -class Baz { - - @Resource(lookup = "somejndiname") - String coolResource; - -} - -class MyTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(Baz.class).bindResource("somejndiname", "coolString").build(); - - @Test - public void test(Baz baz) { - Assertions.assertEquals("coolString", baz.coolResource); - } -} -``` diff --git a/junit4/pom.xml b/junit4/pom.xml deleted file mode 100644 index 786fef63..00000000 --- a/junit4/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - 4.0.0 - - Weld JUnit 4 Extension - - - org.jboss.weld - weld-junit-parent - 5.0.3-SNAPSHOT - - - weld-junit4 - - - - - org.jboss.weld.se - weld-se-core - - - - org.jboss.weld - weld-junit-common - - - - junit - junit - - - - - org.mockito - mockito-core - - - - jakarta.ejb - jakarta.ejb-api - - - - jakarta.persistence - jakarta.persistence-api - test - - - - org.jboss.weld.module - weld-ejb - ${version.weld} - test - - - - - diff --git a/junit4/src/main/java/org/jboss/weld/junit4/WeldInitiator.java b/junit4/src/main/java/org/jboss/weld/junit4/WeldInitiator.java deleted file mode 100644 index e28a102c..00000000 --- a/junit4/src/main/java/org/jboss/weld/junit4/WeldInitiator.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4; - -import java.lang.annotation.Annotation; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Function; - -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.InjectionPoint; - -import org.jboss.weld.environment.se.Weld; -import org.jboss.weld.junit.AbstractWeldInitiator; -import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.rules.MethodRule; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; - -/** - * JUnit 4 initiator - test rule which starts a Weld container per each test method execution: - * - *

- * import org.junit.Rule;
- *
- * public class SimpleTest {
- *
- *     @Rule
- *     public WeldInitiator weld = WeldInitiator.of(Foo.class);
- *
- *     @Test
- *     public void testFoo() {
- *         // Weld container is started automatically
- *         // WeldInitiator can be used to perform programmatic lookup of beans
- *         assertEquals("baz", weld.select(Foo.class).get().getBaz());
- *     }
- * }
- * 
- * - *

- * Alternatively, the container can be shared accross all test methods: - *

- * - *
- * import org.junit.ClassRule;
- *
- * public class ClassRuleTest {
- *
- *     @ClassRule
- *     public WeldInitiator weld = WeldInitiator.of(Foo.class);
- *
- *     @Test
- *     public void test1() {
- *         // Weld container is started automatically
- *         // WeldInitiator can be used to perform programmatic lookup of beans
- *         assertEquals("baz", weld.select(Foo.class).get().getBaz());
- *     }
- *
- *     @Test
- *     public void test2() {
- *         // This test method is using the same Weld container as test1()
- *     }
- * }
- * 
- * - *

- * {@link WeldInitiator} implements {@link Instance} and therefore might be used to perform programmatic lookup of bean - * instances. - *

- * - * @author Martin Kouba - * @author Matej Novotny - */ -public class WeldInitiator extends AbstractWeldInitiator implements TestRule { - - /** - * The container is configured with the result of {@link #createWeld()} method and the given bean classes are added. If any - * of added classes is an extension, it is automatically recognized and enabled. - * - * @param beanClasses - * @return a new test rule - * @see Weld#beanClasses(Class...) - */ - public static WeldInitiator of(Class... beanClasses) { - return from(beanClasses).build(); - } - - /** - * The container is configured through a provided {@link Weld} instance. - * - * @param weld - * @return a new test rule - */ - public static WeldInitiator of(Weld weld) { - return from(weld).build(); - } - - /** - * The container is configured with the result of {@link #createWeld()} method and all the classes from the test class - * package are added. - * - * @return a new test rule - */ - public static WeldInitiator ofTestPackage() { - return fromTestPackage().build(); - } - - /** - * The container is instructed to do automatic bean discovery, the resulting bean archive is NOT synthetic. Note that this - * requires beans.xml to be present. It is equals to {@code WeldInitiator.of(new Weld())} invocation. - * - * @return a new test rule - */ - public static WeldInitiator performDefaultDiscovery() { - return of(new Weld()); - } - - /** - * Create a builder instance. - * - * @param weld - * @return a builder instance - * @see #of(Class...) - */ - public static Builder from(Class... beanClasses) { - Weld weld = createWeld(); - for (Class clazz : beanClasses) { - if (Extension.class.isAssignableFrom(clazz)) { - weld.addExtensions((Class) clazz); - } else { - weld.addBeanClass(clazz); - } - } - return from(weld); - } - - /** - * Create a builder instance. - * - * @param weld - * @return a builder instance - * @see #of(Weld) - */ - public static Builder from(Weld weld) { - return new Builder(weld); - } - - /** - * Create a builder instance. - * - * @return a builder instance - * @see #ofTestPackage() - */ - public static Builder fromTestPackage() { - return new Builder(null); - } - - /** - * The returned {@link Weld} instance has: - *
    - *
  • automatic discovery disabled
  • - *
  • concurrent deployment disabled
  • - *
- * - * @return a new {@link Weld} instance suitable for testing - * @see AbstractWeldInitiator#createDefaultWeld() - */ - public static Weld createWeld() { - return AbstractWeldInitiator.createDefaultWeld(); - } - - /** - * This builder can be used to customize the final {@link WeldInitiator} instance, e.g. to activate a context for a given - * normal scope. - */ - public static final class Builder extends AbstractBuilder { - - private Builder(Weld weld) { - super(weld); - } - - @Override - protected Builder self() { - return this; - } - - @Override - protected WeldInitiator build(Weld weld, List instancesToInject, - Set> scopesToActivate, Set> beans) { - return new WeldInitiator(weld, instancesToInject, scopesToActivate, beans, resources, getEjbFactory(), - getPersistenceUnitFactory(), getPersistenceContextFactory()); - } - - } - - private WeldInitiator(Weld weld, List instancesToInject, Set> scopesToActivate, - Set> beans, - Map resources, Function ejbFactory, - Function persistenceUnitFactory, - Function persistenceContextFactory) { - super(weld, instancesToInject, scopesToActivate, beans, resources, ejbFactory, persistenceUnitFactory, - persistenceContextFactory); - } - - /** - * Returns a {@link MethodRule} that can be used as a {@link Rule} to inject into the test class instance. - * When using this Weld initiator as {@code Rule}, the same can be achieved by calling - * {@link AbstractBuilder#inject(Object) inject(this)} on the builder. But when using this Weld initiator as - * {@link ClassRule}, there is no {@code this} reference available. In that case this method can be used - * as {@code Rule} to do the test class injection part. - * - *

- * Example: - * - *

{@code
-     * }@{@code ClassRule
-     * public static WeldInitiator weld = WeldInitiator.from(Foo.class).build();
-     *
-     * }@{@code Rule
-     * public MethodRule testClassInjectorRule = weld.getTestClassInjectorRule();
-     * }
- * - * @return the test class injector rule - */ - public MethodRule getTestClassInjectorRule() { - return (base, method, target) -> new Statement() { - @Override - public void evaluate() throws Throwable { - try (AutoCloseable contextReleaser = injectNonContextual(target)) { - base.evaluate(); - } - } - }; - } - - @Override - public Statement apply(final Statement base, final Description description) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - Weld weld = WeldInitiator.this.weld; - if (weld == null) { - // Null in case of fromTestPackage() is used - weld = createWeld().addPackage(false, description.getTestClass()); - } - initWeldContainer(weld); - try { - base.evaluate(); - } finally { - shutdownWeldContainer(); - } - } - }; - } -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/BeanManagerTest.java b/junit4/src/test/java/org/jboss/weld/junit4/BeanManagerTest.java deleted file mode 100644 index 2fc9b2a3..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/BeanManagerTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4; - -import static org.junit.Assert.assertEquals; - -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class BeanManagerTest { - - @Rule - public WeldInitiator weld = WeldInitiator.of(Foo.class); - - @Test - public void testFooBean() { - assertEquals(1, weld.getBeanManager().getBeans(Foo.class).size()); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/ContainerNotRunningTest.java b/junit4/src/test/java/org/jboss/weld/junit4/ContainerNotRunningTest.java deleted file mode 100644 index e47370c1..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/ContainerNotRunningTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4; - -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class ContainerNotRunningTest { - - @Rule - public WeldInitiator weld = WeldInitiator.of(WeldInitiator.createWeld().beanClasses(Foo.class)); - - @Test(expected = IllegalStateException.class) - public void testFoo() { - // Shutdown container manually - weld.shutdown(); - // This should throw IllegalStateException - weld.select(Foo.class).get(); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/CustomWeldTest.java b/junit4/src/test/java/org/jboss/weld/junit4/CustomWeldTest.java deleted file mode 100644 index faaa4c33..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/CustomWeldTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4; - -import static org.jboss.weld.junit4.WeldInitiator.createWeld; -import static org.junit.Assert.assertEquals; - -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class CustomWeldTest { - - @Rule - public WeldInitiator weld = WeldInitiator - .of(createWeld().alternatives(FooAlternative.class).beanClasses(Foo.class, FooAlternative.class)); - - @Test - public void testFooAlternative() { - assertEquals("BAZ", weld.select(Foo.class).get().getBar()); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/Foo.java b/junit4/src/test/java/org/jboss/weld/junit4/Foo.java deleted file mode 100644 index c80aa458..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/Foo.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class Foo { - - private String bar; - - @PostConstruct - public void init() { - bar = "baz"; - } - - public String getBar() { - return bar; - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/FooAlternative.java b/junit4/src/test/java/org/jboss/weld/junit4/FooAlternative.java deleted file mode 100644 index 16ee1aab..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/FooAlternative.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4; - -import jakarta.enterprise.inject.Alternative; - -@Alternative -public class FooAlternative extends Foo { - - @Override - public String getBar() { - return super.getBar().toUpperCase(); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/SimpleTest.java b/junit4/src/test/java/org/jboss/weld/junit4/SimpleTest.java deleted file mode 100644 index db46d883..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/SimpleTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4; - -import static org.junit.Assert.assertEquals; - -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class SimpleTest { - - @Rule - public WeldInitiator weld = WeldInitiator.of(Foo.class); - - @Test - public void testFoo() { - assertEquals("baz", weld.select(Foo.class).get().getBar()); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/AddBeanTest.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/AddBeanTest.java deleted file mode 100644 index 5a5c8db8..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/AddBeanTest.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.bean; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.atLeastOnce; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import java.util.List; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.util.TypeLiteral; - -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Rule; -import org.junit.Test; -import org.mockito.Mockito; - -/** - * - * @author Martin Kouba - */ -public class AddBeanTest { - - private static final AtomicInteger SEQUENCE = new AtomicInteger(0); - - @Rule - public WeldInitiator weld = WeldInitiator.from(Blue.class) - .addBeans(MockBean.of(mock(MyService.class), MyService.class)) - .addBeans(MockBean.read(BlueToDiscover.class).scope(Dependent.class).build()) - .addBeans(createListBean(), createSequenceBean(), createIdSupplierBean()) - .build(); - - @SuppressWarnings("serial") - static Bean createListBean() { - return MockBean.builder() - .types(new TypeLiteral>() { - }.getType()) - .qualifiers(Meaty.Literal.INSTANCE) - .creating( - // Mock object provided by Mockito - when(mock(List.class).get(0)).thenReturn("42").getMock()) - .build(); - } - - static Bean createSequenceBean() { - return MockBean. builder() - .types(Integer.class) - .qualifiers(Meaty.Literal.INSTANCE) - .create(ctx -> SEQUENCE.incrementAndGet()) - .build(); - } - - static Bean createIdSupplierBean() { - return MockBean. builder() - .types(IdSupplier.class) - .scope(ApplicationScoped.class) - .create(ctx -> new IdSupplier(UUID.randomUUID().toString())).build(); - } - - @Test - public void testBeansAdded() { - // Blue injects @Meaty List - assertEquals("42", weld.select(Blue.class).get().getStringList().get(0)); - - // Each Bean.create() increments the sequence - SEQUENCE.set(0); - for (int i = 1; i < 11; i++) { - assertEquals(Integer.valueOf(i), - weld.select(Integer.class, Meaty.Literal.INSTANCE).get()); - } - - // Mock with default settings - MyService myService = weld.select(MyService.class).get(); - myService.doBusiness("Adalbert"); - Mockito.verify(myService, atLeastOnce()).doBusiness(anyString()); - - // Test applicaction scoped bean - assertEquals(weld.select(IdSupplier.class).get().getId(), weld.select(IdSupplier.class).get().getId()); - - // The scope is changed to @Dependent - BlueToDiscover blue1 = weld.select(BlueToDiscover.class).get(); - BlueToDiscover blue2 = weld.select(BlueToDiscover.class).get(); - assertNotNull(blue1.getId()); - assertNotNull(blue2.getId()); - assertNotEquals(blue1.getId(), blue2.getId()); - Set> beans = weld.getBeanManager().getBeans("blue"); - assertEquals(1, beans.size()); - } - - interface MyService { - - void doBusiness(String name); - - } - - static class IdSupplier { - - private final String id; - - public IdSupplier(String id) { - this.id = id; - } - - String getId() { - return id; - } - - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/AddGloballyEnabledAlternativeTest.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/AddGloballyEnabledAlternativeTest.java deleted file mode 100644 index 9e395ad0..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/AddGloballyEnabledAlternativeTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.jboss.weld.junit4.bean; - -import java.util.List; -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.util.TypeLiteral; - -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.mockito.Mockito; - -/** - * Tests {@link org.jboss.weld.junit.MockBean} adding a bean that is a globally enabled alternative. - * - * @author Matej Novotny - */ -public class AddGloballyEnabledAlternativeTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(Bar.class) - .addBeans(createFooAlternativeBean(), createListBean()) - .build(); - - public static Bean createFooAlternativeBean() { - return MockBean.read(Foo.class) - .priority(3) - .alternative(true) - .addQualifier(Meaty.Literal.INSTANCE) - .build(); - } - - static Bean createListBean() { - return MockBean.builder() - .types(new TypeLiteral>() { - }.getType()) - .globallySelectedAlternative(2) - .creating( - // Mock object provided by Mockito - Mockito.when(Mockito.mock(List.class).get(0)).thenReturn("42").getMock()) - .build(); - } - - @Test - public void testAllBeansAreAddedAndCanBeSelected() { - Bar bar = weld.select(Bar.class).get(); - Assert.assertNotNull(bar.getFoo()); - Assert.assertNotNull(bar.getSomeList()); - Assert.assertEquals("42", bar.getSomeList().get(0)); - - // assert all of these are actually alternatives (enabled) - Set> beans = weld.getBeanManager().getBeans(Foo.class, Meaty.Literal.INSTANCE); - Assert.assertEquals(1, beans.size()); - Assert.assertTrue(beans.iterator().next().isAlternative()); - - beans = weld.getBeanManager().getBeans(new TypeLiteral>() { - }.getType()); - Assert.assertEquals(1, beans.size()); - Assert.assertTrue(beans.iterator().next().isAlternative()); - } -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/AddPassivatingBeanTest.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/AddPassivatingBeanTest.java deleted file mode 100644 index 051d89d3..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/AddPassivatingBeanTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.bean; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import java.util.List; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.util.TypeLiteral; - -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class AddPassivatingBeanTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(List.class).addBeans(createListBean()).activate(SessionScoped.class).build(); - - @SuppressWarnings("serial") - static Bean createListBean() { - return MockBean.builder() - .types(new TypeLiteral>() { - }.getType()) - .scope(SessionScoped.class) - .creating( - // Mock object provided by Mockito - when(mock(List.class).get(0)).thenReturn("42").getMock()) - .build(); - } - - @SuppressWarnings("serial") - @Test - public void testPassivatingBeanAdded() { - assertEquals("42", weld.select(new TypeLiteral>() { - }).get().get(0)); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/AlternativeMockBeanTest.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/AlternativeMockBeanTest.java deleted file mode 100644 index bab3a6d0..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/AlternativeMockBeanTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.bean; - -import static org.junit.Assert.assertEquals; - -import jakarta.enterprise.context.Dependent; - -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class AlternativeMockBeanTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(SimpleService.class) - .addBeans(MockBean.builder().types(MyService.class).selectedAlternative(CoolService.class) - .create(c -> new CoolService()).build()) - .build(); - - @Test - public void testAlternativeBeanSelected() { - assertEquals(1000, weld.select(MyService.class).get().doBusiness()); - } - - interface MyService { - - int doBusiness(); - - } - - @Dependent - static class SimpleService implements MyService { - - @Override - public int doBusiness() { - return 0; - } - } - - static class CoolService implements MyService { - - @Override - public int doBusiness() { - return 1000; - } - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/Bar.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/Bar.java deleted file mode 100644 index df4d88ca..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/Bar.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.jboss.weld.junit4.bean; - -import java.util.List; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - -@ApplicationScoped -public class Bar { - @Inject - @Meaty - private Foo foo; - - @Inject - private List someList; - - public List getSomeList() { - return someList; - } - - public Foo getFoo() { - return foo; - } -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/BlueToDiscover.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/BlueToDiscover.java deleted file mode 100644 index e376aabb..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/BlueToDiscover.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2018, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.bean; - -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Named; - -@Named("blue") -@ApplicationScoped -public class BlueToDiscover { - - private String id; - - @PostConstruct - void init() { - this.id = UUID.randomUUID().toString(); - } - - public String getId() { - return id; - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/Foo.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/Foo.java deleted file mode 100644 index 436638cd..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/Foo.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.jboss.weld.junit4.bean; - -public class Foo { - public String ping() { - return "foo"; - } -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/MockBeanWithQualifiersTest.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/MockBeanWithQualifiersTest.java deleted file mode 100644 index f962f8dc..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/MockBeanWithQualifiersTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.jboss.weld.junit4.bean; - -import jakarta.enterprise.inject.Any; - -import org.jboss.weld.junit.MockBean; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; - -/** - * Tests that {@link MockBean} with custom qualifiers has {@link Any} qualifier automatically added. - */ -public class MockBeanWithQualifiersTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(MockBeanWithQualifiersTest.class) - .addBeans(MockBean.builder().types(String.class).qualifiers(Meaty.Literal.INSTANCE).create(c -> "foo").build()) - .build(); - - @Test - public void testBeanHasDefaultQualifiersAdded() { - Assert.assertEquals("foo", weld.select(String.class, Any.Literal.INSTANCE).get()); - } -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/TestClassProducerTest.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/TestClassProducerTest.java deleted file mode 100644 index b80599ae..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/TestClassProducerTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.bean; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import java.util.List; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Produces; -import jakarta.enterprise.util.TypeLiteral; - -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Rule; -import org.junit.Test; - -/** - * Note that we add the class to the deployment so it is recognized as a bean and therefore the producer is also discovered. - * - * @author Martin Kouba - */ -public class TestClassProducerTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(List.class, TestClassProducerTest.class).build(); - - @SuppressWarnings("serial") - @Test - public void testBean() { - assertEquals("42", weld.select(new TypeLiteral>() { - }).get().get(0)); - } - - @ApplicationScoped - @Produces - List produceList() { - return when(mock(List.class).get(0)).thenReturn("42").getMock(); - } -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/AddExtensionAsBeanClassWithFromMethodTest.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/AddExtensionAsBeanClassWithFromMethodTest.java deleted file mode 100644 index 45700b80..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/AddExtensionAsBeanClassWithFromMethodTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2018, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.bean.extension; - -import org.jboss.weld.inject.WeldInstance; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Matej Novotny - */ -public class AddExtensionAsBeanClassWithFromMethodTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(GoodOldBean.class, MyExtension.class).build(); - - @Test - public void testThatClassIsRecognizedAsExtension() { - // GoodOldBean should be resolvable - Assert.assertTrue(weld.select(GoodOldBean.class).isResolvable()); - WeldInstance extInstance = weld.select(MyExtension.class); - // extension should be resolvable and should have observed the other bean - Assert.assertTrue(extInstance.isResolvable()); - Assert.assertTrue(extInstance.get().beanObserved()); - } -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/AddExtensionAsBeanClassWithOfMethod.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/AddExtensionAsBeanClassWithOfMethod.java deleted file mode 100644 index 1c1a7793..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/AddExtensionAsBeanClassWithOfMethod.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2018, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.bean.extension; - -import org.jboss.weld.inject.WeldInstance; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Matej Novotny - */ -public class AddExtensionAsBeanClassWithOfMethod { - - @Rule - public WeldInitiator weld = WeldInitiator.of(GoodOldBean.class, MyExtension.class); - - @Test - public void testThatClassIsRecognizedAsExtension() { - // GoodOldBean should be resolvable - Assert.assertTrue(weld.select(GoodOldBean.class).isResolvable()); - WeldInstance extInstance = weld.select(MyExtension.class); - // extension should be resolvable and should have observed the other bean - Assert.assertTrue(extInstance.isResolvable()); - Assert.assertTrue(extInstance.get().beanObserved()); - } -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/GoodOldBean.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/GoodOldBean.java deleted file mode 100644 index 939ba8c5..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/GoodOldBean.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2018, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.bean.extension; - -import jakarta.enterprise.context.ApplicationScoped; - -/** - * - * @author Matej Novotny - */ -@ApplicationScoped -public class GoodOldBean { - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/MyExtension.java b/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/MyExtension.java deleted file mode 100644 index 17c3b578..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/bean/extension/MyExtension.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2018, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.bean.extension; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; - -/** - * - * @author Matej Novotny - */ -public class MyExtension implements Extension { - - private boolean beanObserved = false; - - public void observePAT(@Observes ProcessAnnotatedType event) { - beanObserved = true; - } - - public boolean beanObserved() { - return beanObserved; - } -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/classrule/AsClassRuleTest.java b/junit4/src/test/java/org/jboss/weld/junit4/classrule/AsClassRuleTest.java deleted file mode 100644 index 132f1552..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/classrule/AsClassRuleTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.classrule; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.concurrent.atomic.AtomicReference; - -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.ClassRule; -import org.junit.FixMethodOrder; -import org.junit.Test; -import org.junit.runners.MethodSorters; - -/** - * - * @author Martin Kouba - */ -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class AsClassRuleTest { - - // The container is shared accross all test methods - @ClassRule - public static WeldInitiator weld = WeldInitiator.of(Charlie.class); - - static final AtomicReference CONTAINER_ID = new AtomicReference(null); - - static final AtomicReference CHARLIE_ID = new AtomicReference(null); - - @Test - public void test1() { - assertTrue(weld.isRunning()); - CONTAINER_ID.set(weld.getId()); - CHARLIE_ID.set(weld.select(Charlie.class).get().getId()); - } - - @Test - public void test2() { - assertTrue(weld.isRunning()); - assertEquals(CONTAINER_ID.get(), weld.getId()); - assertEquals(CHARLIE_ID.get(), weld.select(Charlie.class).get().getId()); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/classrule/Charlie.java b/junit4/src/test/java/org/jboss/weld/junit4/classrule/Charlie.java deleted file mode 100644 index d9e438c0..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/classrule/Charlie.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.classrule; - -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class Charlie { - - private String id; - - @PostConstruct - public void init() { - this.id = UUID.randomUUID().toString(); - } - - public String getId() { - return id; - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/contexts/ContextsActivatedTest.java b/junit4/src/test/java/org/jboss/weld/junit4/contexts/ContextsActivatedTest.java deleted file mode 100644 index 0bcb9fc5..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/contexts/ContextsActivatedTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.contexts; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class ContextsActivatedTest { - - @Rule - public WeldInitiator weld = WeldInitiator.from(Foo.class, Oof.class, RequestScopedProducer.class) - .inject(this) - .activate(RequestScoped.class, SessionScoped.class).build(); - - @Inject - String producedString; - - @Test - public void testNormalScopes() { - assertEquals(weld.select(Foo.class).get().getId(), weld.select(Foo.class).get().getId()); - assertEquals(weld.select(Oof.class).get().getId(), weld.select(Oof.class).get().getId()); - assertNotNull(producedString); - assertEquals("foo", producedString); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/contexts/Foo.java b/junit4/src/test/java/org/jboss/weld/junit4/contexts/Foo.java deleted file mode 100644 index 2b0f84c7..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/contexts/Foo.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.contexts; - -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class Foo { - - private String id; - - @PostConstruct - public void init() { - id = UUID.randomUUID().toString(); - } - - public String getId() { - return id; - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/contexts/InvalidScopeTest.java b/junit4/src/test/java/org/jboss/weld/junit4/contexts/InvalidScopeTest.java deleted file mode 100644 index afa944da..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/contexts/InvalidScopeTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.contexts; - -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class InvalidScopeTest { - - @Test(expected = IllegalArgumentException.class) - public void testFoo() { - WeldInitiator.from(Foo.class).activate(Rule.class); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/contexts/events/ContextLifecycleEventsObserver.java b/junit4/src/test/java/org/jboss/weld/junit4/contexts/events/ContextLifecycleEventsObserver.java deleted file mode 100644 index 7f267196..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/contexts/events/ContextLifecycleEventsObserver.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2018, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.contexts.events; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.event.Observes; - -@ApplicationScoped -public class ContextLifecycleEventsObserver { - - static final List EVENTS = new CopyOnWriteArrayList<>(); - - void onRequestContextInit(@Observes @Initialized(RequestScoped.class) Object event) { - EVENTS.add(Initialized.class.getName() + RequestScoped.class.getName()); - } - - void onRequestContextDestroy(@Observes @Destroyed(RequestScoped.class) Object event) { - EVENTS.add(Destroyed.class.getName() + RequestScoped.class.getName()); - } - - void onSessionContextInit(@Observes @Initialized(SessionScoped.class) Object event) { - EVENTS.add(Initialized.class.getName() + SessionScoped.class.getName()); - } - - void onSessionContextDestroy(@Observes @Destroyed(SessionScoped.class) Object event) { - EVENTS.add(Destroyed.class.getName() + SessionScoped.class.getName()); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/contexts/events/ContextLifecycleEventsTest.java b/junit4/src/test/java/org/jboss/weld/junit4/contexts/events/ContextLifecycleEventsTest.java deleted file mode 100644 index 8cec40f7..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/contexts/events/ContextLifecycleEventsTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.contexts.events; - -import static org.junit.Assert.assertTrue; - -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.context.SessionScoped; - -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.AfterClass; -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class ContextLifecycleEventsTest { - - @Rule - public WeldInitiator initiator = WeldInitiator.from(ContextLifecycleEventsObserver.class) - .activate(RequestScoped.class, SessionScoped.class).build(); - - @Test - public void testInitFired() { - // At this time @Initialized should be fired - assertTrue(ContextLifecycleEventsObserver.EVENTS.contains(Initialized.class.getName() + RequestScoped.class.getName())); - assertTrue(ContextLifecycleEventsObserver.EVENTS.contains(Initialized.class.getName() + SessionScoped.class.getName())); - } - - @AfterClass - public static void afterAll() { - // At this time @Destroyed from the previous test method should be fired - assertTrue(ContextLifecycleEventsObserver.EVENTS.contains(Destroyed.class.getName() + RequestScoped.class.getName())); - assertTrue(ContextLifecycleEventsObserver.EVENTS.contains(Destroyed.class.getName() + SessionScoped.class.getName())); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/event/FireEventTest.java b/junit4/src/test/java/org/jboss/weld/junit4/event/FireEventTest.java deleted file mode 100644 index 2937ca61..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/event/FireEventTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.event; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import org.jboss.weld.junit4.Foo; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class FireEventTest { - - @Rule - public WeldInitiator weld = WeldInitiator.of(DummyObserver.class); - - @Test - public void testEventFired() { - DummyObserver.MESSAGES.clear(); - // Fire an event - weld.event().select(Foo.class).fire(new Foo()); - assertEquals(1, DummyObserver.MESSAGES.size()); - assertNull(DummyObserver.MESSAGES.get(0).getBar()); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/inject/IamDependent.java b/junit4/src/test/java/org/jboss/weld/junit4/inject/IamDependent.java deleted file mode 100644 index dc9d1348..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/inject/IamDependent.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.inject; - -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.Dependent; - -/** - * - * @author Martin Kouba - */ -@Dependent -public class IamDependent { - - static final AtomicBoolean DESTROYED = new AtomicBoolean(false); - - void bang() { - } - - @PreDestroy - void destroy() { - DESTROYED.set(true); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/inject/InjectTest.java b/junit4/src/test/java/org/jboss/weld/junit4/inject/InjectTest.java deleted file mode 100644 index fb466028..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/inject/InjectTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.inject; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; - -import org.jboss.weld.junit4.Foo; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.RuleChain; -import org.junit.runners.model.Statement; - -/** - * - * @author Martin Kouba - */ -public class InjectTest { - - private final WeldInitiator weld = WeldInitiator - .from(Foo.class, MeatyStringObserver.class, IamDependent.class) - .inject(this) - .build(); - - @Rule - public RuleChain chain = RuleChain.outerRule((base, description) -> new Statement() { - @Override - public void evaluate() throws Throwable { - base.evaluate(); - assertTrue(IamDependent.DESTROYED.get()); - } - }).around(weld); - - @Inject - Foo foo; - - @Inject - @Meaty - Event event; - - @Inject - IamDependent iamDependent; - - @Test - public void testFoo() { - MeatyStringObserver.MESSAGES.clear(); - assertEquals("baz", foo.getBar()); - event.fire("hello"); - assertEquals(1, MeatyStringObserver.MESSAGES.size()); - assertEquals("hello", MeatyStringObserver.MESSAGES.get(0)); - iamDependent.bang(); - } - - @Test - public void testManualNonContextualInjection() throws Exception { - final InjectTest sut = new InjectTest(); - try (AutoCloseable contextReleaser = weld.injectNonContextual(sut)) { - MeatyStringObserver.MESSAGES.clear(); - assertEquals("baz", sut.foo.getBar()); - sut.event.fire("hello"); - assertEquals(1, MeatyStringObserver.MESSAGES.size()); - assertEquals("hello", MeatyStringObserver.MESSAGES.get(0)); - sut.iamDependent.bang(); - } - assertTrue(IamDependent.DESTROYED.get()); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/inject/InjectWithClassRuleTest.java b/junit4/src/test/java/org/jboss/weld/junit4/inject/InjectWithClassRuleTest.java deleted file mode 100644 index d5263f3b..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/inject/InjectWithClassRuleTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2020, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.inject; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; - -import org.jboss.weld.junit4.Foo; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.MethodRule; -import org.junit.rules.RuleChain; -import org.junit.runners.model.Statement; - -/** - * - * @author Björn Kautler - */ -public class InjectWithClassRuleTest { - private static WeldInitiator weld = WeldInitiator.from(Foo.class, MeatyStringObserver.class, IamDependent.class) - .build(); - - @ClassRule - public static RuleChain chain = RuleChain.outerRule((base, description) -> new Statement() { - @Override - public void evaluate() throws Throwable { - base.evaluate(); - assertTrue(IamDependent.DESTROYED.get()); - } - }).around(weld); - - @Rule - public MethodRule testClassInjectorRule = weld.getTestClassInjectorRule(); - - @Inject - Foo foo; - - @Inject - @Meaty - Event event; - - @Inject - IamDependent iamDependent; - - @Test - public void testFoo() { - MeatyStringObserver.MESSAGES.clear(); - assertEquals("baz", foo.getBar()); - event.fire("hello"); - assertEquals(1, MeatyStringObserver.MESSAGES.size()); - assertEquals("hello", MeatyStringObserver.MESSAGES.get(0)); - iamDependent.bang(); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/inject/Meaty.java b/junit4/src/test/java/org/jboss/weld/junit4/inject/Meaty.java deleted file mode 100644 index 670a3162..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/inject/Meaty.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.inject; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Qualifier -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -public @interface Meaty { - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/inject/MeatyStringObserver.java b/junit4/src/test/java/org/jboss/weld/junit4/inject/MeatyStringObserver.java deleted file mode 100644 index cd7c8155..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/inject/MeatyStringObserver.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.inject; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; - -@ApplicationScoped -public class MeatyStringObserver { - - static final List MESSAGES = new CopyOnWriteArrayList<>(); - - public void observeHelloMessage(@Observes @Meaty String message) { - MESSAGES.add(message); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/interceptor/MockInterceptorOrderingTest.java b/junit4/src/test/java/org/jboss/weld/junit4/interceptor/MockInterceptorOrderingTest.java deleted file mode 100644 index 7536eb63..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/interceptor/MockInterceptorOrderingTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2018, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.interceptor; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.interceptor.InterceptorBinding; - -import org.jboss.weld.junit.MockInterceptor; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - -public class MockInterceptorOrderingTest { - - private static AtomicBoolean guard = new AtomicBoolean(); - - @Rule - public WeldInitiator weld = WeldInitiator - .from(WeldInitiator.createWeld().addBeanClass(Foo.class).enableInterceptors(Integer.class, String.class)).addBeans( - MockInterceptor.withBindings(FooBinding.Literal.INSTANCE).beanClass(Integer.class) - .aroundInvoke((ctx, b) -> { - return 5; - }), - MockInterceptor.withBindings(FooBinding.Literal.INSTANCE).beanClass(String.class).aroundInvoke((ctx, b) -> { - // Should be never invoked - guard.set(true); - return -5; - })) - .build(); - - @Before - public void setup() { - guard.set(false); - } - - @Test - public void testOrdering() { - assertFalse(guard.get()); - assertEquals(5, weld.select(Foo.class).get().ping()); - } - - @FooBinding - static class Foo { - - int ping() { - // Should be never invoked - guard.set(true); - return 1; - } - - } - - @Target({ TYPE, METHOD }) - @Retention(RUNTIME) - @Documented - @InterceptorBinding - static @interface FooBinding { - - @SuppressWarnings("serial") - static final class Literal extends AnnotationLiteral implements FooBinding { - - public static final Literal INSTANCE = new Literal(); - - }; - - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/interceptor/MockInterceptorTest.java b/junit4/src/test/java/org/jboss/weld/junit4/interceptor/MockInterceptorTest.java deleted file mode 100644 index 4ee8b6d3..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/interceptor/MockInterceptorTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2018, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.interceptor; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import java.util.ArrayList; -import java.util.List; - -import jakarta.enterprise.inject.spi.InterceptionType; -import jakarta.enterprise.inject.spi.Interceptor; -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.interceptor.InterceptorBinding; - -import org.jboss.weld.junit.MockInterceptor; -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - -public class MockInterceptorTest { - - private List aroundInvokes; - - private List postConstructs; - - @Rule - public WeldInitiator weld = WeldInitiator.from(Foo.class).addBeans( - MockInterceptor.withBindings(FooBinding.Literal.INSTANCE).aroundInvoke((ctx, b) -> { - aroundInvokes.add(b.getBeanClass().getName()); - return ctx.proceed(); - }), - // This interceptor is disabled - MockInterceptor.withBindings(FooBinding.Literal.INSTANCE).beanClass(String.class).aroundInvoke((ctx, b) -> { - return false; - }), - MockInterceptor.withBindings(FooBinding.Literal.INSTANCE) - .postConstruct((ctx, b) -> postConstructs.add(b.getBeanClass().getName()))) - .build(); - - @Before - public void setup() { - aroundInvokes = new ArrayList<>(); - postConstructs = new ArrayList<>(); - } - - @Test - public void testInterception() { - assertTrue(aroundInvokes.isEmpty()); - assertTrue(postConstructs.isEmpty()); - assertTrue(weld.select(Foo.class).get().ping()); - assertEquals(1, aroundInvokes.size()); - assertEquals(Foo.class.getName(), aroundInvokes.get(0)); - assertEquals(1, postConstructs.size()); - assertEquals(Foo.class.getName(), postConstructs.get(0)); - } - - @Test - public void testDisabledInterceptor() { - List> interceptors = weld.getBeanManager().resolveInterceptors(InterceptionType.AROUND_INVOKE, - FooBinding.Literal.INSTANCE); - assertEquals(1, interceptors.size()); - assertEquals(MockInterceptor.class, interceptors.get(0).getBeanClass()); - } - - @FooBinding - static class Foo { - - boolean ping() { - return true; - } - - } - - @Target({ TYPE, METHOD }) - @Retention(RUNTIME) - @Documented - @InterceptorBinding - static @interface FooBinding { - - @SuppressWarnings("serial") - static final class Literal extends AnnotationLiteral implements FooBinding { - - public static final Literal INSTANCE = new Literal(); - - }; - - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/ofpackage/Alpha.java b/junit4/src/test/java/org/jboss/weld/junit4/ofpackage/Alpha.java deleted file mode 100644 index 6ad57256..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/ofpackage/Alpha.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.ofpackage; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Alpha { - - private String value; - - @PostConstruct - public void init() { - value = this.getClass().getSimpleName().toLowerCase(); - } - - public String getValue() { - return value; - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/ofpackage/OfPackageTest.java b/junit4/src/test/java/org/jboss/weld/junit4/ofpackage/OfPackageTest.java deleted file mode 100644 index b67f1bb1..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/ofpackage/OfPackageTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.ofpackage; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -public class OfPackageTest { - - @Rule - public WeldInitiator weld = WeldInitiator.ofTestPackage(); - - @Test - public void testOfTestPackage() { - assertEquals("alpha", weld.select(Alpha.class).get().getValue()); - assertTrue(weld.select(Bravo.class).isResolvable()); - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/resources/FooEjbs.java b/junit4/src/test/java/org/jboss/weld/junit4/resources/FooEjbs.java deleted file mode 100644 index 29aa5d7b..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/resources/FooEjbs.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.resources; - -import jakarta.ejb.EJB; -import jakarta.enterprise.context.Dependent; - -@Dependent -public class FooEjbs { - - @EJB - DummySessionBean dummySessionBean; - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/resources/FooJpa.java b/junit4/src/test/java/org/jboss/weld/junit4/resources/FooJpa.java deleted file mode 100644 index c04f9034..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/resources/FooJpa.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.resources; - -import jakarta.enterprise.context.Dependent; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.PersistenceUnit; - -@Dependent -public class FooJpa { - - @PersistenceContext - EntityManager entityManager; - - @PersistenceUnit - EntityManagerFactory entityManagerFactory; - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/resources/FooResources.java b/junit4/src/test/java/org/jboss/weld/junit4/resources/FooResources.java deleted file mode 100644 index a13fecf8..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/resources/FooResources.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.resources; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; - -@Dependent -public class FooResources { - - @Resource(lookup = "bar") - String bar; - - String baz; - - @Resource(name = "baz") - void setBaz(String baz) { - this.baz = baz; - } - -} diff --git a/junit4/src/test/java/org/jboss/weld/junit4/resources/InjectResourcesTest.java b/junit4/src/test/java/org/jboss/weld/junit4/resources/InjectResourcesTest.java deleted file mode 100644 index 24d70baa..00000000 --- a/junit4/src/test/java/org/jboss/weld/junit4/resources/InjectResourcesTest.java +++ /dev/null @@ -1,406 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit4.resources; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; - -import java.util.List; -import java.util.Map; -import java.util.function.Function; - -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.persistence.Cache; -import jakarta.persistence.EntityGraph; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.EntityTransaction; -import jakarta.persistence.FlushModeType; -import jakarta.persistence.LockModeType; -import jakarta.persistence.PersistenceUnitUtil; -import jakarta.persistence.Query; -import jakarta.persistence.StoredProcedureQuery; -import jakarta.persistence.SynchronizationType; -import jakarta.persistence.TypedQuery; -import jakarta.persistence.criteria.CriteriaBuilder; -import jakarta.persistence.criteria.CriteriaDelete; -import jakarta.persistence.criteria.CriteriaQuery; -import jakarta.persistence.criteria.CriteriaUpdate; -import jakarta.persistence.metamodel.Metamodel; - -import org.jboss.weld.junit4.WeldInitiator; -import org.junit.Rule; -import org.junit.Test; - -/** - * - * @author Martin Kouba - */ -@SuppressWarnings("rawtypes") -public class InjectResourcesTest { - - @Rule - public WeldInitiator weld = WeldInitiator.fromTestPackage() - .bindResource("bar", "hello1") - .bindResource("java:comp/env/baz", "hello2") - .setEjbFactory(ip -> new DummySessionBean("ping")) - .setPersistenceUnitFactory(getPUFactory()) - .setPersistenceContextFactory(getPCFactory()).build(); - - @Test - public void testResourceInjection() { - FooResources foo = weld.select(FooResources.class).get(); - assertEquals("hello1", foo.bar); - assertEquals("hello2", foo.baz); - } - - @Test - public void testEjbInjection() { - FooEjbs foo = weld.select(FooEjbs.class).get(); - assertEquals("ping", foo.dummySessionBean.id); - } - - @Test - public void testJpaInjection() { - FooJpa foo = weld.select(FooJpa.class).get(); - assertNotNull(foo.entityManagerFactory); - assertFalse(foo.entityManagerFactory.isOpen()); - assertNotNull(foo.entityManager); - assertFalse(foo.entityManager.isOpen()); - } - - // Mock objects - - static Function getPCFactory() { - return ip -> new EntityManager() { - - @Override - public T unwrap(Class cls) { - return null; - } - - @Override - public void setProperty(String propertyName, Object value) { - } - - @Override - public void setFlushMode(FlushModeType flushMode) { - } - - @Override - public void remove(Object entity) { - } - - @Override - public void refresh(Object entity, LockModeType lockMode, Map properties) { - } - - @Override - public void refresh(Object entity, LockModeType lockMode) { - } - - @Override - public void refresh(Object entity, Map properties) { - } - - @Override - public void refresh(Object entity) { - } - - @Override - public void persist(Object entity) { - } - - @Override - public T merge(T entity) { - return null; - } - - @Override - public void lock(Object entity, LockModeType lockMode, Map properties) { - } - - @Override - public void lock(Object entity, LockModeType lockMode) { - } - - @Override - public void joinTransaction() { - } - - @Override - public boolean isOpen() { - return false; - } - - @Override - public boolean isJoinedToTransaction() { - return false; - } - - @Override - public EntityTransaction getTransaction() { - return null; - } - - @Override - public T getReference(Class entityClass, Object primaryKey) { - return null; - } - - @Override - public Map getProperties() { - return null; - } - - @Override - public Metamodel getMetamodel() { - return null; - } - - @Override - public LockModeType getLockMode(Object entity) { - return null; - } - - @Override - public FlushModeType getFlushMode() { - return null; - } - - @Override - public EntityManagerFactory getEntityManagerFactory() { - return null; - } - - @Override - public List> getEntityGraphs(Class entityClass) { - return null; - } - - @Override - public EntityGraph getEntityGraph(String graphName) { - return null; - } - - @Override - public Object getDelegate() { - return null; - } - - @Override - public CriteriaBuilder getCriteriaBuilder() { - return null; - } - - @Override - public void flush() { - } - - @Override - public T find(Class entityClass, Object primaryKey, LockModeType lockMode, Map properties) { - return null; - } - - @Override - public T find(Class entityClass, Object primaryKey, LockModeType lockMode) { - return null; - } - - @Override - public T find(Class entityClass, Object primaryKey, Map properties) { - return null; - } - - @Override - public T find(Class entityClass, Object primaryKey) { - return null; - } - - @Override - public void detach(Object entity) { - } - - @Override - public StoredProcedureQuery createStoredProcedureQuery(String procedureName, String... resultSetMappings) { - return null; - } - - @Override - public StoredProcedureQuery createStoredProcedureQuery(String procedureName, Class... resultClasses) { - return null; - } - - @Override - public StoredProcedureQuery createStoredProcedureQuery(String procedureName) { - return null; - } - - @Override - public TypedQuery createQuery(String qlString, Class resultClass) { - return null; - } - - @Override - public Query createQuery(CriteriaDelete deleteQuery) { - return null; - } - - @Override - public Query createQuery(CriteriaUpdate updateQuery) { - return null; - } - - @Override - public TypedQuery createQuery(CriteriaQuery criteriaQuery) { - return null; - } - - @Override - public Query createQuery(String qlString) { - return null; - } - - @Override - public Query createNativeQuery(String sqlString, String resultSetMapping) { - return null; - } - - @Override - public Query createNativeQuery(String sqlString, Class resultClass) { - return null; - } - - @Override - public Query createNativeQuery(String sqlString) { - return null; - } - - @Override - public StoredProcedureQuery createNamedStoredProcedureQuery(String name) { - return null; - } - - @Override - public TypedQuery createNamedQuery(String name, Class resultClass) { - return null; - } - - @Override - public Query createNamedQuery(String name) { - return null; - } - - @Override - public EntityGraph createEntityGraph(String graphName) { - return null; - } - - @Override - public EntityGraph createEntityGraph(Class rootType) { - return null; - } - - @Override - public boolean contains(Object entity) { - return false; - } - - @Override - public void close() { - } - - @Override - public void clear() { - } - }; - } - - static Function getPUFactory() { - return ip -> new EntityManagerFactory() { - - @Override - public T unwrap(Class cls) { - return null; - } - - @Override - public boolean isOpen() { - return false; - } - - @Override - public Map getProperties() { - return null; - } - - @Override - public PersistenceUnitUtil getPersistenceUnitUtil() { - return null; - } - - @Override - public Metamodel getMetamodel() { - return null; - } - - @Override - public CriteriaBuilder getCriteriaBuilder() { - return null; - } - - @Override - public Cache getCache() { - return null; - } - - @Override - public EntityManager createEntityManager(SynchronizationType synchronizationType, Map map) { - return null; - } - - @Override - public EntityManager createEntityManager(SynchronizationType synchronizationType) { - return null; - } - - @Override - public EntityManager createEntityManager(Map map) { - return null; - } - - @Override - public EntityManager createEntityManager() { - return null; - } - - @Override - public void close() { - } - - @Override - public void addNamedQuery(String name, Query query) { - } - - @Override - public void addNamedEntityGraph(String graphName, EntityGraph entityGraph) { - } - }; - } - -} diff --git a/junit5/.gitignore b/junit5/.gitignore deleted file mode 100644 index 88414527..00000000 --- a/junit5/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/target/ -/.settings/ -/.classpath -/.project -/.idea -*.iml diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/Blue.java b/junit5/src/test/java/org/jboss/weld/junit5/bean/Blue.java deleted file mode 100644 index 77920478..00000000 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/Blue.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit5.bean; - -import java.util.List; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - -@ApplicationScoped -public class Blue { - - @Inject - @Meaty - private List stringList; - - public List getStringList() { - return stringList; - } - -} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/bean/Meaty.java b/junit5/src/test/java/org/jboss/weld/junit5/bean/Meaty.java deleted file mode 100644 index 9a4c2cf3..00000000 --- a/junit5/src/test/java/org/jboss/weld/junit5/bean/Meaty.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit5.bean; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Qualifier -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -public @interface Meaty { - - @SuppressWarnings("all") - static class Literal extends AnnotationLiteral implements Meaty { - - private static final long serialVersionUID = 1L; - - public static final Meaty INSTANCE = new Literal(); - - private Literal() { - } - - } - -} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/contexts/Oof.java b/junit5/src/test/java/org/jboss/weld/junit5/contexts/Oof.java deleted file mode 100644 index aa9c8623..00000000 --- a/junit5/src/test/java/org/jboss/weld/junit5/contexts/Oof.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit5.contexts; - -import java.io.Serializable; -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.SessionScoped; - -@SuppressWarnings("serial") -@SessionScoped -public class Oof implements Serializable { - - private String id; - - @PostConstruct - public void init() { - id = UUID.randomUUID().toString(); - } - - public String getId() { - return id; - } - -} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/contexts/RequestScopedProducer.java b/junit5/src/test/java/org/jboss/weld/junit5/contexts/RequestScopedProducer.java deleted file mode 100644 index 47e20b4f..00000000 --- a/junit5/src/test/java/org/jboss/weld/junit5/contexts/RequestScopedProducer.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.jboss.weld.junit5.contexts; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Produces; - -@RequestScoped -public class RequestScopedProducer { - - @Produces - @Dependent - public String produceDependentString() { - return "foo"; - } -} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/event/DummyObserver.java b/junit5/src/test/java/org/jboss/weld/junit5/event/DummyObserver.java deleted file mode 100644 index 723c6bc9..00000000 --- a/junit5/src/test/java/org/jboss/weld/junit5/event/DummyObserver.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit5.event; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; - -import org.jboss.weld.junit5.basic.Foo; - -@ApplicationScoped -public class DummyObserver { - - static final List MESSAGES = new CopyOnWriteArrayList<>(); - - public void observeHelloMessage(@Observes Foo message) { - MESSAGES.add(message); - } - -} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/bean/Bar.java b/junit5/src/test/java/org/jboss/weld/junit5/initiator/bean/Bar.java deleted file mode 100644 index f421cab0..00000000 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/bean/Bar.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.jboss.weld.junit5.initiator.bean; - -public class Bar { -} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/bean/Foo.java b/junit5/src/test/java/org/jboss/weld/junit5/initiator/bean/Foo.java deleted file mode 100644 index 776b237a..00000000 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/bean/Foo.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.jboss.weld.junit5.initiator.bean; - -public class Foo { - -} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SuperclassWithWeldInitiator.java b/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SuperclassWithWeldInitiator.java deleted file mode 100644 index 05777d6d..00000000 --- a/junit5/src/test/java/org/jboss/weld/junit5/initiator/discovery/SuperclassWithWeldInitiator.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.jboss.weld.junit5.initiator.discovery; - -import org.jboss.weld.environment.se.Weld; -import org.jboss.weld.junit5.WeldInitiator; -import org.jboss.weld.junit5.WeldJunit5Extension; -import org.jboss.weld.junit5.WeldSetup; -import org.jboss.weld.junit5.initiator.bean.Foo; -import org.junit.jupiter.api.extension.ExtendWith; - -@ExtendWith(WeldJunit5Extension.class) -public abstract class SuperclassWithWeldInitiator { - @WeldSetup - public WeldInitiator weld = WeldInitiator - .of(new Weld() - .addBeanClass(Foo.class)); -} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/ofpackage/Bravo.java b/junit5/src/test/java/org/jboss/weld/junit5/ofpackage/Bravo.java deleted file mode 100644 index ba59e722..00000000 --- a/junit5/src/test/java/org/jboss/weld/junit5/ofpackage/Bravo.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2017, Red Hat, Inc., and individual contributors - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.weld.junit5.ofpackage; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Bravo { - - private String value; - - @PostConstruct - public void init() { - value = this.getClass().getSimpleName().toLowerCase(); - } - - public String getValue() { - return value; - } - -} diff --git a/junit5/src/test/java/org/jboss/weld/junit5/resources/DummySessionBean.java b/junit5/src/test/java/org/jboss/weld/junit5/resources/DummySessionBean.java deleted file mode 100644 index ea21a127..00000000 --- a/junit5/src/test/java/org/jboss/weld/junit5/resources/DummySessionBean.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.jboss.weld.junit5.resources; - -public class DummySessionBean { - - final String id; - - public DummySessionBean(String id) { - this.id = id; - } - -} diff --git a/junit5/src/test/resources/META-INF/services/org.jboss.weld.junit5.WeldJunitEnricher b/junit5/src/test/resources/META-INF/services/org.jboss.weld.junit5.WeldJunitEnricher deleted file mode 100644 index ddfc08a1..00000000 --- a/junit5/src/test/resources/META-INF/services/org.jboss.weld.junit5.WeldJunitEnricher +++ /dev/null @@ -1 +0,0 @@ -org.jboss.weld.junit5.enricher.FooWeldJunitEnricher \ No newline at end of file diff --git a/junit5/src/test/resources/logging.properties b/junit5/src/test/resources/logging.properties deleted file mode 100644 index c0e1c1b8..00000000 --- a/junit5/src/test/resources/logging.properties +++ /dev/null @@ -1,2 +0,0 @@ -handlers = java.util.logging.ConsoleHandler -org.jboss.weld.level = WARNING \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6c01c048..f593ac01 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 weld-junit-parent pom - 5.0.3-SNAPSHOT + 6.0.0-SNAPSHOT Weld Extensions for JUnit and Spock Set of JUnit/Spock extensions to enhance the testing of CDI components. @@ -48,12 +48,13 @@ 17 - 4.13.2 - 5.13.4 + + + 6.0.0 2.4-M6-groovy-4.0 - 1.12.2 + 6.0.0 3.0.25 6.0.3.Final 5.20.0 @@ -70,10 +71,9 @@ - junit4 - junit5 + weld-common + junit-jupiter spock - junit-common @@ -86,12 +86,6 @@ ${version.weld} - - junit - junit - ${version.junit4} - - org.junit.jupiter junit-jupiter-api @@ -138,7 +132,13 @@ org.jboss.weld - weld-junit-common + weld-common + ${project.version} + + + + org.jboss.weld + weld-junit-jupiter ${project.version} @@ -213,6 +213,30 @@ + + + + junit5 + + false + + + 5.13.4 + 1.12.2 + + + + + + junit6 + + true + + + 6.0.0 + 6.0.0 + + diff --git a/spock/pom.xml b/spock/pom.xml index 7fb1ba67..c66214ac 100644 --- a/spock/pom.xml +++ b/spock/pom.xml @@ -7,7 +7,7 @@ org.jboss.weld weld-junit-parent - 5.0.3-SNAPSHOT + 6.0.0-SNAPSHOT weld-spock @@ -25,7 +25,7 @@ org.jboss.weld - weld-junit-common + weld-common diff --git a/spock/src/main/java/org/jboss/weld/spock/WeldInitiator.java b/spock/src/main/java/org/jboss/weld/spock/WeldInitiator.java index 97d66d6c..29f661ba 100644 --- a/spock/src/main/java/org/jboss/weld/spock/WeldInitiator.java +++ b/spock/src/main/java/org/jboss/weld/spock/WeldInitiator.java @@ -29,7 +29,7 @@ import org.jboss.weld.environment.se.Weld; import org.jboss.weld.environment.se.WeldContainer; -import org.jboss.weld.junit.AbstractWeldInitiator; +import org.jboss.weld.testing.AbstractWeldInitiator; /** * Weld initiator - can be used to customize the Weld SE container started by diff --git a/spock/src/test/groovy/org/jboss/weld/spock/alternative/AlternativeAsSoleBeanInSyntheticArchiveTest.groovy b/spock/src/test/groovy/org/jboss/weld/spock/alternative/AlternativeAsSoleBeanInSyntheticArchiveTest.groovy index adf806d2..f6ecb8ad 100644 --- a/spock/src/test/groovy/org/jboss/weld/spock/alternative/AlternativeAsSoleBeanInSyntheticArchiveTest.groovy +++ b/spock/src/test/groovy/org/jboss/weld/spock/alternative/AlternativeAsSoleBeanInSyntheticArchiveTest.groovy @@ -19,7 +19,7 @@ package org.jboss.weld.spock.alternative import jakarta.enterprise.context.ApplicationScoped import jakarta.inject.Inject -import org.jboss.weld.junit.MockBean +import org.jboss.weld.testing.MockBean import org.jboss.weld.spock.EnableWeld import org.jboss.weld.spock.WeldInitiator import org.jboss.weld.spock.WeldSetup diff --git a/spock/src/test/groovy/org/jboss/weld/spock/bean/AddBeanTest.groovy b/spock/src/test/groovy/org/jboss/weld/spock/bean/AddBeanTest.groovy index 85b2739c..ac8af751 100644 --- a/spock/src/test/groovy/org/jboss/weld/spock/bean/AddBeanTest.groovy +++ b/spock/src/test/groovy/org/jboss/weld/spock/bean/AddBeanTest.groovy @@ -22,7 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger import jakarta.enterprise.context.ApplicationScoped import jakarta.enterprise.context.Dependent import jakarta.enterprise.util.TypeLiteral -import org.jboss.weld.junit.MockBean +import org.jboss.weld.testing.MockBean import org.jboss.weld.spock.EnableWeld import org.jboss.weld.spock.WeldInitiator import org.jboss.weld.spock.WeldSetup diff --git a/spock/src/test/groovy/org/jboss/weld/spock/bean/AddGloballyEnabledAlternativeTest.groovy b/spock/src/test/groovy/org/jboss/weld/spock/bean/AddGloballyEnabledAlternativeTest.groovy index cfd080cd..48760a9a 100644 --- a/spock/src/test/groovy/org/jboss/weld/spock/bean/AddGloballyEnabledAlternativeTest.groovy +++ b/spock/src/test/groovy/org/jboss/weld/spock/bean/AddGloballyEnabledAlternativeTest.groovy @@ -19,7 +19,7 @@ package org.jboss.weld.spock.bean import jakarta.enterprise.inject.spi.Bean import jakarta.enterprise.util.TypeLiteral -import org.jboss.weld.junit.MockBean +import org.jboss.weld.testing.MockBean import org.jboss.weld.spock.EnableWeld import org.jboss.weld.spock.WeldInitiator import org.jboss.weld.spock.WeldSetup diff --git a/spock/src/test/groovy/org/jboss/weld/spock/bean/AddPassivatingBeanTest.groovy b/spock/src/test/groovy/org/jboss/weld/spock/bean/AddPassivatingBeanTest.groovy index 65a52d08..4108f680 100644 --- a/spock/src/test/groovy/org/jboss/weld/spock/bean/AddPassivatingBeanTest.groovy +++ b/spock/src/test/groovy/org/jboss/weld/spock/bean/AddPassivatingBeanTest.groovy @@ -20,7 +20,7 @@ package org.jboss.weld.spock.bean import jakarta.enterprise.context.SessionScoped import jakarta.enterprise.inject.spi.Bean import jakarta.enterprise.util.TypeLiteral -import org.jboss.weld.junit.MockBean +import org.jboss.weld.testing.MockBean import org.jboss.weld.spock.EnableWeld import org.jboss.weld.spock.WeldInitiator import org.jboss.weld.spock.WeldSetup diff --git a/spock/src/test/groovy/org/jboss/weld/spock/bean/AlternativeMockBeanTest.groovy b/spock/src/test/groovy/org/jboss/weld/spock/bean/AlternativeMockBeanTest.groovy index bc9e6489..7035c9c0 100644 --- a/spock/src/test/groovy/org/jboss/weld/spock/bean/AlternativeMockBeanTest.groovy +++ b/spock/src/test/groovy/org/jboss/weld/spock/bean/AlternativeMockBeanTest.groovy @@ -18,7 +18,7 @@ package org.jboss.weld.spock.bean import jakarta.enterprise.context.Dependent -import org.jboss.weld.junit.MockBean +import org.jboss.weld.testing.MockBean import org.jboss.weld.spock.EnableWeld import org.jboss.weld.spock.WeldInitiator import org.jboss.weld.spock.WeldSetup diff --git a/spock/src/test/groovy/org/jboss/weld/spock/bean/MockBeanWithQualifiersTest.groovy b/spock/src/test/groovy/org/jboss/weld/spock/bean/MockBeanWithQualifiersTest.groovy index 9481df21..8a50468c 100644 --- a/spock/src/test/groovy/org/jboss/weld/spock/bean/MockBeanWithQualifiersTest.groovy +++ b/spock/src/test/groovy/org/jboss/weld/spock/bean/MockBeanWithQualifiersTest.groovy @@ -18,7 +18,7 @@ package org.jboss.weld.spock.bean import jakarta.enterprise.inject.Any -import org.jboss.weld.junit.MockBean +import org.jboss.weld.testing.MockBean import org.jboss.weld.spock.EnableWeld import org.jboss.weld.spock.WeldInitiator import org.jboss.weld.spock.WeldSetup diff --git a/spock/src/test/groovy/org/jboss/weld/spock/interceptor/MockInterceptorTest.groovy b/spock/src/test/groovy/org/jboss/weld/spock/interceptor/MockInterceptorTest.groovy index fc70afa2..dddf35ef 100644 --- a/spock/src/test/groovy/org/jboss/weld/spock/interceptor/MockInterceptorTest.groovy +++ b/spock/src/test/groovy/org/jboss/weld/spock/interceptor/MockInterceptorTest.groovy @@ -23,7 +23,7 @@ import java.lang.annotation.Target import jakarta.enterprise.util.AnnotationLiteral import jakarta.interceptor.InterceptorBinding -import org.jboss.weld.junit.MockInterceptor +import org.jboss.weld.testing.MockInterceptor import org.jboss.weld.spock.EnableWeld import org.jboss.weld.spock.WeldInitiator import org.jboss.weld.spock.WeldSetup diff --git a/junit4/.gitignore b/weld-common/.gitignore similarity index 100% rename from junit4/.gitignore rename to weld-common/.gitignore diff --git a/junit-common/pom.xml b/weld-common/pom.xml similarity index 92% rename from junit-common/pom.xml rename to weld-common/pom.xml index c5161ba1..0e7ecefb 100644 --- a/junit-common/pom.xml +++ b/weld-common/pom.xml @@ -7,10 +7,10 @@ org.jboss.weld weld-junit-parent - 5.0.3-SNAPSHOT + 6.0.0-SNAPSHOT - weld-junit-common + weld-common jar diff --git a/junit-common/src/main/java/org/jboss/weld/junit/AbstractWeldInitiator.java b/weld-common/src/main/java/org/jboss/weld/testing/AbstractWeldInitiator.java similarity index 99% rename from junit-common/src/main/java/org/jboss/weld/junit/AbstractWeldInitiator.java rename to weld-common/src/main/java/org/jboss/weld/testing/AbstractWeldInitiator.java index 7a813223..4152f3e8 100644 --- a/junit-common/src/main/java/org/jboss/weld/junit/AbstractWeldInitiator.java +++ b/weld-common/src/main/java/org/jboss/weld/testing/AbstractWeldInitiator.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit; +package org.jboss.weld.testing; import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; diff --git a/junit-common/src/main/java/org/jboss/weld/junit/ContextImpl.java b/weld-common/src/main/java/org/jboss/weld/testing/ContextImpl.java similarity index 99% rename from junit-common/src/main/java/org/jboss/weld/junit/ContextImpl.java rename to weld-common/src/main/java/org/jboss/weld/testing/ContextImpl.java index a95a72f4..142cc2da 100644 --- a/junit-common/src/main/java/org/jboss/weld/junit/ContextImpl.java +++ b/weld-common/src/main/java/org/jboss/weld/testing/ContextImpl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit; +package org.jboss.weld.testing; import java.lang.annotation.Annotation; import java.util.HashMap; diff --git a/junit-common/src/main/java/org/jboss/weld/junit/MockBean.java b/weld-common/src/main/java/org/jboss/weld/testing/MockBean.java similarity index 99% rename from junit-common/src/main/java/org/jboss/weld/junit/MockBean.java rename to weld-common/src/main/java/org/jboss/weld/testing/MockBean.java index 0eee1a43..e8fc19d4 100644 --- a/junit-common/src/main/java/org/jboss/weld/junit/MockBean.java +++ b/weld-common/src/main/java/org/jboss/weld/testing/MockBean.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit; +package org.jboss.weld.testing; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; diff --git a/junit-common/src/main/java/org/jboss/weld/junit/MockBeanWithPriority.java b/weld-common/src/main/java/org/jboss/weld/testing/MockBeanWithPriority.java similarity index 97% rename from junit-common/src/main/java/org/jboss/weld/junit/MockBeanWithPriority.java rename to weld-common/src/main/java/org/jboss/weld/testing/MockBeanWithPriority.java index 8b01042a..3bc49572 100644 --- a/junit-common/src/main/java/org/jboss/weld/junit/MockBeanWithPriority.java +++ b/weld-common/src/main/java/org/jboss/weld/testing/MockBeanWithPriority.java @@ -1,4 +1,4 @@ -package org.jboss.weld.junit; +package org.jboss.weld.testing; import java.lang.annotation.Annotation; import java.lang.reflect.Type; diff --git a/junit-common/src/main/java/org/jboss/weld/junit/MockEjbInjectionServices.java b/weld-common/src/main/java/org/jboss/weld/testing/MockEjbInjectionServices.java similarity index 94% rename from junit-common/src/main/java/org/jboss/weld/junit/MockEjbInjectionServices.java rename to weld-common/src/main/java/org/jboss/weld/testing/MockEjbInjectionServices.java index b031fa54..9ee3a5b9 100644 --- a/junit-common/src/main/java/org/jboss/weld/junit/MockEjbInjectionServices.java +++ b/weld-common/src/main/java/org/jboss/weld/testing/MockEjbInjectionServices.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit; +package org.jboss.weld.testing; import java.util.function.Function; @@ -24,7 +24,7 @@ import org.jboss.weld.injection.spi.ResourceReference; import org.jboss.weld.injection.spi.ResourceReferenceFactory; import org.jboss.weld.injection.spi.helpers.SimpleResourceReference; -import org.jboss.weld.junit.AbstractWeldInitiator.AbstractBuilder; +import org.jboss.weld.testing.AbstractWeldInitiator.AbstractBuilder; /** * diff --git a/junit-common/src/main/java/org/jboss/weld/junit/MockInterceptor.java b/weld-common/src/main/java/org/jboss/weld/testing/MockInterceptor.java similarity index 99% rename from junit-common/src/main/java/org/jboss/weld/junit/MockInterceptor.java rename to weld-common/src/main/java/org/jboss/weld/testing/MockInterceptor.java index 23729f1c..7a1fdbb0 100644 --- a/junit-common/src/main/java/org/jboss/weld/junit/MockInterceptor.java +++ b/weld-common/src/main/java/org/jboss/weld/testing/MockInterceptor.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit; +package org.jboss.weld.testing; import java.io.Serializable; import java.lang.annotation.Annotation; @@ -35,7 +35,7 @@ import jakarta.interceptor.InvocationContext; import org.jboss.weld.bean.builtin.BeanManagerProxy; -import org.jboss.weld.junit.MockInterceptor.MockInterceptorInstance; +import org.jboss.weld.testing.MockInterceptor.MockInterceptorInstance; import org.jboss.weld.util.bean.SerializableForwardingBean; import org.jboss.weld.util.collections.ImmutableSet; diff --git a/junit-common/src/main/java/org/jboss/weld/junit/MockJpaInjectionServices.java b/weld-common/src/main/java/org/jboss/weld/testing/MockJpaInjectionServices.java similarity index 97% rename from junit-common/src/main/java/org/jboss/weld/junit/MockJpaInjectionServices.java rename to weld-common/src/main/java/org/jboss/weld/testing/MockJpaInjectionServices.java index f660f5d9..28689c0f 100644 --- a/junit-common/src/main/java/org/jboss/weld/junit/MockJpaInjectionServices.java +++ b/weld-common/src/main/java/org/jboss/weld/testing/MockJpaInjectionServices.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit; +package org.jboss.weld.testing; import java.util.function.Function; @@ -26,7 +26,7 @@ import org.jboss.weld.injection.spi.ResourceReference; import org.jboss.weld.injection.spi.ResourceReferenceFactory; import org.jboss.weld.injection.spi.helpers.SimpleResourceReference; -import org.jboss.weld.junit.AbstractWeldInitiator.AbstractBuilder; +import org.jboss.weld.testing.AbstractWeldInitiator.AbstractBuilder; /** * diff --git a/junit-common/src/main/java/org/jboss/weld/junit/MockResourceInjectionServices.java b/weld-common/src/main/java/org/jboss/weld/testing/MockResourceInjectionServices.java similarity index 98% rename from junit-common/src/main/java/org/jboss/weld/junit/MockResourceInjectionServices.java rename to weld-common/src/main/java/org/jboss/weld/testing/MockResourceInjectionServices.java index 2cd223a9..57b64175 100644 --- a/junit-common/src/main/java/org/jboss/weld/junit/MockResourceInjectionServices.java +++ b/weld-common/src/main/java/org/jboss/weld/testing/MockResourceInjectionServices.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit; +package org.jboss.weld.testing; import java.beans.Introspector; import java.lang.reflect.Field; @@ -31,7 +31,7 @@ import org.jboss.weld.injection.spi.ResourceReference; import org.jboss.weld.injection.spi.ResourceReferenceFactory; import org.jboss.weld.injection.spi.helpers.SimpleResourceReference; -import org.jboss.weld.junit.AbstractWeldInitiator.AbstractBuilder; +import org.jboss.weld.testing.AbstractWeldInitiator.AbstractBuilder; import org.jboss.weld.util.collections.ImmutableMap; /** diff --git a/junit-common/src/main/java/org/jboss/weld/junit/WeldCDIExtension.java b/weld-common/src/main/java/org/jboss/weld/testing/WeldCDIExtension.java similarity index 98% rename from junit-common/src/main/java/org/jboss/weld/junit/WeldCDIExtension.java rename to weld-common/src/main/java/org/jboss/weld/testing/WeldCDIExtension.java index ee065e2b..33ba1be6 100644 --- a/junit-common/src/main/java/org/jboss/weld/junit/WeldCDIExtension.java +++ b/weld-common/src/main/java/org/jboss/weld/testing/WeldCDIExtension.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jboss.weld.junit; +package org.jboss.weld.testing; import java.lang.annotation.Annotation; import java.util.ArrayList;