[seam-commits] Seam SVN: r12654 - in modules/drools/trunk/impl/src: main/java/org/jboss/seam/drools/config and 2 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Apr 27 01:36:12 EDT 2010


Author: tsurdilovic
Date: 2010-04-27 01:36:11 -0400 (Tue, 27 Apr 2010)
New Revision: 12654

Modified:
   modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java
   modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/config/DroolsConfig.java
   modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kagent/KAgentTest.java
   modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/kagent/KAgentTest-beans.xml
Log:
minor test changes

Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java	2010-04-27 05:20:47 UTC (rev 12653)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java	2010-04-27 05:36:11 UTC (rev 12654)
@@ -73,7 +73,9 @@
    public StatefulKnowledgeSession produceStatefulSession(KnowledgeBase kbase,DroolsConfig config) throws Exception
    {
       StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(config.getKnowledgeSessionConfiguration(), null);
-      addSeamDelegate(ksession);
+      if(!config.isDisableSeamDelegate()) {
+         addSeamDelegate(ksession);
+      }
       addEventListeners(ksession);
       addWorkItemHandlers(ksession);
       addFactProviders(ksession);
@@ -87,7 +89,9 @@
    public StatefulKnowledgeSession produceScannedStatefulSession(@Scanned KnowledgeBase kbase, DroolsConfig config) throws Exception
    {
       StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(config.getKnowledgeSessionConfiguration(), null);
-      addSeamDelegate(ksession);
+      if(!config.isDisableSeamDelegate()) {
+         addSeamDelegate(ksession);
+      }
       addEventListeners(ksession);
       addWorkItemHandlers(ksession);
       addFactProviders(ksession);
@@ -101,7 +105,9 @@
    public StatelessKnowledgeSession produceScannedStatelessSession(@Scanned KnowledgeBase kbase, DroolsConfig config) throws Exception
    {
       StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession(config.getKnowledgeSessionConfiguration());
-      addSeamDelegate(ksession);
+      if(!config.isDisableSeamDelegate()) {
+         addSeamDelegate(ksession);
+      }
       addEventListeners(ksession);
       
       return ksession;
@@ -112,7 +118,9 @@
    public StatelessKnowledgeSession produceStatelessSession(KnowledgeBase kbase, DroolsConfig config) throws Exception
    {
       StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession(config.getKnowledgeSessionConfiguration());
-      addSeamDelegate(ksession);
+      if(!config.isDisableSeamDelegate()) {
+         addSeamDelegate(ksession);
+      }
       addEventListeners(ksession);
       
       return ksession;

Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/config/DroolsConfig.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/config/DroolsConfig.java	2010-04-27 05:20:47 UTC (rev 12653)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/config/DroolsConfig.java	2010-04-27 05:36:11 UTC (rev 12654)
@@ -73,6 +73,8 @@
    private String loggerPath;
    private int loggerInterval;
 
+   private boolean disableSeamDelegate;
+   
    private RuleResources ruleResources;
 
    private Map<String, String> kbuilderPropertiesMap = new HashMap<String, String>();
@@ -308,4 +310,16 @@
       this.ruleResources = ruleResources;
    }
 
+   public boolean isDisableSeamDelegate()
+   {
+      return disableSeamDelegate;
+   }
+
+   public void setDisableSeamDelegate(boolean disableSeamDelegate)
+   {
+      this.disableSeamDelegate = disableSeamDelegate;
+   }
+   
+   
+
 }

Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kagent/KAgentTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kagent/KAgentTest.java	2010-04-27 05:20:47 UTC (rev 12653)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kagent/KAgentTest.java	2010-04-27 05:36:11 UTC (rev 12654)
@@ -74,8 +74,8 @@
    public void testKAgentConfiguration(@KAgentTestConfig DroolsConfig config)
    {
       assertNotNull(config);
-      assertTrue(config.isStartChangeNotifierService());
-      assertTrue(config.isStartChangeScannerService());
+      assertTrue(!config.isStartChangeNotifierService());
+      assertTrue(!config.isStartChangeScannerService());
       assertTrue(config.getAgentName() != null);
       assertTrue(config.getScannerInterval() > 0);
    }
@@ -91,9 +91,11 @@
       ksession1.fireAllRules();
       Person p1f = (Person) ksession1.getObject(fh1);
       assertTrue(p1f.isEligible());
+      
+      //ResourceFactory.getResourceChangeNotifierService().stop();
+      //ResourceFactory.getResourceChangeScannerService().stop();
       ksession1.dispose();
-      ResourceFactory.getResourceChangeNotifierService().stop();
-      ResourceFactory.getResourceChangeScannerService().stop();
+      
    }
 
 }

Modified: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/kagent/KAgentTest-beans.xml
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/kagent/KAgentTest-beans.xml	2010-04-27 05:20:47 UTC (rev 12653)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/kagent/KAgentTest-beans.xml	2010-04-27 05:36:11 UTC (rev 12654)
@@ -41,7 +41,7 @@
 			</s:entry>
 			<s:entry>
 				<s:key>drools.agent.scanDirectories</s:key>
-				<s:value>true</s:value>
+				<s:value>false</s:value>
 			</s:entry>
 			<s:entry>
 				<s:key>drools.agent.newInstance</s:key>
@@ -52,9 +52,9 @@
 				<s:value>true</s:value>
 			</s:entry>
 		</d:kagentPropertiestMap>
-		<d:startChangeNotifierService>true</d:startChangeNotifierService>
-		<d:startChangeScannerService>true</d:startChangeScannerService>
-		<d:scannerInterval>30</d:scannerInterval>
+		<d:startChangeNotifierService>false</d:startChangeNotifierService>
+		<d:startChangeScannerService>false</d:startChangeScannerService>
+		<d:scannerInterval>60</d:scannerInterval>
 		<d:agentName>
 			<s:value>testagent</s:value>
 		</d:agentName>



More information about the seam-commits mailing list