Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 86317 invoked from network); 26 Nov 2007 18:57:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Nov 2007 18:57:55 -0000 Received: (qmail 22449 invoked by uid 500); 26 Nov 2007 18:57:43 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 22410 invoked by uid 500); 26 Nov 2007 18:57:43 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 22399 invoked by uid 99); 26 Nov 2007 18:57:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Nov 2007 10:57:43 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Nov 2007 18:57:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8F2301A9832; Mon, 26 Nov 2007 10:57:34 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r598385 - in /geronimo/server/trunk/framework/modules/geronimo-kernel/src: main/java/org/apache/geronimo/kernel/config/SelectorUtils.java test/java/org/apache/geronimo/kernel/config/SelectorUtilsTest.java Date: Mon, 26 Nov 2007 18:57:33 -0000 To: scm@geronimo.apache.org From: gawor@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071126185734.8F2301A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gawor Date: Mon Nov 26 10:57:33 2007 New Revision: 598385 URL: http://svn.apache.org/viewvc?rev=598385&view=rev Log: a fix so that path matching is consistent and works the same on unix and windows. fixes latest windows build problem Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/SelectorUtilsTest.java (with props) Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SelectorUtils.java Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SelectorUtils.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SelectorUtils.java?rev=598385&r1=598384&r2=598385&view=diff ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SelectorUtils.java (original) +++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SelectorUtils.java Mon Nov 26 10:57:33 2007 @@ -596,6 +596,8 @@ path = s[1]; } char sep = File.separatorChar; + path = path.replace('/', sep).replace('\\', sep); + int start = 0; int len = path.length(); int count = 0; Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/SelectorUtilsTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/SelectorUtilsTest.java?rev=598385&view=auto ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/SelectorUtilsTest.java (added) +++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/SelectorUtilsTest.java Mon Nov 26 10:57:33 2007 @@ -0,0 +1,34 @@ +/** + * 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.geronimo.kernel.config; + +import junit.framework.TestCase; + +/** + * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $ + */ +public class SelectorUtilsTest extends TestCase { + + public void test() throws Exception { + assertTrue("case1", SelectorUtils.matchPath("a/**", "a/b/c")); + assertTrue("case2", SelectorUtils.matchPath("a/**", "a\\b\\c")); + + assertTrue("case3", SelectorUtils.matchPath("a\\**", "a/b/c")); + assertTrue("case4", SelectorUtils.matchPath("a\\**", "a\\b\\c")); + } + +} Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/SelectorUtilsTest.java ------------------------------------------------------------------------------ svn:eol-style = native