From 0b61983e9e1765da9e4fb368aaf4be3ecb03a139 Mon Sep 17 00:00:00 2001 From: Juan Manuel Leflet Estrada Date: Mon, 31 Jul 2023 17:45:04 +0200 Subject: [PATCH] [WINDUPRULE-1014] Create ruleset for EAP 7.1 Elytron migration (#1014) * [WINDUPRULE-1014] Create ruleset for EAP 7.1 Elytron migration * [WINDUPRULE-1014] Fix version range * [WINDUPRULE-1014] Set rule as potential * [WINDUPRULE-1029] Switch rule to filecontent --- .../eap7/elytron/elytron.windup.xml | 46 +++++++++++++++++++ .../eap7/elytron/tests/data/Elytron.java | 17 +++++++ .../tests/data/jboss-ejb-client.properties | 6 +++ .../elytron/tests/elytron.windup.test.xml | 35 ++++++++++++++ .../tests/data/FinalizationDeprecation.java | 23 ---------- 5 files changed, 104 insertions(+), 23 deletions(-) create mode 100644 rules/rules-reviewed/eap7/elytron/elytron.windup.xml create mode 100644 rules/rules-reviewed/eap7/elytron/tests/data/Elytron.java create mode 100644 rules/rules-reviewed/eap7/elytron/tests/data/jboss-ejb-client.properties create mode 100644 rules/rules-reviewed/eap7/elytron/tests/elytron.windup.test.xml delete mode 100644 rules/rules-reviewed/openjdk21/openjdk17/tests/data/FinalizationDeprecation.java diff --git a/rules/rules-reviewed/eap7/elytron/elytron.windup.xml b/rules/rules-reviewed/eap7/elytron/elytron.windup.xml new file mode 100644 index 000000000..7386ec1a3 --- /dev/null +++ b/rules/rules-reviewed/eap7/elytron/elytron.windup.xml @@ -0,0 +1,46 @@ + + + + + This ruleset provides analysis of applications that Picketlink STS and may require + This ruleset provides analysis to migrate to Elytron in JBoss EAP 7.1 + + + + + + + + eap7 + + + + + + + + + + Migrate a client application that performs a remote JNDI lookup using an `org.jboss.naming.remote.client.InitialContext` class, which is backed by an `org.jboss.naming.remote.client.InitialContextFactory` class, to Elytron. + + + + + + + + + + + + + Remote EJB client must be configured following one of the two options defined in the link below. + + + + + + + diff --git a/rules/rules-reviewed/eap7/elytron/tests/data/Elytron.java b/rules/rules-reviewed/eap7/elytron/tests/data/Elytron.java new file mode 100644 index 000000000..122dc21c7 --- /dev/null +++ b/rules/rules-reviewed/eap7/elytron/tests/data/Elytron.java @@ -0,0 +1,17 @@ +import org.jboss.naming.remote.client.InitialContextFactory; + +import javax.naming.Context; +import javax.naming.NamingException; +import javax.naming.spi.InitialContextFactory; +import java.util.Hashtable; + +public class Elytron { + public static void main(String[] args) { + Properties properties = new Properties(); + properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); + properties.put(Context.PROVIDER_URL,"http-remoting://127.0.0.1:8080"); + properties.put(Context.SECURITY_PRINCIPAL, "bob"); + properties.put(Context.SECURITY_CREDENTIALS, "secret"); + InitialContext context = new InitialContext(properties); + } +} \ No newline at end of file diff --git a/rules/rules-reviewed/eap7/elytron/tests/data/jboss-ejb-client.properties b/rules/rules-reviewed/eap7/elytron/tests/data/jboss-ejb-client.properties new file mode 100644 index 000000000..854462037 --- /dev/null +++ b/rules/rules-reviewed/eap7/elytron/tests/data/jboss-ejb-client.properties @@ -0,0 +1,6 @@ +remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false +remote.connections=default +remote.connection.default.host=127.0.0.1 +remote.connection.default.port = 8080 +remote.connection.default.username=bob +remote.connection.default.password=secret diff --git a/rules/rules-reviewed/eap7/elytron/tests/elytron.windup.test.xml b/rules/rules-reviewed/eap7/elytron/tests/elytron.windup.test.xml new file mode 100644 index 000000000..c97dc4065 --- /dev/null +++ b/rules/rules-reviewed/eap7/elytron/tests/elytron.windup.test.xml @@ -0,0 +1,35 @@ + + + data + ../elytron.windup.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rules/rules-reviewed/openjdk21/openjdk17/tests/data/FinalizationDeprecation.java b/rules/rules-reviewed/openjdk21/openjdk17/tests/data/FinalizationDeprecation.java deleted file mode 100644 index 14478a436..000000000 --- a/rules/rules-reviewed/openjdk21/openjdk17/tests/data/FinalizationDeprecation.java +++ /dev/null @@ -1,23 +0,0 @@ -import javax.imageio.stream.FileImageOutputStream; -import java.io.File; - -public class FinalizationDeprecation extends Object { - - public static void main(String[] args) { - FinalizationDeprecation o1 = new FinalizationDeprecation(); - o1.finalize(); - - Runtime runtime = Runtime.getRuntime(); - runtime.runFinalization(); - - System.runFinalization(); - - FileImageOutputStream stream = new FileImageOutputStream(new File("hey")); - stream.finalize(); - } - - @Override - protected void finalize() throws Throwable { - super.finalize(); - } -} \ No newline at end of file