diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 8747d8cd266..56e2b9abfcd 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -12,19 +12,19 @@ on: jobs: # builds Weld snapshot, downloads WFLY and upgrades it, prepares ENV variable - build-jdk11: - name: "Initial JDK 11 Weld Build + WildFly patch" + initial-build: + name: "Initial JDK 17 Weld Build + WildFly patch" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v4.2.1 with: - java-version: 11 + java-version: 17 distribution: 'temurin' - name: Download WildFly run: | - wget https://github.com/wildfly/wildfly/releases/download/33.0.1.Final/wildfly-33.0.1.Final.zip + wget https://github.com/wildfly/wildfly/releases/download/38.0.0.Final/wildfly-38.0.0.Final.zip unzip wildfly-*.zip -d container cd container mv ./* wildfly/ @@ -74,15 +74,12 @@ jobs: incontainer-tests: name: "Weld In-container Tests - JDK ${{matrix.java.name}}" runs-on: ubuntu-latest - needs: build-jdk11 + needs: initial-build timeout-minutes: 120 strategy: fail-fast: false matrix: java: - - { name: "11", - java-version: 11, - } - { name: "17", java-version: 17, @@ -91,6 +88,10 @@ jobs: name: "21", java-version: 21, } + - { + name: "25", + java-version: 25, + } steps: - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java.name }} @@ -141,15 +142,12 @@ jobs: CDI-TCK: name: "CDI TCK - JDK ${{matrix.java.name}}" runs-on: ubuntu-latest - needs: build-jdk11 + needs: initial-build timeout-minutes: 120 strategy: fail-fast: false matrix: java: - - { name: "11", - java-version: 11, - } - { name: "17", java-version: 17, @@ -158,6 +156,10 @@ jobs: name: "21", java-version: 21, } + - { + name: "25", + java-version: 25, + } steps: - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java.name }} @@ -208,7 +210,7 @@ jobs: relaxed-mode-test: name: "Relaxed mode testing - JDK ${{matrix.java.name}}" runs-on: ubuntu-latest - needs: build-jdk11 + needs: initial-build timeout-minutes: 120 strategy: fail-fast: false @@ -280,15 +282,12 @@ jobs: no-container-tests: name: "Weld Tests w/o Container - JDK ${{matrix.java.name}}" runs-on: ubuntu-latest - needs: build-jdk11 + needs: initial-build timeout-minutes: 120 strategy: fail-fast: false matrix: java: - - { name: "11", - java-version: 11, - } - { name: "17", java-version: 17, @@ -297,6 +296,10 @@ jobs: name: "21", java-version: 21, } + - { + name: "25", + java-version: 25, + } steps: - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java.name }} @@ -326,18 +329,18 @@ jobs: name: test-reports-no-container-jdk${{matrix.java.name}} path: 'test-reports.tgz' - # Weld Examples build and test, only JDK 11 + # Weld Examples build and test, only one JDK examples-tests: - name: "Weld Examples build and test - JDK 11}" + name: "Weld Examples build and test - JDK 17}" runs-on: ubuntu-latest - needs: build-jdk11 + needs: initial-build timeout-minutes: 120 steps: - uses: actions/checkout@v4 - - name: Set up JDK 11 + - name: Set up JDK uses: actions/setup-java@v4.2.1 with: - java-version: 11 + java-version: 17 distribution: 'temurin' - name: Download Maven Repo uses: actions/download-artifact@v4 @@ -354,11 +357,19 @@ jobs: path: . - name: Extract WildFly run: unzip wildfly.zip + # Build examples, start WFLY in background, give it time to boot, run JSF numberguess tests, shutdown WFLY - name: Build with Maven run: | + mvn clean verify -Dno-format -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -f examples/pom.xml JBOSS_HOME=`pwd`'/wildfly' export JBOSS_HOME=`echo $JBOSS_HOME` - mvn clean verify -Dno-format -Darquillian=wildfly-managed -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -f examples/pom.xml + $JBOSS_HOME/bin/standalone.sh & + sleep 3s + WFLY_PID=$(jps | grep -- jboss-modules.jar | grep -Eo '[0-9]{1,}') + mvn clean wildfly:deploy -Dno-format -f examples/jsf/numberguess/pom.xml + mvn clean verify -Dno-format -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Pintegration-testing -f examples/jsf/numberguess/pom.xml + kill -9 $WFLY_PID + sleep 3s - name: Prepare failure archive (if maven failed) if: failure() shell: bash @@ -382,15 +393,12 @@ jobs: CDI-TCK-SE: name: "CDI TCK SE - JDK ${{matrix.java.name}}" runs-on: ubuntu-latest - needs: build-jdk11 + needs: initial-build timeout-minutes: 120 strategy: fail-fast: false matrix: java: - - { name: "11", - java-version: 11, - } - { name: "17", java-version: 17, @@ -399,6 +407,10 @@ jobs: name: "21", java-version: 21, } + - { + name: "25", + java-version: 25, + } steps: - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java.name }} @@ -432,14 +444,14 @@ jobs: weld-se-servlet-coop: name: "Weld SE-Servlet Cooperation" runs-on: ubuntu-latest - needs: build-jdk11 + needs: initial-build timeout-minutes: 20 steps: - uses: actions/checkout@v4 - - name: Set up JDK 11 + - name: Set up JDK uses: actions/setup-java@v4.2.1 with: - java-version: 11 + java-version: 17 distribution: 'temurin' - name: Download Maven Repo uses: actions/download-artifact@v4 diff --git a/docs/reference/src/main/asciidoc/gettingstarted.asciidoc b/docs/reference/src/main/asciidoc/gettingstarted.asciidoc index af3e3484901..850079dda56 100644 --- a/docs/reference/src/main/asciidoc/gettingstarted.asciidoc +++ b/docs/reference/src/main/asciidoc/gettingstarted.asciidoc @@ -5,16 +5,13 @@ endif::[] [[gettingstarted]] == Getting started with Weld -Weld comes with a number of examples. We recommend you start with -`examples/jsf/numberguess` and `examples/jsf/translator`. Numberguess is -a web (war) example containing only non-transactional managed beans. +Weld comes with several numberguess examples in various flavors based on what environment you use. +In its classic variant, it is a web (war) example containing only non-transactional managed beans. This example can be run on a wide range of servers, including WildFly, GlassFish, Apache Tomcat, Jetty, and any compliant -Jakarta EE 10 container. Translator is an enterprise (ear) example that -contains session beans. This example must be run on WildFly 27 or better, -GlassFish 7 or better, or any compliant Jakarta EE 10 container. +Jakarta EE container. -Both examples use JSF 4.0.0 as the web framework and, as such, can be +The example uses JSF as the web framework and, as such, can be found in the `examples/jsf` directory of the Weld distribution. === Prerequisites @@ -25,16 +22,18 @@ following: * the latest release of Weld, which contains the examples * Maven 3, to build and deploy the examples * optionally, a supported runtime environment (minimum versions shown) -** WildFly 27, -** GlassFish 7 or better, -** Apache Tomcat 10.1 or better (war example only), or -** Jetty 11 or better (war example only) +** WildFly, +** GlassFish, +** Apache Tomcat, or +** Jetty + +Note that the version of these runtimes need to target the same Jakarta EE version that Weld does. In the next few sections, you'll be using the Maven command (`mvn`) to invoke the Maven project file in each example to compile, assemble and deploy the example to WildFly and, for the war example, Apache Tomcat. -You can also deploy the generated artifact (war or ear) to any other -container that supports Jakarta EE 10, such as GlassFish 7. +You can also deploy the generated artifact (war) to any other +container that supports Jakarta EE, such as GlassFish. The sections below cover the steps for deploying with Maven in detail. @@ -48,15 +47,13 @@ $> cd examples/jsf/numberguess $> mvn wildfly:run ------------------------------ -The https://docs.jboss.org/wildfly/plugins/maven/latest/[Maven WildFly plugin] will run WildFly and deploy the example and the server will be automatically downloaded in the `target` directory. +The https://docs.wildfly.org/wildfly-maven-plugin/[Maven WildFly plugin] will run WildFly and deploy the example and the server will be automatically downloaded in the `target` directory. The numberguess application is available at http://localhost:8080/weld-numberguess. === Deploying to WildFly -To deploy the examples to a WildFly instance, you'll need to download -http://wildfly.org/downloads/[WildFly] first. The good -news is that there are no additional modifications you have to make to -the server. It's ready to go! +To deploy the examples to your own WildFly instance, you'll need to download https://www.wildfly.org/downloads/[WildFly] first. +The good news is that there are no additional modifications you have to make to the server. It's ready to go! After you have downloaded WildFly, extract it. You can move the extracted folder anywhere you like. Wherever it lays to rest, that's what we'll call the WildFly @@ -64,8 +61,8 @@ installation directory, or `JBOSS_HOME`. [source, console] -------------------------------- -$> unzip wildfly-27.x.y.Final.zip -$> mv wildfly-27.*/ wildfly-27 +$> unzip wildfly-31.x.y.Final.zip +$> mv wildfly-31.*/ wildfly-31 -------------------------------- In order for the build scripts to know where to deploy the example, you @@ -75,13 +72,21 @@ e.g.: [source, console] ------------------------------------- -$> export JBOSS_HOME=/path/to/wildfly-27 +$> export JBOSS_HOME=/path/to/wildfly-31 ------------------------------------- +Next up, start your WildFly server. +Assuming default configuration and Linux, you can do that with the following command (for Windows, use the `.bat` file instead): + +[source, console] +-------------------------------- +$> cd path/to/wildfly +$> ./bin/standalone.sh +-------------------------------- + You're now ready to run your first example! -Switch to the `examples/jsf/numberguess` directory and execute the Maven -`deploy` target: +Switch to the `examples/jsf/numberguess` directory in Weld repository and execute the Maven `deploy` target: [source, console] ------------------------------ @@ -89,15 +94,7 @@ $> cd examples/jsf/numberguess $> mvn wildfly:deploy ------------------------------ -NOTE: If you are using Eclipse, you should seriously consider installing the -http://tools.jboss.org[JBoss Tools] add-ons, which include a wide -variety of tooling for CDI and Jakarta EE development, as well as an -enhanced WildFly server view. - -Wait a few seconds for the application to deploy (or the application -server to start) and see if you can determine the most efficient -approach to pinpoint the random number at the local URL -http://localhost:8080/weld-numberguess. +Wait a bit for the application to deploy and see if you can determine the most efficient approach to pinpoint the random number at the local URL http://localhost:8080/weld-numberguess. [NOTE] ==== @@ -116,12 +113,13 @@ https://docs.wildfly.org/wildfly-maven-plugin/[plugin documentation]. ==== -You can also run functional tests to verify that the example works as -expected. Run: +TODO this ain't true!!! + +You can also run some simple integration tests to verify that the example works as expected. Keep the server with deployed application running and execute the following: [source, console] -------------------------------------------- -$> mvn verify -Darquillian=wildfly-managed +$> mvn verify -Pintegration-testing -------------------------------------------- You should see the following output: @@ -131,64 +129,6 @@ You should see the following output: Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 ------------------------------------------------ -The second starter example, `weld-translator`, will translate your text -into Latin. (Well, not really, but the stub is there for you to -implement, at least. Good luck!) To try it out, switch to the translator -example directory and execute the deploy target: - -[source, console] ---------------------------------- -$> cd examples/jsf/translator/ear -$> mvn wildfly:run ---------------------------------- - -NOTE: The translator uses session beans, which are packaged in an EJB module -within an ear. Java EE 8 allows session beans to be deployed in war -modules, but that's a topic for a later chapter. - -Again, wait a few seconds for the application to deploy (if you're -really bored, read the log messages), and visit -http://localhost:8080/weld-translator to begin pseudo-translating. - -Again, functional tests can be running by executing: - -[source, console] --------------------------------------------- -$> cd examples/jsf/translator/ftest -$> mvn verify -Darquillian=wildfly-managed --------------------------------------------- - -=== Deploying to GlassFish - -Deploying to GlassFish should be easy and familiar, right? After all, -it's the Jakarta EE compatible implementation and Weld is the CDI -compatible implementation, meaning Weld gets bundled with GlassFish. So -yes, it's all quite easy and familiar. - -To deploy the examples to GlassFish, you'll need a GlassFish 7 release. Extract -the zip to a directory of your choice and set the `GLASSFISH_HOME` environment -variable. Switch to the `GLASSFISH_HOME` directory and start the server: - -[source, console] ----------------------------------- -$> ./bin/asadmin start-domain ----------------------------------- - -Now you can deploy the example. - -[source, console] ------------------------------- -$> ./bin/asadmin deploy /path/examples/jsf/numberguess/target/weld-numberguess.war ------------------------------- - -Once the command completes the application is available at -http://localhost:8080/weld-numberguess - -The reason the same artifact can be deployed to both WildFly and -GlassFish, without any modifications, is because all of the features -being used are part of the standard platform. And what a capable -platform it has become! - === Deploying to Apache Tomcat Servlet containers are not required to support Jakarta EE services like @@ -213,7 +153,7 @@ for more info). Let's give the Weld servlet extension a spin on Apache Tomcat. First, you'll need to download Tomcat 10.1 or later from -https://tomcat.apache.org/download-10.cgi[tomcat.apache.org] and extract +https://tomcat.apache.org/[tomcat.apache.org] and extract it. [source, console] @@ -240,7 +180,7 @@ a Windows command window: [source, console] ------------------------------------ -$> cd c:\path\to\apache-tomcat-9\bin +$> cd c:\path\to\apache-tomcat-10\bin $> start ------------------------------------ diff --git a/docs/reference/src/main/asciidoc/images/m2eclipse-wicket-numberguess-import.png b/docs/reference/src/main/asciidoc/images/m2eclipse-wicket-numberguess-import.png deleted file mode 100644 index 7687afac3ad..00000000000 Binary files a/docs/reference/src/main/asciidoc/images/m2eclipse-wicket-numberguess-import.png and /dev/null differ diff --git a/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-1.png b/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-1.png deleted file mode 100644 index 188e2405ef7..00000000000 Binary files a/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-1.png and /dev/null differ diff --git a/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-2.png b/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-2.png deleted file mode 100644 index 0273cf94599..00000000000 Binary files a/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-2.png and /dev/null differ diff --git a/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-3.png b/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-3.png deleted file mode 100644 index bb39d1351f7..00000000000 Binary files a/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-3.png and /dev/null differ diff --git a/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-4.png b/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-4.png deleted file mode 100644 index b20b80d422f..00000000000 Binary files a/docs/reference/src/main/asciidoc/images/weld-se-numberguess-m2eclipse-4.png and /dev/null differ diff --git a/docs/reference/src/main/asciidoc/images/wicket-conversations-snap.png b/docs/reference/src/main/asciidoc/images/wicket-conversations-snap.png deleted file mode 100755 index 9c20a38a5b4..00000000000 Binary files a/docs/reference/src/main/asciidoc/images/wicket-conversations-snap.png and /dev/null differ diff --git a/docs/reference/src/main/asciidoc/images/wicket-numberguess-project.png b/docs/reference/src/main/asciidoc/images/wicket-numberguess-project.png deleted file mode 100755 index 80c77e67d26..00000000000 Binary files a/docs/reference/src/main/asciidoc/images/wicket-numberguess-project.png and /dev/null differ diff --git a/docs/reference/src/main/asciidoc/intro.asciidoc b/docs/reference/src/main/asciidoc/intro.asciidoc index 4cbdd783e51..3f3fbac9d98 100644 --- a/docs/reference/src/main/asciidoc/intro.asciidoc +++ b/docs/reference/src/main/asciidoc/intro.asciidoc @@ -16,42 +16,16 @@ to actually use them to build an application! A bean is exactly what you think it is. Only now, it has a true identity in the container environment. -Prior to Java EE 6, there was no clear definition of the term "bean" in -the Java EE platform. Of course, we've been calling Java classes used in -web and enterprise applications "beans" for years. There were even a -couple of different kinds of things called "beans" in EE specifications, -including EJB beans and JSF managed beans. Meanwhile, other third-party -frameworks such as Spring and Seam introduced their own ideas of what it -meant to be a "bean". What we've been missing is a common definition. - -Java EE 6 finally laid down that common definition in the Managed Beans -specification. Managed Beans are defined as container-managed objects -with minimal programming restrictions, otherwise known by the acronym -POJO (Plain Old Java Object). They support a small set of basic -services, such as resource injection, lifecycle callbacks and -interceptors. Companion specifications, such as EJB and CDI, build on -this basic model. But, _at last_, there's a uniform concept of a bean -and a lightweight component model that's aligned across the Java EE -platform. +Starting with Java EE 6 (now Jakarta) there was a common definition of beans through Managed Beans specification. Managed Beans were defined as container-managed objects with minimal programming restrictions, otherwise known by the acronym POJO (Plain Old Java Object). They support a small set of basic services, such as resource injection, lifecycle callbacks and interceptors. CDI/Weld builds on this basic model and clearly defines a uniform concept of a bean and a lightweight component model that's aligned across the Jakarta EE platform, MicroProfile specification and more. With very few exceptions, almost every concrete Java class that has a constructor with no parameters (or a constructor designated with the -annotation `@Inject`) is a bean. This includes every JavaBean and every -EJB session bean. If you've already got some JavaBeans or session beans -lying around, they're already beans—you won't need any additional -special metadata. - -The JavaBeans and EJBs you've been writing every day, up until now, have -not been able to take advantage of the new services defined by the CDI -specification. But you'll be able to use every one of them with -CDI—allowing the container to create and destroy instances of your beans -and associate them with a designated context, injecting them into other -beans, using them in EL expressions, specializing them with qualifier -annotations, even adding interceptors and decorators to them—without -modifying your existing code. At most, you'll need to add some -annotations. - -Now let's see how to create your first bean that actually uses CDI. +annotation `@Inject`) is a bean; including EJB sessions beans. If you've already got some session beans lying around, they're already beans—you won't need any additional special metadata. + +CDI container manages the lifecycle of your beans from creation to destruction. It also controls their association to designated context, injection into beans, bean availability in EL expressions, interception and decoration, specialization with qualifiers and more. +Many of these functionalities are working automatically, for some you may need to add an annotation or two. + +But enough talking, let's see how to create your first bean that actually uses CDI. === Getting our feet wet diff --git a/docs/reference/src/main/asciidoc/part2.asciidoc b/docs/reference/src/main/asciidoc/part2.asciidoc index 32e243993c5..20b02529b1e 100644 --- a/docs/reference/src/main/asciidoc/part2.asciidoc +++ b/docs/reference/src/main/asciidoc/part2.asciidoc @@ -5,20 +5,23 @@ endif::[] [[part-2]] = Getting Start with Weld, the CDI Reference Implementation -Weld, the CDI Reference Implementation (RI), can be downloaded from the +Weld, the CDI Compatible Implementation, can be downloaded from the http://weld.cdi-spec.org/download[download page]. Information about the -Weld source code repository and instructions about how to obtain and +Weld https://github.com/weld[source code repository] and instructions about how to obtain and build the source can be found on the same page. -Weld provides a complete SPI allowing Java EE containers such as +Weld provides a complete SPI allowing Jakarta EE containers such as WildFly, GlassFish and WebLogic to use Weld as their built-in CDI implementation. Weld also runs in servlet engines like Tomcat and Jetty, or even in a plain Java SE environment. -Weld comes with an extensive library of examples, which are a great -starting point from which to learn CDI. In addition, a number of -quickstarts featuring CDI can be found at the -http://www.jboss.org/developer/quickstarts.html[JBoss Developer site] +Weld comes with several examples showing various possible usages: + +* A full blow Jakarta EE server (WildFly) +* Servlets such as Tomcat or Jetty +* Standalone Java SE application + +Many more Jakarta EE examples can be seen in quickstarts of Jakarta EE servers. A good repository to browse would be https://github.com/wildfly/quickstart[WildFly Quickstarts] as it shows many more Jakarta-world technologies smoothly integrating with CDI/Weld. include::gettingstarted.asciidoc[] diff --git a/docs/reference/src/main/asciidoc/weldexamples.asciidoc b/docs/reference/src/main/asciidoc/weldexamples.asciidoc index d7729d984f9..337f5715f46 100644 --- a/docs/reference/src/main/asciidoc/weldexamples.asciidoc +++ b/docs/reference/src/main/asciidoc/weldexamples.asciidoc @@ -21,102 +21,114 @@ examining the configuration files. All the configuration files for this example are located in `WEB-INF/`, which can be found in the `src/main/webapp` directory of the example. -First, we have the JSF 2.2 version of `faces-config.xml`. A standardized -version of Facelets is the default view handler in JSF 2.2, so there's +First, we have the JSF 4.0 version of `faces-config.xml`. A standardized +version of Facelets is the default view handler in JSF, so there's really nothing that we have to configure. Thus, the configuration consists of only the root element. [source.XML, xml] ------------------------------------------------------------------ - - - numberguess - + ------------------------------------------------------------------ There's also an empty `beans.xml` file, which tells the container to look for beans in this archive and to activate the CDI services. -Finally, some of the supported servers also need a `web.xml` which is -located in `src/main/webapp-[server]/WEB-INF`. +Finally, some supported servers also need a `web.xml` which is located in `src/main/webapp-[server]/WEB-INF`. + +NOTE: This demo uses JSF as the view framework, but you can use Weld with any servlet-based web framework. -NOTE: This demo uses JSF 2 as the view framework, but you can use Weld with -any servlet-based web framework, such as JSF 1.2 or Wicket. +TODO continue here Let's take a look at the main JSF view, `src/main/webapp/home.xhtml`. [source.XML, xml] ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - - -

