Revision: 905
http://cishell.svn.sourceforge.net/cishell/?rev=905&view=rev
Author: mwlinnem
Date: 2009-07-29 21:33:47 +0000 (Wed, 29 Jul 2009)
Log Message:
-----------
Updated converter tester to conform to CIShell 1.0 changes (finally).
Modified Paths:
--------------
trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmUtil.java
Modified: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmUtil.java
===================================================================
--- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmUtil.java 2009-07-29 15:20:15 UTC (rev 904)
+++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmUtil.java 2009-07-29 21:33:47 UTC (rev 905)
@@ -8,21 +8,25 @@
import org.osgi.service.log.LogService;
public class ConverterTesterAlgorithmUtil implements AlgorithmProperty {
- public static ServiceReference[] getConverterReferences(
- BundleContext bContext) {
- String filter = "(&("+ALGORITHM_TYPE+"="+TYPE_CONVERTER+"))";
+ /*
+ * Technically, this returns both converters AND validators.
+ * However, when it was written validators were converters!
+ */
+ public static ServiceReference[] getConverterReferences(BundleContext bContext) {
+ String filter = "(|(" + ALGORITHM_TYPE + "=" + TYPE_CONVERTER + ")(" + ALGORITHM_TYPE + "="
+ + TYPE_VALIDATOR + "))";
- try {
- ServiceReference[] refs = bContext.getServiceReferences(
- AlgorithmFactory.class.getName(), filter);
-
- return refs;
- } catch (InvalidSyntaxException e) {
- System.err.println("Invalid syntax '" + filter +
- "' for filtering service references. Attempted to " +
- "obtain all converter references.");
- e.printStackTrace();
- return null;
- }
+ try {
+ ServiceReference[] refs = bContext.getServiceReferences(AlgorithmFactory.class
+ .getName(), filter);
+
+ return refs;
+ } catch (InvalidSyntaxException e) {
+ System.err.println("Invalid syntax '" + filter
+ + "' for filtering service references. Attempted to "
+ + "obtain all converter references.");
+ e.printStackTrace();
+ return null;
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|