Rat (Release Audit Tool) results

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

*****************************************************
Summary
-------
Generated at: 2017-09-06T08:03:35+02:00
Notes: 0
Binaries: 0
Archives: 0
Standards: 30

Apache Licensed: 25
Generated Documents: 0

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

5 Unknown Licenses

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

Unapproved licenses:

  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/pom.xml
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/StrutsOsgiListener.java
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/resources/beanRefContext.xml
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/resources/struts-plugin.xml
  /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/test/java/org/apache/struts2/osgi/interceptor/OsgiInterceptorTest.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
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/pom.xml
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/BundleAccessor.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/BundleClassLoaderInterface.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/BundleFreemarkerManager.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/BundlePackageLoader.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/DefaultBundleAccessor.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/DelegatingObjectFactory.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/host/BaseOsgiHost.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/host/FelixOsgiHost.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/host/GlassfishOSGiHost.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/host/OsgiHost.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/interceptor/BundleContextAware.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/interceptor/OsgiInterceptor.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/interceptor/ServiceAware.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/loaders/FreeMarkerBundleResourceLoader.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/loaders/StaticContentBundleResourceLoader.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/loaders/VelocityBundleResourceLoader.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiConfigurationProvider.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiHostFactory.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiUtil.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/PackageLoader.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/SpringOsgiObjectFactory.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/StrutsOsgiListener.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/resources/beanRefContext.xml
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/resources/struts-osgi.properties
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/resources/struts-plugin.xml
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/site/site.xml
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/test/java/org/apache/struts2/osgi/host/FelixOsgiHostTest.java
 !????? /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/test/java/org/apache/struts2/osgi/interceptor/OsgiInterceptorTest.java
  AL    /Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/test/java/org/apache/struts2/osgi/interceptor/SomeAction.java
 
*****************************************************
 Printing headers for files without AL header...
 
 
=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/pom.xml
=======================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-plugins</artifactId>
        <version>2.5.13</version>
    </parent>

    <artifactId>struts2-osgi-plugin</artifactId>
    <packaging>jar</packaging>
    <name>Struts 2 OSGi Plugin</name>

    <dependencies>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.main</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.shell</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.shell.tui</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-tools</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
        </dependency>

        <dependency>
            <groupId>org.easymock</groupId>

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/java/org/apache/struts2/osgi/StrutsOsgiListener.java
=======================================================================
package org.apache.struts2.osgi;

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.struts2.StrutsException;
import org.apache.struts2.osgi.host.OsgiHost;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * ServletContextListener that starts Osgi host
 */
public class StrutsOsgiListener implements ServletContextListener {

    public static final String OSGI_HOST = "__struts_osgi_host";
    public static final String PLATFORM_KEY = "struts.osgi.host";

    private static final Logger LOG = LogManager.getLogger(StrutsOsgiListener.class);

    private OsgiHost osgiHost;

    public void contextInitialized(ServletContextEvent sce) {
        ServletContext servletContext = sce.getServletContext();

        String platform = servletContext.getInitParameter(PLATFORM_KEY);
        LOG.debug("Defined OSGi platform as [{}] via context-param [{}]", platform, PLATFORM_KEY);

        osgiHost = OsgiHostFactory.createOsgiHost(platform);
        servletContext.setAttribute(OSGI_HOST, osgiHost);
        try {
            osgiHost.init(servletContext);
        } catch (Exception e) {
            throw new StrutsException("Cannot init OSGi platform!", e);
        }
    }