Guess a number...

- -
- - - -
- -
- I'm thinking of a number between - #{game.smallest} - and #{game.biggest}. - You have #{game.remainingGuesses} guesses remaining. -
- -
- Your guess: - - -
-
- -
-
-
-
+ xmlns:ui="jakarta.faces.facelets" + xmlns:h="jakarta.faces.html" + xmlns:f="jakarta.faces.core"> + + + + numberguess + + + +
+

Guess a number...

+ + + +
+ + + +
+ + +
+ I'm thinking of a number between #{game.smallest} and #{game.biggest}. You have + #{game.remainingGuesses} guesses remaining. +
+ + + +
+ Your guess: + + +
+
+ +
+
+ +
+ +
+ + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -<1> Facelets is the built-in templating language for JSF. Here we are -wrapping our page in a template which defines the layout. - -<2> There are a number of messages which can be sent to the user, "Higher!", +<1> There are a number of messages which can be sent to the user, "Higher!", "Lower!" and "Correct!" -<3> As the user guesses, the range of numbers they can guess gets smaller - +<2> As the user guesses, the range of numbers they can guess gets smaller - this sentence changes to make sure they know the number range of a valid guess. -<4> This input field is bound to a bean property using a value expression. +<3> This input field is bound to a bean property using a value expression. -<5> A validator binding is used to make sure the user doesn't accidentally +<4> A validator binding is used to make sure the user doesn't accidentally input a number outside of the range in which they can guess - if the validator wasn't here, the user might use up a guess on an out of bounds number. -<6> And, of course, there must be a way for the user to send their guess to +<5> And, of course, there must be a way for the user to send their guess to the server. Here we bind to an action method on the bean. -The example consists of 4 classes, the first two of which are -qualifiers. First, there is the `@Random` qualifier, used for injecting -a random number: +The example consists of 4 classes, two of which are qualifiers. +First, there is the `@Random` qualifier, used for injecting a random number: [source.JAVA, java] -------------------------------------------- @@ -185,7 +197,7 @@ retrieving a random number from the `@Random You'll notice that we've also added the `@Named` annotation to this class. This annotation is only required when you want to make the bean -accessible to a JSF view via EL (i.e., #\{game}). +accessible to a JSF view via EL (i.e., `#\{game}`). [source.JAVA, java] ------------------------------------------------------------------------------------------------- @@ -298,12 +310,11 @@ does not provide the CDI services. For your convenience we provide a single jar suitable for running Weld in any servlet container (including Jetty), `weld-servlet-shaded`. -NOTE: You must also include the jars for JSF, EL, and the common annotations, -all of which are provided by the Java EE platform (a Java EE application server). +NOTE: You must also include the jars for JSF, EL, and the common annotations, all of which are provided by the Java EE platform (a Jakarta EE application server). Second, we need to explicitly specify the servlet listener in `web.xml`, again because the container isn't doing this stuff for you. The servlet -listener boots Weld and controls it's interaction with requests. +listener boots Weld and controls its interaction with requests. [source.XML, xml] ------------------------------------------------------------------------------- @@ -325,63 +336,6 @@ Swing application with no EJB or servlet dependencies. This example can be found in the `examples/se/numberguess` folder of the Weld distribution. -==== Creating the Eclipse project - -To use the Weld SE numberguess example in Eclipse, you can either import -it as a Maven project if you have the -http://m2eclipse.sonatype.org/[m2eclipse plugin] installed, or generate -an Eclipse project and import it. - -With m2eclipse installed, you can open any Maven project directly. From -within Eclipse, select _File \-> Import... \-> Existing Maven Projects_. -Then, browse to the location of the Weld SE numberguess example. You -should see that Eclipse recognizes the Maven project. - -Without m2eclipse plugin, you first have to generate an Eclipse project. -Switch into the Weld SE numberguess example folder, then execute the -Maven Eclipse plugin, as follows: - -[source, console] ------------------------------------------------------------------------------------ -mvn eclipse:configure-workspace -Declipse.workspace=/path/to/your/eclipse/workspace ------------------------------------------------------------------------------------ - -and then - -[source, console] -------------------- -mvn eclipse:eclipse -------------------- - -Then from within Eclipse, select _File \-> Import... \-> Existing Projects -into Workspace_ and browse to the location of the Weld SE numberguess -example. - -In both cases, you should now see a project in your workspace called -`weld-se-numberguess`. - -It's time to get the example running! - -==== Running the example from Eclipse - -Disable m2eclipse's _Workspace Resolution_, to make sure that Eclipse -can find `StartMain`. Right click on the project, and choose _Properties -\-> Maven_, and uncheck _Resolve dependencies from Workspace projects_: - -image:images/weld-se-numberguess-m2eclipse-1.png[image] - -Right click on the project, and choose _Run As \-> Java Application_: - -image:images/weld-se-numberguess-m2eclipse-2.png[image] - -Locate the `StartMain` class: - -image:images/weld-se-numberguess-m2eclipse-3.png[image] - -The application should now launch! - -image:images/weld-se-numberguess-m2eclipse-4.png[image] - ==== Running the example from the command line * Ensure that Maven 3 is installed and in your PATH @@ -684,8 +638,7 @@ public class NumberGuessFrame extends javax.swing.JFrame { <3> This application is started in the prescribed Weld SE way, by observing the `ContainerInitialized` event. -<4> This method initializes all of the Swing components. Note the use of the -`msgGenerator` here. +<4> This method initializes all the Swing components. Note the use of the `msgGenerator` here. <5> `guessButtonActionPerformed` is called when the 'Guess' button is clicked, and it does the following: @@ -706,216 +659,7 @@ guesses). game, refreshes the messages in the UI and sets the button's label based on the game state. -=== The translator example in depth - -The translator example will take any sentences you enter, and translate -them to Latin. (Well, not really, but the stub is there for you to -implement, at least. Good luck!) - -The translator example is built as an EAR and contains EJBs. As a -result, it's structure is more complex than the numberguess example. - -NOTE: Java EE 7, which bundles EJB 3.2, allows you to package EJBs in a WAR, -which will make this structure much simpler! Still, there are other -advantages of using an EAR. - -First, let's take a look at the EAR aggregator project, which is located -in the example's `ear` directory. Maven automatically generates the -`application.xml` for us from this plugin configuration: - -[source.XML, xml] ---------------------------------------------------------------------- - - org.apache.maven.plugins - maven-ear-plugin - - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-war - /weld-translator - - - - ---------------------------------------------------------------------- - -This configuration overrides the web context path, resulting in this -application URL: http://localhost:8080/weld-translator. - -[NOTE] -==== - -If you weren't using Maven to generate these files, you would need -`META-INF/application.xml`: - -[source.XML, xml] ------------------------------------------------------------------- - - - weld-jsf-translator-ear - The Weld JSF translator example (ear) - - - - weld-translator.war - /weld-translator - - - - weld-translator.jar - - ------------------------------------------------------------------- -==== - -Next, let's look at the WAR, which is located in the example's `war` -directory. Just as in the numberguess example, we have a -`faces-config.xml` for JSF 2.2 and a `web.xml` (to activate JSF) under -WEB-INF, both sourced from `src/main/webapp/WEB-INF`. - -More interesting is the JSF view used to translate text. Just as in the -numberguess example we have a template, which surrounds the form -(omitted here for brevity): - -[source.XML, xml] ------------------------------------------------------------------------------------------------------- - - - - - - - - - - - -
- Your text - - Translation -
- - - -
-
- -
- -
------------------------------------------------------------------------------------------------------- - -The user can enter some text in the left-hand text area, and hit the -translate button to see the result to the right. - -Finally, let's look at the EJB module, which is located in the example's -`ejb` directory. In `src/main/resources/META-INF` there is just an empty -`beans.xml`, used to mark the archive as containing beans. - -NOTE: The `beans.xml` file is no longer required for CDI enablement as of CDI -1.1. CDI is automatically enabled for archives which don't contain -`beans.xml` but contain one or more bean classes with a _bean defining -annotation_, as described in section -ifndef::generate-index-link[<<_implicit_bean_archive>>] -ifdef::generate-index-link[link:ee.html#_implicit_bean_archive[Implicit bean archive]] -. - -We've saved the most interesting bit for last, the code! The project has -two simple beans, `SentenceParser` and `TextTranslator` and two session -beans, `TranslatorControllerBean` and `SentenceTranslator`. You should -be getting quite familiar with what a bean looks like by now, so we'll -just highlight the most interesting bits here. - -Both `SentenceParser` and `TextTranslator` are dependent beans, and -`TextTranslator` uses constructor injection: - -[source.JAVA, java] ------------------------------------------------------------------- -public class TextTranslator implements Serializable { - - private SentenceParser sentenceParser; - - @EJB private Translator translator; - - @Inject public TextTranslator(SentenceParser sentenceParser) { - this.sentenceParser = sentenceParser; - } - - public String translate(String text) { - StringBuilder sb = new StringBuilder(); - for (String sentence: sentenceParser.parse(text)) { - sb.append(translator.translate(sentence)).append(". "); - } - return sb.toString().trim(); - } - -} ------------------------------------------------------------------- - -`TextTranslator` uses the simple bean (really just a plain Java class!) -`SentenceParser` to parse the sentence and then calls on the stateless -bean with the local business interface `Translator` to perform the -translation. That's where the magic happens. Of course, we couldn't -develop a full translator, but it's convincing enough to anyone who -doesn't understand Latin! - -[source.JAVA, java] --------------------------------------------------------- -@Stateless -public class SentenceTranslator implements Translator { - - public String translate(String sentence) { - return "Lorem ipsum dolor sit amet"; - } - -} --------------------------------------------------------- - -Finally, there is UI orientated controller. This is a request scoped, -named, stateful session bean, which injects the translator. It collects -the text from the user and dispatches it to the translator. The bean -also has getters and setters for all the fields on the page. - -[source.JAVA, java] ------------------------------------------------------------------------ -@Stateful -@RequestScoped -@Named("translator") -public class TranslatorControllerBean implements TranslatorController { - - @Inject private TextTranslator translator; - - private String inputText; - - private String translatedText; - - public void translate() { - translatedText = translator.translate(inputText); - } - - public String getText() { - return inputText; - } - - public void setText(String text) { - this.inputText = text; - } - - public String getTranslatedText() { - return translatedText; - } - - @Remove public void remove() {} - -} ------------------------------------------------------------------------ - That concludes our short tour of the Weld starter examples. For more information on Weld, please visit http://weld.cdi-spec.org/. + +If you want to browse more Jakarta EE examples which leverage CDI technologies, there is a fair amount of them among https://github.com/wildfly/quickstart[WildFly Quickstarts]. diff --git a/environments/se/core/pom.xml b/environments/se/core/pom.xml index d6ba8b33ffb..3c7d890dfaf 100644 --- a/environments/se/core/pom.xml +++ b/environments/se/core/pom.xml @@ -98,18 +98,18 @@ test - org.codehaus.groovy + org.apache.groovy groovy-all true pom - org.codehaus.groovy + org.apache.groovy groovy-test-junit5 - org.codehaus.groovy + org.apache.groovy groovy-testng @@ -149,6 +149,8 @@ + + ${maven.compiler.argument.target} ${project.basedir}/src/test/groovy @@ -169,10 +171,6 @@ compile - - ${maven.compiler.source} - ${maven.compiler.target} - diff --git a/environments/se/tests/src/test/java/org/jboss/weld/environment/se/test/shutdown/hook/UndertowTestServer.java b/environments/se/tests/src/test/java/org/jboss/weld/environment/se/test/shutdown/hook/UndertowTestServer.java index 015e30f589f..1c0967a9df4 100644 --- a/environments/se/tests/src/test/java/org/jboss/weld/environment/se/test/shutdown/hook/UndertowTestServer.java +++ b/environments/se/tests/src/test/java/org/jboss/weld/environment/se/test/shutdown/hook/UndertowTestServer.java @@ -16,11 +16,8 @@ */ package org.jboss.weld.environment.se.test.shutdown.hook; -import java.net.BindException; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.commons.lang3.exception.ExceptionUtils; - import io.undertow.Undertow; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; @@ -49,15 +46,9 @@ static void start() throws InterruptedException { } try { INSTANCE.server.start(); - } catch (Exception e) { - // we might have started the server too early, it's stop() action was still in progress, wait a bit and retry - // this was happening with JDK 11 in Jenkins only - if (ExceptionUtils.indexOfType(e, BindException.class) != -1) { - Thread.sleep(2000l); - INSTANCE.server.start(); - } - } finally { STARTED.set(true); + } catch (Exception e) { + throw new IllegalStateException("There was an error starting Undertow server.", e); } } diff --git a/environments/servlet/tests/jetty/pom.xml b/environments/servlet/tests/jetty/pom.xml index af431d726e4..f2d1da5e342 100644 --- a/environments/servlet/tests/jetty/pom.xml +++ b/environments/servlet/tests/jetty/pom.xml @@ -3,7 +3,7 @@ weld-servlet-parent org.jboss.weld.servlet - 5.0.1-SNAPSHOT + 6.0.0-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/examples/jsf/login/README.md b/examples/jsf/login/README.md deleted file mode 100644 index d44bd74d189..00000000000 --- a/examples/jsf/login/README.md +++ /dev/null @@ -1,23 +0,0 @@ -Weld Login Example -================== - -Deploying to WildFly ---------------------- - -Make sure you have assigned the absolute path of your installation to the -`JBOSS_HOME` environment variable. - -1. Open terminal and start the server by running script: - - $JBOSS_HOME/bin/standalone.sh - -2. Deploy example to the server you have started in step 1 using command - - mvn wildfly:deploy - -3. Now you can view the application at . - - -To run functional tests execute: - - mvn verify -Darquillian=wildfly-managed diff --git a/examples/jsf/login/pom.xml b/examples/jsf/login/pom.xml deleted file mode 100644 index 1ec21c7720f..00000000000 --- a/examples/jsf/login/pom.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - 4.0.0 - - - org.jboss.weld.examples - weld-examples-parent - 5.1.7-SNAPSHOT - ../../pom.xml - - - org.jboss.weld.examples.jsf - weld-jsf-login - war - Weld Examples: Login (JSF) - - http://weld.cdi-spec.org - - - Apache License, Version 2.0 - repo - http://www.apache.org/licenses/LICENSE-2.0.html - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - jakarta.faces - jakarta.faces-api - provided - - - - jakarta.persistence - jakarta.persistence-api - provided - - - - jakarta.transaction - jakarta.transaction-api - provided - - - - jakarta.annotation - jakarta.annotation-api - provided - - - - jakarta.ejb - jakarta.ejb-api - provided - - - - junit - junit - test - - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - - org.jboss.arquillian.graphene - graphene-webdriver - pom - - - - - - weld-login - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - - - - - - ftest - - - - org.codehaus.mojo - build-helper-maven-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - - - - - arquillian-wildfly-managed - - - - arquillian-wildfly-remote - - - - - diff --git a/examples/jsf/login/src/ftest/java/org/jboss/weld/examples/login/ftest/CommonLoginTest.java b/examples/jsf/login/src/ftest/java/org/jboss/weld/examples/login/ftest/CommonLoginTest.java deleted file mode 100755 index 1579c7d309d..00000000000 --- a/examples/jsf/login/src/ftest/java/org/jboss/weld/examples/login/ftest/CommonLoginTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, 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.examples.login.ftest; - -import static org.jboss.arquillian.graphene.Graphene.guardHttp; -import static org.jboss.arquillian.graphene.Graphene.waitModel; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.drone.api.annotation.Drone; -import org.jboss.arquillian.graphene.condition.element.WebElementConditionFactory; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -/** - * Tests login examples in Weld - * - * @author maschmid - * @author kpiwko - * @author plenyi - */ -@RunWith(Arquillian.class) -@RunAsClient -public class CommonLoginTest { - - protected String MAIN_PAGE = "/home.jsf"; - private static final By LOGGED_IN = By.xpath("//li[contains(text(),'Welcome')]"); - private static final By LOGGED_OUT = By.xpath("//li[contains(text(),'Goodbye')]"); - private static final By USERNAME_FIELD = By.id("loginForm:username"); - private static final By PASSWORD_FIELD = By.id("loginForm:password"); - private static final By LOGIN_BUTTON = By.id("loginForm:login"); - private static final By LOGOUT_BUTTON = By.id("loginForm:logout"); - - @Drone - WebDriver driver; - - @FindBy(id = "loginForm:logout") - WebElement logoutElement; - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestDeployment1() { - return Deployments.createDeployment(); - } - - @Before - public void openStartUrl() { - driver.manage().deleteAllCookies(); - driver.navigate().to(contextPath); - } - - @Test - public void loginTest() { - waitModel(driver).until().element(USERNAME_FIELD).is().present(); - assertFalse("User should not be logged in!", new WebElementConditionFactory(logoutElement).isPresent().apply(driver)); - - driver.findElement(USERNAME_FIELD).clear(); - driver.findElement(USERNAME_FIELD).sendKeys("demo"); - - driver.findElement(PASSWORD_FIELD).clear(); - driver.findElement(PASSWORD_FIELD).sendKeys("demo"); - - guardHttp(driver.findElement(LOGIN_BUTTON)).click(); - assertTrue("User should be logged in!", driver.findElement(LOGGED_IN).isDisplayed()); - } - - @Test - public void logoutTest() { - waitModel(driver).until().element(USERNAME_FIELD).is().present(); - assertFalse("User should not be logged in!", new WebElementConditionFactory(logoutElement).isPresent().apply(driver)); - - driver.findElement(USERNAME_FIELD).clear(); - driver.findElement(USERNAME_FIELD).sendKeys("demo"); - - driver.findElement(PASSWORD_FIELD).clear(); - driver.findElement(PASSWORD_FIELD).sendKeys("demo"); - - guardHttp(driver.findElement(LOGIN_BUTTON)).click(); - assertTrue("User should be logged in!", driver.findElement(LOGGED_IN).isDisplayed()); - - guardHttp(driver.findElement(LOGOUT_BUTTON)).click(); - assertTrue("User should not be logged in!", driver.findElement(LOGGED_OUT).isDisplayed()); - } -} diff --git a/examples/jsf/login/src/ftest/java/org/jboss/weld/examples/login/ftest/Deployments.java b/examples/jsf/login/src/ftest/java/org/jboss/weld/examples/login/ftest/Deployments.java deleted file mode 100644 index f51b46b612c..00000000000 --- a/examples/jsf/login/src/ftest/java/org/jboss/weld/examples/login/ftest/Deployments.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, 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.examples.login.ftest; - -import java.io.File; - -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.importer.ZipImporter; -import org.jboss.shrinkwrap.api.spec.WebArchive; - -/** - * Creates a deployment from a build Web Archive using ShrinkWrap ZipImporter - * @author maschmid - * - */ -public class Deployments { - private static final String ARCHIVE_NAME = "weld-login.war"; - private static final String BUILD_DIRECTORY = "target"; - - public static WebArchive createDeployment() { - return ShrinkWrap.create(ZipImporter.class, ARCHIVE_NAME).importFrom(new File(BUILD_DIRECTORY + '/' + ARCHIVE_NAME)) - .as(WebArchive.class); - } -} diff --git a/examples/jsf/login/src/ftest/resources/arquillian.xml b/examples/jsf/login/src/ftest/resources/arquillian.xml deleted file mode 100644 index 5028fd17cc4..00000000000 --- a/examples/jsf/login/src/ftest/resources/arquillian.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -Xmx1024m -XX:MaxPermSize=512m ${jacoco.agent} ${additional.vm.args} - - - - - - - diff --git a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Credentials.java b/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Credentials.java deleted file mode 100644 index 09b6776281e..00000000000 --- a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Credentials.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.jboss.weld.examples.login; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Default; -import jakarta.inject.Named; - -@RequestScoped -@Named -@Default -public class Credentials { - - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - -} diff --git a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/EJBUserManager.java b/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/EJBUserManager.java deleted file mode 100644 index 34dfcdeffa5..00000000000 --- a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/EJBUserManager.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.jboss.weld.examples.login; - -import java.util.List; -import java.util.logging.Logger; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Produces; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.persistence.EntityManager; - -@Named("userManager") -@RequestScoped -@Alternative -@Stateful -public class EJBUserManager implements UserManager { - - @Inject - private transient Logger logger; - - @Inject - private EntityManager userDatabase; - - private Person newUser = new Person(); - - @SuppressWarnings("unchecked") - @Produces - @Named - @RequestScoped - public List getUsers() throws Exception { - return userDatabase.createQuery("select u from User u").getResultList(); - } - - public String addUser() throws Exception { - if (newUser.getName().isEmpty() || newUser.getUsername().isEmpty() || newUser.getPassword().isEmpty()) { - return "/users.xhtml?faces-redirect=true"; - } - userDatabase.persist(newUser); - logger.info("Added " + newUser); - return "/users.xhtml?faces-redirect=true"; - } - - public Person getNewUser() { - return newUser; - } - - public void setNewUser(Person newUser) { - this.newUser = newUser; - } - -} diff --git a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/LoggedIn.java b/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/LoggedIn.java deleted file mode 100644 index bb9e381f878..00000000000 --- a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/LoggedIn.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.jboss.weld.examples.login; - -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 java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Retention(RetentionPolicy.RUNTIME) -@Target({ TYPE, METHOD, FIELD, PARAMETER }) -@Qualifier -public @interface LoggedIn { -} diff --git a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Login.java b/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Login.java deleted file mode 100644 index 024a74874b5..00000000000 --- a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Login.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.jboss.weld.examples.login; - -import java.io.Serializable; -import java.util.List; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.Produces; -import jakarta.faces.application.FacesMessage; -import jakarta.faces.context.FacesContext; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; - -@SessionScoped -@Named -public class Login implements Serializable { - - private static final long serialVersionUID = 7965455427888195913L; - - @Inject - private Credentials credentials; - - @PersistenceContext - private EntityManager userDatabase; - - private Person currentUser; - - @SuppressWarnings("unchecked") - public void login() { - - List results = userDatabase - .createQuery("select u from Person u where u.username=:username and u.password=:password") - .setParameter("username", credentials.getUsername()).setParameter("password", credentials.getPassword()) - .getResultList(); - - if (!results.isEmpty()) { - currentUser = results.get(0); - FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Welcome, " + currentUser.getName())); - } - - } - - public void logout() { - FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Goodbye, " + currentUser.getName())); - currentUser = null; - } - - public boolean isLoggedIn() { - return currentUser != null; - } - - @Produces - @LoggedIn - public Person getCurrentUser() { - return currentUser; - } - -} diff --git a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/ManagedBeanUserManager.java b/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/ManagedBeanUserManager.java deleted file mode 100644 index dce641ba6cf..00000000000 --- a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/ManagedBeanUserManager.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.jboss.weld.examples.login; - -import java.util.List; -import java.util.logging.Logger; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Produces; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.persistence.EntityManager; -import jakarta.transaction.UserTransaction; - -@Named("userManager") -@RequestScoped -public class ManagedBeanUserManager implements UserManager { - - @Inject - private transient Logger logger; - - @Inject - private EntityManager userDatabase; - - @Inject - private UserTransaction utx; - - private Person newUser = new Person(); - - @Override - @SuppressWarnings("unchecked") - @Produces - @Named - @RequestScoped - public List getUsers() throws Exception { - try { - try { - utx.begin(); - return userDatabase.createQuery("select u from Person u").getResultList(); - } finally { - utx.commit(); - } - } catch (Exception e) { - utx.rollback(); - throw e; - } - } - - @Override - public String addUser() throws Exception { - if (newUser.getName().isEmpty() || newUser.getUsername().isEmpty() || newUser.getPassword().isEmpty()) { - return "/users.xhtml?faces-redirect=true"; - } - try { - try { - utx.begin(); - userDatabase.persist(newUser); - logger.info("Added " + newUser); - return "/users.xhtml?faces-redirect=true"; - } finally { - utx.commit(); - } - } catch (Exception e) { - utx.rollback(); - throw e; - } - } - - @Override - public Person getNewUser() { - return newUser; - } - - @Override - public void setNewUser(Person newUser) { - this.newUser = newUser; - } - -} diff --git a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Person.java b/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Person.java deleted file mode 100644 index 1ed878c00d1..00000000000 --- a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Person.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.jboss.weld.examples.login; - -import jakarta.persistence.Entity; -import jakarta.persistence.Id; - -@Entity -public class Person { - @Id - private String username; - private String name; - private String password; - - public Person() { - } - - public String getUsername() { - return username; - } - - public void setName(String name) { - this.name = name; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getName() { - return name; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getPassword() { - return password; - } - - @Override - public String toString() { - return "User (username = " + username + ", name = " + name + ")"; - } - -} diff --git a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Resources.java b/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Resources.java deleted file mode 100644 index 107fd5a886f..00000000000 --- a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/Resources.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.jboss.weld.examples.login; - -import java.util.logging.Logger; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Produces; -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; - -@ApplicationScoped -public class Resources { - - // Expose an entity manager using the resource producer pattern - @SuppressWarnings("unused") - @PersistenceContext - @Produces - private EntityManager em; - - @Produces - Logger getLogger(InjectionPoint ip) { - String category = ip.getMember().getDeclaringClass().getName(); - return Logger.getLogger(category); - } - -} diff --git a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/UserManager.java b/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/UserManager.java deleted file mode 100644 index 543549e438e..00000000000 --- a/examples/jsf/login/src/main/java/org/jboss/weld/examples/login/UserManager.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.jboss.weld.examples.login; - -import java.util.List; - -public interface UserManager { - - List getUsers() throws Exception; - - String addUser() throws Exception; - - Person getNewUser(); - - void setNewUser(Person newUser); - -} diff --git a/examples/jsf/login/src/main/resources/META-INF/persistence.xml b/examples/jsf/login/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 7b4b937eb8d..00000000000 --- a/examples/jsf/login/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - java:jboss/datasources/ExampleDS - - - - - - diff --git a/examples/jsf/login/src/main/resources/import.sql b/examples/jsf/login/src/main/resources/import.sql deleted file mode 100644 index e56352bf35b..00000000000 --- a/examples/jsf/login/src/main/resources/import.sql +++ /dev/null @@ -1 +0,0 @@ -insert into Person (username, name, password) values ('demo', 'Demo User', 'demo') \ No newline at end of file diff --git a/examples/jsf/login/src/main/webapp/WEB-INF/beans.xml b/examples/jsf/login/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index 71a333f1b55..00000000000 --- a/examples/jsf/login/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/examples/jsf/login/src/main/webapp/WEB-INF/faces-config.xml b/examples/jsf/login/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index c19e20a736e..00000000000 --- a/examples/jsf/login/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/examples/jsf/login/src/main/webapp/WEB-INF/web.xml b/examples/jsf/login/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 8052126df96..00000000000 --- a/examples/jsf/login/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Web Beans Login example - - - - - Faces Servlet - jakarta.faces.webapp.FacesServlet - 1 - - - - Faces Servlet - *.jsf - - - - jakarta.faces.DEFAULT_SUFFIX - .xhtml - - - - 10 - - - diff --git a/examples/jsf/login/src/main/webapp/home.xhtml b/examples/jsf/login/src/main/webapp/home.xhtml deleted file mode 100644 index 6a4f7671b34..00000000000 --- a/examples/jsf/login/src/main/webapp/home.xhtml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - Username: - - Password: - - - - - - View users - - - diff --git a/examples/jsf/login/src/main/webapp/index.html b/examples/jsf/login/src/main/webapp/index.html deleted file mode 100644 index 473be2f071f..00000000000 --- a/examples/jsf/login/src/main/webapp/index.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/jsf/login/src/main/webapp/template.xhtml b/examples/jsf/login/src/main/webapp/template.xhtml deleted file mode 100644 index f39878c1aad..00000000000 --- a/examples/jsf/login/src/main/webapp/template.xhtml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - Login - - - - - - -
- - - - -
- -
- -
-
- - - - diff --git a/examples/jsf/login/src/main/webapp/users.xhtml b/examples/jsf/login/src/main/webapp/users.xhtml deleted file mode 100644 index 378e475d591..00000000000 --- a/examples/jsf/login/src/main/webapp/users.xhtml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - -

