Skip to content

Commit

Permalink
[WFLY-17289] showcase major enhancements wrt provisioning, cloud and …
Browse files Browse the repository at this point in the history
…testing on selected quickstarts
  • Loading branch information
ehsavoie authored and emmartins committed Nov 16, 2022
1 parent b211be9 commit 4969f6f
Show file tree
Hide file tree
Showing 116 changed files with 5,213 additions and 1,012 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ atlassian-ide-plugin.xml
*.log
build.metadata

/**/nbproject/
51 changes: 16 additions & 35 deletions cmt/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,22 @@ NotSupported:: If there is a transaction running, it will be suspended and no tr
Supports:: This will run the method within a transaction if a transaction exists, alternatively, if there is no transaction running, the method will not be executed within the scope of a transaction.
Never:: If the client has a transaction running and does not suspend it but calls a method annotated with Never then an EJB exception will be raised.

ifndef::EAPCDRelease[]

// Considerations for Use in a Production Environment
include::../shared-doc/development-shortcuts.adoc[leveloffset=+1]
// System Requirements
include::../shared-doc/system-requirements.adoc[leveloffset=+1]
// Use of {jbossHomeName}
include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1]
// Start the {productName} Standalone Server (with the full profile)
include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+1]

// build and run with standard server distribution
[[build_and_run_the_quickstart_with_server_dist]]
== Building and running the quickstart application with a {productName} server distribution
// Start the {productName} Standalone Server
include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2]
// Build and Deploy the Quickstart
include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+1]
include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2]

== Access the Application
=== Access the Application

The application will be running at the following URL: http://localhost:8080/{artifactId}/

Expand All @@ -77,7 +79,7 @@ If an existing customer name is provided, no JMS message is sent. Instead of the

The customer name should match: letter & '-', otherwise an error is given. This is to show that a `LogMessage` entity is still stored in the database. That is because the `logCreateCustomer` method in the `LogMessageManagerEJB` EJB is decorated with the `@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)` annotation.

== Server Log: Expected Warnings and Errors
=== Server Log: Expected Warnings and Errors

You will see the following warnings in the server log. You can ignore these warnings.

Expand All @@ -86,34 +88,13 @@ You will see the following warnings in the server log. You can ignore these warn
HHH000431: Unable to determine H2 database version, certain features may not work
----

// Testing with Arquillian
include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2]
// Undeploy the Quickstart
include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+1]
// Run the Quickstart in Red Hat CodeReady Studio or Eclipse
include::../shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc[leveloffset=+1]

// Additional Red Hat CodeReady Studio instructions
NOTE: Within {JBDSProductName}, make sure you define a server runtime environment that uses the `standalone-full.xml` configuration file.

// Debug the Application
include::../shared-doc/debug-the-application.adoc[leveloffset=+1]
include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]

// Build and run sections for other environments/builds
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]

//*************************************************
// Product Release content only
//*************************************************
ifdef::ProductRelease[]
// Getting Started with OpenShift
include::../shared-doc/openshift-getting-started.adoc[leveloffset=+1]
//Prepare OpenShift for Quickstart Deployment
include::../shared-doc/openshift-create-project.adoc[leveloffset=+1]
// Import the Latest {xpaasproduct-shortname} Image Streams and Templates
include::../shared-doc/openshift-import-imagestreams-templates.adoc[leveloffset=+1]
// Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift
include::../shared-doc/openshift-deploy-project.adoc[leveloffset=+1]
// Openshift post deployment tasks
include::../shared-doc/openshift-post-deployment-tasks.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
6 changes: 6 additions & 0 deletions cmt/charts/helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build:
uri: https://github.com/wildfly/quickstart.git
ref: main
contextDir: cmt
deploy:
replicas: 1
172 changes: 166 additions & 6 deletions cmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<properties>
<!-- The versions for BOMs, Dependencies and Plugins -->
<version.server.bom>27.0.0.Final</version.server.bom>
<version.server>27.0.0.Final</version.server>
<version.wildfly.maven.plugin>4.0.0.Final</version.wildfly.maven.plugin>
<version.cloud.fp>2.0.0.Final</version.cloud.fp>
</properties>

<repositories>
Expand Down Expand Up @@ -123,12 +126,6 @@
<scope>provided</scope>
</dependency>

<!-- Needed for running tests (you may also use TestNG) -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- Import the JPA API, we use provided scope as the API is included in JBoss EAP -->
<dependency>
<groupId>jakarta.persistence</groupId>
Expand Down Expand Up @@ -170,6 +167,169 @@
<scope>provided</scope>
</dependency>

