Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyDaoTest extends DatabaseTestCase
- {
- private XmlDataSet loadedDataSet;
- MyDao dao;
- protected void setUp() throws Exception
- {
- dao = new CourierUploadQueueMilestonedDaoImpl();
- super.setUp();
- }
- @Override
- protected IDatabaseConnection getConnection() throws Exception
- {
- Class driverClass = Class.forName("com.mysql.jdbc.Driver");
- Connection jdbcConnection = DriverManager.getConnection("jdbc:mysql://localhost/test", "root", "root");
- return new DatabaseConnection(jdbcConnection);
- }
- @Override
- protected IDataSet getDataSet() throws Exception
- {
- FileInputStream in = new FileInputStream("dataset.xml");
- loadedDataSet = new XmlDataSet(in);
- return loadedDataSet;
- }
- protected DatabaseOperation getSetUpOperation() throws Exception
- {
- return DatabaseOperation.CLEAN_INSERT;
- }
- protected DatabaseOperation getTearDownOperation() throws Exception
- {
- return DatabaseOperation.NONE;
- }
- public void testCheckLoginDataLoaded() throws Exception
- {
- assertNotNull(loadedDataSet);
- int rowCount = loadedDataSet.getTable("person").getRowCount();
- assertEquals(2, rowCount);
- }
- }
- <?xml version='1.0' encoding='UTF-8'?>
- <dataset>
- <person id="25" name'"Saurabh" phone="61458972564"/>
- <person id="21" name'"Saurabh" phone="61458972564"/>
- </dataset>
- Method threw 'org.springframework.beans.factory.BeanDefinitionStoreException' exception.
- Unexpected exception parsing XML document from class path resource [applicationContext.xml]
- detailMessage : org/springframework/core/type/AnnotatedTypeMetadata
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement