You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2014/04/24 22:35:23 UTC
svn commit: r1589872 - in /lucene/dev/branches/branch_4x: ./ lucene/
lucene/analysis/
lucene/analysis/common/src/java/org/apache/lucene/analysis/util/
lucene/analysis/common/src/test/org/apache/lucene/analysis/core/
Author: uschindler
Date: Thu Apr 24 20:35:22 2014
New Revision: 1589872
URL: http://svn.apache.org/r1589872
Log:
Merged revision(s) 1589870 from lucene/dev/trunk:
LUCENE-5630: Fix TestAllAnalyzersHaveFactories to correctly check for existence of class and corresponding Map<String,String> ctor
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/lucene/ (props changed)
lucene/dev/branches/branch_4x/lucene/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_4x/lucene/analysis/ (props changed)
lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AnalysisSPILoader.java
lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java
Modified: lucene/dev/branches/branch_4x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/CHANGES.txt?rev=1589872&r1=1589871&r2=1589872&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/lucene/CHANGES.txt Thu Apr 24 20:35:22 2014
@@ -247,6 +247,14 @@ Bug fixes
concurrently. This error is now handled the same way like in NativeFSLockFactory
by returning false. (Uwe Schindler, Robert Muir, Dawid Weiss)
+* LUCENE-5630: Add missing META-INF entry for UpperCaseFilterFactory.
+ (Robert Muir)
+
+Tests
+
+* LUCENE-5630: Fix TestAllAnalyzersHaveFactories to correctly check for existence
+ of class and corresponding Map<String,String> ctor. (Uwe Schindler, Robert Muir)
+
Test Framework
* LUCENE-5592: Incorrectly reported uncloseable files. (Dawid Weiss)
Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AnalysisSPILoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AnalysisSPILoader.java?rev=1589872&r1=1589871&r2=1589872&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AnalysisSPILoader.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AnalysisSPILoader.java Thu Apr 24 20:35:22 2014
@@ -120,7 +120,7 @@ final class AnalysisSPILoader<S extends
return service;
} else {
throw new IllegalArgumentException("A SPI class of type "+clazz.getName()+" with name '"+name+"' does not exist. "+
- "You need to add the corresponding JAR file supporting this SPI to your classpath."+
+ "You need to add the corresponding JAR file supporting this SPI to your classpath. "+
"The current classpath supports the following names: "+availableServices());
}
}
Modified: lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java?rev=1589872&r1=1589871&r2=1589872&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestAllAnalyzersHaveFactories.java Thu Apr 24 20:35:22 2014
@@ -143,6 +143,7 @@ public class TestAllAnalyzersHaveFactori
String clazzName = c.getSimpleName();
assertTrue(clazzName.endsWith("Tokenizer"));
String simpleName = clazzName.substring(0, clazzName.length() - 9);
+ assertNotNull(TokenizerFactory.lookupClass(simpleName));
TokenizerFactory instance = null;
try {
instance = TokenizerFactory.forName(simpleName, args);
@@ -152,7 +153,8 @@ public class TestAllAnalyzersHaveFactori
}
assertSame(c, instance.create(new StringReader("")).getClass());
} catch (IllegalArgumentException e) {
- if (!e.getMessage().contains("SPI") || e.getMessage().contains("does not exist")) {
+ if (e.getCause() instanceof NoSuchMethodException) {
+ // there is no corresponding ctor available
throw e;
}
// TODO: For now pass because some factories have not yet a default config that always works
@@ -161,6 +163,7 @@ public class TestAllAnalyzersHaveFactori
String clazzName = c.getSimpleName();
assertTrue(clazzName.endsWith("Filter"));
String simpleName = clazzName.substring(0, clazzName.length() - (clazzName.endsWith("TokenFilter") ? 11 : 6));
+ assertNotNull(TokenFilterFactory.lookupClass(simpleName));
TokenFilterFactory instance = null;
try {
instance = TokenFilterFactory.forName(simpleName, args);
@@ -174,7 +177,8 @@ public class TestAllAnalyzersHaveFactori
assertSame(c, createdClazz);
}
} catch (IllegalArgumentException e) {
- if (!e.getMessage().contains("SPI") || e.getMessage().contains("does not exist")) {
+ if (e.getCause() instanceof NoSuchMethodException) {
+ // there is no corresponding ctor available
throw e;
}
// TODO: For now pass because some factories have not yet a default config that always works
@@ -183,6 +187,7 @@ public class TestAllAnalyzersHaveFactori
String clazzName = c.getSimpleName();
assertTrue(clazzName.endsWith("CharFilter"));
String simpleName = clazzName.substring(0, clazzName.length() - 10);
+ assertNotNull(CharFilterFactory.lookupClass(simpleName));
CharFilterFactory instance = null;
try {
instance = CharFilterFactory.forName(simpleName, args);
@@ -196,7 +201,8 @@ public class TestAllAnalyzersHaveFactori
assertSame(c, createdClazz);
}
} catch (IllegalArgumentException e) {
- if (!e.getMessage().contains("SPI") || e.getMessage().contains("does not exist")) {
+ if (e.getCause() instanceof NoSuchMethodException) {
+ // there is no corresponding ctor available
throw e;
}
// TODO: For now pass because some factories have not yet a default config that always works