<!-- Tests -->
<!-- Needed for running tests (you may also use TestNG) -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-test-api</artifactId>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-common</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>provisioned-server</id>
<dependencies>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<feature-packs>
<feature-pack>
<location>org.wildfly:wildfly-galleon-pack:${version.server}</location>
</feature-pack>
</feature-packs>
<layers>
<layer>cloud-server</layer>
<layer>ejb</layer>
<layer>jsf</layer>
<layer>embedded-activemq</layer>
<layer>h2-default-datasource</layer>
</layers>
<runtimeName>ROOT.war</runtimeName>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.failsafe.plugin}</version>
<configuration>
<environmentVariables>
<JBOSS_HOME>${project.build.directory}/server</JBOSS_HOME>
</environmentVariables>
<includes>
<include>**/ProvisionedManagedCustomerIT</include>
</includes>
<excludes>
<exclude>**/RemoteCustomerIT</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>openshift</id>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<feature-packs>
<feature-pack>
<location>org.wildfly:wildfly-galleon-pack:${version.server}</location>
</feature-pack>
<feature-pack>
<location>org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp}</location>
</feature-pack>
</feature-packs>
<layers>
<layer>cloud-server</layer>
<layer>ejb</layer>
<layer>jsf</layer>
<layer>embedded-activemq</layer>
<layer>h2-default-datasource</layer>
</layers>
<filename>ROOT.war</filename>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>arq-remote</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.failsafe.plugin}</version>
<configuration>
<includes>
<include>**/RemoteCustomerIT</include>
</includes>
<excludes>
<exclude>**/ProvisionedManagedCustomerIT</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
14 changes: 14 additions & 0 deletions cmt/scripts/embedded-broker.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
if (outcome == success) of /subsystem=messaging-activemq:read-resource
/subsystem=messaging-activemq/server=default:add(elytron-domain=ApplicationDomain)
end-if
if (outcome == success) of /subsystem=messaging-activemq/server=default:read-resource
/subsystem=messaging-activemq/server=default/in-vm-acceptor=in-vm:add(server-id=0, params=[buffer-pooling=false])
/subsystem=messaging-activemq/server=default/in-vm-connector=in-vm:add(server-id=0, params=[buffer-pooling=false])
/subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra:add(connectors=[in-vm], transaction=xa, entries=[java:/JmsXA,java:jboss/DefaultJMSConnectionFactory])
/subsystem=messaging-activemq/server=default/jms-queue=DLQ:add(entries=[java:/jms/queue/DLQ])
/subsystem=messaging-activemq/server=default/jms-queue=ExpiryQueue:add(entries=[java:/jms/queue/ExpiryQueue])
/subsystem=messaging-activemq/server=default/address-setting=#:add(dead-letter-address=jms.queue.DLQ, expiry-address=jms.queue.ExpiryQueue)
end-if
if (outcome == success) of /subsystem=ee/service=default-bindings:read-resource
/subsystem=ee/service=default-bindings:write-attribute(name="jms-connection-factory", value="java:jboss/DefaultJMSConnectionFactory")
end-if
8 changes: 4 additions & 4 deletions cmt/src/main/webapp/WEB-INF/faces-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
-->
<!-- Marker file indicating JSF should be enabled -->
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<faces-config xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
https://jakarta.ee/xml/ns/jakartaee
Expand All @@ -26,19 +26,19 @@
<navigation-rule>
<from-view-id>/addCustomer.xhtml</from-view-id>
<navigation-case>
<from-action>#{customerManager.addCustomer(name)}</from-action>
<from-action>#{customerManager.addCustomer}</from-action>
<from-outcome>customerAdded</from-outcome>
<to-view-id>/customers.xhtml</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-action>#{customerManager.addCustomer(name)}</from-action>
<from-action>#{customerManager.addCustomer}</from-action>
<from-outcome>customerDuplicate</from-outcome>
<to-view-id>/duplicate.xhtml</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-action>#{customerManager.addCustomer(name)}</from-action>
<from-action>#{customerManager.addCustomer}</from-action>
<from-outcome>customerInvalidName</from-outcome>
<to-view-id>/invalidName.xhtml</to-view-id>
<redirect />
Expand Down
42 changes: 21 additions & 21 deletions cmt/src/main/webapp/addCustomer.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
xmlns:ui="jakarta.faces.facelets"
xmlns:h="jakarta.faces.html"
xmlns:f="jakarta.faces.core">

<ui:composition template="template.xhtml">
<ui:define name="content">
<h:messages />
<h:form id="addCustomerForm">
<h:panelGrid columns="3">
<h:outputLabel for="name">Name:</h:outputLabel>
<h:inputText id="name" value="#{customerManager.name}" />
<h:commandButton id="add" value="Add"
action="#{customerManager.addCustomer}">
</h:commandButton>
</h:panelGrid>
</h:form>
<ul>
<li><h:link outcome="/customers.xhtml">List customers</h:link></li>
<li><h:link outcome="/logMessages.xhtml">List log messages</h:link></li>
</ul>
</ui:define>
</ui:composition>
<ui:composition template="template.xhtml">
<ui:define name="content">
<h:messages />
<h:form id="addCustomerForm">
<h:panelGrid columns="3">
<h:outputLabel for="name">Name:</h:outputLabel>
<h:inputText id="name" value="#{customerManager.name}" />
<h:commandButton id="add" value="Add"
action="#{customerManager.addCustomer}">
</h:commandButton>
</h:panelGrid>
</h:form>
<ul>
<li><h:link outcome="/customers.xhtml">List customers</h:link></li>
<li><h:link outcome="/logMessages.xhtml">List log messages</h:link></li>
</ul>
</ui:define>
</ui:composition>
</html>
Loading

0 comments on commit 4969f6f

Please sign in to comment.