[jboss-cvs] jboss-portal/cms/src/main/org/jboss/portal/test/cms/commands ...
Julien Viet
julien at jboss.com
Mon Jul 24 10:19:28 EDT 2006
User: julien
Date: 06/07/24 10:19:28
Modified: cms/src/main/org/jboss/portal/test/cms/commands
TestFileCommands.java TestFolderCommands.java
Log:
added DatabaseTestsuite that helps to create a testsuite for a specific database configuration
Revision Changes Path
1.15 +3 -23 jboss-portal/cms/src/main/org/jboss/portal/test/cms/commands/TestFileCommands.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TestFileCommands.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/cms/src/main/org/jboss/portal/test/cms/commands/TestFileCommands.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- TestFileCommands.java 31 May 2006 08:29:19 -0000 1.14
+++ TestFileCommands.java 24 Jul 2006 14:19:28 -0000 1.15
@@ -56,6 +56,7 @@
import org.jboss.portal.test.cms.AbstractCMSTestCase;
import org.jboss.portal.test.cms.mock.RuntimeExceptionCommand;
import org.jboss.portal.test.framework.embedded.DataSourceSupport;
+import org.jboss.portal.test.framework.junit.DatabaseTestSuite;
import org.w3c.dom.Document;
/**
@@ -86,31 +87,10 @@
public static TestSuite suite() throws Exception
{
-
- TestSuite suite = new TestSuite();
URL configsURL = Thread.currentThread().getContextClassLoader().getResource("datasources.xml");
DataSourceSupport.Config[] configs = DataSourceSupport.Config.fromXML(configsURL);
- for (int i = 0; i < configs.length; i++)
- {
- DataSourceSupport.Config config = configs[i];
-
- //
- Method[] methods = TestFileCommands.class.getMethods();
- for (int j = 0; j < methods.length; j++)
- {
- Method method = methods[j];
- int modifiers = method.getModifiers();
- if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers) && !Modifier.isStatic(modifiers)
- && method.getName().startsWith("test"))
- {
- TestFileCommands testCase = new TestFileCommands(config);
- testCase.setName(method.getName());
- suite.addTest(testCase);
- }
- }
- }
-
- //
+ DatabaseTestSuite suite = new DatabaseTestSuite(configs);
+ suite.addTestCase(TestFileCommands.class);
return suite;
}
1.9 +5 -25 jboss-portal/cms/src/main/org/jboss/portal/test/cms/commands/TestFolderCommands.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TestFolderCommands.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/cms/src/main/org/jboss/portal/test/cms/commands/TestFolderCommands.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- TestFolderCommands.java 26 May 2006 20:12:06 -0000 1.8
+++ TestFolderCommands.java 24 Jul 2006 14:19:28 -0000 1.9
@@ -48,6 +48,7 @@
import org.jboss.portal.common.util.XML;
import org.jboss.portal.test.cms.AbstractCMSTestCase;
import org.jboss.portal.test.framework.embedded.DataSourceSupport;
+import org.jboss.portal.test.framework.junit.DatabaseTestSuite;
/**
* @author <a href="mailto:roy at jboss.org">Roy Russo</a>
@@ -97,31 +98,10 @@
public static TestSuite suite() throws Exception
{
-
- TestSuite suite = new TestSuite();
URL configsURL = Thread.currentThread().getContextClassLoader().getResource("datasources.xml");
DataSourceSupport.Config[] configs = DataSourceSupport.Config.fromXML(configsURL);
- for (int i = 0; i < configs.length; i++)
- {
- DataSourceSupport.Config config = configs[i];
-
- //
- Method[] methods = TestFolderCommands.class.getMethods();
- for (int j = 0; j < methods.length; j++)
- {
- Method method = methods[j];
- int modifiers = method.getModifiers();
- if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers) && !Modifier.isStatic(modifiers)
- && method.getName().startsWith("test"))
- {
- TestFolderCommands testCase = new TestFolderCommands(config);
- testCase.setName(method.getName());
- suite.addTest(testCase);
- }
- }
- }
-
- //
+ DatabaseTestSuite suite = new DatabaseTestSuite(configs);
+ suite.addTestCase(TestFolderCommands.class);
return suite;
}
More information about the jboss-cvs-commits
mailing list