commit cc4c74809f14d12e3a56e54f859d03c2f669fb11 Author: gil puntogil@libero.it Date: Wed Jun 6 17:55:04 2012 +0200
fix javax.servlet 3.0 api support
apache-commons-chain-1.2-tests-servel30.patch | 314 +++++++++++++++++++++++++ apache-commons-chain.spec | 6 +- 2 files changed, 316 insertions(+), 4 deletions(-) --- diff --git a/apache-commons-chain-1.2-tests-servel30.patch b/apache-commons-chain-1.2-tests-servel30.patch new file mode 100644 index 0000000..5e26f02 --- /dev/null +++ b/apache-commons-chain-1.2-tests-servel30.patch @@ -0,0 +1,314 @@ +diff -Nru commons-chain-1.2-src/src/test/org/apache/commons/chain/web/servlet/MockHttpServletRequest.java commons-chain-1.2-src-gil/src/test/org/apache/commons/chain/web/servlet/MockHttpServletRequest.java +--- commons-chain-1.2-src/src/test/org/apache/commons/chain/web/servlet/MockHttpServletRequest.java 2008-05-29 18:43:14.000000000 +0200 ++++ commons-chain-1.2-src-gil/src/test/org/apache/commons/chain/web/servlet/MockHttpServletRequest.java 2012-06-06 15:59:20.385406244 +0200 +@@ -20,12 +20,22 @@ + import org.apache.commons.chain.web.MockEnumeration; + import org.apache.commons.chain.web.MockPrincipal; + ++import javax.servlet.AsyncContext; ++import javax.servlet.DispatcherType; + import javax.servlet.RequestDispatcher; ++import javax.servlet.ServletContext; ++import javax.servlet.ServletException; + import javax.servlet.ServletInputStream; ++import javax.servlet.ServletRequest; ++import javax.servlet.ServletResponse; + import javax.servlet.http.Cookie; + import javax.servlet.http.HttpServletRequest; ++import javax.servlet.http.HttpServletResponse; + import javax.servlet.http.HttpSession; ++import javax.servlet.http.Part; + import java.io.BufferedReader; ++import java.io.IOException; ++import java.lang.IllegalStateException; + import java.security.Principal; + import java.util.*; + +@@ -466,5 +476,64 @@ + throw new UnsupportedOperationException(); + } + ++ public Part getPart(String name) throws IOException, IllegalStateException, ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Collection<Part> getParts() throws IOException, IllegalStateException, ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public void logout() throws ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public void login(String username, String password) throws ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public boolean authenticate(HttpServletResponse response) throws IOException, ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public DispatcherType getDispatcherType() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public AsyncContext getAsyncContext() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public boolean isAsyncSupported() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public boolean isAsyncStarted() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public AsyncContext startAsync() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public ServletContext getServletContext() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } + + } +diff -Nru commons-chain-1.2-src/src/test/org/apache/commons/chain/web/servlet/MockHttpServletResponse.java commons-chain-1.2-src-gil/src/test/org/apache/commons/chain/web/servlet/MockHttpServletResponse.java +--- commons-chain-1.2-src/src/test/org/apache/commons/chain/web/servlet/MockHttpServletResponse.java 2008-05-29 18:43:14.000000000 +0200 ++++ commons-chain-1.2-src-gil/src/test/org/apache/commons/chain/web/servlet/MockHttpServletResponse.java 2012-06-06 15:17:50.916284494 +0200 +@@ -17,11 +17,13 @@ + package org.apache.commons.chain.web.servlet; + + ++import javax.servlet.ServletException; + import javax.servlet.ServletOutputStream; + import javax.servlet.http.Cookie; + import javax.servlet.http.HttpServletResponse; + import java.io.IOException; + import java.io.PrintWriter; ++import java.util.Collection; + import java.util.Locale; + + +@@ -205,5 +207,28 @@ + this.locale = locale; + } + ++ public Collection<String> getHeaderNames() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public String getHeader(String name) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Collection<String> getHeaders(String name) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public void logout() throws ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } + ++ public int getStatus() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } + } +diff -Nru commons-chain-1.2-src/src/test/org/apache/commons/chain/web/servlet/MockServletContext.java commons-chain-1.2-src-gil/src/test/org/apache/commons/chain/web/servlet/MockServletContext.java +--- commons-chain-1.2-src/src/test/org/apache/commons/chain/web/servlet/MockServletContext.java 2008-05-29 18:43:13.000000000 +0200 ++++ commons-chain-1.2-src-gil/src/test/org/apache/commons/chain/web/servlet/MockServletContext.java 2012-06-06 17:49:20.960935501 +0200 +@@ -17,19 +17,33 @@ + package org.apache.commons.chain.web.servlet; + + ++import javax.servlet.Filter; ++import javax.servlet.FilterRegistration; ++import javax.servlet.FilterRegistration.Dynamic; + import javax.servlet.RequestDispatcher; + import javax.servlet.Servlet; + import javax.servlet.ServletContext; + import javax.servlet.ServletException; ++import javax.servlet.SessionCookieConfig; ++import javax.servlet.ServletRegistration; ++import javax.servlet.SessionTrackingMode; ++import javax.servlet.descriptor.JspConfigDescriptor; + + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + + import java.io.InputStream; ++import java.lang.Class; ++import java.lang.ClassLoader; ++import java.lang.IllegalArgumentException; ++import java.lang.IllegalStateException; ++import java.lang.UnsupportedOperationException; + import java.net.MalformedURLException; + import java.net.URL; + import java.util.Enumeration; ++import java.util.EventListener; + import java.util.Hashtable; ++import java.util.Map; + import java.util.Set; + + +@@ -149,5 +163,139 @@ + attributes.put(name, value); + } + ++ public String getContextPath() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public JspConfigDescriptor getJspConfigDescriptor() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public ClassLoader getClassLoader() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public void declareRoles(String... roleNames) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public <T extends EventListener> T createListener(Class<T> c) throws ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public <T extends EventListener> void addListener(T t) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public void addListener(String className) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public void addListener(Class<? extends EventListener> listenerClass) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Set<SessionTrackingMode> getEffectiveSessionTrackingModes() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Set<SessionTrackingMode> getDefaultSessionTrackingModes() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes) throws IllegalStateException, IllegalArgumentException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public SessionCookieConfig getSessionCookieConfig() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Map<String,? extends FilterRegistration> getFilterRegistrations() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public FilterRegistration getFilterRegistration(String filterName) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public <T extends Filter> T createFilter(Class<T> c) throws ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public FilterRegistration.Dynamic addFilter(String filterName, Class<? extends Filter> filterClass) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public FilterRegistration.Dynamic addFilter(String filterName, Filter filter) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public FilterRegistration.Dynamic addFilter(String filterName, String className) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Map<String,? extends ServletRegistration> getServletRegistrations() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public ServletRegistration getServletRegistration(String servletName) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public <T extends Servlet> T createServlet(Class<T> c) throws ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public ServletRegistration.Dynamic addServlet(String servletName, Class<? extends Servlet> servletClass) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public ServletRegistration.Dynamic addServlet(String servletName, String className) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public boolean setInitParameter(String name, String value) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public int getEffectiveMinorVersion() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public int getEffectiveMajorVersion() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } + + } diff --git a/apache-commons-chain.spec b/apache-commons-chain.spec index 2d18309..0e36273 100644 --- a/apache-commons-chain.spec +++ b/apache-commons-chain.spec @@ -11,7 +11,7 @@ Source0: ftp://ftp.gbnet.net/pub/apache/dist/commons/%{base_name}/source/% # replace myfaces-api with jboss-jsf-2.1-api Patch0: %{name}-%{version}-pom.patch # javax.servlet 3.0 api support -Patch1: %{name}-%{version}-servlet30.patch +Patch1: %{name}-%{version}-tests-servlet30.patch # javax.portlet 2.0 api support Patch2: %{name}-%{version}-portlet20.patch
@@ -83,10 +83,8 @@ find . -name '*.jar' -delete
perl -pi -e 's/\r$//g;' *.txt %patch0 -p0 -%patch1 -p0 +%patch1 -p1 %patch2 -p0 -# Failed tests: testDefaut(org.apache.commons.chain.config.ConfigParserTestCase): Correct command count expected:<17> but was:<19> -rm -r src/test/org/apache/commons/chain/config/ConfigParserTestCase.java
%build
java-sig-commits@lists.fedoraproject.org