You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by eb...@apache.org on 2020/04/13 09:55:54 UTC

[tomcat-jakartaee-migration] branch master updated (1f5be19 -> 6e31d53)

This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git.


    from 1f5be19  Bugfix: TextConverter: Do not duplicate the content of text files.
     new f2cf302  Test all the substitutions supported
     new 6e31d53  Document the Ant task

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.md                                          | 10 +++
 .../apache/tomcat/jakartaee/EESpecProfileTest.java | 97 ++++++++++++++++++++++
 2 files changed, 107 insertions(+)
 create mode 100644 src/test/java/org/apache/tomcat/jakartaee/EESpecProfileTest.java


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat-jakartaee-migration] 02/02: Document the Ant task

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git

commit 6e31d539f764a7185ef6d31ca23a6d69c745ba50
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Apr 13 11:55:42 2020 +0200

    Document the Ant task
---
 README.md | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/README.md b/README.md
index 2890a27..bbdea9e 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,8 @@ The aim of the tool is to take a web application written for Java EE 8 that
 runs on Apache Tomcat 9 and convert it automatically so it runs on Apache
 Tomcat 10 which implements Jakarta EE 9.
 
+The tool can be used from the command line or as an Ant task.
+
 ## Usage
 
 ### Build
@@ -32,6 +34,14 @@ the same type as the source.
 >
 > A warning will be logged for each JAR file where the signature has been removed.
 
+## Ant task
+
+The migration tool is available as an Ant task, here is an example:
+
+    <taskdef name="javax2jakarta" classname="org.apache.tomcat.jakartaee.MigrationTask" classpath="jakartaee-migration-*-shaded.jar"/>
+    
+    <javax2jakarta src="webapp.war" dest="webapp.migrated.war" profile="tomcat"/>
+
 ## Differences between Java EE 8 and Jakarta EE 9
 
 Jakarta EE 9 is still under development and there are some details that remain


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat-jakartaee-migration] 01/02: Test all the substitutions supported

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git

commit f2cf302e21166479460d98978a64ac3d2142b7cf
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Apr 13 11:38:49 2020 +0200

    Test all the substitutions supported
---
 .../apache/tomcat/jakartaee/EESpecProfileTest.java | 97 ++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/src/test/java/org/apache/tomcat/jakartaee/EESpecProfileTest.java b/src/test/java/org/apache/tomcat/jakartaee/EESpecProfileTest.java
new file mode 100644
index 0000000..bc88aaf
--- /dev/null
+++ b/src/test/java/org/apache/tomcat/jakartaee/EESpecProfileTest.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.tomcat.jakartaee;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class EESpecProfileTest {
+
+    @Test
+    public void testProfileTomcat() {
+        EESpecProfile profile = EESpecProfile.TOMCAT;
+
+        assertEquals("jakarta.annotation", profile.convert("javax.annotation"));
+        assertEquals("jakarta.ejb", profile.convert("javax.ejb"));
+        assertEquals("jakarta.el", profile.convert("javax.el"));
+        assertEquals("jakarta.mail", profile.convert("javax.mail"));
+        assertEquals("jakarta.persistence", profile.convert("javax.persistence"));
+        assertEquals("jakarta.security.auth.message", profile.convert("javax.security.auth.message"));
+        assertEquals("jakarta.servlet", profile.convert("javax.servlet"));
+        assertEquals("jakarta.transaction", profile.convert("javax.transaction"));
+        assertEquals("jakarta.websocket", profile.convert("javax.websocket"));
+
+        // not converted EE packages
+        assertEquals("javax.activation", profile.convert("javax.activation"));
+        assertEquals("javax.decorator", profile.convert("javax.decorator"));
+        assertEquals("javax.enterprise", profile.convert("javax.enterprise"));
+        assertEquals("javax.json", profile.convert("javax.json"));
+        assertEquals("javax.interceptor", profile.convert("javax.interceptor"));
+        assertEquals("javax.inject", profile.convert("javax.inject"));
+        assertEquals("javax.validation", profile.convert("javax.validation"));
+        assertEquals("javax.ws.rs", profile.convert("javax.ws.rs"));
+        assertEquals("javax.xml.bind", profile.convert("javax.xml.bind"));
+        assertEquals("javax.xml.namespace", profile.convert("javax.xml.namespace"));
+        assertEquals("javax.xml.rpc", profile.convert("javax.xml.rpc"));
+        assertEquals("javax.xml.soap", profile.convert("javax.xml.soap"));
+        assertEquals("javax.xml.stream", profile.convert("javax.xml.stream"));
+        assertEquals("javax.xml.ws", profile.convert("javax.xml.ws"));
+        assertEquals("javax.xml.XMLConstants", profile.convert("javax.xml.XMLConstants"));
+
+        // non EE javax packages
+        assertEquals("javax.security", profile.convert("javax.security"));
+        assertEquals("javax.security.auth", profile.convert("javax.security.auth"));
+        assertEquals("javax.swing", profile.convert("javax.swing"));
+    }
+
+    @Test
+    public void testProfileEE() {
+        EESpecProfile profile = EESpecProfile.EE;
+
+        assertEquals("jakarta.activation", profile.convert("javax.activation"));
+        assertEquals("jakarta.annotation", profile.convert("javax.annotation"));
+        assertEquals("jakarta.decorator", profile.convert("javax.decorator"));
+        assertEquals("jakarta.ejb", profile.convert("javax.ejb"));
+        assertEquals("jakarta.el", profile.convert("javax.el"));
+        assertEquals("jakarta.enterprise", profile.convert("javax.enterprise"));
+        assertEquals("jakarta.json", profile.convert("javax.json"));
+        assertEquals("jakarta.interceptor", profile.convert("javax.interceptor"));
+        assertEquals("jakarta.inject", profile.convert("javax.inject"));
+        assertEquals("jakarta.mail", profile.convert("javax.mail"));
+        assertEquals("jakarta.persistence", profile.convert("javax.persistence"));
+        assertEquals("jakarta.security.auth.message", profile.convert("javax.security.auth.message"));
+        assertEquals("jakarta.servlet", profile.convert("javax.servlet"));
+        assertEquals("jakarta.transaction", profile.convert("javax.transaction"));
+        assertEquals("jakarta.validation", profile.convert("javax.validation"));
+        assertEquals("jakarta.websocket", profile.convert("javax.websocket"));
+        assertEquals("jakarta.ws.rs", profile.convert("javax.ws.rs"));
+        assertEquals("jakarta.xml.bind", profile.convert("javax.xml.bind"));
+        assertEquals("jakarta.xml.namespace", profile.convert("javax.xml.namespace"));
+        assertEquals("jakarta.xml.rpc", profile.convert("javax.xml.rpc"));
+        assertEquals("jakarta.xml.soap", profile.convert("javax.xml.soap"));
+        assertEquals("jakarta.xml.stream", profile.convert("javax.xml.stream"));
+        assertEquals("jakarta.xml.ws", profile.convert("javax.xml.ws"));
+        assertEquals("jakarta.xml.XMLConstants", profile.convert("javax.xml.XMLConstants"));
+
+        // non EE javax packages
+        assertEquals("javax.security", profile.convert("javax.security"));
+        assertEquals("javax.security.auth", profile.convert("javax.security.auth"));
+        assertEquals("javax.swing", profile.convert("javax.swing"));
+    }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org