tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlmonte...@apache.org
Subject [03/38] tomee git commit: TOMEE-2247 - Simplified Arquillian packaging.
Date Mon, 10 Dec 2018 14:47:06 GMT
TOMEE-2247 - Simplified Arquillian packaging.


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/ac382e99
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/ac382e99
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/ac382e99

Branch: refs/heads/master
Commit: ac382e99c1383971fec6a3751d8231113ef9e206
Parents: 3b246d3
Author: Roberto Cortez <radcortez@yahoo.com>
Authored: Fri Sep 14 12:09:43 2018 +0100
Committer: Roberto Cortez <radcortez@yahoo.com>
Committed: Fri Dec 7 18:08:36 2018 +0000

----------------------------------------------------------------------
 .../jwt/MicroProfileJWTTCKArchiveProcessor.java   | 18 +++++++++++++++++-
 .../jwt/MicroProfileJWTTCKDeploymentPackager.java | 16 ----------------
 .../jwt/src/test/resources/arquillian.xml         |  2 +-
 3 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/ac382e99/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKArchiveProcessor.java
----------------------------------------------------------------------
diff --git a/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKArchiveProcessor.java
b/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKArchiveProcessor.java
index 41390f2..16182c3 100644
--- a/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKArchiveProcessor.java
+++ b/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKArchiveProcessor.java
@@ -16,11 +16,14 @@
  */
 package org.apache.tomee.microprofile.tck.jwt;
 
+import com.nimbusds.jose.JWSSigner;
+import org.apache.openejb.loader.JarLocation;
 import org.apache.tomee.arquillian.remote.RemoteTomEEConfiguration;
 import org.apache.tomee.arquillian.remote.RemoteTomEEContainer;
 import org.eclipse.microprofile.jwt.tck.config.IssValidationTest;
 import org.eclipse.microprofile.jwt.tck.config.PublicKeyAsPEMLocationTest;
 import org.eclipse.microprofile.jwt.tck.config.PublicKeyAsPEMTest;
+import org.eclipse.microprofile.jwt.tck.util.TokenUtils;
 import org.jboss.arquillian.container.spi.Container;
 import org.jboss.arquillian.container.spi.ContainerRegistry;
 import org.jboss.arquillian.container.spi.client.deployment.TargetDescription;
@@ -31,6 +34,7 @@ import org.jboss.arquillian.test.spi.TestClass;
 import org.jboss.shrinkwrap.api.Archive;
 import org.jboss.shrinkwrap.api.ArchivePath;
 import org.jboss.shrinkwrap.api.Node;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
 import org.jboss.shrinkwrap.api.asset.StringAsset;
 import org.jboss.shrinkwrap.api.spec.WebArchive;
 
@@ -51,6 +55,11 @@ public class MicroProfileJWTTCKArchiveProcessor implements ApplicationArchivePro
         }
         final WebArchive war = WebArchive.class.cast(applicationArchive);
 
+        // Add Required Libraries
+        war.addAsLibrary(JarLocation.jarLocation(TokenUtils.class))
+           .addAsLibrary(JarLocation.jarLocation(JWSSigner.class))
+           .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+
         // Provide keys required for tests (vendor specific way)
         war.addClass(JWTAuthContextInfoProvider.class);
 
@@ -59,11 +68,16 @@ public class MicroProfileJWTTCKArchiveProcessor implements ApplicationArchivePro
         Stream.of(
                 PublicKeyAsPEMTest.class,
                 PublicKeyAsPEMLocationTest.class,
+                org.apache.tomee.microprofile.tck.jwt.config.PublicKeyAsPEMLocationTest.class,
                 IssValidationTest.class)
               .filter(c -> c.equals(testClass.getJavaClass()))
               .findAny()
               .ifPresent(c -> war.deleteClass(JWTAuthContextInfoProvider.class));
 
