Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 2443fe648 -> 440824f39


QPID-8158: [Broker-J] [System Tests] Fix issue with creation of folder 
test.output.dir_UNDEFINED by logback when variable test.output.dir is not 
defined


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/440824f3
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/440824f3
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/440824f3

Branch: refs/heads/master
Commit: 440824f39d6bab4aa90706db0cceb25ddc7252da
Parents: c2cdab1
Author: Alex Rudyy <oru...@apache.org>
Authored: Fri Apr 13 13:35:49 2018 +0100
Committer: Alex Rudyy <oru...@apache.org>
Committed: Fri Apr 13 13:49:30 2018 +0100

----------------------------------------------------------------------
 qpid-test-utils/src/main/resources/logback.xml  |  2 +-
 .../qpid/systests/admin/SpawnBrokerAdmin.java   |  3 ++-
 .../main/resources/default-broker-logback.xml   | 24 ++++++++++++++++++++
 .../systests/admin/SpawnBrokerAdminTest.java    | 22 ++++++++++++++++++
 4 files changed, 49 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/440824f3/qpid-test-utils/src/main/resources/logback.xml
----------------------------------------------------------------------
diff --git a/qpid-test-utils/src/main/resources/logback.xml 
b/qpid-test-utils/src/main/resources/logback.xml
index 9e188f5..c311b2a 100644
--- a/qpid-test-utils/src/main/resources/logback.xml
+++ b/qpid-test-utils/src/main/resources/logback.xml
@@ -29,7 +29,7 @@
         </discriminator>
         <sift>
             <appender name="FILE-${classQualifiedTestName}" 
class="ch.qos.logback.core.FileAppender">
-                
<File>${test.output.dir}${file.separator}TEST-${classQualifiedTestName}.txt</File>
+                
<File>${test.output.dir:-target${file.separator}surefire-reports}${file.separator}TEST-${classQualifiedTestName}.txt</File>
                 <Append>False</Append>
                 <encoder>
                     <pattern>%date %-5level [%thread] %logger{10} 
%msg%n</pattern>

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/440824f3/systests/qpid-systests-spawn-admin/src/main/java/org/apache/qpid/systests/admin/SpawnBrokerAdmin.java
----------------------------------------------------------------------
diff --git 
a/systests/qpid-systests-spawn-admin/src/main/java/org/apache/qpid/systests/admin/SpawnBrokerAdmin.java
 
b/systests/qpid-systests-spawn-admin/src/main/java/org/apache/qpid/systests/admin/SpawnBrokerAdmin.java
index 350a431..353dd0e 100644
--- 
a/systests/qpid-systests-spawn-admin/src/main/java/org/apache/qpid/systests/admin/SpawnBrokerAdmin.java
+++ 
b/systests/qpid-systests-spawn-admin/src/main/java/org/apache/qpid/systests/admin/SpawnBrokerAdmin.java
@@ -85,7 +85,7 @@ public class SpawnBrokerAdmin implements BrokerAdmin, 
Closeable
     private static final String SYSTEST_PROPERTY_VIRTUALHOSTNODE_TYPE = 
"virtualhostnode.type";
     private static final String SYSTEST_PROPERTY_VIRTUALHOST_BLUEPRINT = 
"virtualhostnode.context.blueprint";
     private static final String 
SYSTEST_PROPERTY_INITIAL_CONFIGURATION_LOCATION = 
"qpid.initialConfigurationLocation";
-    private static final String SYSTEST_PROPERTY_BUILD_CLASSPATH_FILE = 
"qpid.systests.build.classpath.file";
+    static final String SYSTEST_PROPERTY_BUILD_CLASSPATH_FILE = 
"qpid.systests.build.classpath.file";
     private static final String AMQP_QUEUE_TYPE = "org.apache.qpid.Queue";
     private static final String AMQP_NODE_TYPE = 
"org.apache.qpid.VirtualHostNode";
     private static final String AMQP_VIRTUAL_HOST_TYPE = 