Users

- - - - Username - - - - - - Name - - - - - - Password - - - - -

Add user

- - - - - - - - - - - - - - - - - - - - -
Username
Name
Password
View login page
- -
- -
-
- diff --git a/examples/jsf/numberguess/README.md b/examples/jsf/numberguess/README.md index 593d3a38ef2..17bc6ad8a87 100644 --- a/examples/jsf/numberguess/README.md +++ b/examples/jsf/numberguess/README.md @@ -2,7 +2,7 @@ Weld Numberguess Example ======================== This example demonstrates the use of Weld in a Servlet container (Tomcat or -Jetty) or as a non-EJB application for a Java EE server (WildFly or GlassFish). No alterations are expected +Jetty) or as a non-EJB application for a Jakarta EE server (WildFly or GlassFish). No alterations are expected to be made to the container. All services are self-contained within the deployment. @@ -14,36 +14,31 @@ Make sure you have assigned the absolute path of your installation to the 1. Open terminal and start the server by running - $JBOSS_HOME/bin/standalone.sh +```shell +$JBOSS_HOME/bin/standalone.sh +``` 2. Build and deploy the example to the server you have started in step 1 using command - mvn clean package wildfly:deploy +```shell +mvn clean package wildfly:deploy +``` 3. Now you can view the application at . +If you do not have WildFly server downloaded, you can use a Maven profile to provision the server and deploy the app onto it. -To run the functional tests, execute: +1. Provision server using the following command. Replace `XYZ` with the version of WildFly you need. - mvn verify -Darquillian=wildfly-managed +```shell +mvn clean package -Pprovision-wildfly-server -Dversion.wfly.server=XYZ +``` -Deploying to WildFly Web ------------------------- +2. The server is now prepared under `/target/server` and already contains Numberguess example in its `standalone/deployments` directory. Execute the server startup script as follows: -WildFly Web is a lightweight Servlet-only version of WildFly. - -Make sure you have assigned the absolute path of your installation to the -`JBOSS_HOME` environment variable. - -1. Open terminal and start the server by running - - $JBOSS_HOME/bin/standalone.sh - -2. Build and deploy the example to the server you have started in step 1 using command - - mvn clean package -Pwildfly-web wildfly:deploy - -3. Now you can view the application at . +```shell +./target/server/bin/standalone.sh +``` Deploying to standalone Tomcat -------------------------------- @@ -53,19 +48,39 @@ extract Tomcat. This build assumes you will be running Tomcat in its default configuration, with a hostname of localhost and port 8080. Build example using command - mvn clean package -Ptomcat +```shell +mvn clean package -Ptomcat +``` and deploy the created WAR to Tomcat. Deploying to standalone Jetty ----------------------------- -If you want to run the application on a standalone Jetty, first download and -extract the Jetty distribution. This build assumes you will be running Jetty in its default -configuration, with a hostname of localhost and port 8080. Build example using -command +If you want to run the application on a standalone Jetty, first download and extract the Jetty distribution. This build assumes you will be running Jetty in its default configuration, with a hostname of localhost and port 8080. + +Note that Jetty needs to have its CDI module (`ee10-cdi`) and websockets module (`ee10-websocket-jakarta`) enabled for Numberguess to work. Here's how to do it: - mvn clean package -Pjetty +```shell +$ export JETTY_HOME=/path/to/jetty-home +$ mkdir /path/to/jetty-base +$ cd /path/to/jetty-base +$ java -jar $JETTY_HOME/start.jar --add-modules=server,http,ee10-deploy,ee10-cdi,ee10-websocket-jakarta +``` +Build example using command + +```shell +mvn clean package -Pjetty +``` + +then deploy the created WAR to Jetty (e.g. copy the artifact to webapps directory) and start Jetty. You should see the app under . + +Executing tests +----------------------------- -and deploy the created WAR to Jetty (e.g. copy the artifact to webapps directory). +Tests can be executed against any of the above containers. +Once the server/servlet is started and Numberguess is deployed, run the following command: +```shell +mvn clean verify -Pintegration-testing +``` \ No newline at end of file diff --git a/examples/jsf/numberguess/pom.xml b/examples/jsf/numberguess/pom.xml index d501db12331..424cbd5e15f 100644 --- a/examples/jsf/numberguess/pom.xml +++ b/examples/jsf/numberguess/pom.xml @@ -23,14 +23,13 @@ - - - - junit - junit - test - + + + 31.0.0.Final + + + jakarta.enterprise jakarta.enterprise.cdi-api @@ -50,70 +49,46 @@ - org.jboss.arquillian.junit - arquillian-junit-container + junit + junit test - - - org.jboss.arquillian.graphene - graphene-webdriver - pom - - - - - wildfly-web - - - jakarta.enterprise - jakarta.enterprise.cdi-api - compile - - - jakarta.faces - jakarta.faces-api - compile - - - org.jboss.weld.servlet - weld-servlet-core - runtime - - - org.jboss.weld.module - weld-jsf - runtime - - - org.glassfish - jakarta.faces - - - - wildfly-cluster + + provision-wildfly-server - org.apache.maven.plugins - maven-war-plugin + org.wildfly.plugins + wildfly-maven-plugin - - - src/main/webapp-wildfly-cluster - true - - + + + org.wildfly:wildfly-galleon-pack:${version.wfly.server} + + + + cloud-server + jsf + + weld-numberguess.war + + + + package + + + + tomcat @@ -127,12 +102,6 @@ runtime - - jakarta.servlet.jsp.jstl - jakarta.servlet.jsp.jstl-api - runtime - - org.jboss.weld.servlet weld-servlet-shaded @@ -157,6 +126,8 @@ + + jetty @@ -171,9 +142,8 @@ - jakarta.servlet.jsp.jstl - jakarta.servlet.jsp.jstl-api - runtime + org.glassfish + jakarta.el @@ -200,34 +170,33 @@ - - ftest + + + integration-testing - - org.codehaus.mojo - build-helper-maven-plugin - org.apache.maven.plugins - maven-surefire-plugin + maven-failsafe-plugin + + + **/*IT + + + + + + integration-test + verify + + + - - arquillian-wildfly-managed - - - - arquillian-wildfly-remote - - - - arquillian-wildfly-cluster - weld-numberguess @@ -239,6 +208,7 @@ WEB-INF/classes/**,WEB-INF/lib/** + src/main/webapp-wildfly true @@ -264,11 +234,11 @@
- org.apache.maven.plugins maven-surefire-plugin + true @@ -276,10 +246,5 @@ - - http://127.0.1.1:8080/weld-numberguess - http://127.0.2.1:8080/weld-numberguess - - diff --git a/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/CommonNumberGuessTest.java b/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/CommonNumberGuessTest.java deleted file mode 100644 index 0d299d2101c..00000000000 --- a/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/CommonNumberGuessTest.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, 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.examples.numberguess.ftest; - -import static org.jboss.arquillian.graphene.Graphene.guardHttp; -import static org.jboss.arquillian.graphene.Graphene.waitModel; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.net.MalformedURLException; -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.drone.api.annotation.Drone; -import org.jboss.arquillian.graphene.Graphene; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -/** - * Tests numberguess examples in Weld - * - * @author maschmid - * @author Jozef Hartinger - * @author kpiwko - * @author plenyi - */ -@RunWith(Arquillian.class) -@RunAsClient -public class CommonNumberGuessTest { - - protected String MAIN_PAGE = "/home.jsf"; - protected By GUESS_MESSAGES = By.id("numberGuess:messages"); - protected By GUESS_FIELD = By.id("numberGuess:inputGuess"); - protected By GUESS_SUBMIT = By.id("numberGuess:guessButton"); - protected By GUESS_RESET = By.id("numberGuess:resetButton"); - protected By GUESS_SMALLEST = By.id("numberGuess:smallest"); - protected By GUESS_BIGGEST = By.id("numberGuess:biggest"); - protected String WIN_MSG = "Correct!"; - protected String LOSE_MSG = "No guesses left!"; - - @Drone - WebDriver driver; - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestDeployment1() { - return Deployments.createDeployment(); - } - - @Before - public void openStartUrl() throws MalformedURLException { - driver.navigate().to(new URL(contextPath.toString() + "home.jsf")); - waitModel().until().element(GUESS_FIELD).is().present(); - } - - @After - public void resetSession() { - driver.manage().deleteAllCookies(); - } - - @Test - public void smartTest() { - - int min; - int max; - int guess; - int i = 0; - - while (isOnGuessPage()) { - if (i > 10) { - fail("Game should not be longer than 10 guesses"); - } - assertTrue("Expected smallest number on page", driver.findElement(GUESS_SMALLEST).isDisplayed()); - assertTrue("Expected biggest number on page", driver.findElement(GUESS_BIGGEST).isDisplayed()); - - min = Integer.parseInt(driver.findElement(GUESS_SMALLEST).getText()); - max = Integer.parseInt(driver.findElement(GUESS_BIGGEST).getText()); - - guess = min + ((max - min) / 2); - enterGuess(guess); - i++; - } - assertTrue("Win page expected after playing smart.", isOnWinPage()); - } - - @Test - public void linearTest() { - int guess = 0; - - while (isOnGuessPage()) { - enterGuess(++guess); - assertTrue("Guess count exceeded.", guess <= 11); - } - if (guess < 11) { - assertTrue("Player should not lose before 10th guess.", isOnWinPage()); - } else { - assertTrue("After 10th guess player should lose or win.", isOnLosePage() || isOnWinPage()); - } - - } - - protected void enterGuess(int guess) { - driver.findElement(GUESS_FIELD).clear(); - driver.findElement(GUESS_FIELD).sendKeys(String.valueOf(guess)); - guardHttp(driver.findElement(GUESS_SUBMIT)).click(); - } - - protected boolean isOnGuessPage() { - return !(isOnWinPage() || isOnLosePage()); - } - - protected boolean isOnWinPage() { - String text = driver.findElement(GUESS_MESSAGES).getText(); - return WIN_MSG.equals(text); - } - - protected boolean isOnLosePage() { - String text = driver.findElement(GUESS_MESSAGES).getText(); - return LOSE_MSG.equals(text); - } -} diff --git a/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/Deployments.java b/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/Deployments.java deleted file mode 100644 index 8c750b75906..00000000000 --- a/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/Deployments.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, 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.examples.numberguess.ftest; - -import java.io.File; - -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.importer.ZipImporter; -import org.jboss.shrinkwrap.api.spec.WebArchive; - -/** - * Creates a deployment from a build Web Archive using ShrinkWrap ZipImporter - * @author maschmid - * - */ -public class Deployments { - private static final String ARCHIVE_NAME = "weld-numberguess.war"; - private static final String BUILD_DIRECTORY = "target"; - - public static WebArchive createDeployment() { - return ShrinkWrap.create(ZipImporter.class, ARCHIVE_NAME).importFrom(new File(BUILD_DIRECTORY + '/' + ARCHIVE_NAME)) - .as(WebArchive.class); - } -} diff --git a/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/cluster/GameState.java b/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/cluster/GameState.java deleted file mode 100644 index 1414468ff17..00000000000 --- a/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/cluster/GameState.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @authors tag. All rights reserved. - * 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.examples.numberguess.ftest.cluster; - -/** - * Store the game state. - * - * @author maschmid - * - */ -public class GameState { - - public GameState() { - remainingGuesses = 10; - smallest = 0; - largest = 100; - } - - public int getRemainingGuesses() { - return remainingGuesses; - } - public void setRemainingGuesses(int remainingGuesses) { - this.remainingGuesses = remainingGuesses; - } - public int getSmallest() { - return smallest; - } - public void setSmallest(int smallest) { - this.smallest = smallest; - } - public int getLargest() { - return largest; - } - public void setLargest(int largest) { - this.largest = largest; - } - public int getGuess() { - return guess; - } - public void setGuess(int guess) { - this.guess = guess; - } - public void setPreviousGuess(int previousGuess) { - this.previousGuess = previousGuess; - } - public int getPreviousGuess() { - return previousGuess; - } - - private int remainingGuesses; - private int smallest; - private int largest; - private int guess; - private int previousGuess; -} diff --git a/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/cluster/NumberGuessClusterTest.java b/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/cluster/NumberGuessClusterTest.java deleted file mode 100644 index 2da74276d9c..00000000000 --- a/examples/jsf/numberguess/src/ftest/java/org/jboss/weld/examples/numberguess/ftest/cluster/NumberGuessClusterTest.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @authors tag. All rights reserved. - * 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.examples.numberguess.ftest.cluster; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.arquillian.container.test.api.ContainerController; -import org.jboss.arquillian.container.test.api.Deployer; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.container.test.api.TargetsContainer; -import org.jboss.arquillian.drone.api.annotation.Drone; -import org.jboss.arquillian.graphene.Graphene; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.junit.InSequence; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.weld.examples.numberguess.ftest.Deployments; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.openqa.selenium.By; -import org.openqa.selenium.Cookie; -import org.openqa.selenium.WebDriver; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -/** - * - * @author mgencur - * @author kpiwko - * @author maschmid - * - */ -@RunWith(Arquillian.class) -@RunAsClient -public class NumberGuessClusterTest { - - protected String MAIN_PAGE = "home.jsf"; - - public static final long GRACE_TIME_TO_REPLICATE = 1000; - public static final long GRACE_TIME_TO_MEMBERSHIP_CHANGE = 5000; - - private static final String CONTAINER1 = "container1"; - private static final String CONTAINER2 = "container2"; - private static final String DEPLOYMENT1 = "dep.container1"; - private static final String DEPLOYMENT2 = "dep.container2"; - - protected By GUESS_MESSAGES = By.id("numberGuess:messages"); - protected By GUESS_STATUS = By.xpath("//div[contains(text(),'I'm thinking of ')]"); - - protected By GUESS_FIELD = By.id("numberGuess:inputGuess"); - protected By GUESS_FIELD_WITH_VALUE = By.xpath("//input[@id='numberGuess:inputGuess'][@value=3]"); - - protected By GUESS_SUBMIT = By.id("numberGuess:guessButton"); - protected By GUESS_RESTART = By.id("numberGuess:restartButton"); - protected By GUESS_SMALLEST = By.id("numberGuess:smallest"); - protected By GUESS_BIGGEST = By.id("numberGuess:biggest"); - - protected String WIN_MSG = "Correct!"; - protected String LOSE_MSG = "No guesses left!"; - protected String HIGHER_MSG = "Higher!"; - protected String LOWER_MSG = "Lower!"; - - protected Pattern guessesNumberPattern = Pattern.compile("You have (\\d+) guesses remaining."); - - private GameState gameState; - - @ArquillianResource - private ContainerController controller; - - @ArquillianResource - private Deployer deployer; - - @Drone - WebDriver driver; - - String contextPath1; - String contextPath2; - - boolean browsersSwitched = false; - - @Deployment(name = DEPLOYMENT1, managed=false, testable=false) - @TargetsContainer(CONTAINER1) - public static WebArchive createTestDeployment1() { - return Deployments.createDeployment(); - } - - @Deployment(name = DEPLOYMENT2, managed=false, testable=false) - @TargetsContainer(CONTAINER2) - public static WebArchive createTestDeployment2() { - return Deployments.createDeployment() - .addAsWebInfResource(EmptyAsset.INSTANCE, "force-hashcode-change.txt"); - } - - @Before - public void before() throws MalformedURLException { - // We can't use @ArquillianResource URL here as we are using unmanaged deployments - contextPath1 = System.getProperty("node1.contextPath"); - contextPath2 = System.getProperty("node2.contextPath"); - } - - protected void resetForm() { - Graphene.guardHttp(driver.findElement(GUESS_RESTART)).click(); - gameState = null; - } - - protected void enterGuess(int guess) throws InterruptedException { - gameState.setGuess(guess); - driver.findElement(GUESS_FIELD).clear(); - driver.findElement(GUESS_FIELD).sendKeys(String.valueOf(guess)); - Graphene.guardHttp(driver.findElement(GUESS_SUBMIT)).click(); - } - - protected boolean isOnGuessPage() { - return !(isOnWinPage() || isOnLosePage()); - } - - protected boolean isOnWinPage() { - String text = driver.findElement(GUESS_MESSAGES).getText(); - return WIN_MSG.equals(text); - } - - protected boolean isOnLosePage() { - String text = driver.findElement(GUESS_MESSAGES).getText(); - return LOSE_MSG.equals(text); - } - - public String getAddressForSecondInstance() { - String loc = driver.getCurrentUrl(); - String[] parsedStrings = loc.split("/"); - StringBuilder sb = new StringBuilder(); - for (int i = 4; i < parsedStrings.length; i++) { - sb.append("/").append(parsedStrings[i]); - } - - return sb.toString(); - } - - private Integer getRemainingGuesses() { - Matcher m = guessesNumberPattern.matcher(driver.findElement(By.tagName("body")).getText()); - if (m.find()) { - return Integer.parseInt(m.group(1)); - } - else { - return null; - } - } - - /** - * Asserts the game state matches what the page displays - */ - private void updateGameState() { - - GameState nextState = new GameState(); - nextState.setRemainingGuesses(getRemainingGuesses()); - nextState.setLargest(Integer.parseInt(driver.findElement(GUESS_BIGGEST).getText())); - nextState.setSmallest(Integer.parseInt(driver.findElement(GUESS_SMALLEST).getText())); - - if (gameState == null) { - // Initial state - assertEquals("Remaining guesses dosn't match", 10, nextState.getRemainingGuesses()); - assertEquals("Smallest numbers dosn't match", 0, nextState.getSmallest()); - assertEquals("Largest numbers dosn't match", 100, nextState.getLargest()); - } - else { - nextState.setPreviousGuess(gameState.getGuess()); - assertEquals("Remaining guesses dosn't match", gameState.getRemainingGuesses() - 1, nextState.getRemainingGuesses()); - - boolean higher = driver.findElement(By.tagName("body")).getText().contains(HIGHER_MSG); - boolean lower = driver.findElement(By.tagName("body")).getText().contains(LOWER_MSG); - - assertEquals(lower, (nextState.getLargest() < gameState.getLargest())); - if (gameState.getGuess() != 0) { - // Bug in numberguess, doesn't display "higher" for zero guess. - assertEquals(higher, (nextState.getSmallest() > gameState.getSmallest())); - } - assertTrue(!lower || !higher); - } - - gameState = nextState; - } - - private void naiveStep() throws InterruptedException { - updateGameState(); - enterGuess(gameState.getSmallest()); - } - - private void smartStep() throws InterruptedException { - updateGameState(); - enterGuess(gameState.getSmallest() + ((gameState.getLargest() - gameState.getSmallest()) / 2)); - } - - private void switchBrowsers() throws MalformedURLException { - String address = getAddressForSecondInstance(); - - String sid = driver.manage().getCookieNamed("JSESSIONID").getValue(); - - String contextPath = browsersSwitched ? contextPath1 : contextPath2; - - // We navigate to the home page on the second server, just to set the cookies - driver.navigate().to(new URL(contextPath)); - driver.manage().deleteAllCookies(); - driver.manage().addCookie(new Cookie("JSESSIONID", sid)); - - // Now we navigate for reals - driver.navigate().to(new URL(contextPath + "/" + address)); - - browsersSwitched = !browsersSwitched; - } - - @Test - @InSequence(1) - public void guessingWithFailoverTest() throws MalformedURLException, InterruptedException { - - controller.start(CONTAINER1); - deployer.deploy(DEPLOYMENT1); - - controller.start(CONTAINER2); - deployer.deploy(DEPLOYMENT2); - - driver.navigate().to(new URL(contextPath1 + "/" + MAIN_PAGE)); - - // we always want to enter at least 3 guesses so that we can continue - // in the other browser window with expected results - do { - resetForm(); - for (int i = 0; i < 3 && isOnGuessPage(); ++i) { - naiveStep(); - } - } while(!isOnGuessPage()); - - Thread.sleep(GRACE_TIME_TO_REPLICATE); - - deployer.undeploy(DEPLOYMENT1); - controller.stop(CONTAINER1); - - Thread.sleep(GRACE_TIME_TO_REPLICATE); - - switchBrowsers(); - - while(isOnGuessPage()) { - smartStep(); - } - - assertTrue("Win page expected after playing smart.", isOnWinPage()); - - deployer.undeploy(DEPLOYMENT2); - controller.stop(CONTAINER2); - } - - @Test - @InSequence(2) - public void guessingWithInterleavingTest() throws MalformedURLException, InterruptedException { - controller.start(CONTAINER1); - deployer.deploy(DEPLOYMENT1); - - driver.navigate().to(new URL(contextPath1 + "/" + MAIN_PAGE)); - - for(;;) { - - smartStep(); - - if (!isOnGuessPage()) { - break; - } - - if (browsersSwitched) { - controller.start(CONTAINER1); - deployer.deploy(DEPLOYMENT1); - - Thread.sleep(GRACE_TIME_TO_MEMBERSHIP_CHANGE); - - deployer.undeploy(DEPLOYMENT2); - controller.stop(CONTAINER2); - } - else { - controller.start(CONTAINER2); - deployer.deploy(DEPLOYMENT2); - - Thread.sleep(GRACE_TIME_TO_MEMBERSHIP_CHANGE); - - deployer.undeploy(DEPLOYMENT1); - controller.stop(CONTAINER1); - } - - Thread.sleep(GRACE_TIME_TO_REPLICATE); - - switchBrowsers(); - } - - assertTrue("Win page expected after playing smart.", isOnWinPage()); - - if (browsersSwitched) { - deployer.undeploy(DEPLOYMENT2); - controller.stop(CONTAINER2); - } - else { - deployer.undeploy(DEPLOYMENT1); - controller.stop(CONTAINER1); - } - } -} diff --git a/examples/jsf/numberguess/src/ftest/resources/arquillian.xml b/examples/jsf/numberguess/src/ftest/resources/arquillian.xml deleted file mode 100644 index 4b1bcd8bac8..00000000000 --- a/examples/jsf/numberguess/src/ftest/resources/arquillian.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - -Xmx1024m -XX:MaxPermSize=512m ${jacoco.agent} ${additional.vm.args} - - - - - - - - - - - ${node1.managementAddress:127.0.1.1} - ${node1.managementPort:9990} - ${node1.jbossHome} - -Djboss.node.name=${node1.nodeName:node1} -Djava.net.preferIPv4Stack=true - ${jboss.server.config.file.name:standalone-ha.xml} - - - - - - ${node2.managementAddress:127.0.2.1} - ${node2.managementPort:9990} - ${node2.jbossHome} - -Djboss.node.name=${node2.nodeName:node2} -Djava.net.preferIPv4Stack=true - ${jboss.server.config.file.name:standalone-ha.xml} - - - - - - diff --git a/examples/jsf/numberguess/src/main/webapp-jetty/WEB-INF/jetty-web.xml b/examples/jsf/numberguess/src/main/webapp-jetty/WEB-INF/jetty-web.xml index 82f14ec442c..c12573a8938 100644 --- a/examples/jsf/numberguess/src/main/webapp-jetty/WEB-INF/jetty-web.xml +++ b/examples/jsf/numberguess/src/main/webapp-jetty/WEB-INF/jetty-web.xml @@ -1,21 +1,6 @@ - - - -org.eclipse.jetty.util.Decorator - - - -org.eclipse.jetty.util.DecoratedObjectFactory - - - -org.eclipse.jetty.server.handler.ContextHandler. - - - -org.eclipse.jetty.server.handler.ContextHandler - - - -org.eclipse.jetty.servlet.ServletContextHandler - + diff --git a/examples/jsf/numberguess/src/main/webapp-jetty/WEB-INF/web.xml b/examples/jsf/numberguess/src/main/webapp-jetty/WEB-INF/web.xml index a9db02cbbb5..b95a6e49892 100644 --- a/examples/jsf/numberguess/src/main/webapp-jetty/WEB-INF/web.xml +++ b/examples/jsf/numberguess/src/main/webapp-jetty/WEB-INF/web.xml @@ -1,10 +1,9 @@ - + Weld Numberguess example diff --git a/examples/jsf/numberguess/src/main/webapp-tomcat/WEB-INF/web.xml b/examples/jsf/numberguess/src/main/webapp-tomcat/WEB-INF/web.xml index a9db02cbbb5..d0f81284bbb 100644 --- a/examples/jsf/numberguess/src/main/webapp-tomcat/WEB-INF/web.xml +++ b/examples/jsf/numberguess/src/main/webapp-tomcat/WEB-INF/web.xml @@ -1,11 +1,9 @@ - - + Weld Numberguess example diff --git a/examples/jsf/numberguess/src/main/webapp-wildfly-cluster/WEB-INF/web.xml b/examples/jsf/numberguess/src/main/webapp-wildfly-cluster/WEB-INF/web.xml deleted file mode 100644 index 15b67000b08..00000000000 --- a/examples/jsf/numberguess/src/main/webapp-wildfly-cluster/WEB-INF/web.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - Weld Numberguess example - - - jakarta.faces.DEFAULT_SUFFIX - .xhtml - - - - Faces Servlet - jakarta.faces.webapp.FacesServlet - 1 - - - - Faces Servlet - *.jsf - - - - 10 - - - diff --git a/examples/jsf/numberguess/src/main/webapp/WEB-INF/faces-config.xml b/examples/jsf/numberguess/src/main/webapp/WEB-INF/faces-config.xml index 6488c433db3..591ca1fe02c 100644 --- a/examples/jsf/numberguess/src/main/webapp/WEB-INF/faces-config.xml +++ b/examples/jsf/numberguess/src/main/webapp/WEB-INF/faces-config.xml @@ -1,11 +1,8 @@ - - - - numberguess - + + diff --git a/examples/jsf/numberguess/src/main/webapp/home.xhtml b/examples/jsf/numberguess/src/main/webapp/home.xhtml index 1e485bcb508..f5f18fef29c 100644 --- a/examples/jsf/numberguess/src/main/webapp/home.xhtml +++ b/examples/jsf/numberguess/src/main/webapp/home.xhtml @@ -1,34 +1,58 @@ + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - - -

