[GitHub] tomee pull request #176: TOMEE-2253 - tomee.sh -version not working properly...

2018-12-04 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/tomee/pull/176


---


[GitHub] tomee pull request #176: TOMEE-2253 - tomee.sh -version not working properly...

2018-10-29 Thread jgallimore
Github user jgallimore commented on a diff in the pull request:

https://github.com/apache/tomee/pull/176#discussion_r228923707
  
--- Diff: tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java 
---
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tomee;
+
+import org.apache.openejb.loader.IO;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+public class TomEECliIT {
+
+@Test
+public void testTomEECli() throws IOException, InterruptedException {
+final File jar = new 
File(getClass().getClassLoader().getResource("test-1.0.jar").getFile());
+
+File work = new 
File("target/webprofile-work-dir/").getAbsoluteFile();
+if (!work.exists()) {
+work = new 
File("apache-tomee/target/webprofile-work-dir/").getAbsoluteFile();
+}
+
+final File[] files = work.listFiles(new FileFilter() {
+@Override
+public boolean accept(final File pathname) {
+return pathname.isDirectory() && 
pathname.getName().startsWith("apache-tomcat-");
+}
+});
+
+final File tomee = (null != files ? files[0] : null);
+if (tomee == null) {
+fail("Failed to find Tomcat directory required for this test - 
Ensure you have run at least the maven phase: mvn process-resources");
+}
+
+
+final ProcessBuilder builder = new ProcessBuilder()
+.command("java", "-cp", jar.getAbsolutePath() + ":" +
+tomee.getAbsolutePath() + 
"/lib/openejb-core-8.0.0-SNAPSHOT.jar:" +
+tomee.getAbsolutePath() + 
"/lib/commons-cli-1.2.jar",
+"org.apache.openejb.cli.Bootstrap", 
"classloadertest");
--- End diff --

Add another test with a directory as a classpath element.


---


[GitHub] tomee pull request #176: TOMEE-2253 - tomee.sh -version not working properly...

2018-10-29 Thread jgallimore
Github user jgallimore commented on a diff in the pull request:

https://github.com/apache/tomee/pull/176#discussion_r228923550
  
--- Diff: tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java 
---
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tomee;
+
+import org.apache.openejb.loader.IO;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+public class TomEECliIT {
+
+@Test
+public void testTomEECli() throws IOException, InterruptedException {
+final File jar = new 
File(getClass().getClassLoader().getResource("test-1.0.jar").getFile());
+
+File work = new 
File("target/webprofile-work-dir/").getAbsoluteFile();
+if (!work.exists()) {
+work = new 
File("apache-tomee/target/webprofile-work-dir/").getAbsoluteFile();
+}
+
+final File[] files = work.listFiles(new FileFilter() {
+@Override
+public boolean accept(final File pathname) {
+return pathname.isDirectory() && 
pathname.getName().startsWith("apache-tomcat-");
+}
+});
+
+final File tomee = (null != files ? files[0] : null);
+if (tomee == null) {
+fail("Failed to find Tomcat directory required for this test - 
Ensure you have run at least the maven phase: mvn process-resources");
+}
+
+
+final ProcessBuilder builder = new ProcessBuilder()
+.command("java", "-cp", jar.getAbsolutePath() + ":" +
+tomee.getAbsolutePath() + 
"/lib/openejb-core-8.0.0-SNAPSHOT.jar:" +
+tomee.getAbsolutePath() + 
"/lib/commons-cli-1.2.jar",
+"org.apache.openejb.cli.Bootstrap", 
"classloadertest");
+
+final Process start = builder.start();
+start.waitFor();
+
+final String result = IO.slurp(start.getInputStream());
--- End diff --

I suspect the logic that creates this output is in the JAR added in 
test/resources, making it a bit invisible. Can you assemble it with ShrinkWrap 
instead?


---


[GitHub] tomee pull request #176: TOMEE-2253 - tomee.sh -version not working properly...

2018-10-29 Thread jgallimore
Github user jgallimore commented on a diff in the pull request:

https://github.com/apache/tomee/pull/176#discussion_r228922983
  
--- Diff: tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java 
---
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tomee;
+
+import org.apache.openejb.loader.IO;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+public class TomEECliIT {
+
+@Test
+public void testTomEECli() throws IOException, InterruptedException {
+final File jar = new 
File(getClass().getClassLoader().getResource("test-1.0.jar").getFile());
+
+File work = new 
File("target/webprofile-work-dir/").getAbsoluteFile();
+if (!work.exists()) {
+work = new 
File("apache-tomee/target/webprofile-work-dir/").getAbsoluteFile();
+}
+
+final File[] files = work.listFiles(new FileFilter() {
+@Override
+public boolean accept(final File pathname) {
+return pathname.isDirectory() && 
pathname.getName().startsWith("apache-tomcat-");
+}
+});
+
+final File tomee = (null != files ? files[0] : null);
+if (tomee == null) {
+fail("Failed to find Tomcat directory required for this test - 
Ensure you have run at least the maven phase: mvn process-resources");
+}
+
+
+final ProcessBuilder builder = new ProcessBuilder()
+.command("java", "-cp", jar.getAbsolutePath() + ":" +
--- End diff --

Using : won't work on Windows.


---


[GitHub] tomee pull request #176: TOMEE-2253 - tomee.sh -version not working properly...

2018-10-09 Thread danielsoro
GitHub user danielsoro opened a pull request:

https://github.com/apache/tomee/pull/176

TOMEE-2253 - tomee.sh -version not working properly with Java 11



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/danielsoro/tomee tomee-2253

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tomee/pull/176.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #176


commit bafe834710301e44b8d9d56f0c3a9340cb319314
Author: Daniel Cunha (soro) 
Date:   2018-10-09T14:56:45Z

TOMEE-2253 - tomee.sh -version not working properly with Java 11




---