Skip to content

Commit

Permalink
Migration to Jakarta EE
Browse files Browse the repository at this point in the history
  • Loading branch information
bvfalcon committed Sep 2, 2024
1 parent d0e2d7a commit 3b9ee9a
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 183 deletions.
10 changes: 5 additions & 5 deletions build/org.eclipse.birt.target/BIRT Chart Test.launch
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
<setEntry value="jakarta.servlet.jsp@default:default"/>
<setEntry value="jakarta.servlet@default:default"/>
<setEntry value="javax.activation*2.0.0.v20221203-1659@default:default"/>
<setEntry value="javax.annotation@default:default"/>
<setEntry value="javax.el@default:default"/>
<setEntry value="javax.inject@default:default"/>
<setEntry value="javax.mail@default:default"/>
<setEntry value="jakarta.annotation@default:default"/>
<setEntry value="jakarta.el@default:default"/>
<setEntry value="jakarta.inject@default:default"/>
<setEntry value="jakarta.mail@default:default"/>
<setEntry value="jakarta.servlet-api@default:default"/>
<setEntry value="jakarta.servlet.jsp-api@default:default"/>
<setEntry value="javax.transaction@default:false"/>
<setEntry value="jakarta.transaction@default:false"/>
<setEntry value="javax.wsdl@default:default"/>
<setEntry value="javax.xml.soap@default:default"/>
<setEntry value="javax.xml.stream@default:default"/>
Expand Down
10 changes: 5 additions & 5 deletions build/org.eclipse.birt.target/BIRT Report Engine Test.launch
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
<setEntry value="jakarta.servlet.jsp@default:default"/>
<setEntry value="jakarta.servlet@default:default"/>
<setEntry value="javax.activation*2.0.0.v20221203-1659@default:default"/>
<setEntry value="javax.annotation@default:default"/>
<setEntry value="javax.el@default:default"/>
<setEntry value="javax.inject@default:default"/>
<setEntry value="javax.mail@default:default"/>
<setEntry value="jakarta.annotation@default:default"/>
<setEntry value="jakarta.el@default:default"/>
<setEntry value="jakarta.inject@default:default"/>
<setEntry value="jakarta.mail@default:default"/>
<setEntry value="jakarta.servlet-api@default:default"/>
<setEntry value="javax.transaction@default:false"/>
<setEntry value="jakarta.transaction@default:false"/>
<setEntry value="javax.wsdl@default:default"/>
<setEntry value="javax.xml.soap@default:default"/>
<setEntry value="javax.xml.stream@default:default"/>
Expand Down
10 changes: 5 additions & 5 deletions build/org.eclipse.birt.target/BIRT Report Model Test.launch
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
<setEntry value="jakarta.servlet.jsp@default:default"/>
<setEntry value="jakarta.servlet@default:default"/>
<setEntry value="javax.activation*2.0.0.v20221203-1659@default:default"/>
<setEntry value="javax.annotation@default:default"/>
<setEntry value="javax.el@default:default"/>
<setEntry value="javax.inject@default:default"/>
<setEntry value="javax.mail@default:default"/>
<setEntry value="jakarta.annotation@default:default"/>
<setEntry value="jakarta.el@default:default"/>
<setEntry value="jakarta.inject@default:default"/>
<setEntry value="jakarta.mail@default:default"/>
<setEntry value="jakarta.servlet-api@default:default"/>
<setEntry value="javax.transaction@default:false"/>
<setEntry value="jakarta.transaction@default:false"/>
<setEntry value="javax.wsdl@default:default"/>
<setEntry value="javax.xml.soap@default:default"/>
<setEntry value="javax.xml.stream@default:default"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
<setEntry value="jakarta.servlet.jsp@default:default"/>
<setEntry value="jakarta.servlet@default:default"/>
<setEntry value="javax.activation*2.0.0.v20221203-1659@default:default"/>
<setEntry value="javax.annotation@default:default"/>
<setEntry value="javax.el@default:default"/>
<setEntry value="javax.inject@default:default"/>
<setEntry value="javax.mail@default:default"/>
<setEntry value="jakarta.annotation@default:default"/>
<setEntry value="jakarta.el@default:default"/>
<setEntry value="jakarta.inject@default:default"/>
<setEntry value="jakarta.mail@default:default"/>
<setEntry value="jakarta.servlet-api@default:default"/>
<setEntry value="javax.transaction@default:false"/>
<setEntry value="jakarta.transaction@default:false"/>
<setEntry value="javax.wsdl@default:default"/>
<setEntry value="javax.xml.soap@default:default"/>
<setEntry value="javax.xml.stream@default:default"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import jakarta.servlet.AsyncContext;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletConnection;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletInputStream;
Expand Down Expand Up @@ -516,16 +517,6 @@ public boolean isRequestedSessionIdFromURL() {
return false;
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.http.HttpServletRequest#isRequestedSessionIdFromUrl
*/
@Override
public boolean isRequestedSessionIdFromUrl() {
return isRequestedSessionIdFromURL();
}

/*
* (non-Javadoc)
*
Expand Down Expand Up @@ -624,22 +615,6 @@ public BufferedReader getReader() throws IOException {
throw new UnsupportedOperationException("Do not support getReader operation!"); //$NON-NLS-1$
}

/**
* (non-Javadoc)
*
* @see jakarta.servlet.http.HttpServletRequest#getRealPath( java.lang.String )
* @deprecated
*/
@Deprecated
@Override
public String getRealPath(String path) {
if (path == null) {
return null;
}

return this.context.getRealPath(path);
}

/*
* (non-Javadoc)
*
Expand Down Expand Up @@ -1118,4 +1093,22 @@ public <T extends HttpUpgradeHandler> T upgrade(Class<T> arg0) throws IOExceptio
// TODO Auto-generated method stub
return null;
}

@Override
public String getRequestId() {
// TODO Auto-generated method stub
return null;
}

@Override
public String getProtocolRequestId() {
// TODO Auto-generated method stub
return null;
}

@Override
public ServletConnection getServletConnection() {
// TODO Auto-generated method stub
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletResponse;

import junit.framework.AssertionFailedError;

/**
Expand Down Expand Up @@ -202,17 +201,6 @@ public String encodeRedirectURL(String url) {
return url;
}

/*
* (non-Javadoc)
*
* @see
* jakarta.servlet.http.HttpServletResponse#encodeRedirectUrl(java.lang.String)
*/
@Override
public String encodeRedirectUrl(String url) {
return encodeRedirectURL(url);
}

/*
* (non-Javadoc)
*
Expand All @@ -223,24 +211,14 @@ public String encodeURL(String url) {
return url;
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.http.HttpServletResponse#encodeUrl(java.lang.String)
*/
@Override
public String encodeUrl(String url) {
return encodeURL(url);
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.http.HttpServletResponse#sendError(int)
*/
@Override
public void sendError(int status) throws IOException {
setStatus(status);
this.status = status;
throw new AssertionFailedError(" Response error :" + status); //$NON-NLS-1$
}

Expand All @@ -251,7 +229,8 @@ public void sendError(int status) throws IOException {
*/
@Override
public void sendError(int status, String message) throws IOException {
setStatus(status, message);
this.status = status;
this.message = message;
throw new AssertionFailedError(" Response error :" + status + " " //$NON-NLS-1$//$NON-NLS-2$
+ message);
}
Expand Down Expand Up @@ -327,18 +306,7 @@ public void removeHeader(String name) {
*/
@Override
public void setStatus(int status) {
setStatus(status, null);
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.http.HttpServletResponse#setStatus(int, java.lang.String)
*/
@Override
public void setStatus(int status, String message) {
this.status = status;
this.message = message;
}

/*
Expand Down Expand Up @@ -592,4 +560,9 @@ public void setContentLengthLong(long arg0) {

}

@Override
public void sendRedirect(String location, int sc, boolean clearBuffer) throws IOException {
// TODO Auto-generated method stub
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
import java.util.Enumeration;
import java.util.Hashtable;

import org.eclipse.birt.report.viewer.util.RandomUtil;

import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpSession;
import jakarta.servlet.http.HttpSessionContext;

import org.eclipse.birt.report.viewer.util.RandomUtil;

/**
* Mock a HttpSession class for Viewer UnitTest
Expand Down Expand Up @@ -87,51 +86,6 @@ public void removeAttribute(String name) {
this.attributes.remove(name);
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.http.HttpSession#getValue(java.lang.String)
*/
@Override
public Object getValue(String name) {
verify();
return this.getAttribute(name);
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.http.HttpSession#getValueNames()
*/
@Override
public String[] getValueNames() {
verify();
return (String[]) this.attributes.keySet().toArray();
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.http.HttpSession#putValue(java.lang.String,
* java.lang.Object)
*/
@Override
public void putValue(String name, Object value) {
verify();
this.setAttribute(name, value);
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.http.HttpSession#removeValue(java.lang.String)
*/
@Override
public void removeValue(String name) {
verify();
this.removeAttribute(name);
}

/*
* (non-Javadoc)
*
Expand Down Expand Up @@ -187,17 +141,6 @@ public ServletContext getServletContext() {
return this.context;
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.http.HttpSession#getSessionContext()
*/
@Override
public HttpSessionContext getSessionContext() {
verify();
throw new UnsupportedOperationException("Do not support getSessionContext operation!"); //$NON-NLS-1$
}

/*
* (non-Javadoc)
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,6 @@ public String getServerInfo() {
return "BirtMockServletEngine"; //$NON-NLS-1$
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.ServletContext#getServlet(java.lang.String)
*/
@Override
public Servlet getServlet(String name) throws ServletException {
throw new UnsupportedOperationException("Do not support getServlet operation!"); //$NON-NLS-1$
}

/*
* (non-Javadoc)
*
Expand All @@ -281,26 +271,6 @@ public String getServletContextName() {
throw new UnsupportedOperationException("Do not support getServletContextName operation!"); //$NON-NLS-1$
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.ServletContext#getServletNames()
*/
@Override
public Enumeration getServletNames() {
throw new UnsupportedOperationException("Do not support getServletNames operation!"); //$NON-NLS-1$
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.ServletContext#getServlets()
*/
@Override
public Enumeration getServlets() {
throw new UnsupportedOperationException("Do not support getServlets operation!"); //$NON-NLS-1$
}

/*
* (non-Javadoc)
*
Expand All @@ -311,16 +281,6 @@ public void log(String content) {
System.out.println(content);
}

/*
* (non-Javadoc)
*
* @see jakarta.servlet.ServletContext#log(java.lang.Exception, java.lang.String)
*/
@Override
public void log(Exception exception, String content) {
System.out.println(content + "--" + exception.getMessage()); //$NON-NLS-1$
}

/*
* (non-Javadoc)
*
Expand Down
Loading

0 comments on commit 3b9ee9a

Please sign in to comment.