Guess a number...

- -
- - - -
- -
- I'm thinking of a number between #{game.smallest} and #{game.biggest}. You have #{game.remainingGuesses} guesses remaining. -
- -
- Your guess: - - -
-
- -
-
-
-
+ xmlns:ui="jakarta.faces.facelets" + xmlns:h="jakarta.faces.html" + xmlns:f="jakarta.faces.core"> + + + + numberguess + + + +
+

Guess a number...

+ + + +
+ + + +
+ + +
+ I'm thinking of a number between #{game.smallest} and #{game.biggest}. You have + #{game.remainingGuesses} guesses remaining. +
+ + + +
+ Your guess: + + +
+
+ +
+
+ +
+ +
+ + diff --git a/examples/jsf/numberguess/src/main/webapp/template.xhtml b/examples/jsf/numberguess/src/main/webapp/template.xhtml deleted file mode 100644 index d5a118c5a8b..00000000000 --- a/examples/jsf/numberguess/src/main/webapp/template.xhtml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - Numberguess - - - - - -
- - - - -
- -
- -
-
- - - - diff --git a/examples/jsf/numberguess/src/test/java/org/jboss/weld/examples/numberguess/tests/BasicRuntimeIT.java b/examples/jsf/numberguess/src/test/java/org/jboss/weld/examples/numberguess/tests/BasicRuntimeIT.java new file mode 100644 index 00000000000..9eb97e6ff00 --- /dev/null +++ b/examples/jsf/numberguess/src/test/java/org/jboss/weld/examples/numberguess/tests/BasicRuntimeIT.java @@ -0,0 +1,49 @@ +package org.jboss.weld.examples.numberguess.tests; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import org.junit.Test; + +/** + * The very basic runtime integration testing. + * + * @author Emmanuel Hugonnet + * @author emartins + */ +public class BasicRuntimeIT { + + private static final String DEFAULT_SERVER_HOST = "http://localhost:8080/weld-numberguess"; + + public static String getServerHost() { + String serverHost = System.getenv("SERVER_HOST"); + if (serverHost == null) { + serverHost = System.getProperty("server.host"); + } + if (serverHost == null) { + serverHost = DEFAULT_SERVER_HOST; + } + return serverHost; + } + + @Test + public void testHTTPEndpointIsAvailable() throws IOException, InterruptedException, URISyntaxException { + final HttpRequest request = HttpRequest.newBuilder() + .uri(new URI(getServerHost() + "/")) + .GET() + .build(); + final HttpClient client = HttpClient.newBuilder() + .followRedirects(HttpClient.Redirect.ALWAYS) + .connectTimeout(Duration.ofMinutes(1)) + .build(); + final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + assertEquals(200, response.statusCode()); + } +} diff --git a/examples/jsf/numberguess/src/test/java/org/jboss/weld/examples/numberguess/tests/NumberguessIT.java b/examples/jsf/numberguess/src/test/java/org/jboss/weld/examples/numberguess/tests/NumberguessIT.java new file mode 100644 index 00000000000..0accde3bce3 --- /dev/null +++ b/examples/jsf/numberguess/src/test/java/org/jboss/weld/examples/numberguess/tests/NumberguessIT.java @@ -0,0 +1,63 @@ +package org.jboss.weld.examples.numberguess.tests; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.net.CookieManager; +import java.net.CookiePolicy; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URLEncoder; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpRequest.BodyPublisher; +import java.net.http.HttpRequest.BodyPublishers; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Map; + +import org.junit.Test; + +public class NumberguessIT { + + private java.util.Random random = new java.util.Random(System.currentTimeMillis()); + + @Test + public void testGuessNumber() throws Exception { + guessNumber(); + } + + public void guessNumber() throws IOException, InterruptedException, URISyntaxException { + HttpClient client = HttpClient.newBuilder() + .followRedirects(HttpClient.Redirect.ALWAYS) + .cookieHandler(new CookieManager(null, CookiePolicy.ACCEPT_ALL)) + .build(); + HttpRequest request = HttpRequest.newBuilder().uri(new URI(BasicRuntimeIT.getServerHost() + "/home.jsf")) + .POST(ofFormData(Map.of("numberGuess:inputGuess", (Object) getNumber()))) + .build(); + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + assertEquals(200, response.statusCode()); + assertTrue(response.body().toString().contains("
data) { + StringBuilder builder = new StringBuilder(); + for (Map.Entry entry : data.entrySet()) { + if (builder.length() > 0) { + builder.append("&"); + } + builder + .append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8)); + builder.append("="); + builder + .append(URLEncoder.encode(entry.getValue().toString(), StandardCharsets.UTF_8)); + } + return BodyPublishers.ofString(builder.toString()); + } + +} diff --git a/examples/jsf/translator/README.md b/examples/jsf/translator/README.md deleted file mode 100644 index 91a2d10d324..00000000000 --- a/examples/jsf/translator/README.md +++ /dev/null @@ -1,31 +0,0 @@ -Weld Translator Example -======================= - -This example demonstrates the use of Weld in a Jakarta EE container (WildFly). -No alterations are expected to be made to the container. All services are -self-contained within the deployment. - -Deploying to WildFly --------------------- - -Make sure you have assigned the absolute path of your installation to the -`JBOSS_HOME` environment variable. - -1. Open terminal and start the server by running script: - - $JBOSS_HOME/bin/standalone.sh - -2. Install the parent using command: - - mvn install -f ../../pom.xml - -3. Deploy this example to the server you have started in step 1 using command - - mvn wildfly:deploy -f ear/pom.xml - -4. Now you can view the application at . - - -To run functional tests execute: - - mvn verify -Darquillian=wildfly-managed -f ftest/pom.xml diff --git a/examples/jsf/translator/ear/pom.xml b/examples/jsf/translator/ear/pom.xml deleted file mode 100644 index e1911d26f5c..00000000000 --- a/examples/jsf/translator/ear/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - 4.0.0 - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-parent - 5.1.7-SNAPSHOT - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-ear - ear - Weld Examples: Translator [ear] (JSF) - - http://weld.cdi-spec.org - - - Apache License, Version 2.0 - repo - http://www.apache.org/licenses/LICENSE-2.0.html - - - - - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-ejb - ejb - - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-war - war - - - - - - weld-translator - - - org.apache.maven.plugins - maven-ear-plugin - - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-war - /weld-translator - - - 7 - - - - - - - diff --git a/examples/jsf/translator/ejb/pom.xml b/examples/jsf/translator/ejb/pom.xml deleted file mode 100644 index 63590cbcf15..00000000000 --- a/examples/jsf/translator/ejb/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-parent - 5.1.7-SNAPSHOT - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-ejb - ejb - Weld Examples: Translator [ejb] (JSF) - http://weld.cdi-spec.org - - - Apache License, Version 2.0 - repo - http://www.apache.org/licenses/LICENSE-2.0.html - - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - jakarta.ejb - jakarta.ejb-api - provided - - - - - - weld-translator - - - - diff --git a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/SentenceParser.java b/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/SentenceParser.java deleted file mode 100644 index b7d3defa781..00000000000 --- a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/SentenceParser.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.jboss.weld.examples.translator; - -import java.util.Arrays; -import java.util.List; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class SentenceParser { - - public List parse(String text) { - return Arrays.asList(text.split("[.?]")); - } - -} diff --git a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/SentenceTranslator.java b/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/SentenceTranslator.java deleted file mode 100644 index 0eeb1a14270..00000000000 --- a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/SentenceTranslator.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.jboss.weld.examples.translator; - -import jakarta.ejb.Stateless; - -@Stateless -public class SentenceTranslator implements Translator { - - public String translate(String sentence) { - return "Lorem ipsum dolor sit amet"; - } - -} diff --git a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/TextTranslator.java b/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/TextTranslator.java deleted file mode 100644 index 5ae63288987..00000000000 --- a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/TextTranslator.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.jboss.weld.examples.translator; - -import java.io.Serializable; - -import jakarta.ejb.EJB; -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class TextTranslator implements Serializable { - private SentenceParser sentenceParser; - - @EJB - Translator translator; - - @Inject - public TextTranslator(SentenceParser sentenceParser) { - this.sentenceParser = sentenceParser; - } - - public String translate(String text) { - StringBuilder sb = new StringBuilder(); - for (String sentence : sentenceParser.parse(text)) { - sb.append(translator.translate(sentence)).append(". "); - } - return sb.toString().trim(); - } - -} diff --git a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/Translator.java b/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/Translator.java deleted file mode 100644 index a29779956d7..00000000000 --- a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/Translator.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.jboss.weld.examples.translator; - -import jakarta.ejb.Local; - -@Local -public interface Translator { - - String translate(String sentence); - -} diff --git a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/TranslatorController.java b/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/TranslatorController.java deleted file mode 100644 index f97a4dd2c2a..00000000000 --- a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/TranslatorController.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.jboss.weld.examples.translator; - -public interface TranslatorController { - - String getText(); - - void setText(String text); - - void translate(); - - String getTranslatedText(); - - void remove(); - -} diff --git a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/TranslatorControllerBean.java b/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/TranslatorControllerBean.java deleted file mode 100644 index 3aee0560f54..00000000000 --- a/examples/jsf/translator/ejb/src/main/java/org/jboss/weld/examples/translator/TranslatorControllerBean.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.jboss.weld.examples.translator; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -@Stateful -@RequestScoped -@Named("translator") -public class TranslatorControllerBean implements TranslatorController { - - @Inject - private TextTranslator translator; - - private String inputText; - - private String translatedText; - - public String getText() { - return inputText; - } - - public void setText(String text) { - this.inputText = text; - } - - public void translate() { - translatedText = translator.translate(inputText); - } - - public String getTranslatedText() { - return translatedText; - } - - @Remove - public void remove() { - - } - -} diff --git a/examples/jsf/translator/ejb/src/main/resources/META-INF/beans.xml b/examples/jsf/translator/ejb/src/main/resources/META-INF/beans.xml deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/examples/jsf/translator/ftest/pom.xml b/examples/jsf/translator/ftest/pom.xml deleted file mode 100644 index a207f3e6dbe..00000000000 --- a/examples/jsf/translator/ftest/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - 4.0.0 - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-parent - 5.1.7-SNAPSHOT - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-ftest - jar - Weld Examples: Translator [ftest] (JSF) - - http://weld.cdi-spec.org - - - Apache License, Version 2.0 - repo - http://www.apache.org/licenses/LICENSE-2.0.html - - - - - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-ear - ear - - - - junit - junit - test - - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - - org.jboss.arquillian.graphene - graphene-webdriver - pom - - - - - - - ftest - - - - arquillian-wildfly-managed - - - - arquillian-wildfly-remote - - - - - weld-translator - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - - - - diff --git a/examples/jsf/translator/ftest/src/ftest/java/org/jboss/weld/examples/translator/ftest/Deployments.java b/examples/jsf/translator/ftest/src/ftest/java/org/jboss/weld/examples/translator/ftest/Deployments.java deleted file mode 100644 index ca43404924f..00000000000 --- a/examples/jsf/translator/ftest/src/ftest/java/org/jboss/weld/examples/translator/ftest/Deployments.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, 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.examples.translator.ftest; - -import java.io.File; - -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.importer.ZipImporter; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; - -/** - * Creates a deployment from a build Enterprise Archive using ShrinkWrap ZipImporter - * @author maschmid - * - */ -public class Deployments { - private static final String ARCHIVE_NAME = "weld-translator.ear"; - private static final String BUILD_DIRECTORY = "../ear/target"; - - public static EnterpriseArchive createDeployment() { - return ShrinkWrap.create(ZipImporter.class, ARCHIVE_NAME).importFrom(new File(BUILD_DIRECTORY + '/' + ARCHIVE_NAME)) - .as(EnterpriseArchive.class); - } -} diff --git a/examples/jsf/translator/ftest/src/ftest/java/org/jboss/weld/examples/translator/ftest/TranslatorTest.java b/examples/jsf/translator/ftest/src/ftest/java/org/jboss/weld/examples/translator/ftest/TranslatorTest.java deleted file mode 100755 index c4ec2e55412..00000000000 --- a/examples/jsf/translator/ftest/src/ftest/java/org/jboss/weld/examples/translator/ftest/TranslatorTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, 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.examples.translator.ftest; - -import static org.jboss.arquillian.graphene.Graphene.guardHttp; -import static org.jboss.arquillian.graphene.Graphene.waitModel; -import static org.junit.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.drone.api.annotation.Drone; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -/** - * Tests translator example in Weld - * - * @author maschmid - * @author mgencur - * @author plenyi - */ -@RunWith(Arquillian.class) -@RunAsClient -public class TranslatorTest { - - protected String MAIN_PAGE = "/home.jsf"; - protected By INPUT_AREA = By.id("TranslatorMain:text"); - protected By TRANSLATE_BUTTON = By.id("TranslatorMain:button"); - protected By BODY = By.tagName("body"); - protected String ONE_SENTENCE = "This is only one sentence."; - protected String MORE_SENTENCES = "First sentence. Second and last sentence."; - protected String ONE_SENTENCE_TRANSLATED = "Lorem ipsum dolor sit amet."; - protected String MORE_SENTENCES_TRANSLATED = "Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet."; - - @Drone - WebDriver driver; - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static EnterpriseArchive createTestDeployment1() { - return Deployments.createDeployment(); - } - - @Before - public void openStartUrl() { - driver.navigate().to(contextPath); - waitModel(driver).until().element(INPUT_AREA).is().present(); - } - - @Test - public void translateTest() { - driver.findElement(INPUT_AREA).clear(); - driver.findElement(INPUT_AREA).sendKeys(ONE_SENTENCE); - guardHttp(driver.findElement(TRANSLATE_BUTTON)).click(); - assertTrue("One sentence translated into latin expected.", driver.findElement(BODY).getText().contains(ONE_SENTENCE_TRANSLATED)); - driver.findElement(INPUT_AREA).clear(); - driver.findElement(INPUT_AREA).sendKeys(MORE_SENTENCES); - guardHttp(driver.findElement(TRANSLATE_BUTTON)).click(); - assertTrue("More sentences translated into latin expected.", driver.findElement(BODY).getText().contains(MORE_SENTENCES_TRANSLATED)); - } - -} diff --git a/examples/jsf/translator/ftest/src/ftest/resources/arquillian.xml b/examples/jsf/translator/ftest/src/ftest/resources/arquillian.xml deleted file mode 100644 index 193b911f558..00000000000 --- a/examples/jsf/translator/ftest/src/ftest/resources/arquillian.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -Xmx1024m -XX:MaxPermSize=512m ${jacoco.agent} ${additional.vm.args} - - - - - - - diff --git a/examples/jsf/translator/pom.xml b/examples/jsf/translator/pom.xml deleted file mode 100644 index 65a9fd9eac2..00000000000 --- a/examples/jsf/translator/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - - org.jboss.weld.examples - weld-examples-parent - 5.1.7-SNAPSHOT - ../../pom.xml - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-parent - pom - Weld Examples: Translator [parent] (JSF) - http://weld.cdi-spec.org - - - Apache License, Version 2.0 - repo - http://www.apache.org/licenses/LICENSE-2.0.html - - - - - Ear Example for the Jakarta Context Dependency Injection compatible implementation: Weld - - - - war - ejb - ear - ftest - - - - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-war - ${project.version} - war - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-ear - ${project.version} - ear - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-ejb - ${project.version} - ejb - - - - - - diff --git a/examples/jsf/translator/war/pom.xml b/examples/jsf/translator/war/pom.xml deleted file mode 100644 index 64f2432cd32..00000000000 --- a/examples/jsf/translator/war/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-parent - 5.1.7-SNAPSHOT - - - org.jboss.weld.examples.jsf.translator - weld-jsf-translator-war - war - Weld Examples: Translator [war] (JSF) - http://weld.cdi-spec.org - - - Apache License, Version 2.0 - repo - http://www.apache.org/licenses/LICENSE-2.0.html - - - - - - - jakarta.faces - jakarta.faces-api - provided - - - - - - weld-translator - - - - diff --git a/examples/jsf/translator/war/src/main/webapp/WEB-INF/beans.xml b/examples/jsf/translator/war/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/examples/jsf/translator/war/src/main/webapp/WEB-INF/faces-config.xml b/examples/jsf/translator/war/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index 38316a61ebd..00000000000 --- a/examples/jsf/translator/war/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/examples/jsf/translator/war/src/main/webapp/WEB-INF/web.xml b/examples/jsf/translator/war/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 5eb218e1feb..00000000000 --- a/examples/jsf/translator/war/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Web Beans Numbergues example - - - - - Faces Servlet - jakarta.faces.webapp.FacesServlet - 1 - - - - Faces Servlet - *.jsf - - - - jakarta.faces.DEFAULT_SUFFIX - .xhtml - - - - 10 - - - diff --git a/examples/jsf/translator/war/src/main/webapp/home.xhtml b/examples/jsf/translator/war/src/main/webapp/home.xhtml deleted file mode 100644 index e6b10bc10f3..00000000000 --- a/examples/jsf/translator/war/src/main/webapp/home.xhtml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - -

