tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: dont assume libs we use in tests have the righ asm version
Date Thu, 04 May 2017 17:12:44 GMT
Repository: tomee
Updated Branches:
  refs/heads/master c26f5923d -> d39434836


dont assume libs we use in tests have the righ asm version


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

Branch: refs/heads/master
Commit: d3943483627ab97e251f6360f24d51391ed4bb00
Parents: c26f592
Author: rmannibucau <rmannibucau@apache.org>
Authored: Thu May 4 19:12:37 2017 +0200
Committer: rmannibucau <rmannibucau@apache.org>
Committed: Thu May 4 19:12:37 2017 +0200

----------------------------------------------------------------------
 arquillian/arquillian-tomee-remote/pom.xml               | 10 ++++++++--
 .../apache/openejb/arquillian/AdditionalLibsTest.java    |  5 +++--
 .../apache/openejb/arquillian/CheckServerInfoTest.java   |  3 ++-
 .../openejb/arquillian/javaagent/JavaagentTest.java      | 11 +++++++----
 .../src/test/resources/arquillian.xml                    |  5 +++--
 .../java/org/apache/tomee/catalina/ServerListener.java   |  2 +-
 6 files changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/d3943483/arquillian/arquillian-tomee-remote/pom.xml
----------------------------------------------------------------------
diff --git a/arquillian/arquillian-tomee-remote/pom.xml b/arquillian/arquillian-tomee-remote/pom.xml
index 2556566..b3eaf03 100644
--- a/arquillian/arquillian-tomee-remote/pom.xml
+++ b/arquillian/arquillian-tomee-remote/pom.xml
@@ -166,8 +166,14 @@
 
     <dependency>
       <groupId>org.apache.sirona</groupId>
-      <artifactId>sirona-web</artifactId>
-      <version>0.2-incubating</version>
+      <artifactId>sirona-api</artifactId>
+      <version>0.3-incubating</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.testdriven</groupId>
+      <artifactId>cfgagent</artifactId>
+      <version>1.0.0</version>
       <scope>test</scope>
     </dependency>
   </dependencies>

http://git-wip-us.apache.org/repos/asf/tomee/blob/d3943483/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/AdditionalLibsTest.java
----------------------------------------------------------------------
diff --git a/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/AdditionalLibsTest.java
b/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/AdditionalLibsTest.java
index 6dcd604..3a21bc8 100644
--- a/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/AdditionalLibsTest.java
+++ b/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/AdditionalLibsTest.java
@@ -16,7 +16,8 @@
  */
 package org.apache.openejb.arquillian;
 
-import org.apache.sirona.web.servlet.SironaFilter;
+import org.apache.sirona.Role;
+import org.apache.sirona.counters.Unit;
 import org.jboss.arquillian.container.test.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.shrinkwrap.api.Archive;
@@ -49,7 +50,7 @@ public class AdditionalLibsTest {
         });
         assertEquals(1, sirona.length); // web
 
-        assertNotNull(new SironaFilter()); // would fail if libs are missing
+        assertNotNull(new Role("test", Unit.UNARY)); // would fail if libs are missing
     }
 
     private static class Tester {

http://git-wip-us.apache.org/repos/asf/tomee/blob/d3943483/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/CheckServerInfoTest.java
----------------------------------------------------------------------
diff --git a/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/CheckServerInfoTest.java
b/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/CheckServerInfoTest.java
index 266c3d2..b40917d 100644
--- a/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/CheckServerInfoTest.java
+++ b/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/CheckServerInfoTest.java
@@ -37,6 +37,7 @@ public class CheckServerInfoTest {
 
     @Test
     public void checkServerInfo() {
-        assertTrue(ServerInfo.getServerInfo().startsWith("Apache Tomcat (TomEE)/"));
+        final String serverInfo = ServerInfo.getServerInfo();
+        assertTrue(serverInfo, serverInfo.startsWith("Apache Tomcat"));
     }
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/d3943483/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/javaagent/JavaagentTest.java
----------------------------------------------------------------------
diff --git a/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/javaagent/JavaagentTest.java
b/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/javaagent/JavaagentTest.java
index 6ef2951..821e4af 100644
--- a/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/javaagent/JavaagentTest.java
+++ b/arquillian/arquillian-tomee-remote/src/test/java/org/apache/openejb/arquillian/javaagent/JavaagentTest.java
@@ -26,6 +26,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import java.lang.management.ManagementFactory;
+import java.util.List;
 
 import static org.junit.Assert.fail;
 
@@ -33,16 +34,18 @@ import static org.junit.Assert.fail;
 public class JavaagentTest {
     @Deployment
     public static Archive<?> empty() {
-        return ShrinkWrap.create(WebArchive.class, "javaagent.war").addAsResource(EmptyAsset.INSTANCE,
"foo");
+        return ShrinkWrap.create(WebArchive.class, "javaagent.war")
+                .addAsResource(EmptyAsset.INSTANCE, "foo");
     }
 
     @Test
     public void checkAgent() {
-        for (final String arg : ManagementFactory.getRuntimeMXBean().getInputArguments())
{
-            if (arg.startsWith("-javaagent") && arg.endsWith("sirona-javaagent-0.2-incubating-shaded.jar"))
{
+        final List<String> inputArguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
+        for (final String arg : inputArguments) {
+            if (arg.startsWith("-javaagent") && arg.endsWith("cfgagent-1.0.0.jar"))
{
                 return;
             }
         }
-        fail("didnt find sirona as javaagent");
+        fail("didnt find sirona as javaagent: " + inputArguments.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/d3943483/arquillian/arquillian-tomee-remote/src/test/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/arquillian/arquillian-tomee-remote/src/test/resources/arquillian.xml b/arquillian/arquillian-tomee-remote/src/test/resources/arquillian.xml
index dc9fb5b..db472b7 100644
--- a/arquillian/arquillian-tomee-remote/src/test/resources/arquillian.xml
+++ b/arquillian/arquillian-tomee-remote/src/test/resources/arquillian.xml
@@ -28,10 +28,11 @@
                <property name="ajpPort">-1</property>
                <property name="dir">target/apache-tomee-remote</property>
                <property name="additionalLibs">
-                 mvn:org.apache.sirona:sirona-web:0.2-incubating
+                 mvn:org.apache.sirona:sirona-api:0.3-incubating
                </property>
                <property name="javaagent">
-                 mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
+                 # just a javaagent not reading bytecode to not fail cause it doesnt use
the wrong asm version
+                 mvn:com.github.testdriven:cfgagent:1.0.0:jar
                </property>
                <property name="appWorkingDir">target/arquillian-test-working-dir</property>
                <property name="properties">

http://git-wip-us.apache.org/repos/asf/tomee/blob/d3943483/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/ServerListener.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/ServerListener.java
b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/ServerListener.java
index 0235c02..83715dc 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/ServerListener.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/ServerListener.java
@@ -199,7 +199,7 @@ public class ServerListener implements LifecycleListener {
             field.setAccessible(true);
             final String tomeeVersion = OpenEjbVersion.get().getVersion();
             final int modifiers = field.getModifiers();
-            if (Modifier.isFinal(modifiers)) {
+            if (Modifier.isFinal(modifiers)) { // this is a bit fragile, we can surely drop
this feature at some point
                 final Field modifiersField = Field.class.getDeclaredField("modifiers");
                 modifiersField.setAccessible(true);
                 modifiersField.setInt(field, modifiers & ~Modifier.FINAL);


Mime
View raw message