lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject svn commit: r929520 - in /lucene/dev/trunk/lucene/contrib/benchmark: ./ src/java/org/apache/lucene/benchmark/byTask/utils/ src/test/org/apache/lucene/benchmark/byTask/utils/
Date Wed, 31 Mar 2010 13:06:14 GMT
Author: shaie
Date: Wed Mar 31 13:06:13 2010
New Revision: 929520

URL: http://svn.apache.org/viewvc?rev=929520&view=rev
Log:
JIRA-2353: Config incorrectly handles Windows absolute pathnames

Added:
    lucene/dev/trunk/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/
    lucene/dev/trunk/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java
  (with props)
Modified:
    lucene/dev/trunk/lucene/contrib/benchmark/CHANGES.txt
    lucene/dev/trunk/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java

Modified: lucene/dev/trunk/lucene/contrib/benchmark/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/benchmark/CHANGES.txt?rev=929520&r1=929519&r2=929520&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/benchmark/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/contrib/benchmark/CHANGES.txt Wed Mar 31 13:06:13 2010
@@ -2,6 +2,10 @@ Lucene Benchmark Contrib Change Log
 
 The Benchmark contrib package contains code for benchmarking Lucene in a variety of ways.
 
+3/28/2010
+  LUCENE-2353: Fixed bug in Config where Windows absolute path property values 
+  were incorrectly handled (Shai Erera via ?)
+  
 3/24/2010
   LUCENE-2343: Added support for benchmarking collectors. (Grant Ingersoll, Shai Erera)
 

Modified: lucene/dev/trunk/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java?rev=929520&r1=929519&r2=929520&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java
(original)
+++ lucene/dev/trunk/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java
Wed Mar 31 13:06:13 2010
@@ -139,6 +139,10 @@ public class Config {
     }
     if (sval.indexOf(":") < 0) {
       return sval;
+    } else if (sval.indexOf(":\\") >= 0 || sval.indexOf(":/") >= 0) {
+      // this previously messed up absolute path names on Windows. Assuming
+      // there is no real value that starts with \ or /
+      return sval;
     }
     // first time this prop is extracted by round
     int k = sval.indexOf(":");

Added: lucene/dev/trunk/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java?rev=929520&view=auto
==============================================================================
--- lucene/dev/trunk/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java
(added)
+++ lucene/dev/trunk/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java
Wed Mar 31 13:06:13 2010
@@ -0,0 +1,39 @@
+package org.apache.lucene.benchmark.byTask.utils;
+
+/**
+ * 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.
+ */
+
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.apache.lucene.util.LuceneTestCaseJ4;
+import org.junit.Test;
+
+public class TestConfig extends LuceneTestCaseJ4 {
+
+  @Test
+  public void testAbsolutePathNamesWindows() throws Exception {
+    Properties props = new Properties();
+    props.setProperty("work.dir1", "c:\\temp");
+    props.setProperty("work.dir2", "c:/temp");
+    Config conf = new Config(props);
+    assertEquals("c:\\temp", conf.get("work.dir1", ""));
+    assertEquals("c:/temp", conf.get("work.dir2", ""));
+  }
+
+}

Propchange: lucene/dev/trunk/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/dev/trunk/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



Mime
View raw message