Translate your text into Latin!

- - - - - - - - - - - -
- Your text - - Translation -
- - - -
-
- -
- - -
-
-
- diff --git a/examples/jsf/translator/war/src/main/webapp/index.html b/examples/jsf/translator/war/src/main/webapp/index.html deleted file mode 100644 index 473be2f071f..00000000000 --- a/examples/jsf/translator/war/src/main/webapp/index.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/jsf/translator/war/src/main/webapp/template.xhtml b/examples/jsf/translator/war/src/main/webapp/template.xhtml deleted file mode 100644 index 6ee6561e064..00000000000 --- a/examples/jsf/translator/war/src/main/webapp/template.xhtml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - Translator - - - - - - -
- - - - -
- -
- -
-
- - - - diff --git a/examples/pom.xml b/examples/pom.xml index 945cf68576e..1aa9dff533b 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -93,8 +93,6 @@ jsf/numberguess - jsf/translator - jsf/login se/numberguess se/groovy-numberguess @@ -102,16 +100,17 @@ 6.0.0 4.0.1 - 1.1.15 - 4.1.0.Beta5 5.0.0-M1 - src/ftest/java - src/ftest/resources + + 5.1.5.Final + + + 3.4.0 + 3.2.5 - jakarta.faces jakarta.faces-api @@ -129,56 +128,10 @@ jakarta.el ${uel.version} - - - net.sourceforge.htmlunit - htmlunit - - - - org.jboss.arquillian - arquillian-bom - ${arquillian.version} - pom - import - - - - org.jboss.arquillian.extension - arquillian-drone-bom - ${arquillian.drone.version} - pom - import - - - - org.jboss.arquillian.graphene - graphene-webdriver - ${arquillian.graphene.version} - pom - test - - - - org.jboss.arquillian.extension - arquillian-drone-webdriver-depchain - ${arquillian.drone.version} - pom - test - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - true - - - @@ -194,15 +147,15 @@ maven-ear-plugin 3.3.0 - org.apache.maven.plugins maven-war-plugin - 3.3.2 - - false - + ${maven.war.plugin.version} + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven.failsafe.plugin.version} @@ -216,89 +169,6 @@ - - ftest - - - arquillian - - - - - log4j - log4j - test - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-ftest-source - - add-test-source - - - - ${ftest.sources.directory} - - - - - add-ftest-resource - - add-test-resource - - - - - ${ftest.resources.directory} - . - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - ${arquillian} - ${jacoco.agent} - ${additional.vm.args} - - - - - surefire-it - integration-test - - test - - - false - true - false - true - - **/ftest/*Test.java - - - - - - - - - - arquillian-wildfly-managed @@ -333,98 +203,6 @@ - - arquillian-wildfly-cluster - - - arquillian - wildfly-cluster - - - - - org.wildfly.arquillian - wildfly-arquillian-container-managed - test - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - surefire-it - integration-test - - test - - - - ${node1.contextPath} - ${node1.managementAddress} - - ${node1.managementPort} - ${node1.jbossHome} - ${node1.nodeName} - - ${node2.contextPath} - ${node2.managementAddress} - - ${node2.managementPort} - ${node2.jbossHome} - ${node2.nodeName} - - - false - true - false - true - - **/ftest/cluster/*Test.java - - - - - - - - - - - - jacoco - - false - - jacoco - - - - - - org.jacoco - jacoco-maven-plugin - - jacoco.agent - - org.jboss.weld.examples.* - - - - - - prepare-agent - - - - - - - - jboss-public-repository diff --git a/examples/se/groovy-numberguess/pom.xml b/examples/se/groovy-numberguess/pom.xml index 7861b82bfcf..709d777d215 100644 --- a/examples/se/groovy-numberguess/pom.xml +++ b/examples/se/groovy-numberguess/pom.xml @@ -31,7 +31,7 @@ - org.codehaus.groovy + org.apache.groovy groovy-all pom @@ -57,7 +57,6 @@ org.codehaus.gmavenplus gmavenplus-plugin - 1.13.1 @@ -73,6 +72,7 @@ + ${maven.compiler.argument.target} ${project.basedir}/src/main/java diff --git a/examples/se/numberguess/README.md b/examples/se/numberguess/README.md index 7fc9241e11e..4a27c1dc5ff 100644 --- a/examples/se/numberguess/README.md +++ b/examples/se/numberguess/README.md @@ -7,12 +7,7 @@ To start this Weld SE application you can either choose to start it with `org.jb The former is a well known default which attempts to discover beans on classpath and then boots the application. The latter is a synthetic archive which has defined components and disables discovery leading to a minimal, quickly booting application. Of course you will need all of the relevant jar dependencies -on your classpath, which is most easily done by loading the project into your -favourite Maven-capable IDE and running it from there. - -If you are using m2eclipse, and the application won't start, make sure you uncheck -"Resolve dependencies from Workspace projects" in the Maven properties panel. Then -run a full build to ensure all classes are in the right place. +on your classpath, which is most easily done by loading the project into your favourite Maven-capable IDE and running it from there. To run this example using Maven directly: @@ -55,9 +50,8 @@ This profile provides the capability to package the artifact in a fat-jar (singl Swing Example: Number Guess --------------------------- -Here's an example of a Swing application, Number Guess, similar to the example in chapter 7. -This example shows how to use the Weld SE extension in a Java SE based Swing application -with no EJB or servlet dependencies. +Here's an example of a Swing application, Number Guess, similar to the example in chapter 6. +This example shows how to use the Weld SE extension in a Java SE based Swing application with no EJB or servlet dependencies. In the Number Guess application you are given 10 attempts to guess a number between 1 and 100. After each attempt, you will be told whether you are too high, or too low. @@ -68,9 +62,7 @@ The game's main logic is located in `Game.java`. In this example, it differs fro * Notice that the bean is not named, since it doesn't need to be accessed via EL. -* In Java SE there is no JSF `FacesContext` to which messages can be added. Instead - the Game class provides additional information about the state of the current game - including: +* In Java SE there is no JSF `FacesContext` to which messages can be added. Instead, the Game class provides additional information about the state of the current game including: * if the game has been won or lost, diff --git a/examples/se/numberguess/pom.xml b/examples/se/numberguess/pom.xml index 3f1d8abd4d1..36826ce3c8a 100644 --- a/examples/se/numberguess/pom.xml +++ b/examples/se/numberguess/pom.xml @@ -106,7 +106,7 @@ jandex - org.jboss + io.smallrye jandex @@ -119,9 +119,9 @@ - org.jboss.jandex + io.smallrye jandex-maven-plugin - 1.2.3 + ${jandex.version} make-index @@ -136,7 +136,7 @@ - org.jboss + io.smallrye jandex ${jandex.version} diff --git a/jboss-tck-runner/pom.xml b/jboss-tck-runner/pom.xml index ab41b9b610d..8653ad881a3 100644 --- a/jboss-tck-runner/pom.xml +++ b/jboss-tck-runner/pom.xml @@ -446,7 +446,6 @@ org.jboss.arquillian.protocol arquillian-protocol-servlet-jakarta - ${arquillian.version} test diff --git a/pom.xml b/pom.xml index 1247adfc38f..824db8ef4ab 100644 --- a/pom.xml +++ b/pom.xml @@ -58,10 +58,11 @@ 6.7.0 - 1.7.0.Alpha12 + 1.10.0.Final + 10.0.0.Final 3.0.0-alpha.5 3.0.0-alpha.3 - 3.0.2.Final + 4.0.0.Final 1.0.2.Final 1.2.0.Final 1.0.0.Final @@ -73,9 +74,7 @@ 1.3.0.Final - 4.7.3.4 - 4.7.3 - 3.0.20 + 5.0.2 2.70.0 0.8.8 2.4.3.Final @@ -84,8 +83,8 @@ 5.0.0-M1 3.1.0 4.0.1 - 3.5.0.Final - 2.2.1.Final + 3.6.1.Final + 3.0.4.Final 2.1.19.Final 4.0.0 3.1.0 @@ -93,11 +92,12 @@ 4.13.2 1.2.17 1.2.6 - 2.0.0 - 3.1.4 + 3.3.4 + 4.7.3.4 + 4.7.3 7.4.0 5.0.SP3 - 5.0.0.Alpha5 + 5.1.0.Final 2.23.0 1.9.0 @@ -126,7 +126,7 @@ - org.codehaus.groovy + org.apache.groovy groovy-all ${groovy.version} pom @@ -217,7 +217,17 @@ ${classfilewriter.version} - + + + + org.jboss.arquillian.jakarta + arquillian-jakarta-bom + ${arquillian.jakarta.version} + pom + import + + + org.jboss.arquillian arquillian-bom @@ -226,6 +236,14 @@ import + + org.jboss.shrinkwrap + shrinkwrap-bom + ${shrinkwrap.version} + pom + import + + org.jboss.arquillian.container arquillian-container-spi @@ -414,32 +432,14 @@ - org.jboss.shrinkwrap - shrinkwrap-api - ${shrinkwrap.version} - - - - org.jboss.shrinkwrap - shrinkwrap-spi - ${shrinkwrap.version} - - - - org.jboss.shrinkwrap - shrinkwrap-impl-base - ${shrinkwrap.version} - - - - org.jboss.shrinkwrap.descriptors - shrinkwrap-descriptors-impl - ${shrinkwrap.descriptors.version} + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven + ${shrinkwrap.resolver.version} org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven + shrinkwrap-resolver-spi ${shrinkwrap.resolver.version} @@ -518,7 +518,9 @@ maven-compiler-plugin - -Aorg.jboss.logging.tools.addGeneratedAnnotation=false + + + -proc:full