Merge branch 'master' of github.com:apache/tomee-tck
diff --git a/pom.xml b/pom.xml
index 61c8f21..78c654c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,7 @@
 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <version.maven-dependency-plugin>2.9</version.maven-dependency-plugin>
-    <version.activemq>5.15.8</version.activemq>
+    <version.activemq>5.15.12</version.activemq>
     <version.gmaven-plugin>1.5</version.gmaven-plugin>
   </properties>
 
@@ -98,6 +98,22 @@
 
     <dependency>
       <groupId>org.apache.activemq</groupId>
+      <artifactId>activemq-ra</artifactId>
+      <version>${version.activemq}</version>
+      <exclusions>
+        <exclusion>
+          <artifactId>slf4j-api</artifactId>
+          <groupId>org.slf4j</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.components</groupId>
+      <artifactId>geronimo-connector</artifactId>
+      <version>3.1.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
       <artifactId>activemq-client</artifactId>
       <version>${version.activemq}</version>
       <exclusions>
@@ -141,6 +157,20 @@
       <scope>system</scope>
       <systemPath>${javaee.cts.home}/lib/tsharness.jar</systemPath>
     </dependency>
+    <dependency>
+      <groupId>com.sun.javaee.tck</groupId>
+      <artifactId>tssv</artifactId>
+      <version>${javaee.tck.version}</version>
+      <scope>system</scope>
+      <systemPath>${javaee.cts.home}/lib/tssv.jar</systemPath>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.javaee.tck</groupId>
+      <artifactId>tsprovider</artifactId>
+      <version>${javaee.tck.version}</version>
+      <scope>system</scope>
+      <systemPath>${javaee.cts.home}/lib/tsprovider.jar</systemPath>
+    </dependency>
 
     <dependency>
       <groupId>com.sun.javaee.tck</groupId>
@@ -204,6 +234,12 @@
       <type>jar</type>
       <version>${tomee.version}</version>
     </dependency>
+    <dependency>
+      <groupId>${openejb.groupId}</groupId>
+      <artifactId>tomee-security</artifactId>
+      <type>jar</type>
+      <version>${tomee.version}</version>
+    </dependency>
 
     <dependency>
       <groupId>org.apache.geronimo.modules</groupId>
@@ -253,6 +289,16 @@
     </dependency>
     <dependency>
       <groupId>org.apache.tomcat</groupId>
