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?


---

Reply via email to