[seam-commits] Seam SVN: r12376 - in modules/drools/trunk/core: src/main/java/org/jboss/seam/drools and 2 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Fri Apr 2 23:32:15 EDT 2010
Author: dan.j.allen
Date: 2010-04-02 23:32:15 -0400 (Fri, 02 Apr 2010)
New Revision: 12376
Added:
modules/drools/trunk/core/src/test/resources/org/jboss/seam/drools/kbase/KBaseTest-beans.xml
Modified:
modules/drools/trunk/core/pom.xml
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java
modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/kbase/KBaseTest.java
Log:
add classes to support ResourceProvider
temporarily depend on weld-extensions 1.0.0-SNAPSHOT
reintroduce XML bean config for KBaseTest
Modified: modules/drools/trunk/core/pom.xml
===================================================================
--- modules/drools/trunk/core/pom.xml 2010-04-03 03:17:56 UTC (rev 12375)
+++ modules/drools/trunk/core/pom.xml 2010-04-03 03:32:15 UTC (rev 12376)
@@ -78,6 +78,7 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
Modified: modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java
===================================================================
--- modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java 2010-04-03 03:17:56 UTC (rev 12375)
+++ modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java 2010-04-03 03:32:15 UTC (rev 12376)
@@ -3,8 +3,6 @@
import java.io.InputStream;
import java.util.Properties;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.context.SessionScoped;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
Modified: modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/kbase/KBaseTest.java
===================================================================
--- modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/kbase/KBaseTest.java 2010-04-03 03:17:56 UTC (rev 12375)
+++ modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/kbase/KBaseTest.java 2010-04-03 03:32:15 UTC (rev 12376)
@@ -3,7 +3,6 @@
import javax.enterprise.inject.Any;
import javax.enterprise.inject.Instance;
import static org.junit.Assert.assertNotNull;
-import static org.jboss.shrinkwrap.api.formatter.Formatters.VERBOSE;
import javax.enterprise.util.AnnotationLiteral;
import javax.inject.Inject;
@@ -31,18 +30,15 @@
public static JavaArchive createTestArchive()
{
String pkgPath = KBaseTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = Archives.create("test.jar", JavaArchive.class)
+ JavaArchive archive = Archives.create("test.jar", JavaArchive.class)
.addPackages(true, KnowledgeBaseProducer.class.getPackage())
- .addClass(ResourceProvider.class)
+ .addPackages(true, ResourceProvider.class.getPackage())
.addResource(pkgPath + "/kbasetest.drl", ArchivePaths.create("kbasetest.drl"))
- .addResource(pkgPath + "/kbuilderconfig.properties", ArchivePaths.create("kbuilderconfig.properties"))
+ .addResource(pkgPath + "/kbuilderconfig.properties", ArchivePaths.create("kbuilderconfig.properties"))
.addResource(pkgPath + "/kbaseconfig.properties", ArchivePaths.create("kbaseconfig.properties"))
- .addManifestResource("META-INF/beans.xml", ArchivePaths.create("beans.xml"));
- // the XML bean config module doesn't pick up the beans.xml unless it's located at src/test/resources/META-INF/beans.xml
- //.addManifestResource(pkgPath + "/KBaseTest-beans.xml", ArchivePaths.create("beans.xml"));
- System.out.println(archive.toString(VERBOSE));
-
- return archive;
+ .addManifestResource(pkgPath + "/KBaseTest-beans.xml", ArchivePaths.create("beans.xml"));
+ System.out.println(archive.toString(Formatters.VERBOSE));
+ return archive;
}
@Inject @Any Instance<KnowledgeBaseConfig> kbaseConfigResolver;
@@ -63,8 +59,6 @@
assertNotNull(kbase);
}
-
-
static class KBaseConfigBinding extends AnnotationLiteral<KBaseConfig> implements KBaseConfig
{
private String value = null;
@@ -78,4 +72,3 @@
}
}
}
-
Added: modules/drools/trunk/core/src/test/resources/org/jboss/seam/drools/kbase/KBaseTest-beans.xml
===================================================================
--- modules/drools/trunk/core/src/test/resources/org/jboss/seam/drools/kbase/KBaseTest-beans.xml (rev 0)
+++ modules/drools/trunk/core/src/test/resources/org/jboss/seam/drools/kbase/KBaseTest-beans.xml 2010-04-03 03:32:15 UTC (rev 12376)
@@ -0,0 +1,32 @@
+<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:drools="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config:org.jboss.seam.drools.qualifier">
+
+ <drools:KnowledgeBaseConfig>
+ <s:overrides/>
+ <drools:KBaseConfig value="kbaseconfig1"/>
+ <drools:knowledgeBuilderConfig>kbuilderconfig.properties</drools:knowledgeBuilderConfig>
+ <drools:knowledgeBaseConfig>kbaseconfig.properties</drools:knowledgeBaseConfig>
+ <drools:ruleResources>
+ <s:value>classpath:kbasetest.drl:DRL</s:value>
+ </drools:ruleResources>
+ <drools:eventListeners>
+ <s:value>org.drools.event.knowledgebase.DefaultKnowledgeBaseEventListener</s:value>
+ </drools:eventListeners>
+ </drools:KnowledgeBaseConfig>
+
+ <drools:KnowledgeBaseProducer>
+ <s:specializes/>
+ <drools:produceKBase>
+ <drools:KBase value="kbase1"/>
+ <s:parameters>
+ <drools:KnowledgeBaseConfig>
+ <s:Inject/>
+ <drools:KBaseConfig value="kbaseconfig1"/>
+ </drools:KnowledgeBaseConfig>
+ </s:parameters>
+ </drools:produceKBase>
+ </drools:KnowledgeBaseProducer>
+
+</beans>
More information about the seam-commits
mailing list