This is a small patch that fixes something I noticed by chance.
When the JUnit4TestAdapter() is used in a #suite() method of a JUnit 4 unit
test, it must be passed the name of the current class. I don't know of an
easy programmatic way to do this, and right now the class name is just
hardcoded. This can easily lead to cut-and-paste errors when new JUnit4
tests are developed that must be compatible with the existing JUnit 3 stuff.
I also don't know of an easy/robust programmatic way to ensure this doesn't
happen in the future (I just did a little find/grep stuff to get these), but
here's a patch to at least get the existing unit tests to run that are
broken (in that they aren't being run).
This patch is against revision [EMAIL PROTECTED], and all unit tests pass.
--
Adam Monsen
Index: test/org/mifos/application/accounts/financial/util/helpers/TestFinancialActionConstants.java
===================================================================
--- test/org/mifos/application/accounts/financial/util/helpers/TestFinancialActionConstants.java (revision 12194)
+++ test/org/mifos/application/accounts/financial/util/helpers/TestFinancialActionConstants.java (working copy)
@@ -6,7 +6,6 @@
import org.hibernate.Query;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.mifos.application.accounts.business.AddAccountActionTest;
import org.mifos.framework.hibernate.helper.HibernateUtil;
import org.mifos.framework.util.helpers.DatabaseSetup;
@@ -37,7 +36,7 @@
}
public static junit.framework.Test suite() {
- return new JUnit4TestAdapter(AddAccountActionTest.class);
+ return new JUnit4TestAdapter(TestFinancialActionConstants.class);
}
}
Index: test/org/mifos/framework/util/helpers/StringUtilsTest.java
===================================================================
--- test/org/mifos/framework/util/helpers/StringUtilsTest.java (revision 12194)
+++ test/org/mifos/framework/util/helpers/StringUtilsTest.java (working copy)
@@ -29,7 +29,7 @@
public class StringUtilsTest {
public static junit.framework.Test suite() {
- return new JUnit4TestAdapter(MoneyTest.class);
+ return new JUnit4TestAdapter(StringUtilsTest.class);
}
@Test
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/