Rat (Release Audit Tool) results

The following document contains the results of Rat (Release Audit Tool).

*****************************************************
Summary
-------
Generated at: 2017-09-06T07:57:37+02:00
Notes: 1
Binaries: 0
Archives: 0
Standards: 33

Apache Licensed: 31
Generated Documents: 0

JavaDocs are generated and so license header is optional
Generated files do not required license headers

2 Unknown Licenses

*******************************

Unapproved licenses:

  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultContentTypeHandlerManagerTest.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionInvocationTest.java

*******************************

Archives:

*****************************************************
  Files with Apache License headers will be marked AL
  Binary files (which do not require AL headers) will be marked B
  Compressed archives will be marked A
  Notices, licenses etc will be marked N
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/pom.xml
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultHttpHeaders.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/AbstractContentTypeHandler.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/AllowedClasses.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/AllowedClassNames.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/FormUrlEncodedHandler.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/HtmlHandler.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JacksonLibHandler.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JsonLibHandler.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/MultipartFormDataHandler.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamPermissionProvider.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/HttpHeaders.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionProxyFactory.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionSupport.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java
  N     /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/resources/NOTICE.txt
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/main/resources/struts-plugin.xml
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/site/site.xml
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/ContentTypeHandlerManagerTest.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultContentTypeHandlerManagerTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/handler/Contact.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/handler/JacksonLibHandlerTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/handler/JsonLibHandlerTest.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionInvocationTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/RestWorkflowInterceptorTest.java
 
*****************************************************
 Printing headers for files without AL header...
 
 
=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultContentTypeHandlerManagerTest.java
=======================================================================
package org.apache.struts2.rest;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.XWorkTestCase;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Scope;
import org.apache.struts2.rest.handler.AbstractContentTypeHandler;
import org.apache.struts2.rest.handler.ContentTypeHandler;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.util.HashSet;
import java.util.Set;

public class DefaultContentTypeHandlerManagerTest extends XWorkTestCase {

    public void testObtainingHandlerForRequestWithEncoding() throws Exception {
        // given
        DefaultContentTypeHandlerManager handlerManager = new DefaultContentTypeHandlerManager();
        handlerManager.setContainer(new DummyContainer("application/json;charset=UTF-8", null));

        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setContentType("application/json;charset=UTF-8");

        // when
        ContentTypeHandler handler = handlerManager.getHandlerForRequest(request);

        // then
        assertNotNull(handler);
        assertEquals("application/json;charset=UTF-8", handler.getContentType());
    }

    public void testObtainingHandlerForRequestWithoutEncoding() throws Exception {
        // given
        DefaultContentTypeHandlerManager handlerManager = new DefaultContentTypeHandlerManager();
        handlerManager.setContainer(new DummyContainer("application/json", null));

        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setContentType("application/json;charset=UTF-8");

        // when
        ContentTypeHandler handler = handlerManager.getHandlerForRequest(request);

        // then
        assertNotNull(handler);
        assertEquals("application/json", handler.getContentType());
    }

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionInvocationTest.java
=======================================================================
package org.apache.struts2.rest;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.DefaultUnknownHandlerManager;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.InterceptorMapping;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.mock.MockActionProxy;
import com.opensymphony.xwork2.mock.MockInterceptor;
import com.opensymphony.xwork2.ognl.OgnlUtil;
import com.opensymphony.xwork2.util.XWorkTestCaseHelper;
import junit.framework.TestCase;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.result.HttpHeaderResult;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED;

public class RestActionInvocationTest extends TestCase {

	RestActionInvocation restActionInvocation;
	MockHttpServletRequest request;
	MockHttpServletResponse response;

	@Override
	protected void setUp() throws Exception {
		super.setUp();
		
		restActionInvocation = new RestActionInvocationTester();
		request = new MockHttpServletRequest();
		response = new MockHttpServletResponse();
		ServletActionContext.setRequest(request);
		ServletActionContext.setResponse(response);

	}
	
	/**
	 * Test the correct action results: null, String, HttpHeaders, Result
	 * @throws Exception
	 */