Author: tsurdilovic
Date: 2010-04-27 00:15:32 -0400 (Tue, 27 Apr 2010)
New Revision: 12652
Added:
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/
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateBean.java
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/DelegateTestQualifier.java
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/delegate/
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.drl
Modified:
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java
modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cep/CEPTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/query/QueryTest.java
Log:
Added seam delegate test.
Modified:
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java
===================================================================
---
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java 2010-04-26
22:29:50 UTC (rev 12651)
+++
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java 2010-04-27
04:15:32 UTC (rev 12652)
@@ -24,6 +24,7 @@
import java.io.Serializable;
import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Default;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -44,6 +45,7 @@
private static final Logger log = LoggerFactory.getLogger(EntryPointProducer.class);
@Produces
+ @Default
@EntryPoint
public WorkingMemoryEntryPoint produceEntryPoint(StatefulKnowledgeSession ksession,
InjectionPoint ip) throws Exception
{
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-26
22:29:50 UTC (rev 12651)
+++
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java 2010-04-27
04:15:32 UTC (rev 12652)
@@ -28,6 +28,7 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.New;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
@@ -63,12 +64,16 @@
@Inject
DroolsExtension droolsExtension;
+
+ @Inject
+ SeamDelegate delegate;
@Produces
@RequestScoped
public StatefulKnowledgeSession produceStatefulSession(KnowledgeBase
kbase,DroolsConfig config) throws Exception
{
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession(config.getKnowledgeSessionConfiguration(), null);
+ addSeamDelegate(ksession);
addEventListeners(ksession);
addWorkItemHandlers(ksession);
addFactProviders(ksession);
@@ -82,6 +87,7 @@
public StatefulKnowledgeSession produceScannedStatefulSession(@Scanned KnowledgeBase
kbase, DroolsConfig config) throws Exception
{
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession(config.getKnowledgeSessionConfiguration(), null);
+ addSeamDelegate(ksession);
addEventListeners(ksession);
addWorkItemHandlers(ksession);
addFactProviders(ksession);
@@ -95,6 +101,7 @@
public StatelessKnowledgeSession produceScannedStatelessSession(@Scanned KnowledgeBase
kbase, DroolsConfig config) throws Exception
{
StatelessKnowledgeSession ksession =
kbase.newStatelessKnowledgeSession(config.getKnowledgeSessionConfiguration());
+ addSeamDelegate(ksession);
addEventListeners(ksession);
return ksession;
@@ -105,6 +112,7 @@
public StatelessKnowledgeSession produceStatelessSession(KnowledgeBase kbase,
DroolsConfig config) throws Exception
{
StatelessKnowledgeSession ksession =
kbase.newStatelessKnowledgeSession(config.getKnowledgeSessionConfiguration());
+ addSeamDelegate(ksession);
addEventListeners(ksession);
return ksession;
@@ -119,6 +127,14 @@
session.dispose();
}
+ private void addSeamDelegate(StatefulKnowledgeSession ksession) {
+ ksession.getGlobals().setDelegate(new SeamDelegate());
+ }
+
+ private void addSeamDelegate(StatelessKnowledgeSession ksession) {
+ ksession.getGlobals().setDelegate(delegate);
+ }
+
private void addEventListeners(KnowledgeRuntimeEventManager ksession)
{
Iterator<Object> iter =
droolsExtension.getKsessionEventListenerSet().iterator();
Modified:
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java
===================================================================
---
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java 2010-04-26
22:29:50 UTC (rev 12651)
+++
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java 2010-04-27
04:15:32 UTC (rev 12652)
@@ -24,6 +24,7 @@
import java.io.Serializable;
import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Default;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -44,6 +45,7 @@
private static final Logger log =
LoggerFactory.getLogger(QueryResultsProducer.class);
@Produces
+ @Default
@Query
public QueryResults produceQueryResults(StatefulKnowledgeSession ksession,
InjectionPoint ip)
{
Added: 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
(rev 0)
+++
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/SeamDelegate.java 2010-04-27
04:15:32 UTC (rev 12652)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.drools;
+
+import java.util.Set;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+
+import org.drools.runtime.Globals;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@ApplicationScoped
+public class SeamDelegate implements Globals
+{
+ private static final Logger log = LoggerFactory.getLogger(SeamDelegate.class);
+
+ // TODO figure out why manager is NULL!!!!!
+ @Inject
+ BeanManager manager;
+
+ private Globals delegate;
+
+ public Object get(String name)
+ {
+ Set<Bean<?>> beans = manager.getBeans(name);
+
+ System.out.println("***** BEAN : " + beans);
+
+ if (beans != null && beans.size() > 0)
+ {
+ Bean<?> bean = beans.iterator().next();
+ CreationalContext<?> context = manager.createCreationalContext(bean);
+ return manager.getReference(bean, Object.class, context);
+ }
+ else
+ {
+ log.info("Could not find beans named: " + name);
+ return delegate.get(name);
+ }
+
+ }
+
+ public void set(String name, Object value)
+ {
+ delegate.set(name, value);
+ }
+
+ public void setDelegate(Globals delegate)
+ {
+ this.delegate = delegate;
+ }
+
+}
Modified: modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml 2010-04-26 22:29:50
UTC (rev 12651)
+++ modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml 2010-04-27 04:15:32
UTC (rev 12652)
@@ -377,5 +377,6 @@
</d:RuleResources>
</s:parameters>
</d:DroolsConfig>
+
</beans>
\ No newline at end of file
Modified:
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cep/CEPTest.java
===================================================================
---
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cep/CEPTest.java 2010-04-26
22:29:50 UTC (rev 12651)
+++
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cep/CEPTest.java 2010-04-27
04:15:32 UTC (rev 12652)
@@ -67,39 +67,36 @@
return archive;
}
+ @Inject @Default @CEPPseudoClockConfig StatefulKnowledgeSession cepSession;
+ @Inject @Default @CEPPseudoClockConfig @EntryPoint("FireDetectionStream")
WorkingMemoryEntryPoint fireDetectionStream;
+ @Inject @Default @CEPPseudoClockConfig
@EntryPoint("SprinklerDetectionStream") WorkingMemoryEntryPoint
sprinklerDetectionStream;
+
@Test
- public void dummy() {
- assertTrue(true);
+ public void testCEP() {
+ assertNotNull(cepSession);
+ assertTrue(cepSession.getId() >= 0);
+ assertNotNull(fireDetectionStream);
+ assertNotNull(sprinklerDetectionStream);
+ assertNotSame(fireDetectionStream, sprinklerDetectionStream);
+
+ FireAlarm fireAlarm = new FireAlarm();
+ assertTrue(!fireAlarm.isActivated());
+ cepSession.setGlobal("fireAlarm", fireAlarm);
+ SessionPseudoClock clock = cepSession.getSessionClock();
+ fireDetectionStream.insert(new FireDetected());
+ clock.advanceTime(9, TimeUnit.SECONDS);
+
+ cepSession.fireAllRules();
+
+ FireAlarm afireAlarm = (FireAlarm) cepSession.getGlobal("fireAlarm");
+ assertTrue(!afireAlarm.isActivated());
+
+ clock.advanceTime(2, TimeUnit.SECONDS);
+
+ cepSession.fireAllRules();
+
+ FireAlarm bfireAlarm = (FireAlarm) cepSession.getGlobal("fireAlarm");
+ assertTrue(bfireAlarm.isActivated());
+
}
-
- //@Test
-// public void testCEP(@Default @CEPPseudoClockConfig StatefulKnowledgeSession
cepSession,
-// @Default @CEPPseudoClockConfig @EntryPoint("FireDetectionStream")
WorkingMemoryEntryPoint fireDetectionStream,
-// @Default @CEPPseudoClockConfig
@EntryPoint("SprinklerDetectionStream") WorkingMemoryEntryPoint
sprinklerDetectionStream) {
-// assertNotNull(cepSession);
-// assertTrue(cepSession.getId() >= 0);
-// assertNotNull(fireDetectionStream);
-// assertNotNull(sprinklerDetectionStream);
-// assertNotSame(fireDetectionStream, sprinklerDetectionStream);
-//
-// FireAlarm fireAlarm = new FireAlarm();
-// assertTrue(!fireAlarm.isActivated());
-// cepSession.setGlobal("fireAlarm", fireAlarm);
-// SessionPseudoClock clock = cepSession.getSessionClock();
-// fireDetectionStream.insert(new FireDetected());
-// clock.advanceTime(9, TimeUnit.SECONDS);
-//
-// cepSession.fireAllRules();
-//
-// FireAlarm afireAlarm = (FireAlarm)
cepSession.getGlobal("fireAlarm");
-// assertTrue(!afireAlarm.isActivated());
-//
-// clock.advanceTime(2, TimeUnit.SECONDS);
-//
-// cepSession.fireAllRules();
-//
-// FireAlarm bfireAlarm = (FireAlarm)
cepSession.getGlobal("fireAlarm");
-// assertTrue(bfireAlarm.isActivated());
-//
-// }
}
Added:
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateBean.java
===================================================================
---
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateBean.java
(rev 0)
+++
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateBean.java 2010-04-27
04:15:32 UTC (rev 12652)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.drools.test.delegate;
+
+public class DelegateBean
+{
+ private boolean touched;
+
+ public boolean isTouched()
+ {
+ return touched;
+ }
+
+ public void setTouched(boolean touched)
+ {
+ this.touched = touched;
+ }
+
+
+}
Added:
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
(rev 0)
+++
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTest.java 2010-04-27
04:15:32 UTC (rev 12652)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.drools.test.delegate;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertNotSame;
+
+import javax.enterprise.inject.Default;
+
+import org.drools.runtime.StatefulKnowledgeSession;
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.drools.KnowledgeBaseProducer;
+import org.jboss.seam.drools.qualifiers.config.DefaultConfig;
+import org.jboss.seam.drools.test.DroolsModuleFilter;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.weld.extensions.resources.ResourceProvider;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class DelegateTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ String pkgPath =
DelegateTest.class.getPackage().getName().replaceAll("\\.", "/");
+ JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ .addPackages(true, new DroolsModuleFilter("delegate"),
KnowledgeBaseProducer.class.getPackage())
+ .addPackages(true, ResourceProvider.class.getPackage())
+ .addClass(DelegateBean.class)
+ .addResource(pkgPath + "/delegatetest.drl",
ArchivePaths.create("delegatetest.drl"))
+ //.addResource(pkgPath + "/kbuilderconfig.properties",
ArchivePaths.create("kbuilderconfig.properties"))
+ //.addResource(pkgPath + "/kbaseconfig.properties",
ArchivePaths.create("kbaseconfig.properties"))
+ .addManifestResource(pkgPath + "/DelegateTest-beans.xml",
ArchivePaths.create("beans.xml"));
+ //System.out.println(archive.toString(Formatters.VERBOSE));
+ return archive;
+ }
+
+ @Test
+ public void testDelegate(DelegateBean delegateBean, @Default @DefaultConfig
StatefulKnowledgeSession ksession) {
+ assertNotNull(ksession);
+ ksession.fireAllRules();
+ assertTrue(delegateBean.isTouched());
+ }
+}
Added:
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTestQualifier.java
===================================================================
---
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTestQualifier.java
(rev 0)
+++
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTestQualifier.java 2010-04-27
04:15:32 UTC (rev 12652)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.drools.test.delegate;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@Qualifier
+@Target( { TYPE, METHOD, FIELD, PARAMETER })
+@Documented
+@Retention(RUNTIME)
+public @interface DelegateTestQualifier
+{
+
+}
Modified:
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/query/QueryTest.java
===================================================================
---
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/query/QueryTest.java 2010-04-26
22:29:50 UTC (rev 12651)
+++
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/query/QueryTest.java 2010-04-27
04:15:32 UTC (rev 12652)
@@ -64,26 +64,24 @@
return archive;
}
+ // cannot yet move to test method arguments (ARQ-120)
+ @Inject @Default @DefaultConfig @Query("number of adults") QueryResults
adultsQuery;
+ @Inject @Default @DefaultConfig @Query("number of minors") QueryResults
minorsQuery;
+ @Inject @Default @DefaultConfig ExecutionResults executionResults;
+
@Test
- public void dummy() {
- assertTrue(true);
+ public void testQuery() {
+ assertNotNull(adultsQuery);
+ assertNotNull(minorsQuery);
+ assertNotSame(adultsQuery, minorsQuery);
+
+ assertTrue(adultsQuery.size() == 7);
+ assertTrue(minorsQuery.size() == 7);
+
+ assertNotNull(executionResults);
+ assertTrue(((QueryResults) executionResults.getValue("number of
adults")).size() == 7);
+ assertTrue(((QueryResults) executionResults.getValue("number of
minors")).size() == 7);
+
+
}
-
-// @Test
-// public void testQuery(@Default @DefaultConfig @Query("number of adults")
QueryResults adultsQuery,
-// @Default @DefaultConfig @Query("number of minors") QueryResults
minorsQuery,
-// @Default @DefaultConfig ExecutionResults executionResults) {
-// assertNotNull(adultsQuery);
-// assertNotNull(minorsQuery);
-// assertNotSame(adultsQuery, minorsQuery);
-//
-// assertTrue(adultsQuery.size() == 7);
-// assertTrue(minorsQuery.size() == 7);
-//
-// assertNotNull(executionResults);
-// assertTrue(((QueryResults) executionResults.getValue("number of
adults")).size() == 7);
-// assertTrue(((QueryResults) executionResults.getValue("number of
minors")).size() == 7);
-//
-//
-// }
}
Added:
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
(rev 0)
+++
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)
@@ -0,0 +1,39 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<beans
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:d="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
+ xmlns:test="urn:java:org.jboss.seam.drools.test.delegate">
+
+ <d:DefaultRuleResources>
+ <s:specializes/>
+ <d:resources>
+ <s:value>classpath;delegatetest.drl;DRL</s:value>
+ </d:resources>
+ </d:DefaultRuleResources>
+
+ <test:DelegateBean>
+ <s:overrides/>
+ <s:Named>someBean</s:Named>
+ </test:DelegateBean>
+
+</beans>
Added:
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/delegate/delegatetest.drl
===================================================================
---
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/delegate/delegatetest.drl
(rev 0)
+++
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/delegate/delegatetest.drl 2010-04-27
04:15:32 UTC (rev 12652)
@@ -0,0 +1,10 @@
+package org.jboss.seam.drools.test.delegate
+
+import org.jboss.seam.drools.test.delegate.DelegateBean;
+
+global DelegateBean testDelegate
+
+rule "dummy"
+then
+ testDelegate.setTouched(true);
+end
\ No newline at end of file