[jboss-svn-commits] JBL Code SVN: r24465 - in labs/jbossrules/trunk/drools-guvnor/src: main/resources and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Dec 22 02:16:06 EST 2008
Author: michael.neale at jboss.com
Date: 2008-12-22 02:16:05 -0500 (Mon, 22 Dec 2008)
New Revision: 24465
Added:
labs/jbossrules/trunk/drools-guvnor/src/test/resources/badselectors.properties
Modified:
labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/server/selector/SelectorManager.java
labs/jbossrules/trunk/drools-guvnor/src/main/resources/selectors.properties
labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/selector/SelectorManagerTest.java
Log:
GUVNOR-85 Selector failures
Modified: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/server/selector/SelectorManager.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/server/selector/SelectorManager.java 2008-12-22 05:26:57 UTC (rev 24464)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/server/selector/SelectorManager.java 2008-12-22 07:16:05 UTC (rev 24465)
@@ -31,11 +31,15 @@
for (Iterator iter = props.keySet().iterator(); iter.hasNext();) {
String selectorName = (String) iter.next();
String val = props.getProperty(selectorName);
- if (val.endsWith("drl")) {
- selectors.put(selectorName ,loadRuleSelector( val) );
- } else {
- selectors.put(selectorName, loadSelectorImplementation( val ));
- }
+ try {
+ if (val.endsWith("drl")) {
+ selectors.put(selectorName ,loadRuleSelector( val) );
+ } else {
+ selectors.put(selectorName, loadSelectorImplementation( val ));
+ }
+ } catch (RuntimeException e) {
+ log.error("Unable to load a selector [" + val + "]", e);
+ }
}
} catch (IOException e) {
log.error("Unable to load selectors.", e);
Modified: labs/jbossrules/trunk/drools-guvnor/src/main/resources/selectors.properties
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/resources/selectors.properties 2008-12-22 05:26:57 UTC (rev 24464)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/resources/selectors.properties 2008-12-22 07:16:05 UTC (rev 24465)
@@ -7,7 +7,7 @@
#
#############################################################################################
-#<name>=</Path to drl> OR <className of a class that implements AssetSelector>
+#<name>=</Path to drl IN CLASSPATH> OR <className of a class that implements AssetSelector>
#############################################################################################
#example:
@@ -15,6 +15,7 @@
#prodServer=/SomeRules.drl
#
#You then use the above by name "testServer" in the package builder GUI.
+#Note "SomeRules.drl" would be in the classes folder under the WEB-INF folder (root of the classpath).
#############################################################################################
Modified: labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/selector/SelectorManagerTest.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/selector/SelectorManagerTest.java 2008-12-22 05:26:57 UTC (rev 24464)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/selector/SelectorManagerTest.java 2008-12-22 07:16:05 UTC (rev 24465)
@@ -47,4 +47,9 @@
}
+ public void testBadConfig() throws Exception {
+ SelectorManager sm = new SelectorManager("/badselectors.properties");
+
+ }
+
}
Copied: labs/jbossrules/trunk/drools-guvnor/src/test/resources/badselectors.properties (from rev 24454, labs/jbossrules/trunk/drools-guvnor/src/test/resources/emptyselectors.properties)
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/test/resources/badselectors.properties (rev 0)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/resources/badselectors.properties 2008-12-22 07:16:05 UTC (rev 24465)
@@ -0,0 +1,2 @@
+#this is deliberately empty to test the default state of the system
+prodServer=/fdsgdfsfdsafdsafdsa.drl
\ No newline at end of file
Property changes on: labs/jbossrules/trunk/drools-guvnor/src/test/resources/badselectors.properties
___________________________________________________________________
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
More information about the jboss-svn-commits
mailing list