Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 45A2A200BA1 for ; Mon, 17 Oct 2016 18:37:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 44096160AEC; Mon, 17 Oct 2016 16:37:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8B379160AE2 for ; Mon, 17 Oct 2016 18:37:04 +0200 (CEST) Received: (qmail 40266 invoked by uid 500); 17 Oct 2016 16:36:58 -0000 Mailing-List: contact issues-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list issues@activemq.apache.org Received: (qmail 40210 invoked by uid 99); 17 Oct 2016 16:36:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Oct 2016 16:36:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 655742C4C73 for ; Mon, 17 Oct 2016 16:36:58 +0000 (UTC) Date: Mon, 17 Oct 2016 16:36:58 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ARTEMIS-801) Several tests fail if the project is located on path with special characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 17 Oct 2016 16:37:05 -0000 [ https://issues.apache.org/jira/browse/ARTEMIS-801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15582696#comment-15582696 ] ASF GitHub Bot commented on ARTEMIS-801: ---------------------------------------- Github user clebertsuconic commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/845#discussion_r83683002 --- Diff: artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/GuestLoginModuleTest.java --- @@ -23,22 +23,33 @@ import javax.security.auth.login.LoginContext; import javax.security.auth.login.LoginException; import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.net.URL; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal; import org.apache.activemq.artemis.spi.core.security.jaas.UserPrincipal; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; public class GuestLoginModuleTest extends Assert { + private static final Logger logger = Logger.getLogger(GuestLoginModuleTest.class); + static { String path = System.getProperty("java.security.auth.login.config"); if (path == null) { URL resource = GuestLoginModuleTest.class.getClassLoader().getResource("login.config"); if (resource != null) { - path = resource.getFile(); - System.setProperty("java.security.auth.login.config", path); + try { + path = URLDecoder.decode(resource.getFile(), StandardCharsets.UTF_8.name()); --- End diff -- I'm just confused why you changed this, if this is just a test. > Several tests fail if the project is located on path with special characters > ---------------------------------------------------------------------------- > > Key: ARTEMIS-801 > URL: https://issues.apache.org/jira/browse/ARTEMIS-801 > Project: ActiveMQ Artemis > Issue Type: Bug > Affects Versions: 1.4.0 > Reporter: Erich Duda > > If the path to file contains special characters such as '&', the file is not found. > {code} > java.nio.file.NoSuchFileException: /mnt/hudson_workspace/workspace/artemis-project-testsuite-matrix-upstream/NATIVES/false/jdk/openjdk1.8_local/label/RHEL6%26%26x86_64/artemis-cli/target/test-classes/broker-reload.xml > at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) > at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) > at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) > at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) > at java.nio.file.Files.newByteChannel(Files.java:361) > at java.nio.file.Files.newByteChannel(Files.java:407) > at java.nio.file.Files.readAllBytes(Files.java:3152) > at org.apache.activemq.cli.test.FileBrokerTest.replacePatternInFile(FileBrokerTest.java:145) > at org.apache.activemq.cli.test.FileBrokerTest.testConfigFileReload(FileBrokerTest.java:137) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)