+        // MP Config in wrong place - See https://github.com/eclipse/microprofile/issues/46.
+        final Map<ArchivePath, Node> content = war.getContent(object -> object.get().matches(".*META-INF/.*"));
+        content.forEach((archivePath, node) -> war.addAsResource(node.getAsset(), node.getPath()));
+
         // Rewrite the correct server port in configuration
         final Container container = containerRegistry.get().getContainer(TargetDescription.DEFAULT);
         if (container.getDeployableContainer() instanceof RemoteTomEEContainer) {
@@ -78,7 +92,7 @@ public class MicroProfileJWTTCKArchiveProcessor implements ApplicationArchivePro
                 try {
                     final Properties properties = new Properties();
                     properties.load(node.getAsset().openStream());
-                    properties.replaceAll((key, value) -> ((String) value).replaceAll("8080",
httpPort));
+                    properties.replaceAll((key, value) -> ((String) value).replaceAll("8080",
httpPort + "/" + war.getName().replaceAll("\\.war", "")));
                     final StringWriter stringWriter = new StringWriter();
                     properties.store(stringWriter, null);
                     war.delete(archivePath);
@@ -88,5 +102,7 @@ public class MicroProfileJWTTCKArchiveProcessor implements ApplicationArchivePro
                 }
             });
         }
+
+        System.out.println(war.toString(true));
     }
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/ac382e99/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKDeploymentPackager.java
----------------------------------------------------------------------
diff --git a/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKDeploymentPackager.java
b/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKDeploymentPackager.java
index d1b1fe4..cd92e00 100644
--- a/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKDeploymentPackager.java
+++ b/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKDeploymentPackager.java
@@ -16,21 +16,14 @@
  */
 package org.apache.tomee.microprofile.tck.jwt;
 
-import com.nimbusds.jose.JWSSigner;
-import org.apache.openejb.loader.JarLocation;
-import org.eclipse.microprofile.jwt.tck.util.TokenUtils;
 import org.jboss.arquillian.container.test.spi.TestDeployment;
 import org.jboss.arquillian.container.test.spi.client.deployment.ProtocolArchiveProcessor;
 import org.jboss.arquillian.protocol.servlet.v_2_5.ServletProtocolDeploymentPackager;
 import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ArchivePath;
-import org.jboss.shrinkwrap.api.Node;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
 import org.jboss.shrinkwrap.api.spec.WebArchive;
 
 import java.util.Collection;
-import java.util.Map;
 
 public class MicroProfileJWTTCKDeploymentPackager extends ServletProtocolDeploymentPackager
{
     @Override
@@ -39,15 +32,6 @@ public class MicroProfileJWTTCKDeploymentPackager extends ServletProtocolDeploym
         final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, testDeployment.getApplicationArchive().getName())
                                                 .merge(testDeployment.getApplicationArchive());
 
-        // Add Required Libraries
-        webArchive.addAsLibrary(JarLocation.jarLocation(TokenUtils.class))
-                  .addAsLibrary(JarLocation.jarLocation(JWSSigner.class))
-                  .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
-
-        // MP Config in wrong place - See https://github.com/eclipse/microprofile/issues/46.
-        final Map<ArchivePath, Node> content = webArchive.getContent(object -> object.get().matches(".*META-INF/.*"));
-        content.forEach((archivePath, node) -> webArchive.addAsResource(node.getAsset(),
node.getPath()));
-
         return super.generateDeployment(
                 new TestDeployment(null, webArchive, testDeployment.getAuxiliaryArchives()),
processors);
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/ac382e99/tck/microprofile-tck/jwt/src/test/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/tck/microprofile-tck/jwt/src/test/resources/arquillian.xml b/tck/microprofile-tck/jwt/src/test/resources/arquillian.xml
index 7009d05..e14a14b 100644
--- a/tck/microprofile-tck/jwt/src/test/resources/arquillian.xml
+++ b/tck/microprofile-tck/jwt/src/test/resources/arquillian.xml
@@ -24,7 +24,7 @@
 <container qualifier="tomee-remote" default="true">
   <configuration>
     <property name="debug">false</property>
-    <property name="httpPort">8080</property>
+    <property name="httpPort">-1</property>
     <property name="ajpPort">-1</property>
     <property name="stopPort">-1</property>
     <property name="classifier">microprofile</property>


Mime
View raw message