-
+
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data-jakarta/direct/HelloEJB.java b/rules/rules-reviewed/quarkus/java-ee/tests/data-jakarta/direct/HelloEJB.java
index e53a0805f..5dc4aaa38 100644
--- a/rules/rules-reviewed/quarkus/java-ee/tests/data-jakarta/direct/HelloEJB.java
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data-jakarta/direct/HelloEJB.java
@@ -1,6 +1,8 @@
import jakarta.ejb.Stateless;
+import jakarta.ejb.Stateful;
@Stateless
+@Stateful
public class HelloEJB {
String createHelloMessage(String name) {
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloService.java b/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloService.java
index 85e935d1d..490d887f5 100644
--- a/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloService.java
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/application-javaee-api/src/main/java/sample/HelloService.java
@@ -2,6 +2,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
+import javax.ejb.Stateless;
@Dependent
public class HelloService {
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/cdi-to-quarkus/beans.xml b/rules/rules-reviewed/quarkus/java-ee/tests/data/cdi-to-quarkus/beans.xml
new file mode 100644
index 000000000..ad4e3f1d8
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/cdi-to-quarkus/beans.xml
@@ -0,0 +1,18 @@
+
+
+
+ com.acme.intercept.SecurityInterceptor
+ com.acme.intercept.TransactionInterceptor
+
+
+ com.acme.decorate.BigAccountDecorator
+ com.acme.decorate.SpecialGiftDecorator
+
+
+ com.acme.business.MockPaymentProcessor
+ com.acme.stereotype.Mock
+
+
\ No newline at end of file
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/ee-to-quarkus/HelloEJBJakartaEE.java b/rules/rules-reviewed/quarkus/java-ee/tests/data/ee-to-quarkus/HelloEJBJakartaEE.java
new file mode 100644
index 000000000..5dc4aaa38
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/ee-to-quarkus/HelloEJBJakartaEE.java
@@ -0,0 +1,12 @@
+import jakarta.ejb.Stateless;
+import jakarta.ejb.Stateful;
+
+@Stateless
+@Stateful
+public class HelloEJB {
+
+ String createHelloMessage(String name) {
+ return "Hello " + name + "!";
+ }
+
+}
\ No newline at end of file
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/ee-to-quarkus/HelloEJBJavaEE.java b/rules/rules-reviewed/quarkus/java-ee/tests/data/ee-to-quarkus/HelloEJBJavaEE.java
new file mode 100644
index 000000000..2884ad723
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/ee-to-quarkus/HelloEJBJavaEE.java
@@ -0,0 +1,12 @@
+import javax.ejb.Stateless;
+import javax.ejb.Stateful;
+
+@Stateless
+@Stateful
+public class HelloEJB {
+
+ String createHelloMessage(String name) {
+ return "Hello " + name + "!";
+ }
+
+}
\ No newline at end of file
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/ee-to-quarkus/TransactionalBean.java b/rules/rules-reviewed/quarkus/java-ee/tests/data/ee-to-quarkus/TransactionalBean.java
new file mode 100644
index 000000000..ea0bff933
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/ee-to-quarkus/TransactionalBean.java
@@ -0,0 +1,9 @@
+import javax.ejb.Stateful;
+
+@Stateful
+public class TransactionalBean {
+
+ public String aTransactionalMethod(String str) {
+ return "Hello " + str;
+ }
+}
\ No newline at end of file
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/helloworld-rs/src/main/webapp/WEB-INF/beans.xml b/rules/rules-reviewed/quarkus/java-ee/tests/data/helloworld-rs/src/main/webapp/WEB-INF/beans.xml
index d3ddf148e..7d303eba4 100644
--- a/rules/rules-reviewed/quarkus/java-ee/tests/data/helloworld-rs/src/main/webapp/WEB-INF/beans.xml
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/helloworld-rs/src/main/webapp/WEB-INF/beans.xml
@@ -21,4 +21,12 @@
http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="all">
+
+ com.acme.intercept.SecurityInterceptor
+ com.acme.intercept.TransactionInterceptor
+
+
+ com.acme.decorate.BigAccountDecorator
+ com.acme.decorate.SpecialGiftDecorator
+
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/AuthController.java b/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/AuthController.java
new file mode 100644
index 000000000..4f2030432
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/AuthController.java
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2015, Red Hat, Inc. and/or its affiliates, 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.as.quickstarts.tasksJsf;
+
+import javax.enterprise.context.Conversation;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+/**
+ * Provides authentication operations with current user store: {@link Authentication}.
+ *
+ * @author Lukas Fryc
+ *
+ */
+@Named
+@RequestScoped
+public class AuthController {
+
+ @Inject
+ private Authentication authentication;
+
+ @Inject
+ private UserDao userDao;
+
+ @Inject
+ private FacesContext facesContext;
+
+ @Inject
+ private Conversation conversation;
+
+ /**
+ *
+ * Provides current user to the context available for injection using:
+ *
+ *
+ *
+ * @Inject @CurrentUser currentUser;
+ *
+ *
+ *
+ * or from the Expression Language context using an expression #{currentUser}.
+ *
+ *
+ * @return current authenticated user
+ */
+ @Produces
+ @Named
+ @CurrentUser
+ public User getCurrentUser() {
+ return authentication.getCurrentUser();
+ }
+
+ /**
+ *
+ * Authenticates current user with 'username' against user data store
+ *
+ *
+ *
+ * Starts the new conversation.
+ *
+ *
+ * @param username the username of the user to authenticate
+ */
+ public void authenticate(String username) {
+ if (isLogged()) {
+ throw new IllegalStateException("User is logged and tries to authenticate again");
+ }
+
+ User user = userDao.getForUsername(username);
+ if (user == null) {
+ user = createUser(username);
+ }
+ authentication.setCurrentUser(user);
+ conversation.begin();
+ }
+
+ /**
+ * Logs current user out and ends the current conversation.
+ */
+ public void logout() {
+ authentication.setCurrentUser(null);
+ conversation.end();
+ }
+
+ /**
+ * Returns true if user is logged in
+ *
+ * @return true if user is logged in; false otherwise
+ */
+ public boolean isLogged() {
+ return authentication.getCurrentUser() != null;
+ }
+
+ private User createUser(String username) {
+ try {
+ User user = new User(username);
+ userDao.createUser(user);
+ facesContext.addMessage(null, new FacesMessage("User successfully created"));
+ return user;
+ } catch (Exception e) {
+ facesContext.addMessage(null, new FacesMessage("Failed to create user '" + username + "'", e.getMessage()));
+ return null;
+ }
+ }
+}
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/faces-config.xml b/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/faces-config.xml
new file mode 100644
index 000000000..0dd296f5b
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/faces-config.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+ /index.xhtml
+
+ #{authController.authenticate(username)}
+ #{authController.logged}
+ /tasks.xhtml
+
+
+
+
+
+ /tasks.xhtml
+
+ #{authController.logout}
+ #{!authController.logged}
+ /index.xhtml
+
+
+
+
+
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/index.xhtml b/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/index.xhtml
new file mode 100644
index 000000000..5350d4ed7
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/index.xhtml
@@ -0,0 +1,23 @@
+
+
+
+
+ tasks-jsf
+
+
+
+ Tasks - Authentication
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/pom.xml b/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/pom.xml
new file mode 100644
index 000000000..436fd580f
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/jsf-to-qute/pom.xml
@@ -0,0 +1,106 @@
+
+
+
+ 4.0.0
+
+ org.jboss.eap.quickstarts
+ quickstart-parent
+
+ 7.4.0.GA
+ ../pom.xml
+
+
+ tasks-jsf
+ war
+ Quickstart: tasks-jsf
+ This project demonstrates how to use JPA persistence to manage tasks with JSF as view layer
+
+
+
+ Apache License, Version 2.0
+ http://www.apache.org/licenses/LICENSE-2.0.html
+ repo
+
+
+
+
+
+
+
+ jakarta.enterprise
+ jakarta.enterprise.cdi-api
+ provided
+
+
+
+
+ junit
+ junit
+ test
+
+
+
+
+ jakarta.persistence
+ jakarta.persistence-api
+ provided
+
+
+
+ org.jboss.arquillian.junit
+ arquillian-junit-container
+ test
+
+
+
+ org.jboss.arquillian.protocol
+ arquillian-protocol-servlet
+ test
+
+
+
+
+ org.jboss.spec.javax.ejb
+ jboss-ejb-api_3.2_spec
+ provided
+
+
+
+
+ org.jboss.spec.javax.faces
+ jboss-jsf-api_2.3_spec
+ provided
+
+
+
+ jakarta.faces
+ jakarta.faces-api
+ 4.0.1
+
+
+
+
+
+
+
+ ${project.artifactId}
+
+
+
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/persistence-to-quarkus/PersistenceRelatedClass.java b/rules/rules-reviewed/quarkus/java-ee/tests/data/persistence-to-quarkus/PersistenceRelatedClass.java
new file mode 100644
index 000000000..b367b876a
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/persistence-to-quarkus/PersistenceRelatedClass.java
@@ -0,0 +1,13 @@
+import javax.enterprise.inject.Produces;
+import javax.persistence.EntityManager;
+
+public class PersistenceRelatedClass {
+
+ @Produces
+ private EntityManager entityManager;
+
+ @Produces
+ public EntityManager getEntityManager() {
+ return entityManager;
+ }
+}
\ No newline at end of file
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/data/persistence-to-quarkus/persistence.xml b/rules/rules-reviewed/quarkus/java-ee/tests/data/persistence-to-quarkus/persistence.xml
new file mode 100644
index 000000000..5b08c01d0
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/data/persistence-to-quarkus/persistence.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+ java:jboss/datasources/TasksJsfQuickstartDS
+
+
+
+
+
+
+
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/dependency-removal-for-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/dependency-removal-for-quarkus.windup.test.xml
index 35f0d75bc..7a91984ca 100644
--- a/rules/rules-reviewed/quarkus/java-ee/tests/dependency-removal-for-quarkus.windup.test.xml
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/dependency-removal-for-quarkus.windup.test.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/ee-to-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/ee-to-quarkus.windup.test.xml
new file mode 100644
index 000000000..6edb7d414
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/ee-to-quarkus.windup.test.xml
@@ -0,0 +1,48 @@
+
+
+ data/ee-to-quarkus
+ ../ee-to-quarkus.windup.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/javaee-faces-to-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/javaee-faces-to-quarkus.windup.test.xml
index 78f23c83b..939318d16 100644
--- a/rules/rules-reviewed/quarkus/java-ee/tests/javaee-faces-to-quarkus.windup.test.xml
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/javaee-faces-to-quarkus.windup.test.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml
index fcaa0a520..0b040e42a 100644
--- a/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/javaee-pom-to-quarkus.windup.test.xml
@@ -10,7 +10,7 @@
-
+
@@ -22,7 +22,7 @@
-
+
@@ -34,7 +34,7 @@
-
+
@@ -46,7 +46,7 @@
-
+
@@ -58,7 +58,7 @@
-
+
@@ -70,7 +70,7 @@
-
+
@@ -82,7 +82,7 @@
-
+
@@ -94,7 +94,7 @@
-
+
@@ -106,7 +106,7 @@
-
+
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/jsf-to-qute.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/jsf-to-qute.windup.test.xml
new file mode 100755
index 000000000..e9d5b2975
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/jsf-to-qute.windup.test.xml
@@ -0,0 +1,70 @@
+
+
+ data/jsf-to-qute
+ ../jsf-to-qute.windup.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/rules/rules-reviewed/quarkus/java-ee/tests/persistence-to-quarkus.windup.test.xml b/rules/rules-reviewed/quarkus/java-ee/tests/persistence-to-quarkus.windup.test.xml
new file mode 100755
index 000000000..7cecb86cc
--- /dev/null
+++ b/rules/rules-reviewed/quarkus/java-ee/tests/persistence-to-quarkus.windup.test.xml
@@ -0,0 +1,36 @@
+
+
+ data/persistence-to-quarkus
+ ../persistence-to-quarkus.windup.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+