geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
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 GMT
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



Mime
View raw message