[jboss-svn-commits] JBL Code SVN: r34062 - in labs/jbossrules/trunk: drools-ant/src/test/java/org/drools/contrib and 3 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Jul 20 09:46:48 EDT 2010
Author: Rikkola
Date: 2010-07-20 09:46:47 -0400 (Tue, 20 Jul 2010)
New Revision: 34062
Removed:
labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/Misc2.drl
labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/Misc3.drl
labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForDates.drl
labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForDoubles.drl
labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForInts.drl
labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForVariables.drl
Modified:
labs/jbossrules/trunk/drools-ant/src/main/java/org/drools/contrib/DroolsVerifierAntTask.java
labs/jbossrules/trunk/drools-ant/src/test/java/org/drools/contrib/BuildFileTest.java
labs/jbossrules/trunk/drools-ant/src/test/java/org/drools/contrib/DroolsAntTaskTest.java
labs/jbossrules/trunk/drools-verifier/src/main/java/org/drools/verifier/builder/VerifierImpl.java
labs/jbossrules/trunk/drools-verifier/src/main/java/org/drools/verifier/report/html/MissingRangesReportVisitor.java
Log:
Verifier was failing when creating the HTML report. Tried to get a nonexisting item from iterator.
Modified: labs/jbossrules/trunk/drools-ant/src/main/java/org/drools/contrib/DroolsVerifierAntTask.java
===================================================================
--- labs/jbossrules/trunk/drools-ant/src/main/java/org/drools/contrib/DroolsVerifierAntTask.java 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-ant/src/main/java/org/drools/contrib/DroolsVerifierAntTask.java 2010-07-20 13:46:47 UTC (rev 34062)
@@ -20,145 +20,146 @@
public class DroolsVerifierAntTask extends MatchingTask {
- public static final String DRLFILEEXTENSION = ".drl";
+ public static final String DRLFILEEXTENSION = ".drl";
- private File srcdir;
- private File toFile;
- private Path classpath;
+ private File srcdir;
+ private File toFile;
+ private Path classpath;
- /**
- * Source directory to read DRL files from
- *
- * @param directory
- */
- public void setSrcDir(File directory) {
- this.srcdir = directory;
- }
+ /**
+ * Source directory to read DRL files from
+ *
+ * @param directory
+ */
+ public void setSrcDir(File directory) {
+ this.srcdir = directory;
+ }
- /**
- * File to serialize the rulebase to
- *
- * @param toFile
- */
- public void setToFile(File toFile) {
- this.toFile = toFile;
- }
+ /**
+ * File to serialize the rulebase to
+ *
+ * @param toFile
+ */
+ public void setToFile(File toFile) {
+ this.toFile = toFile;
+ }
- /**
- * The classpath to use when compiling the rulebase
- *
- * @param classpath
- */
- public void setClasspath(Path classpath) {
- createClasspath().append(classpath);
- }
+ /**
+ * The classpath to use when compiling the rulebase
+ *
+ * @param classpath
+ */
+ public void setClasspath(Path classpath) {
+ createClasspath().append( classpath );
+ }
- /**
- * Classpath to use, by reference, when compiling the rulebase
- *
- * @param r
- * a reference to an existing classpath
- */
- public void setClasspathref(Reference r) {
- createClasspath().setRefid(r);
- }
+ /**
+ * Classpath to use, by reference, when compiling the rulebase
+ *
+ * @param r
+ * a reference to an existing classpath
+ */
+ public void setClasspathref(Reference r) {
+ createClasspath().setRefid( r );
+ }
- /**
- * Adds a path to the classpath.
- *
- * @return created classpath
- */
- public Path createClasspath() {
- if (this.classpath == null) {
- this.classpath = new Path(getProject());
- }
- return this.classpath.createPath();
- }
+ /**
+ * Adds a path to the classpath.
+ *
+ * @return created classpath
+ */
+ public Path createClasspath() {
+ if ( this.classpath == null ) {
+ this.classpath = new Path( getProject() );
+ }
+ return this.classpath.createPath();
+ }
- /**
- * Task's main method
- */
- public void execute() throws BuildException {
- super.execute();
+ /**
+ * Task's main method
+ */
+ public void execute() throws BuildException {
+ super.execute();
- // checking parameters are set
- if (toFile == null) {
- throw new BuildException(
- "Destination rulebase file does not specified.");
- }
+ // checking parameters are set
+ if ( toFile == null ) {
+ throw new BuildException( "Destination rulebase file does not specified." );
+ }
- // checking parameters are set
- if (srcdir == null) {
- throw new BuildException("Source directory not specified.");
- }
+ // checking parameters are set
+ if ( srcdir == null ) {
+ throw new BuildException( "Source directory not specified." );
+ }
- if (!srcdir.exists()) {
- throw new BuildException("Source directory does not exists."
- + srcdir.getAbsolutePath());
- }
+ if ( !srcdir.exists() ) {
+ throw new BuildException( "Source directory does not exists." + srcdir.getAbsolutePath() );
+ }
- try {
+ try {
- // create a specialized classloader
+ // create a specialized classloader
- Verifier droolsanalyzer = VerifierBuilderFactory
- .newVerifierBuilder().newVerifier();
+ Verifier droolsanalyzer = VerifierBuilderFactory.newVerifierBuilder().newVerifier();
- // get the list of files to be added to the rulebase
- String[] fileNames = getFileList();
+ // get the list of files to be added to the rulebase
+ String[] fileNames = getFileList();
- for (int i = 0; i < fileNames.length; i++) {
- compileAndAnalyzeFile(droolsanalyzer, fileNames[i]);
- }
+ for ( int i = 0; i < fileNames.length; i++ ) {
+ compileAndAnalyzeFile( droolsanalyzer,
+ fileNames[i] );
+ }
- droolsanalyzer.fireAnalysis();
+ droolsanalyzer.fireAnalysis();
- VerifierReport result = droolsanalyzer.getResult();
+ VerifierReport result = droolsanalyzer.getResult();
- VerifierReportWriter vReportWriter = VerifierReportWriterFactory
- .newHTMLReportWriter();
+ VerifierReportWriter vReportWriter = VerifierReportWriterFactory.newHTMLReportWriter();
- File path = new File(toFile, "report.zip");
+ File path = new File( toFile,
+ "report.zip" );
- OutputStream out = new FileOutputStream(path);
+ OutputStream out = new FileOutputStream( path );
- vReportWriter.writeReport(out, result);
+ vReportWriter.writeReport( out,
+ result );
- System.out.println("Writing verifier report to " + path);
+ System.out.println( "Writing verifier report to " + path );
- } catch (Exception e) {
- throw new BuildException("RuleBaseTask failed: " + e.getMessage(),
- e);
- }
- }
+ } catch ( Exception e ) {
- private void compileAndAnalyzeFile(Verifier droolsVerifier, String filename)
- throws DroolsParserException {
+ System.out.println( e.getMessage() );
- // Verifier just works with drl files
- if (!filename.endsWith(DroolsVerifierAntTask.DRLFILEEXTENSION)) {
- throw new UnsupportedOperationException();
- }
+ throw new BuildException( "RuleBaseTask failed: " + e.getMessage(),
+ e );
+ }
+ }
- droolsVerifier.addResourcesToVerify(ResourceFactory
- .newFileResource(new File(srcdir.getAbsolutePath(), filename)),
- ResourceType.DRL);
- }
+ private void compileAndAnalyzeFile(Verifier droolsVerifier,
+ String filename) throws DroolsParserException {
- /**
- * Returns the list of files to be added into the rulebase
- *
- * @return
- */
- private String[] getFileList() {
- // scan source directory for rule files
- DirectoryScanner directoryScanner = getDirectoryScanner(srcdir);
- String[] fileNames = directoryScanner.getIncludedFiles();
+ // Verifier just works with drl files
+ if ( !filename.endsWith( DroolsVerifierAntTask.DRLFILEEXTENSION ) ) {
+ throw new UnsupportedOperationException();
+ }
- if (fileNames == null || fileNames.length <= 0) {
- throw new BuildException(
- "No rule files found in include directory.");
- }
- return fileNames;
- }
+ droolsVerifier.addResourcesToVerify( ResourceFactory.newFileResource( new File( srcdir.getAbsolutePath(),
+ filename ) ),
+ ResourceType.DRL );
+ }
+
+ /**
+ * Returns the list of files to be added into the rulebase
+ *
+ * @return
+ */
+ private String[] getFileList() {
+ // scan source directory for rule files
+ DirectoryScanner directoryScanner = getDirectoryScanner( srcdir );
+ String[] fileNames = directoryScanner.getIncludedFiles();
+
+ if ( fileNames == null || fileNames.length <= 0 ) {
+ throw new BuildException( "No rule files found in include directory." );
+ }
+ return fileNames;
+ }
}
Modified: labs/jbossrules/trunk/drools-ant/src/test/java/org/drools/contrib/BuildFileTest.java
===================================================================
--- labs/jbossrules/trunk/drools-ant/src/test/java/org/drools/contrib/BuildFileTest.java 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-ant/src/test/java/org/drools/contrib/BuildFileTest.java 2010-07-20 13:46:47 UTC (rev 34062)
@@ -39,12 +39,12 @@
*/
public abstract class BuildFileTest extends TestCase {
- protected Project project;
+ protected Project project;
- private StringBuffer logBuffer;
- private StringBuffer fullLogBuffer;
- private StringBuffer outBuffer;
- private StringBuffer errBuffer;
+ private StringBuffer logBuffer;
+ private StringBuffer fullLogBuffer;
+ private StringBuffer outBuffer;
+ private StringBuffer errBuffer;
private BuildException buildException;
/**
@@ -53,7 +53,7 @@
*@param name string to pass up to TestCase constructor
*/
public BuildFileTest(String name) {
- super(name);
+ super( name );
}
/**
@@ -62,18 +62,23 @@
*@param target target to run
*@param cause information string to reader of report
*/
- protected void expectBuildException(String target, String cause) {
- expectSpecificBuildException(target, cause, null);
+ protected void expectBuildException(String target,
+ String cause) {
+ expectSpecificBuildException( target,
+ cause,
+ null );
}
/**
* Assert that only the given message has been logged with a
* priority >= INFO when running the given target.
*/
- protected void expectLog(String target, String log) {
- executeTarget(target);
+ protected void expectLog(String target,
+ String log) {
+ executeTarget( target );
String realLog = getLog();
- assertEquals(log, realLog);
+ assertEquals( log,
+ realLog );
}
/**
@@ -82,18 +87,18 @@
protected void assertLogContaining(String substring) {
String realLog = getLog();
- assertTrue("expecting log to contain \"" + substring + "\" log was \""
- + realLog + "\"",
- realLog.indexOf(substring) >= 0);
+ assertTrue( "expecting log to contain \"" + substring + "\" log was \"" + realLog + "\"",
+ realLog.indexOf( substring ) >= 0 );
}
/**
* Assert that the given message has been logged with a priority
* >= INFO when running the given target.
*/
- protected void expectLogContaining(String target, String log) {
- executeTarget(target);
- assertLogContaining(log);
+ protected void expectLogContaining(String target,
+ String log) {
+ executeTarget( target );
+ assertLogContaining( log );
}
/**
@@ -111,10 +116,12 @@
* Assert that the given message has been logged with a priority
* >= DEBUG when running the given target.
*/
- protected void expectDebuglog(String target, String log) {
- executeTarget(target);
+ protected void expectDebuglog(String target,
+ String log) {
+ executeTarget( target );
String realLog = getFullLog();
- assertEquals(log, realLog);
+ assertEquals( log,
+ realLog );
}
/**
@@ -135,10 +142,12 @@
*@param output output to look for
*/
- protected void expectOutput(String target, String output) {
- executeTarget(target);
+ protected void expectOutput(String target,
+ String output) {
+ executeTarget( target );
String realOutput = getOutput();
- assertEquals(output, realOutput.trim());
+ assertEquals( output,
+ realOutput.trim() );
}
/**
@@ -149,20 +158,24 @@
*@param error Description of Parameter
*/
- protected void expectOutputAndError(String target, String output, String error) {
- executeTarget(target);
+ protected void expectOutputAndError(String target,
+ String output,
+ String error) {
+ executeTarget( target );
String realOutput = getOutput();
- assertEquals(output, realOutput);
+ assertEquals( output,
+ realOutput );
String realError = getError();
- assertEquals(error, realError);
+ assertEquals( error,
+ realError );
}
protected String getOutput() {
- return cleanBuffer(outBuffer);
+ return cleanBuffer( outBuffer );
}
protected String getError() {
- return cleanBuffer(errBuffer);
+ return cleanBuffer( errBuffer );
}
protected BuildException getBuildException() {
@@ -172,17 +185,17 @@
private String cleanBuffer(StringBuffer buffer) {
StringBuffer cleanedBuffer = new StringBuffer();
boolean cr = false;
- for (int i = 0; i < buffer.length(); i++) {
- char ch = buffer.charAt(i);
- if (ch == '\r') {
+ for ( int i = 0; i < buffer.length(); i++ ) {
+ char ch = buffer.charAt( i );
+ if ( ch == '\r' ) {
cr = true;
continue;
}
- if (!cr) {
- cleanedBuffer.append(ch);
+ if ( !cr ) {
+ cleanedBuffer.append( ch );
} else {
- cleanedBuffer.append(ch);
+ cleanedBuffer.append( ch );
}
}
return cleanedBuffer.toString();
@@ -194,7 +207,8 @@
* @param filename name of project file to run
*/
protected void configureProject(String filename) throws BuildException {
- configureProject(filename, Project.MSG_DEBUG);
+ configureProject( filename,
+ Project.MSG_DEBUG );
}
/**
@@ -202,15 +216,17 @@
*
* @param filename name of project file to run
*/
- protected void configureProject(String filename, int logLevel)
- throws BuildException {
+ protected void configureProject(String filename,
+ int logLevel) throws BuildException {
logBuffer = new StringBuffer();
fullLogBuffer = new StringBuffer();
project = new Project();
project.init();
- project.setUserProperty( "ant.file" , new File(filename).getAbsolutePath() );
- project.addBuildListener(new AntTestListener(logLevel));
- ProjectHelper.configureProject(project, new File(filename));
+ project.setUserProperty( "ant.file",
+ new File( filename ).getAbsolutePath() );
+ project.addBuildListener( new AntTestListener( logLevel ) );
+ ProjectHelper.configureProject( project,
+ new File( filename ) );
}
/**
@@ -225,18 +241,18 @@
sysOut.flush();
sysErr.flush();
outBuffer = new StringBuffer();
- PrintStream out = new PrintStream(new AntOutputStream(outBuffer));
- System.setOut(out);
+ PrintStream out = new PrintStream( new AntOutputStream( outBuffer ) );
+ System.setOut( out );
errBuffer = new StringBuffer();
- PrintStream err = new PrintStream(new AntOutputStream(errBuffer));
- System.setErr(err);
+ PrintStream err = new PrintStream( new AntOutputStream( errBuffer ) );
+ System.setErr( err );
logBuffer = new StringBuffer();
fullLogBuffer = new StringBuffer();
buildException = null;
- project.executeTarget(targetName);
+ project.executeTarget( targetName );
} finally {
- System.setOut(sysOut);
- System.setErr(sysErr);
+ System.setOut( sysOut );
+ System.setErr( sysErr );
}
}
@@ -266,19 +282,19 @@
*@param msg the message value of the build exception we are waiting for
set to null for any build exception to be valid
*/
- protected void expectSpecificBuildException(String target, String cause, String msg) {
+ protected void expectSpecificBuildException(String target,
+ String cause,
+ String msg) {
try {
- executeTarget(target);
- } catch (org.apache.tools.ant.BuildException ex) {
+ executeTarget( target );
+ } catch ( org.apache.tools.ant.BuildException ex ) {
buildException = ex;
- if ((null != msg) && (!ex.getMessage().equals(msg))) {
- fail("Should throw BuildException because '" + cause
- + "' with message '" + msg
- + "' (actual message '" + ex.getMessage() + "' instead)");
+ if ( (null != msg) && (!ex.getMessage().equals( msg )) ) {
+ fail( "Should throw BuildException because '" + cause + "' with message '" + msg + "' (actual message '" + ex.getMessage() + "' instead)" );
}
return;
}
- fail("Should throw BuildException because: " + cause);
+ fail( "Should throw BuildException because: " + cause );
}
/**
@@ -289,20 +305,21 @@
*@param cause information string to reader of report
*@param contains substring of the build exception to look for
*/
- protected void expectBuildExceptionContaining(String target, String cause, String contains) {
+ protected void expectBuildExceptionContaining(String target,
+ String cause,
+ String contains) {
try {
- executeTarget(target);
- } catch (org.apache.tools.ant.BuildException ex) {
+ executeTarget( target );
+ } catch ( org.apache.tools.ant.BuildException ex ) {
buildException = ex;
- if ((null != contains) && (ex.getMessage().indexOf(contains) == -1)) {
- fail("Should throw BuildException because '" + cause + "' with message containing '" + contains + "' (actual message '" + ex.getMessage() + "' instead)");
+ if ( (null != contains) && (ex.getMessage().indexOf( contains ) == -1) ) {
+ fail( "Should throw BuildException because '" + cause + "' with message containing '" + contains + "' (actual message '" + ex.getMessage() + "' instead)" );
}
return;
}
- fail("Should throw BuildException because: " + cause);
+ fail( "Should throw BuildException because: " + cause );
}
-
/**
* call a target, verify property is as expected
*
@@ -311,9 +328,12 @@
* @param value expected value
*/
- protected void expectPropertySet(String target, String property, String value) {
- executeTarget(target);
- assertPropertyEquals(property, value);
+ protected void expectPropertySet(String target,
+ String property,
+ String value) {
+ executeTarget( target );
+ assertPropertyEquals( property,
+ value );
}
/**
@@ -321,9 +341,12 @@
* @param property property name
* @param value expected value
*/
- protected void assertPropertyEquals(String property, String value) {
- String result = project.getProperty(property);
- assertEquals("property " + property,value,result);
+ protected void assertPropertyEquals(String property,
+ String value) {
+ String result = project.getProperty( property );
+ assertEquals( "property " + property,
+ value,
+ result );
}
/**
@@ -331,7 +354,8 @@
* @param property property name
*/
protected void assertPropertySet(String property) {
- assertPropertyEquals(property, "true");
+ assertPropertyEquals( property,
+ "true" );
}
/**
@@ -339,28 +363,33 @@
* @param property property name
*/
protected void assertPropertyUnset(String property) {
- assertPropertyEquals(property, null);
+ assertPropertyEquals( property,
+ null );
}
-
/**
* call a target, verify named property is "true".
*
* @param target build file target
* @param property property name
*/
- protected void expectPropertySet(String target, String property) {
- expectPropertySet(target, property, "true");
+ protected void expectPropertySet(String target,
+ String property) {
+ expectPropertySet( target,
+ property,
+ "true" );
}
-
/**
* call a target, verify property is null
* @param target build file target
* @param property property name
*/
- protected void expectPropertyUnset(String target, String property) {
- expectPropertySet(target, property, null);
+ protected void expectPropertyUnset(String target,
+ String property) {
+ expectPropertySet( target,
+ property,
+ null );
}
/**
@@ -369,9 +398,10 @@
* relative to the package name or absolute from the root path.
* @param resource the resource to retrieve its url.
*/
- protected URL getResource(String resource){
- URL url = getClass().getResource(resource);
- assertNotNull("Could not find resource :" + resource, url);
+ protected URL getResource(String resource) {
+ URL url = getClass().getResource( resource );
+ assertNotNull( "Could not find resource :" + resource,
+ url );
return url;
}
@@ -381,19 +411,21 @@
private static class AntOutputStream extends java.io.OutputStream {
private StringBuffer buffer;
- public AntOutputStream( StringBuffer buffer ) {
+ public AntOutputStream(StringBuffer buffer) {
this.buffer = buffer;
}
public void write(int b) {
- buffer.append((char)b);
+ buffer.append( (char) b );
}
}
/**
* our own personal build listener
*/
- private class AntTestListener implements BuildListener {
+ private class AntTestListener
+ implements
+ BuildListener {
private int logLevel;
/**
@@ -464,20 +496,17 @@
* @see BuildEvent#getPriority()
*/
public void messageLogged(BuildEvent event) {
- if (event.getPriority() > logLevel) {
+ if ( event.getPriority() > logLevel ) {
// ignore event
return;
}
- if (event.getPriority() == Project.MSG_INFO ||
- event.getPriority() == Project.MSG_WARN ||
- event.getPriority() == Project.MSG_ERR) {
- logBuffer.append(event.getMessage());
+ if ( event.getPriority() == Project.MSG_INFO || event.getPriority() == Project.MSG_WARN || event.getPriority() == Project.MSG_ERR ) {
+ logBuffer.append( event.getMessage() );
}
- fullLogBuffer.append(event.getMessage());
+ fullLogBuffer.append( event.getMessage() );
}
}
-
}
Modified: labs/jbossrules/trunk/drools-ant/src/test/java/org/drools/contrib/DroolsAntTaskTest.java
===================================================================
--- labs/jbossrules/trunk/drools-ant/src/test/java/org/drools/contrib/DroolsAntTaskTest.java 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-ant/src/test/java/org/drools/contrib/DroolsAntTaskTest.java 2010-07-20 13:46:47 UTC (rev 34062)
@@ -23,10 +23,9 @@
import org.drools.KnowledgeBase;
import org.drools.RuleBase;
+import org.drools.core.util.DroolsStreamUtils;
import org.drools.definition.KnowledgePackage;
import org.drools.rule.Package;
-import org.drools.core.util.DroolsStreamUtils;
-import org.junit.Ignore;
/**
* DroolsAntTask test case
@@ -50,11 +49,11 @@
configureProject( "src/test/resources/DroolsAntTask.xml" );
}
- public void FIXME_testVerifierReport() {
+ public void testVerifierReport() {
try {
executeTarget( "verifierreport" );
} catch ( Exception e ) {
- fail();
+ fail( e.getMessage() );
}
}
Deleted: labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/Misc2.drl
===================================================================
--- labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/Misc2.drl 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/Misc2.drl 2010-07-20 13:46:47 UTC (rev 34062)
@@ -1,130 +0,0 @@
-package com.misc.missingRanges
-
-import com.sample.DroolsTest.Message;
-
-
-rule "Check time 1"
- when
- Time( startDate > "1-Jan-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 2"
- when
- Foo( startDate <= "10-Jan-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 3"
- when
- Foo( startDate > "10-Jan-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 4"
- when
- Foo( startDate < "20-Jan-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 5"
- when
- Foo( startDate > "27-Jan-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 6"
- when
- Foo( startDate <= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 7"
- when
- Foo( endDate < "10-Jan-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 8"
- when
- Foo( endDate == "11-Jan-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 9"
- when
- Foo( endDate >= "11-Jan-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 10"
- when
- Foo( endDate < "20-Jan-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 11"
- when
- Foo( endDate >= "20-Jan-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 12"
- when
- Foo( endDate < "13-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 13"
- when
- Foo( endDate == "13-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 14"
- when
- Foo( endDate == "14-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 15"
- when
- Foo( endDate == "15-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 16"
- when
- Foo( endDate == "25-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 17"
- when
- Foo( endDate < "26-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Check time 18"
- when
- Foo( endDate >= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
Deleted: labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/Misc3.drl
===================================================================
--- labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/Misc3.drl 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/Misc3.drl 2010-07-20 13:46:47 UTC (rev 34062)
@@ -1,37 +0,0 @@
-package com.misc.missingRanges
-
-import com.sample.DroolsTest.Message;
-
-/*
-rule "Redundant restrictions"
- when
- RedundancyPattern( a == 1, a == 1 )
- then
- // Something
-end
-
-rule "Redundant rule 1, rules"
- when
- RedundancyPattern( a == 1 )
- RedundancyPattern2( a == 1 )
- then
- System.out.println("TEST");
-end
-*/
-rule "Redundant rule 2, rules"
- when
- RedundancyPattern( a == 1 )
- RedundancyPattern2( a >= 1 )
- RedundancyPattern3( a == 1, a == 1 )
- then
- System.out.println("TEST");
-end
-
-rule "Equivalent rule"
- when
- BlaaBlaa( a == 1 )
- RedundancyPattern( a == 1 )
- RedundancyPattern2( a == 1 )
- then
- System.out.println("NOT A TEST");
-end
Deleted: labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForDates.drl
===================================================================
--- labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForDates.drl 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForDates.drl 2010-07-20 13:46:47 UTC (rev 34062)
@@ -1,450 +0,0 @@
-package com.sample
-
-import com.sample.DroolsTest.Message;
-
-rule "Date gap rule 1"
- when
- DatePattern1( value == "27-Oct-2007" )
- then
- # gap > 10 <.
-end
-
-rule "Date gap rule 2"
- when
- DatePattern2( value >= "27-Oct-2000" )
- then
- # gap < 15.
-end
-
-rule "Date gap rule 3"
- when
- DatePattern3( value <= "27-Oct-2004" )
- then
- # gap > 15.
-end
-
-rule "Date gap rule 4a"
- when
- DatePattern4( value > "27-Oct-2001" )
- then
- # gap == 25.
-end
-
-rule "Date gap rule 4b"
- when
- DatePattern4( value < "27-Oct-2001" )
- then
- # gap == 25.
-end
-
-rule "Date gap rule 5a"
- when
- DatePattern5( value > "20-Oct-2007" )
- then
- # gap 100 > x > 50.
-end
-
-rule "Date gap rule 5b"
- when
- DatePattern5( value < "10-Oct-2007" )
- then
- # gap 100 > x > 50.
-end
-
-rule "Date gap rule 6a"
- when
- DatePattern6( value > "28-Oct-2007" )
- then
- # gap < 350.
-end
-
-rule "Date gap rule 6b"
- when
- DatePattern6( value == "28-Oct-2007" )
- then
- # gap < 350.
-end
-
-rule "Date gap rule 7a"
- when
- DatePattern7( value < "27-Jan-2007" )
- then
- # gap > 55.
-end
-
-rule "Date gap rule 7b"
- when
- DatePattern7( value == "27-Jan-2007" )
- then
- # gap > 55.
-end
-
-rule "Date gap rule 8a"
- when
- DatePattern8( value < "11-Jan-2007" )
- then
- # No gap
-end
-
-rule "Date gap rule 8b"
- when
- DatePattern8( value == "11-Jan-2007" )
- then
- # No gap
-end
-
-rule "Date gap rule 8c"
- when
- DatePattern8( value > "11-Jan-2007" )
- then
- # No gap
-end
-
-rule "Date gap rule 9a"
- when
- DatePattern9( value <= "14-Jan-2007" )
- then
- # No gap
-end
-
-rule "Date gap rule 9b"
- when
- DatePattern9( value == "15-Jan-2007" )
- then
- # No gap
-end
-
-rule "Date gap rule 9c"
- when
- DatePattern9( value >= "16-Jan-2007" )
- then
- # No gap
-end
-
-/*
-#
-# These rules have gaps
-#
-rule "Date range 1a, has gap"
- when
- Foo1( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 2a, has gap"
- when
- Foo2( value >= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 3a, has gap"
- when
- Foo3( value < "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 4a, has gap"
- when
- Foo4( value <= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 5a, has gap"
- when
- Foo5( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 5b, has gap"
- when
- Foo5( value == "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 6a, has gap"
- when
- Foo6( value < "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 6b, has gap"
- when
- Foo6( value == "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 7a, has gap"
- when
- Foo7( value < "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 7b, has gap"
- when
- Foo7( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 8a, has gap"
- when
- Foo8( value < "03-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 8b, has gap"
- when
- Foo8( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 9a, has gap"
- when
- Foo9( value <= "03-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 9b, has gap"
- when
- Foo9( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 10a, has gap"
- when
- Foo10( value < "03-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 10b, has gap"
- when
- Foo10( value >= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 11a, has gap"
- when
- Foo11( value <= "03-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 11b, has gap"
- when
- Foo11( value >= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-#
-# Not rules that have gaps.
-#
-
-rule "Date range 12a, has gap"
- when
- not Foo12( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 13a, has gap"
- when
- not Foo13( value >= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 14a, has gap"
- when
- not Foo14( value < "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 15a, has gap"
- when
- not Foo15( value <= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 16a, has gap"
- when
- not Foo16( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 16b, has gap"
- when
- not Foo16( value == "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 17a, has gap"
- when
- not Foo17( value < "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 17b, has gap"
- when
- not Foo17( value == "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 18a, has gap"
- when
- not Foo18( value < "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 18b, has gap"
- when
- not Foo18( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 19a, has gap"
- when
- not Foo19( value < "03-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 19b, has gap"
- when
- not Foo19( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 20a, has gap"
- when
- not Foo20( value <= "03-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 20b, has gap"
- when
- not Foo20( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 21a, has gap"
- when
- not Foo21( value < "03-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 21b, has gap"
- when
- not Foo21( value >= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 22a, has gap"
- when
- not Foo22( value <= "03-Oct-2002" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 22b, has gap"
- when
- not Foo22( value >= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-#
-# No gaps
-#
-
-rule "Date range 23a, no gap"
- when
- Foo23( value >= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 23b, no gap"
- when
- Foo23( value < "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 24a, no gap"
- when
- Foo24( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 24b, no gap"
- when
- Foo24( value <= 27-Oct-2007 )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 25a, no gap"
- when
- Foo25( value >= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 25b, no gap"
- when
- Foo25( value <= "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 25a, no gap"
- when
- Foo25( value > "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 25b, no gap"
- when
- Foo25( value == "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-
-rule "Date range 25c, no gap"
- when
- Foo25( value < "27-Oct-2007" )
- then
- System.out.println( "Test" );
-end
-*/
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForDoubles.drl
===================================================================
--- labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForDoubles.drl 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForDoubles.drl 2010-07-20 13:46:47 UTC (rev 34062)
@@ -1,464 +0,0 @@
-package com.sample
-
-import com.sample.DroolsTest.Message;
-
-rule "Double gap rule 1"
- when
- DoublePattern1( value == 10.0 )
- then
- # gap > 10 <.
-end
-
-rule "Double gap rule 2"
- when
- DoublePattern2( value >= 15.0 )
- then
- # gap < 15.
-end
-
-rule "Double gap rule 3"
- when
- DoublePattern3( value <= 15.0 )
- then
- # gap > 15.
-end
-
-rule "Double gap rule 4a"
- when
- DoublePattern4( value > 25.0 )
- then
- # gap == 25.
-end
-
-rule "Double gap rule 4b"
- when
- DoublePattern4( value < 25.0 )
- then
- # gap == 25.
-end
-
-rule "Double gap rule 5a"
- when
- DoublePattern5( value > 100.0 )
- then
- # gap 100 > x > 50.
-end
-
-rule "Double gap rule 5b"
- when
- DoublePattern5( value < 50.0 )
- then
- # gap 100 > x > 50.
-end
-
-rule "Double gap rule 6a"
- when
- DoublePattern6( value > 350.0 )
- then
- # gap < 350.
-end
-
-rule "Double gap rule 6b"
- when
- DoublePattern6( value == 350.0 )
- then
- # gap < 350.
-end
-
-rule "Double gap rule 7a"
- when
- DoublePattern7( value < 55.0 )
- then
- # gap > 55.
-end
-
-rule "Double gap rule 7b"
- when
- DoublePattern7( value == 55.0 )
- then
- # gap > 55.
-end
-
-rule "Double gap rule 8a"
- when
- DoublePattern8( value < 333.0 )
- then
- # No gap
-end
-
-rule "Double gap rule 8b"
- when
- DoublePattern8( value == 333.0 )
- then
- # No gap
-end
-
-rule "Double gap rule 8c"
- when
- DoublePattern8( value > 333.0 )
- then
- # No gap
-end
-
-rule "Double gap rule 9a"
- when
- DoublePattern9( value >= 400.0 )
- then
- # gap 400 > x > 399
-end
-
-rule "Double gap rule 9b"
- when
- DoublePattern9( value <= 399.0 )
- then
- # gap 400 > x > 399
-end
-
-/*
-#
-# These rules have gaps
-#
-rule "Double range 1a, has gap"
- when
- Foo1( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 2a, has gap"
- when
- Foo2( value >= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 3a, has gap"
- when
- Foo3( value < 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 4a, has gap"
- when
- Foo4( value <= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 5a, has gap"
- when
- Foo5( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 5b, has gap"
- when
- Foo5( value == 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 6a, has gap"
- when
- Foo6( value < 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 6b, has gap"
- when
- Foo6( value == 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 7a, has gap"
- when
- Foo7( value < 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 7b, has gap"
- when
- Foo7( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 8a, has gap"
- when
- Foo8( value < 40.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 8b, has gap"
- when
- Foo8( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 9a, has gap"
- when
- Foo9( value <= 40.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 9b, has gap"
- when
- Foo9( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 10a, has gap"
- when
- Foo10( value < 40.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 10b, has gap"
- when
- Foo10( value >= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 11a, has gap"
- when
- Foo11( value <= 40.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 11b, has gap"
- when
- Foo11( value >= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-#
-# Not rules that have gaps.
-#
-
-rule "Double range 12a, has gap"
- when
- not Foo12( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 13a, has gap"
- when
- not Foo13( value >= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 14a, has gap"
- when
- not Foo14( value < 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 15a, has gap"
- when
- not Foo15( value <= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 16a, has gap"
- when
- not Foo16( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 16b, has gap"
- when
- not Foo16( value == 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 17a, has gap"
- when
- not Foo17( value < 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 17b, has gap"
- when
- not Foo17( value == 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 18a, has gap"
- when
- not Foo18( value < 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 18b, has gap"
- when
- not Foo18( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 19a, has gap"
- when
- not Foo19( value < 40.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 19b, has gap"
- when
- not Foo19( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 20a, has gap"
- when
- not Foo20( value <= 40.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 20b, has gap"
- when
- not Foo20( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 21a, has gap"
- when
- not Foo21( value < 40.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 21b, has gap"
- when
- not Foo21( value >= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 22a, has gap"
- when
- not Foo22( value <= 40.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 22b, has gap"
- when
- not Foo22( value >= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-#
-# No gaps
-#
-
-rule "Double range 23a, no gap"
- when
- Foo23( value >= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 23b, no gap"
- when
- Foo23( value < 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 24a, no gap"
- when
- Foo24( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 24b, no gap"
- when
- Foo24( value <= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 25a, no gap"
- when
- Foo25( value >= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 25b, no gap"
- when
- Foo25( value <= 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 25a, no gap"
- when
- Foo25( value > 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 25b, no gap"
- when
- Foo25( value == 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 25c, no gap"
- when
- Foo25( value < 42.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 27a, no gap"
- when
- Foo27( value > 0.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 27b, no gap"
- when
- Foo27( value == 0.0 )
- then
- System.out.println( "Test" );
-end
-
-rule "Double range 27c, no gap"
- when
- Foo27( value < 0.0 )
- then
- System.out.println( "Test" );
-end
-*/
Deleted: labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForInts.drl
===================================================================
--- labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForInts.drl 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForInts.drl 2010-07-20 13:46:47 UTC (rev 34062)
@@ -1,122 +0,0 @@
-package com.sample
-
-import com.sample.DroolsTest.Message;
-
-rule "Integer gap rule 1"
- when
- IntegerPattern1( value == 10 )
- then
- # gap > 10 <.
-end
-
-rule "Integer gap rule 2"
- when
- IntegerPattern2( value >= 15 )
- then
- # gap < 15.
-end
-
-rule "Integer gap rule 3"
- when
- IntegerPattern3( value <= 15 )
- then
- # gap > 15.
-end
-
-rule "Integer gap rule 4a"
- when
- IntegerPattern4( value > 25 )
- then
- # gap == 25.
-end
-
-rule "Integer gap rule 4b"
- when
- IntegerPattern4( value < 25 )
- then
- # gap == 25.
-end
-
-rule "Integer gap rule 5a"
- when
- IntegerPattern5( value > 100 )
- then
- # gap 100 > x > 50.
-end
-
-rule "Integer gap rule 5b"
- when
- IntegerPattern5( value < 50 )
- then
- # gap 100 > x > 50.
-end
-
-rule "Integer gap rule 6a"
- when
- IntegerPattern6( value > 350 )
- then
- # gap < 350.
-end
-
-rule "Integer gap rule 6b"
- when
- IntegerPattern6( value == 350 )
- then
- # gap < 350.
-end
-
-rule "Integer gap rule 7a"
- when
- IntegerPattern7( value < 55 )
- then
- # gap > 55.
-end
-
-rule "Integer gap rule 7b"
- when
- IntegerPattern7( value == 55 )
- then
- # gap > 55.
-end
-
-rule "Integer gap rule 8a"
- when
- IntegerPattern8( value < 333 )
- then
- # No gap
-end
-
-rule "Integer gap rule 8b"
- when
- IntegerPattern8( value == 333 )
- then
- # No gap
-end
-
-rule "Integer gap rule 8c"
- when
- IntegerPattern8( value > 333 )
- then
- # No gap
-end
-
-rule "Integer gap rule 9a"
- when
- IntegerPattern9( value <= 122 )
- then
- # No gap
-end
-
-rule "Integer gap rule 9b"
- when
- IntegerPattern9( value == 123 )
- then
- # No gap
-end
-
-rule "Integer gap rule 9c"
- when
- IntegerPattern9( value >= 124 )
- then
- # No gap
-end
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForVariables.drl
===================================================================
--- labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForVariables.drl 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-ant/src/test/resources/org/drools/verifier/MissingRangesForVariables.drl 2010-07-20 13:46:47 UTC (rev 34062)
@@ -1,145 +0,0 @@
-package com.sample
-
-import com.sample.DroolsTest.Message;
-/*
-#
-# These rules have gaps
-#
-rule "Missing variable range 1a, warning"
- when
- $s :Something( )
- Foo1w( value > $s.a.b.c.d )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 1b, warning"
- when
- $s :Something( )
- Foo1w( value < $s.a.b.c.d )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 2a, warning"
- when
- $s :Something( )
- Foo2w( value > $s.bar )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 2b, warning"
- when
- $s :Something( )
- Foo2w( value < $s.bar )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 3a, warning"
- when
- Something( $bar :bar)
- Foo3w( value > $bar )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 3b, warning"
- when
- Something( $bar :bar)
- Foo3w( value < $bar )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 4a, warning"
- when
- Something( $bar :bar)
- Foo4w( value > $bar )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 4b, warning"
- when
- Something( $bar :bar)
- Foo4w( value == $bar )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 5a, warning"
- when
- Something( $bar :bar)
- Foo5w( value < $bar )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 5b, warning"
- when
- Something( $bar :bar)
- Foo5w( value == $bar )
- then
- System.out.println( "Test" );
-end
-*/
-#
-# These rules have no gaps
-#
-rule "Missing variable range 1a, covers all"
- when
- $s :Something( )
- Foo1a( value >= $s.a.b.c.d )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 1b, covers all"
- when
- $s :Something()
- Foo1a( value < $s.a.b.c.d )
- then
- System.out.println( "Test" );
-end
-/*
-rule "Missing variable range 2a, covers all"
- when
- $s :Something()
- Foo2a( value > $s.bar )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 2b, covers all"
- when
- $s :Something( )
- Foo2a( value =< $s.bar )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 3a, covers all"
- when
- Something( $bar :bar)
- Foo3a( value > $bar )
- then
- System.out.println( "Test" );
-end
-
-rule "Missing variable range 3b, covers all"
- when
- Something( $bar :bar)
- Foo3a( value == $bar )
- then
- System.out.println( "Test" );
-end
-rule "Missing variable range 3c, covers all"
- when
- Something( $bar :bar)
- Foo3a( value < $bar )
- then
- System.out.println( "Test" );
-end
-*/
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-verifier/src/main/java/org/drools/verifier/builder/VerifierImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-verifier/src/main/java/org/drools/verifier/builder/VerifierImpl.java 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-verifier/src/main/java/org/drools/verifier/builder/VerifierImpl.java 2010-07-20 13:46:47 UTC (rev 34062)
@@ -141,9 +141,11 @@
result );
ksession.fireAllRules( scopesAgendaFilter );
+ String test = "";
+ test = test;
} catch ( Exception e ) {
- throw new RuntimeException( e );
+ throw new RuntimeException( e );
}
return true;
Modified: labs/jbossrules/trunk/drools-verifier/src/main/java/org/drools/verifier/report/html/MissingRangesReportVisitor.java
===================================================================
--- labs/jbossrules/trunk/drools-verifier/src/main/java/org/drools/verifier/report/html/MissingRangesReportVisitor.java 2010-07-20 11:06:59 UTC (rev 34061)
+++ labs/jbossrules/trunk/drools-verifier/src/main/java/org/drools/verifier/report/html/MissingRangesReportVisitor.java 2010-07-20 13:46:47 UTC (rev 34062)
@@ -56,7 +56,7 @@
try {
NumberRestriction restriction = (NumberRestriction) r;
- dt.put( restriction.getValue(),
+ dt.put( restriction.getValue().toString(),
new DataRow( restriction.getRulePath(),
restriction.getRuleName(),
restriction.getOperator(),
@@ -78,7 +78,7 @@
// Combine these two.
stringRows.add( "Missing : " + previous + " .. " + current );
- current = iterator.next();
+ if ( iterator.hasNext() ) current = iterator.next();
} else if ( previous.ruleId != null && previous.ruleId.equals( current.ruleId ) ) {
// Combine these two.
@@ -86,7 +86,7 @@
current.ruleId,
current.ruleName ) + " : " + previous.toString() + " " + current.toString() );
- current = iterator.next();
+ if ( iterator.hasNext() ) current = iterator.next();
} else if ( !iterator.hasNext() ) { // If this is last row
// Print previous and current if they were not merged.
More information about the jboss-svn-commits
mailing list