"org.apache.qpid.VirtualHost";
@@ -735,6 +735,7 @@ public class SpawnBrokerAdmin implements BrokerAdmin, 
Closeable
         jvmArguments.add("-cp");
         jvmArguments.add(classpath);
         jvmArguments.add("-Djava.io.tmpdir=" + 
escape(System.getProperty("java.io.tmpdir")));
+        
jvmArguments.add("-Dlogback.configurationFile=default-broker-logback.xml");
         jvmArguments.add("-Dqpid.tests.mms.messagestore.persistence=true");
         jvmArguments.add("org.apache.qpid.server.Main");
         jvmArguments.add("--store-type");

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/440824f3/systests/qpid-systests-spawn-admin/src/main/resources/default-broker-logback.xml
----------------------------------------------------------------------
diff --git 
a/systests/qpid-systests-spawn-admin/src/main/resources/default-broker-logback.xml
 
b/systests/qpid-systests-spawn-admin/src/main/resources/default-broker-logback.xml
new file mode 100644
index 0000000..e489e54
--- /dev/null
+++ 
b/systests/qpid-systests-spawn-admin/src/main/resources/default-broker-logback.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+  ~ 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.
+  ~
+  -->
+<configuration off="true">
+    <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" 
/>
+    <root level="off"/>
+</configuration>

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/440824f3/systests/qpid-systests-spawn-admin/src/test/java/org/apache/qpid/systests/admin/SpawnBrokerAdminTest.java
----------------------------------------------------------------------
diff --git 
a/systests/qpid-systests-spawn-admin/src/test/java/org/apache/qpid/systests/admin/SpawnBrokerAdminTest.java
 
b/systests/qpid-systests-spawn-admin/src/test/java/org/apache/qpid/systests/admin/SpawnBrokerAdminTest.java
index b6b4ebb..c6a9164 100644
--- 
a/systests/qpid-systests-spawn-admin/src/test/java/org/apache/qpid/systests/admin/SpawnBrokerAdminTest.java
+++ 
b/systests/qpid-systests-spawn-admin/src/test/java/org/apache/qpid/systests/admin/SpawnBrokerAdminTest.java
@@ -20,8 +20,11 @@
  */
 package org.apache.qpid.systests.admin;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.nio.file.StandardOpenOption.APPEND;
 import static org.apache.qpid.systests.Utils.getJmsProvider;
 import static org.apache.qpid.systests.Utils.getReceiveTimeout;
+import static 
org.apache.qpid.systests.admin.SpawnBrokerAdmin.SYSTEST_PROPERTY_BUILD_CLASSPATH_FILE;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.hamcrest.CoreMatchers.is;
@@ -30,7 +33,11 @@ import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
 import static org.junit.Assume.assumeThat;
 
+import java.io.File;
+import java.io.IOException;
 import java.net.InetSocketAddress;
+import java.nio.file.Files;
+import java.util.Arrays;
 
 import javax.jms.Connection;
 import javax.jms.DeliveryMode;
@@ -42,6 +49,7 @@ import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import org.apache.qpid.systests.AmqpManagementFacade;
@@ -51,6 +59,20 @@ import org.apache.qpid.tests.utils.BrokerAdmin;
 public class SpawnBrokerAdminTest extends UnitTestBase
 {
 
+    @BeforeClass
+    public static void appendLocalClassPath() throws Exception
+    {
+        String file = 
System.getProperty(SYSTEST_PROPERTY_BUILD_CLASSPATH_FILE);
+
+        // append test classpath in order to locate logback configuration for 
spawn broker
+        final String appendedClasspath = System.getProperty("path.separator")
+                                         + 
System.getProperty("java.class.path");
+        Files.write(new File(file).toPath(),
+                    appendedClasspath.getBytes(UTF_8),
+                    APPEND);
+    }
+
+
     @Test
     public void beforeTestClass() throws Exception
     {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to