AppFuseEclipse |
|
Your trail: |
Difference between
version 51
and
version 50:
At line 60 changed 1 line. |
After you have successfully done so, in Eclipse open a test you'd like to run (i.e. UserDaoTest) and go to Run → Debug As → JUnit Test. If this doesn't work, I'd suggest just using the command line - i.e. ant test-dao -Dtestcase=UserDAO. I've spent countless hours trying to get AppFuse tests to run in Eclipse and whenever I figure out a formula to make things work - it quits working the next time. Running tests from the command line always works. ;-) |
After you have successfully done so, in Eclipse open a test you'd like to run (i.e. UserDaoTest) and go to Run → Debug As → JUnit Test. Note that you may have to run the "db-load" target before you run your tests every so often. I did have the following method in the Base*TestCase class for each layer, but this caused DBUnit to reload the database before every test in a Test class. Removing it reduces the execution time of "test-all" by more than 30 seconds. |
At line 62 added 16 lines. |
[{Java2HtmlPlugin |
|
protected void setUp() throws Exception { |
DataSource ds = (DataSource) ctx.getBean("dataSource"); |
IDatabaseConnection conn = new DatabaseConnection(ds.getConnection()); |
IDataSet dataSet = |
new XmlDataSet(new FileInputStream("metadata/sql/sample-data.xml")); |
// clear table and insert only sample data |
DatabaseOperation.CLEAN_INSERT.execute(conn, dataSet); |
conn.close(); |
} |
}] |
|
If the instructions above don't work for running JUnit tests in Eclipse, I suggest just using the command line - i.e. ant test-dao -Dtestcase=UserDAO. I've spent countless hours trying to get AppFuse tests to run in Eclipse and whenever I figure out a formula to make things work - it quits working the next time. Running tests from the command line ''always'' works. ;-) |
|
|
Back to AppFuseEclipse,
or to the Page History.
|