Skip to content

Commit

Permalink
[#1802] Switch pax-web-itest-jsp from javax to jakarta
Browse files Browse the repository at this point in the history
  • Loading branch information
grgrzybek committed Jun 19, 2023
1 parent 95d42dc commit b9f3e03
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 70 deletions.
2 changes: 1 addition & 1 deletion pax-web-itest/pax-web-itest-jsp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<artifactId>osgi.core</artifactId>
</dependency>

<!-- JavaEE (the packages not re-exported by pax-web-jsp) -->
<!-- JakartaEE (the packages not re-exported by pax-web-jsp) -->

<dependency>
<groupId>jakarta.el</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package org.ops4j.pax.web.test.tags;

import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import jakarta.servlet.jsp.JspException;
import jakarta.servlet.jsp.tagext.TagSupport;

public class TestTag extends TagSupport {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
package org.ops4j.pax.web.test.jsp;

import java.util.ServiceLoader;
import javax.el.ELContext;
import javax.el.ELManager;
import javax.el.ELProcessor;
import javax.el.ELResolver;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import jakarta.el.ELContext;
import jakarta.el.ELManager;
import jakarta.el.ELProcessor;
import jakarta.el.ELResolver;
import jakarta.el.ExpressionFactory;
import jakarta.el.ValueExpression;

import org.junit.Test;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import javax.servlet.Servlet;
import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.descriptor.JspConfigDescriptor;
import javax.servlet.descriptor.JspPropertyGroupDescriptor;
import javax.servlet.descriptor.TaglibDescriptor;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.Servlet;
import jakarta.servlet.ServletContainerInitializer;
import jakarta.servlet.ServletContext;
import jakarta.servlet.descriptor.JspConfigDescriptor;
import jakarta.servlet.descriptor.JspPropertyGroupDescriptor;
import jakarta.servlet.descriptor.TaglibDescriptor;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.io.FileUtils;
import org.junit.Before;
Expand Down Expand Up @@ -68,7 +68,7 @@ public class PaxWebCustomTldIntegrationTest {
@BeforeClass
@SuppressWarnings("JavaReflectionInvocation")
public static void initStatic() throws Exception {
Class<?> jspFactoryClass = Class.forName("javax.servlet.jsp.JspFactory");
Class<?> jspFactoryClass = Class.forName("jakarta.servlet.jsp.JspFactory");
Method setDefaultFactory = jspFactoryClass.getDeclaredMethod("setDefaultFactory", jspFactoryClass);
Class<?> jspFactoryImplClass = Class.forName("org.apache.jasper.runtime.JspFactoryImpl");
setDefaultFactory.invoke(null, jspFactoryClass.cast(jspFactoryImplClass.getConstructor().newInstance()));
Expand Down Expand Up @@ -168,6 +168,11 @@ public String getBuffer() {
public String getErrorOnUndeclaredNamespace() {
return "false";
}

@Override
public String getErrorOnELNotFound() {
return "false";
}
});
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
import java.io.File;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import javax.servlet.Servlet;
import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.descriptor.JspConfigDescriptor;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.Servlet;
import jakarta.servlet.ServletContainerInitializer;
import jakarta.servlet.ServletContext;
import jakarta.servlet.descriptor.JspConfigDescriptor;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.io.FileUtils;
import org.junit.Before;
Expand Down Expand Up @@ -64,7 +64,7 @@ public class PaxWebJspIntegrationTest {
@BeforeClass
@SuppressWarnings("JavaReflectionInvocation")
public static void initStatic() throws Exception {
Class<?> jspFactoryClass = Class.forName("javax.servlet.jsp.JspFactory");
Class<?> jspFactoryClass = Class.forName("jakarta.servlet.jsp.JspFactory");
Method setDefaultFactory = jspFactoryClass.getDeclaredMethod("setDefaultFactory", jspFactoryClass);
Class<?> jspFactoryImplClass = Class.forName("org.apache.jasper.runtime.JspFactoryImpl");
setDefaultFactory.invoke(null, jspFactoryClass.cast(jspFactoryImplClass.getConstructor().newInstance()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
import java.util.Collection;
import java.util.Collections;
import java.util.UUID;
import javax.servlet.Servlet;
import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.descriptor.JspConfigDescriptor;
import javax.servlet.descriptor.JspPropertyGroupDescriptor;
import javax.servlet.descriptor.TaglibDescriptor;
import jakarta.servlet.Servlet;
import jakarta.servlet.ServletContainerInitializer;
import jakarta.servlet.ServletContext;
import jakarta.servlet.descriptor.JspConfigDescriptor;
import jakarta.servlet.descriptor.JspPropertyGroupDescriptor;
import jakarta.servlet.descriptor.TaglibDescriptor;

import org.junit.Before;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -61,7 +61,7 @@ public class PaxWebJspNoScriptingIntegrationTest {

@BeforeClass
public static void initStatic() throws Exception {
Class<?> jspFactoryClass = Class.forName("javax.servlet.jsp.JspFactory");
Class<?> jspFactoryClass = Class.forName("jakarta.servlet.jsp.JspFactory");
Method setDefaultFactory = jspFactoryClass.getDeclaredMethod("setDefaultFactory", jspFactoryClass);
Class<?> jspFactoryImplClass = Class.forName("org.apache.jasper.runtime.JspFactoryImpl");
setDefaultFactory.invoke(null, jspFactoryClass.cast(jspFactoryImplClass.getConstructor().newInstance()));
Expand Down Expand Up @@ -147,6 +147,11 @@ public String getBuffer() {
public String getErrorOnUndeclaredNamespace() {
return "false";
}

@Override
public String getErrorOnELNotFound() {
return "false";
}
});
}
};
Expand Down
2 changes: 1 addition & 1 deletion pax-web-jsp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
{maven-dependencies}
</Include-Resource>
<Embed-Dependency>
artifactId=taglibs-standard-impl;inline=**/*.tld
artifactId=jakarta.servlet.jsp.jstl;inline=**/*.tld
</Embed-Dependency>
<_nouses>true</_nouses>
<_contract>!*</_contract>
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit b9f3e03

Please sign in to comment.