diff --git a/apache-commons-chain-1.2-portlet20.patch b/apache-commons-chain-1.2-portlet20.patch new file mode 100644 index 0000000..4456e92 --- /dev/null +++ b/apache-commons-chain-1.2-portlet20.patch @@ -0,0 +1,66 @@ +diff -Nru src/test/org/apache/commons/chain/web/portlet/MockPortletContext.java src/test/org/apache/commons/chain/web/portlet-gil/MockPortletContext.java +--- src/test/org/apache/commons/chain/web/portlet/MockPortletContext.java 2008-05-29 18:43:14.000000000 +0200 ++++ src/test/org/apache/commons/chain/web/portlet-gil/MockPortletContext.java 2012-05-26 17:40:42.000000000 +0200 +@@ -135,4 +135,9 @@ + attributes.put(name, value); + } + ++ public Enumeration getContainerRuntimeOptions() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ + } +diff -Nru src/test/org/apache/commons/chain/web/portlet/MockPortletRequest.java src/test/org/apache/commons/chain/web/portlet-gil/MockPortletRequest.java +--- src/test/org/apache/commons/chain/web/portlet/MockPortletRequest.java 2008-05-29 18:43:14.000000000 +0200 ++++ src/test/org/apache/commons/chain/web/portlet-gil/MockPortletRequest.java 2012-05-26 18:10:29.000000000 +0200 +@@ -27,6 +27,7 @@ + import javax.portlet.PortletMode; + import javax.portlet.PortletPreferences; + import javax.portlet.WindowState; ++import javax.servlet.http.Cookie; + import java.security.Principal; + import java.util.Map; + import java.util.HashMap; +@@ -312,4 +313,24 @@ + } + } + ++ public Map getPublicParameterMap() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Map getPrivateParameterMap() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Cookie[] getCookies() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public String getWindowID() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ + } +diff -Nru src/test/org/apache/commons/chain/web/portlet/MockPortletSession.java src/test/org/apache/commons/chain/web/portlet-gil/MockPortletSession.java +--- src/test/org/apache/commons/chain/web/portlet/MockPortletSession.java 2008-05-29 18:43:14.000000000 +0200 ++++ src/test/org/apache/commons/chain/web/portlet-gil/MockPortletSession.java 2012-05-26 17:44:41.000000000 +0200 +@@ -172,4 +172,13 @@ + } + } + ++ public Map getAttributeMap(int scope) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Map getAttributeMap() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } + } diff --git a/apache-commons-chain-1.2-tests-servlet31.patch b/apache-commons-chain-1.2-tests-servlet31.patch new file mode 100644 index 0000000..7cdfc75 --- /dev/null +++ b/apache-commons-chain-1.2-tests-servlet31.patch @@ -0,0 +1,336 @@ +diff -Nru commons-chain-1.2-src/src/test/org/apache/commons/chain/web/servlet/MockHttpServletRequest.java commons-chain-1.2-src.servlet/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.servlet/src/test/org/apache/commons/chain/web/servlet/MockHttpServletRequest.java 2015-06-17 03:36:16.057356781 +0200 +@@ -20,12 +20,23 @@ + 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 javax.servlet.http.HttpUpgradeHandler; + import java.io.BufferedReader; ++import java.io.IOException; ++import java.lang.IllegalStateException; + import java.security.Principal; + import java.util.*; + +@@ -466,5 +477,76 @@ + throw new UnsupportedOperationException(); + } + ++ public Part getPart(String name) throws IOException, IllegalStateException, ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Collection 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."); ++ } ++ ++ public T upgrade(Class arg0) throws IOException, ServletException { ++ throw new RuntimeException("Not implemented"); ++ } ++ ++ public String changeSessionId() { ++ throw new RuntimeException("Not implemented"); ++ } ++ ++ public long getContentLengthLong() { ++ throw new RuntimeException("Not implemented"); ++ } + + } +diff -Nru commons-chain-1.2-src/src/test/org/apache/commons/chain/web/servlet/MockHttpServletResponse.java commons-chain-1.2-src.servlet/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.servlet/src/test/org/apache/commons/chain/web/servlet/MockHttpServletResponse.java 2015-06-17 03:17:13.646842003 +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,33 @@ + this.locale = locale; + } + ++ public Collection getHeaderNames() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public String getHeader(String name) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Collection 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."); ++ } ++ ++ public void setContentLengthLong(long arg0) { ++ throw new RuntimeException("Not implemented"); ++ } + + } +diff -Nru commons-chain-1.2-src/src/test/org/apache/commons/chain/web/servlet/MockServletContext.java commons-chain-1.2-src.servlet/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.servlet/src/test/org/apache/commons/chain/web/servlet/MockServletContext.java 2015-06-17 03:16:59.146531770 +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,143 @@ + 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 createListener(Class c) throws ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public 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 listenerClass) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Set getEffectiveSessionTrackingModes() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Set getDefaultSessionTrackingModes() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public void setSessionTrackingModes(Set sessionTrackingModes) throws IllegalStateException, IllegalArgumentException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public SessionCookieConfig getSessionCookieConfig() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public Map getFilterRegistrations() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public FilterRegistration getFilterRegistration(String filterName) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public T createFilter(Class c) throws ServletException { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public FilterRegistration.Dynamic addFilter(String filterName, Class 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 getServletRegistrations() { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public ServletRegistration getServletRegistration(String servletName) { ++ // TODO ++ throw new UnsupportedOperationException("Not supported."); ++ } ++ ++ public T createServlet(Class 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 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."); ++ } ++ ++ public String getVirtualServerName() { ++ throw new RuntimeException("Not implemented"); ++ } + + } diff --git a/apache-commons-chain.spec b/apache-commons-chain.spec new file mode 100644 index 0000000..359561d --- /dev/null +++ b/apache-commons-chain.spec @@ -0,0 +1,71 @@ +%global base_name chain +%global short_name commons-%{base_name} +Name: apache-commons-chain +Version: 1.2 +Release: 1 +Summary: An implementation of the GoF Chain of Responsibility pattern +License: ASL 2.0 +URL: http://commons.apache.org/chain/ +Source0: https://archive.apache.org/dist/commons/chain/source/commons-chain-%{version}-src.tar.gz +Patch0: %{name}-%{version}-tests-servlet31.patch +Patch1: %{name}-%{version}-portlet20.patch +BuildRequires: maven-local mvn(commons-beanutils:commons-beanutils) +BuildRequires: mvn(commons-digester:commons-digester) mvn(commons-logging:commons-logging) +BuildRequires: mvn(javax.portlet:portlet-api) mvn(javax.servlet:javax.servlet-api) +BuildRequires: mvn(junit:junit) mvn(org.apache.commons:commons-parent:pom:) +BuildRequires: mvn(org.jboss.spec.javax.faces:jboss-jsf-api_2.1_spec) +BuildArch: noarch +%description +A popular technique for organizing the execution of complex +processing flows is the "Chain of Responsibility" pattern, as +described (among many other places) in the classic "Gang of Four" +design patterns book. Although the fundamental API contracts +required to implement this design pattern are extremely simple, +it is useful to have a base API that facilitates using the pattern, +and (more importantly) encouraging composition of command +implementations from multiple diverse sources. +Towards that end, the Chain API models a computation as a series +of "commands" that can be combined into a "chain". The API for a +command consists of a single method (execute()), which is passed +a "context" parameter containing the dynamic state of the +computation, and whose return value is a boolean that determines +whether or not processing for the current chain has been completed +(true), or whether processing should be delegated to the next +command in the chain (false). + +%package javadoc +Summary: Javadoc for %{name} +%description javadoc +This package contains javadoc for %{name}. + +%prep +%setup -q -n %{short_name}-%{version}-src +find . -name '*.class' -delete +find . -name '*.jar' -delete +sed -i 's/\r$//g;' *.txt +%patch0 -p1 +%patch1 -p0 +rm -r src/test/org/apache/commons/chain/config/ConfigParserTestCase.java +%pom_remove_dep :myfaces-api +%pom_add_dep org.jboss.spec.javax.faces:jboss-jsf-api_2.1_spec +%pom_xpath_set "pom:dependency[pom:groupId = 'javax.servlet' ]/pom:artifactId" javax.servlet-api +%pom_xpath_set "pom:dependency[pom:groupId = 'javax.servlet' ]/pom:version" 3.1.0 +%mvn_file :%{short_name} %{name} +%mvn_file :%{short_name} %{short_name} + +%build +%mvn_build -- -Dmaven.compile.source=1.6 -Dmaven.compile.target=1.6 + +%install +%mvn_install + +%files -f .mfiles +%doc RELEASE-NOTES.txt +%license LICENSE.txt NOTICE.txt + +%files javadoc -f .mfiles-javadoc +%license LICENSE.txt NOTICE.txt + +%changelog +* Tue Aug 4 2020 yanan li - 1.2-1 +- Package init diff --git a/apache-commons-chain.yaml b/apache-commons-chain.yaml new file mode 100644 index 0000000..646aeae --- /dev/null +++ b/apache-commons-chain.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/apache/commons-chain.git +version_control: github +src_repo: commons-chain +tag_prefix: "CHAIN_" +seperator: "_" diff --git a/commons-chain-1.2-src.tar.gz b/commons-chain-1.2-src.tar.gz new file mode 100644 index 0000000..172c507 Binary files /dev/null and b/commons-chain-1.2-src.tar.gz differ