    public void contextDestroyed(ServletContextEvent sce) {
        try {
            osgiHost.destroy();
        } catch (Exception e) {
            throw new StrutsException("Cannot stop OSGi platform!", e);
        }
    }

}

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/resources/beanRefContext.xml
=======================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="parent-context-bean" class="org.springframework.context.support.ClassPathXmlApplicationContext">
        <constructor-arg>
            <list>
                <value>classpath*:/spring/*.xml</value>
            </list>
        </constructor-arg>
    </bean>
</beans>

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/main/resources/struts-plugin.xml
=======================================================================
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
	"http://struts.apache.org/dtds/struts-2.5.dtd">
    
<struts order="10">
    <constant name="struts.objectFactory" value="osgi" />
    <constant name="struts.objectFactory.delegate" value="struts" />
    <constant name="struts.freemarker.manager.classname" value="org.apache.struts2.osgi.BundleFreemarkerManager" />
    <constant name="struts.staticContentLoader" value="org.apache.struts2.osgi.loaders.StaticContentBundleResourceLoader" />

    <constant name="struts.convention.action.includeJars" value="jar:file:.*?/bundles/.*?\.jar(!/)?" />

    <bean type="org.apache.struts2.osgi.BundleAccessor" class="org.apache.struts2.osgi.DefaultBundleAccessor" />
    <bean type="org.apache.struts2.osgi.PackageLoader" class="org.apache.struts2.osgi.BundlePackageLoader" />
    
    <bean name="osgi" type="com.opensymphony.xwork2.ObjectFactory" class="org.apache.struts2.osgi.DelegatingObjectFactory" />
    <bean name="springOsgi" type="com.opensymphony.xwork2.ObjectFactory" class="org.apache.struts2.osgi.SpringOsgiObjectFactory" />
    <bean name="osgi" type="com.opensymphony.xwork2.config.PackageProvider" class="org.apache.struts2.osgi.OsgiConfigurationProvider" />
    <bean name="osgi" type="com.opensymphony.xwork2.util.finder.ClassLoaderInterface" class="org.apache.struts2.osgi.BundleClassLoaderInterface" />

    <package name="osgi-default" extends="struts-default" abstract="yes">
        <interceptors>
            <interceptor name="osgi" class="org.apache.struts2.osgi.interceptor.OsgiInterceptor" />

            <interceptor-stack name="osgiStack">
                <interceptor-ref name="defaultStack"/>
                <interceptor-ref name="osgi"/>
            </interceptor-stack>
        </interceptors>

         <default-interceptor-ref name="osgiStack"/>
    </package>
</struts>

=======================================================================
==/Users/lukaszlenart/Projects/Apache/struts/target/checkout/plugins/osgi/src/test/java/org/apache/struts2/osgi/interceptor/OsgiInterceptorTest.java
=======================================================================
package org.apache.struts2.osgi.interceptor;

import org.easymock.EasyMock;
import org.apache.struts2.osgi.host.OsgiHost;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;

import javax.servlet.ServletContext;

import com.opensymphony.xwork2.ActionInvocation;
import junit.framework.TestCase;

import java.util.List;

public class OsgiInterceptorTest extends TestCase {
    public void testBundleContextAware() throws Exception {
        ServletContext servletContext = EasyMock.createStrictMock(ServletContext.class);
        BundleContext bundleContext = EasyMock.createStrictMock(BundleContext.class);
        ActionInvocation actionInvocation = EasyMock.createStrictMock(ActionInvocation.class);
        BundleContextAware bundleContextAware = EasyMock.createStrictMock(BundleContextAware.class);

        EasyMock.expect(servletContext.getAttribute(OsgiHost.OSGI_BUNDLE_CONTEXT)).andReturn(bundleContext);
        EasyMock.expect(actionInvocation.getAction()).andReturn(bundleContextAware);
        bundleContextAware.setBundleContext(bundleContext);
        EasyMock.expect(actionInvocation.invoke()).andReturn("");

        EasyMock.replay(bundleContextAware);
        EasyMock.replay(servletContext);
        EasyMock.replay(actionInvocation);

        OsgiInterceptor osgiInterceptor = new OsgiInterceptor();
        osgiInterceptor.setServletContext(servletContext);
        osgiInterceptor.intercept(actionInvocation);

        EasyMock.verify(bundleContextAware);
    }

     public void testBundleContextAwareNegative() throws Exception {
        ServletContext servletContext = EasyMock.createStrictMock(ServletContext.class);
        ActionInvocation actionInvocation = EasyMock.createStrictMock(ActionInvocation.class);
        BundleContextAware bundleContextAware = EasyMock.createStrictMock(BundleContextAware.class);

        EasyMock.expect(servletContext.getAttribute(OsgiHost.OSGI_BUNDLE_CONTEXT)).andReturn(null);
        EasyMock.expect(actionInvocation.invoke()).andReturn("");

        EasyMock.replay(bundleContextAware);
        EasyMock.replay(servletContext);
        EasyMock.replay(actionInvocation);

        OsgiInterceptor osgiInterceptor = new OsgiInterceptor();