[seam-commits] Seam SVN: r12480 - in modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test: ksession and 1 other directory.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue Apr 13 16:08:11 EDT 2010
Author: tsurdilovic
Date: 2010-04-13 16:08:10 -0400 (Tue, 13 Apr 2010)
New Revision: 12480
Added:
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestFilter.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestFiler.java
Modified:
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java
Log:
Added filters to test classes so that classes from other test packages do not get picked up.
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java 2010-04-13 19:24:35 UTC (rev 12479)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java 2010-04-13 20:08:10 UTC (rev 12480)
@@ -27,7 +27,7 @@
{
String pkgPath = KBaseTest.class.getPackage().getName().replaceAll("\\.", "/");
JavaArchive archive = Archives.create("test.jar", JavaArchive.class)
- .addPackages(true, KnowledgeBaseProducer.class.getPackage())
+ .addPackages(true, new KBaseTestFilter(), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(KBaseTestQualifier.class)
.addClass(MyKnowledgeBaseEventListener.class)
Added: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestFilter.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestFilter.java (rev 0)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTestFilter.java 2010-04-13 20:08:10 UTC (rev 12480)
@@ -0,0 +1,19 @@
+package org.jboss.seam.drools.test.kbase;
+
+import org.jboss.shrinkwrap.api.Filter;
+
+public class KBaseTestFilter implements Filter<Class<?>>
+{
+
+ public boolean include(Class<?> clazz)
+ {
+ // exclude classes in all other test packages except your own
+ if(clazz.getPackage().getName().startsWith("org.jboss.seam.drools.test")
+ && !clazz.getPackage().getName().equals(KBaseTestFilter.class.getPackage().getName())) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+}
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java 2010-04-13 19:24:35 UTC (rev 12479)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java 2010-04-13 20:08:10 UTC (rev 12480)
@@ -26,7 +26,7 @@
{
String pkgPath = KSessionTest.class.getPackage().getName().replaceAll("\\.", "/");
JavaArchive archive = Archives.create("test.jar", JavaArchive.class)
- .addPackages(true, KnowledgeBaseProducer.class.getPackage())
+ .addPackages(true, new KSessionTestFiler(), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(KSessionTestQualifier.class)
.addResource(pkgPath + "/ksessiontest.drl", ArchivePaths.create("ksessiontest.drl"))
Added: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestFiler.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestFiler.java (rev 0)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTestFiler.java 2010-04-13 20:08:10 UTC (rev 12480)
@@ -0,0 +1,19 @@
+package org.jboss.seam.drools.test.ksession;
+
+import org.jboss.shrinkwrap.api.Filter;
+
+public class KSessionTestFiler implements Filter<Class<?>>
+{
+
+ public boolean include(Class<?> clazz)
+ {
+ // exclude classes in all other test packages except your own
+ if(clazz.getPackage().getName().startsWith("org.jboss.seam.drools.test")
+ && !clazz.getPackage().getName().equals(KSessionTestFiler.class.getPackage().getName())) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+}
More information about the seam-commits
mailing list