At line 169 changed 1 line. |
In order to test that all of this works, you need to create a ''WeblogDaoTest.java'' class. Create this class in ''test/dao/**/dao'' and fill it with the following code. |
In order to test that all of this works, you need to create some test classes, add some sample data, develop some DAO interfaces, and create hibernate DAO classes. |
At line 173 added 2 lines. |
Let's start with ''WeblogDaoTest.java'' class. Create this class in ''test/dao/**/dao'' and fill it with the following code. |
|
At line 264 changed 1 line. |
This test relies on some sample data, so add the following XML to __metadata/sql/sample-data.xml__. |
All of these tests relies on some sample data, so add the following XML to __metadata/sql/sample-data.xml__. |
At line 269 changed 33 lines. |
<column>weblog_id</column> |
<column>blog_title</column> |
<column>date_created</column> |
<column>username</column> |
<row> |
<value>1</value> |
<value><![CDATA[Sponge Bob is Cool]]></value> |
<value>2004-03-31</value> |
<value>tomcat</value> |
</row> |
<row> |
<value>2</value> |
<value><![CDATA[Java Development = Fun]]></value> |
<value>2005-01-05</value> |
<value>mraible</value> |
</row> |
</table> |
<table name='weblog_user'> |
<column>weblog_id</column> |
<column>username</column> |
<row> |
<value>1</value> |
<value>tomcat</value> |
</row> |
<row> |
<value>1</value> |
<value>mraible</value> |
</row> |
<row> |
<value>2</value> |
<value>mraible</value> |
</row> |
</table> |
<column>weblog_id</column> |
<column>blog_title</column> |
<column>date_created</column> |
<column>username</column> |
<row> |
<value>1</value> |
<value><![CDATA[Sponge Bob is Cool]]></value> |
<value>2004-03-31</value> |
<value>tomcat</value> |
</row> |
<row> |
<value>2</value> |
<value><![CDATA[Java Development = Fun]]></value> |
<value>2005-01-05</value> |
<value>mraible</value> |
</row> |
</table> |
<table name='weblog_user'> |
<column>weblog_id</column> |
<column>username</column> |
<row> |
<value>1</value> |
<value>tomcat</value> |
</row> |
<row> |
<value>1</value> |
<value>mraible</value> |
</row> |
<row> |
<value>2</value> |
<value>mraible</value> |
</row> |
</table> |
<table name='category'> |
<column>category_id</column> |
<column>category_name</column> |
<column>category_description</column> |
<row> |
<value>1</value> |
<value><![CDATA[Struts v. Spring MVC]]></value> |
<value><![CDATA[Comparisons between two interpretations of the MVC Design Pattern]]></value> |
</row> |
<row> |
<value>2</value> |
<value><![CDATA[Cycling Notes]]></value> |
<value><![CDATA[All about cycling in the US.]]></value> |
</row> |
<row> |
<value>3</value> |
<value><![CDATA[Cyclocross]]></value> |
<value><![CDATA[Bog Trotters Unite!]]></value> |
</row> |
</table> |
<table name='entry'> |
<column>entry_id</column> |
<column>entry_text</column> |
<column>time_created</column> |
<column>weblog_id</column> |
<column>category_id</column> |
<row> |
<value>1</value> |
<value><![CDATA[Testing]]></value> |
<value>2005-04-11</value> |
<value>1</value> |
<value>1</value> |
</row> |
<row> |
<value>2</value> |
<value><![CDATA[Test Value]]></value> |
<value>2005-04-12</value> |
<value>1</value> |
<value>1</value> |
</row> |
<row> |
<value>3</value> |
<value><![CDATA[Test Value 3]]></value> |
<value>2005-04-12</value> |
<value>2</value> |
<value>3</value> |
</row> |
</table> |