<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1839111674258075739</id><updated>2011-11-27T16:43:28.545-08:00</updated><category term='junit'/><category term='hibernate'/><category term='Struts'/><category term='iText'/><category term='dbunit'/><category term='open source'/><category term='unit test'/><category term='Log4j'/><category term='java'/><category term='Maven'/><category term='Ant'/><category term='spring'/><title type='text'>Ramraj's Green Java Technology Blog</title><subtitle type='html'>Java resource, tutorials and best practices</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://greenjavatech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1839111674258075739/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://greenjavatech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ramraj</name><uri>http://www.blogger.com/profile/04594540856212933810</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://bp1.blogger.com/_9Pv4JgsT0HQ/SHw4NpcRRLI/AAAAAAAAAB0/LEIPFwexGFE/S220/2.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1839111674258075739.post-3758409195586941810</id><published>2008-09-12T06:51:00.000-07:00</published><updated>2008-09-12T23:03:41.072-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='iText'/><title type='text'>iText PDF Generator</title><content type='html'>Here I am going to explain how to creat a simple pdf file with java pdf library called iText. There are other well known competitors like Apache cocoon and PDFBox frameworks which are good and mature. But I choose to use iText, because of its popularity and support, infact, it is very good for pdf generation from scratch.&lt;br /&gt;&lt;br /&gt;iText generates pdf dynamically, ideally this framework is very useful for developer who wants to enhance thier web application developement with dyanamic pdf generation based on user inputs on the fly.&lt;br /&gt;&lt;br /&gt;Using iText, you can able to generate, maniulate and parse the pdf file. And, please remember, this is not an end user tool to view pdf files. To use this framework you should have installed Acrobat PDF software from Adobe Systems.&lt;br /&gt;&lt;br /&gt;Enough said, we will get into the code and make our hands diryt. okay.&lt;br /&gt;Download latest iText jar file &lt;a href="http://prdownloads.sourceforge.net/itext/iText-2.1.3.jar"&gt;Click here&lt;/a&gt; , and put it in your project's classpath&lt;br /&gt;First, you need to create document object&lt;br /&gt;&lt;blockquote&gt;com.lowagie.text.Document document = new com.lowagie.text.Document();&lt;/blockquote&gt;Second, create PDFWriter object by passing document, and give pdf file name you want to create &lt;blockquote&gt;com.lowagie.text.pdf.PdfWriter.PdfWriter.getInstance(document, new&lt;br /&gt;FileOutputStream("HelloWorld.pdf"));&lt;br /&gt;&lt;/blockquote&gt;Third, open the document to start writing&lt;br /&gt;&lt;blockquote&gt;document.open();&lt;br /&gt;&lt;/blockquote&gt;Fourth, add a paragraph to your document&lt;br /&gt;&lt;blockquote&gt;document.add(new Paragraph("Hello Ramraj...."));&lt;br /&gt;&lt;/blockquote&gt;Finally, you need to close the document&lt;br /&gt;&lt;blockquote&gt;document.close();&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;p&gt;Probably, some time later, I will attach the full source code :-) &lt;/p&gt;&lt;p&gt;Enough staying at office, I gotta go home, bye&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1839111674258075739-3758409195586941810?l=greenjavatech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://greenjavatech.blogspot.com/feeds/3758409195586941810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1839111674258075739&amp;postID=3758409195586941810' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1839111674258075739/posts/default/3758409195586941810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1839111674258075739/posts/default/3758409195586941810'/><link rel='alternate' type='text/html' href='http://greenjavatech.blogspot.com/2008/09/itext-pdf-generator.html' title='iText PDF Generator'/><author><name>Ramraj</name><uri>http://www.blogger.com/profile/04594540856212933810</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://bp1.blogger.com/_9Pv4JgsT0HQ/SHw4NpcRRLI/AAAAAAAAAB0/LEIPFwexGFE/S220/2.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1839111674258075739.post-3102702887919784158</id><published>2008-08-07T04:12:00.000-07:00</published><updated>2008-08-11T02:48:33.716-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><category scheme='http://www.blogger.com/atom/ns#' term='dbunit'/><category scheme='http://www.blogger.com/atom/ns#' term='junit'/><category scheme='http://www.blogger.com/atom/ns#' term='unit test'/><title type='text'>Junit friends DBUnit and Spring test framework :-)</title><content type='html'>Now-a-days TDD(Test driven development) is defacto standard in software developemnt. Dont know what is TDD? It is all about writing unit test cases for your business logic or for your data access layer a.k.a DAO layer before you actually implement your complete logic. I have been writing unit test cases for more than 2 and half years, and generally I use Junit framework. Of course, JUnit is a standard across java space for unit testing.&lt;br /&gt;&lt;br /&gt;Junit is simple to implement for service/business logic. when it comes to database integration testing you may need to insert lots of data in database for to initialize your test data. For this to acheive you need to write lot of database insert scripts and run in setup method or you may prefer writing text/xml file with the required data and read the files using some other api and then insert the data in database. All these things you have to manage yourself, and may requires you write lots of bipolarate jdbc code, lots of complexity is involved when you use junit for integration tesitng.&lt;br /&gt;&lt;br /&gt;Here comes spring test framework and DBUnit to simplify Junit and adds few usefull features which will ease the integration testing. These two frameworks are superset of Junit means they extend junit and adds additional features.&lt;br /&gt;&lt;br /&gt;DBUnit features&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Manages the insert/delete data from database (you just need to provide data set xml file)&lt;/li&gt;&lt;li&gt;DBUnit helps you preparing data-set file, so no manual work :-)&lt;/li&gt;&lt;li&gt;Exports tables in order based on foreign key constraint&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Spring test framework features&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Provides dependency injection in your unit test class( you just need to load your spring config files)&lt;/li&gt;&lt;li&gt;Automatic transactions applied to all the test* methods, so need to write transaction code.&lt;/li&gt;&lt;li&gt;Automatic rollback after unit test execution completed.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Your comments are appreciated. Have a good day :-) :-)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1839111674258075739-3102702887919784158?l=greenjavatech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://greenjavatech.blogspot.com/feeds/3102702887919784158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1839111674258075739&amp;postID=3102702887919784158' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1839111674258075739/posts/default/3102702887919784158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1839111674258075739/posts/default/3102702887919784158'/><link rel='alternate' type='text/html' href='http://greenjavatech.blogspot.com/2008/08/junit-friends-dbunit-and-spring-test.html' title='Junit friends DBUnit and Spring test framework :-)'/><author><name>Ramraj</name><uri>http://www.blogger.com/profile/04594540856212933810</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://bp1.blogger.com/_9Pv4JgsT0HQ/SHw4NpcRRLI/AAAAAAAAAB0/LEIPFwexGFE/S220/2.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1839111674258075739.post-6949000682910461486</id><published>2008-07-14T10:25:00.000-07:00</published><updated>2008-08-11T02:57:15.548-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='hibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='Ant'/><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><category scheme='http://www.blogger.com/atom/ns#' term='Log4j'/><category scheme='http://www.blogger.com/atom/ns#' term='Struts'/><title type='text'>My First Blog</title><content type='html'>Hi Everybody, this is my first blog I ever created. I have planed long back to put up a blog about java technology, but couldnt find time to do so, finally wow I created a blog.&lt;br /&gt;&lt;br /&gt;I am very much passionate about java technology and open source frameworks. Here in this blog, I am going to write about java opensoure frameworks like spring, struts, spring mvc, hibernate, ant, maven, log4j, JPA and many other frameworks. So, keep checking this blog regularly :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1839111674258075739-6949000682910461486?l=greenjavatech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://greenjavatech.blogspot.com/feeds/6949000682910461486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1839111674258075739&amp;postID=6949000682910461486' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1839111674258075739/posts/default/6949000682910461486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1839111674258075739/posts/default/6949000682910461486'/><link rel='alternate' type='text/html' href='http://greenjavatech.blogspot.com/2008/07/my-first-blog.html' title='My First Blog'/><author><name>Ramraj</name><uri>http://www.blogger.com/profile/04594540856212933810</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://bp1.blogger.com/_9Pv4JgsT0HQ/SHw4NpcRRLI/AAAAAAAAAB0/LEIPFwexGFE/S220/2.JPG'/></author><thr:total>0</thr:total></entry></feed>
