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 <ebo...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to