+      <artifactId>tomcat-util-scan</artifactId>
+      <version>${tomcat.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.tomcat</groupId>
+      <artifactId>tomcat-catalina</artifactId>
+      <version>${tomcat.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.tomcat</groupId>
       <artifactId>tomcat-juli</artifactId>
       <version>${tomcat.version}</version>
     </dependency>
@@ -448,6 +494,20 @@
                   </artifactItems>
                 </configuration>
               </execution>
+              <execution>
+                <id>copy-activemq</id>
+                <phase>pre-integration-test</phase>
+                <goals>
+                  <goal>copy-dependencies</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>${openejb.home}/lib</outputDirectory>
+                  <overWriteReleases>false</overWriteReleases>
+                  <overWriteSnapshots>true</overWriteSnapshots>
+                  <excludeTransitive>false</excludeTransitive>
+                  <includeArtifactIds>hawtbuf,activemq-ra,activemq-broker,activemq-kahadb-store,geronimo-connector</includeArtifactIds>
+                </configuration>
+              </execution>
             </executions>
           </plugin>
         </plugins>
@@ -867,7 +927,7 @@
               <overWriteReleases>false</overWriteReleases>
               <overWriteSnapshots>true</overWriteSnapshots>
               <excludeTransitive>true</excludeTransitive>
-              <includeArtifactIds>hawtbuf,tomcat-websocket,tomcat-util,tomcat-juli,tomcat-api,openejb-lite,activemq-client,activemq-client,tsharness,cts,whitebox,dbprocedures,geronimo-mail,openejb-derbynet,derby,derbynet,derbyclient,webdeployer</includeArtifactIds>
+              <includeArtifactIds>hawtbuf,tomcat-websocket,tomcat-util,tomcat-util-scan,tomcat-juli,tomcat-catalina,tomee-security,tomcat-api,openejb-lite,activemq-client,tsharness,tssv,cts,whitebox,dbprocedures,geronimo-mail,openejb-derbynet,derby,derbynet,derbyclient,webdeployer</includeArtifactIds>
             </configuration>
           </execution>
           <execution>
@@ -881,7 +941,7 @@
               <overWriteReleases>false</overWriteReleases>
               <overWriteSnapshots>true</overWriteSnapshots>
               <excludeTransitive>true</excludeTransitive>
-              <includeArtifactIds>activemq-client,activemq-client,tsharness,cts,whitebox,dbprocedures,geronimo-mail,openejb-derbynet,derby,derbynet,derbyclient,webdeployer</includeArtifactIds>
+              <includeArtifactIds>activemq-client,tsharness,tssv,cts,whitebox,dbprocedures,geronimo-mail,openejb-derbynet,derby,derbynet,derbyclient,webdeployer</includeArtifactIds>
             </configuration>
           </execution>
         </executions>
diff --git a/src/test/resources/testsuite.properties b/src/test/resources/testsuite.properties
index 8d8aa17..27fab25 100644
--- a/src/test/resources/testsuite.properties
+++ b/src/test/resources/testsuite.properties
@@ -24,6 +24,7 @@
         ${ts.home}/lib/saxpath.jar${pathsep}\
         ${ts.home}/lib/xercesImpl-2.11.0.jar${pathsep}\
         ${ts.home}/lib/xalan-2.7.2.jar${pathsep}\
+        ${ts.home}/lib/tssv.jar${pathsep}\
         ${ts.home}/lib/xml-apis-1.4.01.jar \
         DISPLAY=${ts.display} \
         HOME="${user.home}" \
@@ -40,6 +41,7 @@
         -Djavax.net.ssl.trustStorePassword=changeit \
         -Djava.endorsed.dirs=${s1as.java.endorsed.dirs} \
         -Dcom.sun.aas.installRoot=${javaee.home} \
+        -Dcatalina.base=${openejb.home} \
         -Dlog.file.location=${log.file.location} \
         -Dservlet.is.jsr115.compatible=${servlet.is.jsr115.compatible} \
         -Dprovider.configuration.file=${provider.configuration.file} \
@@ -158,7 +160,7 @@
 keystores.dir=%basedir%/src/test/keystores
 harness.temp.directory=%basedir%/target/harnesstmp/
 
-log.file.location=${openejb.home}/logs
+log.file.location=%basedir%/${openejb.home}/logs
 
 mailuser1=foo@foo.com
 mailHost=localhost
@@ -227,3 +229,12 @@
 imap.port = 3143
 smtp.port = 3025
 javamail.mailbox = INBOX
+
+# Jaspic
+# vendor.authconfig.factory=com.sun.ts.tests.jaspic.tssv.config.TSAuthConfigFactory
+vendor.authconfig.factory=org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl
+provider.configuration.file=%basedir%/%openejb.home%/conf/ProviderConfiguration.xml
+j2eelogin.name=j2ee
+j2eelogin.password=j2ee
+servlet.is.jsr115.compatible=false
+logical.hostname.servlet=Catalina/localhost
\ No newline at end of file
diff --git a/src/test/script/openejb/tck/commands/CommandSupport.groovy b/src/test/script/openejb/tck/commands/CommandSupport.groovy
index b0c5858..d503cc4 100644
--- a/src/test/script/openejb/tck/commands/CommandSupport.groovy
+++ b/src/test/script/openejb/tck/commands/CommandSupport.groovy
@@ -244,6 +244,9 @@
         // for jonzon
         builder.appendAll("johnzon-*.jar")
 
+        // tomcat for jaspic auth provider and factory
+        builder.appendAll("tomcat-*.jar")
+
         builder.getPath("ts.run.classpath")
         // ts.harness.classpath
         builder = new PathBuilder(this)
diff --git a/src/test/tomee-plume/conf/ProviderConfiguration.xml b/src/test/tomee-plume/conf/ProviderConfiguration.xml
new file mode 100644
index 0000000..a3c6e1b
--- /dev/null
+++ b/src/test/tomee-plume/conf/ProviderConfiguration.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Public License v. 2.0, which is available at
+    http://www.eclipse.org/legal/epl-2.0.
+
+    This Source Code may also be made available under the following Secondary
+    Licenses when the conditions for such availability set forth in the
+    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+    version 2 with the GNU Classpath Exception, which is available at
+    https://www.gnu.org/software/classpath/license.html.
+
+    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+-->
+
+<provider-config
+     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xmlns="http://java.oracle.com/xml/ns/jaspic"
+     xsi:schemaLocation="http://java.oracle.com/xml/ns/jaspic provider-configuration.xsd">
+   <provider-config-entry>
+        <provider-class>com.sun.ts.tests.jaspic.tssv.config.TSAuthConfigProvider</provider-class>
+        <properties version="1.0">
+            <entry key="AuthStatus_SEND_SUCCESS">false</entry>
+            <entry key="requestPolicy">USER_NAME_PASSWORD</entry>
+        </properties>
+        <message-layer>SOAP</message-layer>
+        <app-context-id>null</app-context-id>
+        <reg-description>TestSuite JSR 196 Config Provider</reg-description>
+    </provider-config-entry>
+   <provider-config-entry>
+        <provider-class>com.sun.ts.tests.jaspic.tssv.config.TSAuthConfigProvider</provider-class>
+        <properties version="1.0">
+            <entry key="AuthStatus_SEND_SUCCESS">false</entry>
+            <entry key="requestPolicy">USER_NAME_PASSWORD</entry>
+        </properties>
+        <message-layer>SOAP</message-layer>
+        <app-context-id>localhost /Hello_web/Hello</app-context-id>
+        <reg-description>TestSuite JSR 196 Config Provider</reg-description>
+    </provider-config-entry>
+    <provider-config-entry>
+        <provider-class>com.sun.ts.tests.jaspic.tssv.config.TSAuthConfigProviderServlet</provider-class>
+        <properties version="1.0">
+            <entry key="AuthStatus_SEND_SUCCESS">true</entry>
+            <entry key="requestPolicy">USER_NAME_PASSWORD</entry>
+        </properties>
+        <message-layer>HttpServlet</message-layer>
+        <app-context-id>Catalina/localhost /spitests_servlet_web</app-context-id>
+        <reg-description>Registration for TSAuthConfigProviderServlet using spitests_servlet_web</reg-description>
+    </provider-config-entry>
+    <provider-config-entry>
+        <provider-class>com.sun.ts.tests.jaspic.tssv.config.TSAuthConfigProviderServlet</provider-class>
+        <properties version="1.0">
+            <entry key="AuthStatus_SEND_SUCCESS">true</entry>
+            <entry key="requestPolicy">USER_NAME_PASSWORD</entry>
+        </properties>
+        <message-layer>HttpServlet</message-layer>
+        <app-context-id>Catalina/localhost /spitests_servlet_web/WrapperServlet</app-context-id>
+        <reg-description>Registration for TSAuthConfigProviderServlet using spitests_servlet_web</reg-description>
+    </provider-config-entry>
+</provider-config>
diff --git a/src/test/tomee-plume/conf/context.xml b/src/test/tomee-plume/conf/context.xml
index 023c798..9736302 100644
--- a/src/test/tomee-plume/conf/context.xml
+++ b/src/test/tomee-plume/conf/context.xml
@@ -28,4 +28,8 @@
     <!--
     <Manager pathname="" />
     -->
+
+    <!-- this is for Jaspic so we can override the default CallbackHandler until we discuss on Tomcat Mailing list -->
+    <Valve className="org.apache.catalina.authenticator.BasicAuthenticator"
+           jaspicCallbackHandlerClass="org.apache.tomee.security.provider.CallbackHandlerImpl"/>
 </Context>
diff --git a/src/test/tomee-plume/conf/jaspic-providers.xml b/src/test/tomee-plume/conf/jaspic-providers.xml
index a7913d7..fc0ebe1 100644
--- a/src/test/tomee-plume/conf/jaspic-providers.xml
+++ b/src/test/tomee-plume/conf/jaspic-providers.xml
@@ -21,7 +21,7 @@
                   version="1.0">
 
 
-<!--  <provider name="any"
+  <provider name="any"
             className="org.apache.tomee.security.provider.TomEESecurityAuthConfigProvider"
             layer="HttpServlet"
             appContext="Catalina/localhost /securityapi_ham_autoapplysession_web"
@@ -416,7 +416,7 @@
             layer="HttpServlet"
             appContext="Catalina/localhost /securityapi_securitycontext_getprincipalsbytype_web"
             description="any">
-</provider>-->
+  </provider>
 </jaspic-providers>
 
 
diff --git a/src/test/tomee-plume/conf/system.properties b/src/test/tomee-plume/conf/system.properties
index 91de084..6af8c4f 100644
--- a/src/test/tomee-plume/conf/system.properties
+++ b/src/test/tomee-plume/conf/system.properties
@@ -132,6 +132,14 @@
 app/env/appds.Password=cts
 
 openejb.classloader.forced-load = com.sun.ts.tests.
+openejb.classloader.forced-skip=com.sun.ts.tests.jaspic.tssv.util.
+
+# not sure why we have to duplicate this one here
+log.file.location=%user.dir%/%openejb.home%/logs
+vendor.authconfig.factory=org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl
+provider.configuration.file=%user.dir%/%openejb.home%/conf/ProviderConfiguration.xml
+j2eelogin.name=j2ee
+j2eelogin.password=j2ee
 
 #
 #for n in app/env/appds2; do