tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlmonte...@apache.org
Subject [tomee] branch tomee-7.0.x updated: Fixing TomEECliIT test
Date Wed, 20 Mar 2019 12:16:56 GMT
This is an automated email from the ASF dual-hosted git repository.

jlmonteiro pushed a commit to branch tomee-7.0.x
in repository https://gitbox.apache.org/repos/asf/tomee.git


The following commit(s) were added to refs/heads/tomee-7.0.x by this push:
     new 127b5d1  Fixing TomEECliIT test
     new 2b68ce6  Merge pull request #449 from danielsoro/tomee-7.0.x-fix-build
127b5d1 is described below

commit 127b5d15f45e9bfa676400540495e2c751982403
Author: Daniel Cunha (soro) <danielsoro@apache.org>
AuthorDate: Wed Mar 20 00:04:13 2019 -0300

    Fixing TomEECliIT test
---
 .../src/test/java/org/apache/tomee/TomEECliIT.java | 61 +++++++++++++++++++---
 1 file changed, 53 insertions(+), 8 deletions(-)

diff --git a/tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java b/tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java
index bff58c4..ba95a74 100644
--- a/tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java
+++ b/tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java
@@ -26,6 +26,7 @@ import org.junit.Test;
 
 import java.io.File;
 import java.io.FileFilter;
+import java.io.FilenameFilter;
 import java.io.IOException;
 import java.nio.file.Files;
 
@@ -65,12 +66,34 @@ public class TomEECliIT {
             fail("Failed to find Tomcat directory required for this test - Ensure you have
run at least the maven phase: mvn process-resources");
         }
 
+        final File libDir = new File(tomee.getAbsolutePath() + File.separator + "lib");
+        final String[] openejbCore = libDir.list(new FilenameFilter() {
+            @Override
+            public boolean accept(File dir, String name) {
+                return name.startsWith("openejb-core");
+            }
+        });
+
+        final String[] commonsCli = libDir.list(new FilenameFilter() {
+            @Override
+            public boolean accept(File dir, String name) {
+                return name.startsWith("commons-cli");
+            }
+        });
+
+        final String[] commonsLang = libDir.list(new FilenameFilter() {
+            @Override
+            public boolean accept(File dir, String name) {
+                return name.startsWith("commons-lang3");
+            }
+        });
+
         final ProcessBuilder builder = new ProcessBuilder()
-            .command("java", "-cp", jar.getAbsolutePath() + File.pathSeparator +
-                            tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ "openejb-core-8.0.0-SNAPSHOT.jar" + File.pathSeparator +
-                            tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ "commons-cli-1.2.jar" + File.pathSeparator +
-                            tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ "commons-lang3-3.8.1.jar",
-                    "org.apache.openejb.cli.Bootstrap", "classloadertest");
+                .command("java", "-cp", jar.getAbsolutePath() + File.pathSeparator +
+                                tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ openejbCore[0] + File.pathSeparator +
+                                tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ commonsCli[0] + File.pathSeparator +
+                                tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ commonsLang[0],
+                        "org.apache.openejb.cli.Bootstrap", "classloadertest");
 
         final Process start = builder.start();
         start.waitFor();
@@ -159,12 +182,34 @@ public class TomEECliIT {
             fail("Failed to find Tomcat directory required for this test - Ensure you have
run at least the maven phase: mvn process-resources");
         }
 
+        final File libDir = new File(tomee.getAbsolutePath() + File.separator + "lib");
+        final String[] openejbCore = libDir.list(new FilenameFilter() {
+            @Override
+            public boolean accept(File dir, String name) {
+                return name.startsWith("openejb-core");
+            }
+        });
+
+        final String[] commonsCli = libDir.list(new FilenameFilter() {
+            @Override
+            public boolean accept(File dir, String name) {
+                return name.startsWith("commons-cli");
+            }
+        });
+
+        final String[] commonsLang = libDir.list(new FilenameFilter() {
+            @Override
+            public boolean accept(File dir, String name) {
+                return name.startsWith("commons-lang3");
+            }
+        });
+
         final ProcessBuilder builder = new ProcessBuilder()
                 .command("java", "-cp", jar.getAbsolutePath() + File.pathSeparator +
                                 jar2.getAbsolutePath() + File.pathSeparator +
-                                tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ "openejb-core-8.0.0-SNAPSHOT.jar" + File.pathSeparator +
-                                tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ "commons-cli-1.2.jar" + File.pathSeparator +
-                                tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ "commons-lang3-3.8.1.jar",
+                                tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ openejbCore[0] + File.pathSeparator +
+                                tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ commonsCli[0] + File.pathSeparator +
+                                tomee.getAbsolutePath() + File.separator + "lib" + File.separator
+ commonsLang[0],
                         "org.apache.openejb.cli.Bootstrap", "classloadertest2");
 
         final Process start = builder.start();


Mime
View raw message