[seam-commits] Seam SVN: r12653 - in modules/drools/trunk/impl/src: test/java/org/jboss/seam/drools/test/delegate and 1 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue Apr 27 01:20:48 EDT 2010
Author: tsurdilovic
Date: 2010-04-27 01:20:47 -0400 (Tue, 27 Apr 2010)
New Revision: 12653
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/SeamDelegate.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTest.java
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/delegate/DelegateTest-beans.xml
Log:
fixed up delegate test.
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 04:15:32 UTC (rev 12652)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java 2010-04-27 05:20:47 UTC (rev 12653)
@@ -128,7 +128,7 @@
}
private void addSeamDelegate(StatefulKnowledgeSession ksession) {
- ksession.getGlobals().setDelegate(new SeamDelegate());
+ ksession.getGlobals().setDelegate(delegate);
}
private void addSeamDelegate(StatelessKnowledgeSession ksession) {
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/SeamDelegate.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/SeamDelegate.java 2010-04-27 04:15:32 UTC (rev 12652)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/SeamDelegate.java 2010-04-27 05:20:47 UTC (rev 12653)
@@ -42,7 +42,6 @@
{
private static final Logger log = LoggerFactory.getLogger(SeamDelegate.class);
- // TODO figure out why manager is NULL!!!!!
@Inject
BeanManager manager;
@@ -52,8 +51,6 @@
{
Set<Bean<?>> beans = manager.getBeans(name);
- System.out.println("***** BEAN : " + beans);
-
if (beans != null && beans.size() > 0)
{
Bean<?> bean = beans.iterator().next();
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTest.java 2010-04-27 04:15:32 UTC (rev 12652)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTest.java 2010-04-27 05:20:47 UTC (rev 12653)
@@ -63,6 +63,7 @@
@Test
public void testDelegate(DelegateBean delegateBean, @Default @DefaultConfig StatefulKnowledgeSession ksession) {
assertNotNull(ksession);
+ assertNotNull(delegateBean);
ksession.fireAllRules();
assertTrue(delegateBean.isTouched());
}
Modified: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/delegate/DelegateTest-beans.xml
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/delegate/DelegateTest-beans.xml 2010-04-27 04:15:32 UTC (rev 12652)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/delegate/DelegateTest-beans.xml 2010-04-27 05:20:47 UTC (rev 12653)
@@ -33,7 +33,8 @@
<test:DelegateBean>
<s:overrides/>
- <s:Named>someBean</s:Named>
+ <s:RequestScoped />
+ <s:Named>testDelegate</s:Named>
</test:DelegateBean>
</beans>
More information about the seam-commits
mailing list