<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CkAGQ3syfSp7ImA9WhdREU0.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160</id><updated>2011-07-31T01:25:22.595-07:00</updated><category term="EJB criticism" /><category term="Best Programming Language" /><category term="extreme programming tutorial" /><category term="web development" /><category term="pdf bursting" /><category term="document distribution server" /><category term="ftps" /><category term="distribute documents files ftp ftps sftp tftp upload webdav windows share unix samba" /><category term="jaxb2.0" /><category term="burst" /><category term="wxWidgets tutorial" /><category term="empiredb jaxb" /><category term="feedback" /><category term="autoit" /><category term="Ubuntu 10.04 LTS" /><category term="test driven development tutorial" /><category term="pdf splitting" /><category term="apache ant tutorial" /><category term="report splitting" /><category term="dove" /><category term="email" /><category term="Sun JDK" /><category term="Innsbruck ski" /><category term="java xml binding" /><category term="getters setters java" /><category term="dependency hell" /><category term="java enterprise development" /><category term="VC++ debugging memory leaks" /><category term="xml binding tutorial" /><category term="sftp" /><category term="jmock tutorial" /><category term="quartz java scheduling" /><category term="WebDAV" /><category term="javabeans mess" /><category term="Commons BeanUtils" /><category term="CIFS" /><category term="java dependencies" /><category term="documentburster" /><category term="maven2 dependency management" /><category term="java portability" /><category term="junit tutorial" /><category term="Visual Leak Detector" /><category term="Eclipse" /><category term="GUI automation" /><category term="automate functional testing" /><category term="j2ee portability" /><category term="report bursting" /><category term="jaxb2 tutorial" /><category term="ftp" /><category term="OpenJDK" /><title>Java Hobby</title><subtitle type="html">Java, C++, Test Driven Development and much more ...</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://java-hobby.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/JavaHobby" /><feedburner:info uri="javahobby" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CkQCQnYyeCp7ImA9WxFUE0s.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-5298299558322071981</id><published>2010-06-23T23:03:00.000-07:00</published><updated>2010-06-23T23:19:23.890-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-23T23:19:23.890-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="distribute documents files ftp ftps sftp tftp upload webdav windows share unix samba" /><title>Dove project - new release</title><content type="html">Yesterday I released a new version of &lt;a href="http://doveman.sourceforge.net/"&gt;Dove which is a java based Document Distribution System&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Following are the new features since the previous release:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Added support for following new protocols&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;  FTPs&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;  SFTP&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;  TFTP&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;  Windows Share and UNIX Samba - CIFS&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;  WebDAV&lt;/li&gt;&lt;/ul&gt;         2. Email Templates and Variables support&lt;br /&gt;         3. User Guide Document&lt;br /&gt;         4. Sample job files provided for all the. The files can be found under the samples folder.&lt;br /&gt;         5. UNIX/Linux shell scripts.&lt;br /&gt;&lt;br /&gt;Please feel free to &lt;a href="http://sourceforge.net/projects/doveman/"&gt;download and use Dove&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;See you next time!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-5298299558322071981?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=ITTQL1VhU6U:J6EYDMXvKC0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/ITTQL1VhU6U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/5298299558322071981/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=5298299558322071981" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5298299558322071981?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5298299558322071981?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/ITTQL1VhU6U/dove-project-new-release.html" title="Dove project - new release" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2010/06/dove-project-new-release.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UMSX87eip7ImA9WxFWGUw.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-4899169850580946847</id><published>2010-06-07T05:50:00.000-07:00</published><updated>2010-06-07T05:54:48.102-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-07T05:54:48.102-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="dove" /><category scheme="http://www.blogger.com/atom/ns#" term="ftp" /><category scheme="http://www.blogger.com/atom/ns#" term="document distribution server" /><category scheme="http://www.blogger.com/atom/ns#" term="ftps" /><category scheme="http://www.blogger.com/atom/ns#" term="email" /><category scheme="http://www.blogger.com/atom/ns#" term="WebDAV" /><category scheme="http://www.blogger.com/atom/ns#" term="CIFS" /><category scheme="http://www.blogger.com/atom/ns#" term="sftp" /><title>Dove - Document Distribution Server</title><content type="html">Today I released a new version of &lt;a href="http://doveman.sourceforge.net/"&gt;Dove - Document Distribution Server&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Dove is an application which distributes your documents to a variety of destinations. It allows you to send a document to email or to a WebDAV server with equal ease, no matter which programming language you are using to do it.&lt;br /&gt;&lt;br /&gt;Dove can currently distribute documents to email and FTP. It can be used from Java, C/C++, COBOL, .Net, Visual Basic, Delphi, PHP, or any other language you might think of.&lt;br /&gt;&lt;a href="http://doveman.sourceforge.net/"&gt;&lt;br /&gt;http://doveman.sourceforge.net/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-4899169850580946847?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=yU3tmSV6Xy4:sGMxNKXUdZc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/yU3tmSV6Xy4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/4899169850580946847/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=4899169850580946847" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/4899169850580946847?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/4899169850580946847?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/yU3tmSV6Xy4/dove-document-distribution-server.html" title="Dove - Document Distribution Server" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2010/06/dove-document-distribution-server.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcFRHg6eip7ImA9WxFWGU0.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-3748743343347732408</id><published>2010-06-07T01:31:00.000-07:00</published><updated>2010-06-07T01:40:15.612-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-07T01:40:15.612-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="getters setters java" /><category scheme="http://www.blogger.com/atom/ns#" term="Commons BeanUtils" /><category scheme="http://www.blogger.com/atom/ns#" term="javabeans mess" /><category scheme="http://www.blogger.com/atom/ns#" term="empiredb jaxb" /><title>JavaBeans mess</title><content type="html">It is a known fact that JavaBeans - 'Generate Getters and Setters' was not the most brilliant idea in java.&lt;br /&gt;&lt;br /&gt;One more instance of the problem. I have two libraries which I am using EmpireDB and Java Architecture for XML Binding (JAXB). I have a datatype which I need to use in both - JobInfo let's say. EmpireDB requires JobInfo bean in the classic bean format private field + getter + setter in order to work properly.JAXB requires the JobInfo bean to have public fields and no getters and setters. So I cannot use the same datatype in both places.&lt;br /&gt;&lt;br /&gt;Because of the previous I came with the dirty work around of making two different types one JobInfo for EmpireDB and another XMLJobInfo for JAXB while for copying the field values of XMLJobInfo to JobInfo I tried to use BeanUtils.copyProperties(job, xmlJob)&lt;br /&gt;&lt;br /&gt;Unfortunately BeanUtils.copyProperties is not handling the situation with two different beans - one with public properties and one with getters and setters. Now the only solution which is left for me is to write the boiler plate code of copying by hand each field's value.&lt;br /&gt;&lt;br /&gt;Not good at all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-3748743343347732408?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=XCsPP7-l-2g:QME_bZZ-BVM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/XCsPP7-l-2g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/3748743343347732408/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=3748743343347732408" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/3748743343347732408?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/3748743343347732408?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/XCsPP7-l-2g/javabeans-mess.html" title="JavaBeans mess" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2010/06/javabeans-mess.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08NQX08eCp7ImA9WxFWGEw.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-5096253468517406569</id><published>2010-06-06T03:21:00.000-07:00</published><updated>2010-06-06T03:24:50.370-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-06T03:24:50.370-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="OpenJDK" /><category scheme="http://www.blogger.com/atom/ns#" term="Sun JDK" /><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu 10.04 LTS" /><title>Sun JDK on Ubuntu 10.04 LTS</title><content type="html">Yesterday I tried for some time to get Eclipse3.5.2 working with Sun JDK6 on Ubuntu 10.04 LTS&lt;br /&gt;&lt;br /&gt;This version of Ubuntu is coming by default with OpenJDK JRE installed. It seems that Sun's official Java is not being shipped because of licensing issues.I don't know if this is the only reason, however it is obvious that guys from Ubuntu tried to make the switch to Sun's Java a task which is taking more than 5 minutes.&lt;br /&gt;&lt;br /&gt;First of all Sun's JDK is not available to be installed through the official Ubuntu Software Center. I also tried various installing commands which I found on various forums - but none was successful for various reasons. When un-installing OpenJDK the GNU Java was being installed semi-automatically to replace it.&lt;br /&gt;&lt;br /&gt;Finally I gave up and I came back to OpenJDK and Eclipse combination. Now I am not able to get Maven2 m2 eclipse plug-in properly working on this combination. I hope is not because of OpenJDK.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-5096253468517406569?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=Tus6uCeVCQY:C35o1_mPOOs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/Tus6uCeVCQY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/5096253468517406569/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=5096253468517406569" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5096253468517406569?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5096253468517406569?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/Tus6uCeVCQY/sun-jdk-on-ubuntu-1004-lts.html" title="Sun JDK on Ubuntu 10.04 LTS" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2010/06/sun-jdk-on-ubuntu-1004-lts.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04HQHs8fyp7ImA9WxdXF08.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-5607541534520657635</id><published>2008-06-26T11:16:00.000-07:00</published><updated>2008-06-29T01:58:51.577-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-29T01:58:51.577-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="test driven development tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="jmock tutorial" /><title>TDD Part 4 . Practical Java mocking tutorial using jMock</title><content type="html">Hello everybody. If you came to read this ‘&lt;a href="http://java-hobby.blogspot.com/search/label/test%20driven%20development%20tutorial"&gt;TDD tutorial series&lt;/a&gt;’ it means that the benefits of Automated Unit testing are obvious to you. If you are still not convinced you can read “&lt;a href="http://www.codeproject.com/KB/architecture/onunittesting.aspx"&gt;The benefits of automated unit testing&lt;/a&gt;”.&lt;br /&gt;&lt;br /&gt;Just after starting to write your first real life Junit test cases you realize that you need something more: &lt;a href="http://en.wikipedia.org/wiki/Mock_object"&gt;mocking or stubbing&lt;/a&gt;. When you are doing unit testing you are focusing on an element/class at a time, like the name also suggest. But most of the classes are not straightforward and use some other collaborator classes in order to achieve their goals. Here is where the mocking techniques comes into picture and help you to “fake” the collaborator classes in order to be able to perform tests only on the class that you are focused. The term “Mock Objects” has become a popular one to describe special case objects that mimic real objects for testing purposes. By taking one by one each class of your system and writing junits (with the help of mock objects) you will finish with your system fully tested.&lt;br /&gt;&lt;br /&gt;The scope of this tutorial is to be a “hands on” &lt;a href="http://www.jmock.org/"&gt;jMock&lt;/a&gt; presentation but before going into real source code I want to enumerate some techniques to use in order to improve testability in regard with mocking:&lt;br /&gt;&lt;br /&gt;a) Code to interfaces rather than classes.&lt;br /&gt;b) Minimize the dependence on environment-specific APIs (EJB, Servlet etc)&lt;br /&gt;c) Give each object a manageable and consistent set of responsibilities&lt;br /&gt;d) Hide implementation details.&lt;br /&gt;e) Refactor into methods to allow overriding at test time.&lt;br /&gt;f) Use a technique similar with Dependency Injection in order to “inject” dependencies rather than directly create them. This will help at test time when mocks/stubs will be injected instead of real classes.&lt;br /&gt;&lt;br /&gt;In jMock and in other mocking frameworks you define expectations over the collaborator classes. These expectations "describe" the comportment that is expected from "the mocks" while executing the main code that is under test.&lt;br /&gt;&lt;br /&gt;Assuming we want to test the following method. Please take a closer look to the bold code which represents the collaborator classes that I will mock.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;protected void endDocument(PDDocument pdf) throws IOException {&lt;br /&gt;&lt;br /&gt;  Enumeration keys = burstDocuments.keys();&lt;br /&gt;&lt;br /&gt;  while (keys.hasMoreElements()) {&lt;br /&gt;&lt;br /&gt;    String burstToken = (String) keys.nextElement();&lt;br /&gt;    Vector&lt;pdpage&gt; pages =(Vector&lt;pdpage&gt;)burstDocuments.get(burstToken).getSecond();&lt;br /&gt;&lt;br /&gt;    &lt;b&gt;IPageExtractor pageExtractor = getPageExtractor(pdf,extractedFilePath);&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    try {&lt;br /&gt;&lt;br /&gt;      pageExtractor.doExtract(pages);&lt;br /&gt;      extractedDocuments.add(extractedFilePath);&lt;br /&gt;&lt;br /&gt;      if (sendDocuments) {&lt;br /&gt;&lt;br /&gt;        &lt;b&gt;ISender sender = getSender(burstToken);&lt;/b&gt;&lt;br /&gt;        sender.attachFile(extractedFilePath);&lt;br /&gt;        sender.doSend();&lt;br /&gt;&lt;br /&gt;      } else {&lt;br /&gt;        log.warn("Document: '" + extractedFilePath +&lt;br /&gt;          "' was not sent to any recipient because (sendDocuments) is false");&lt;br /&gt;      }&lt;br /&gt;    } catch (COSVisitorException e) {&lt;br /&gt;        log.fatal("Document: '" + extractedFilePath + "'", e);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pdpage&gt;&lt;/pdpage&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Don't bother if you don't understand each line of code. Look only to the bold code where the collaborator classes appear. These classes are the candidates for mocking using jMock in order to "describe" the expectations. In short this code extracts from a big document pages corresponding to specific address destinations and sends the "bursted documents" to email, ftp etc.&lt;br /&gt;&lt;br /&gt;In order to replace the collaborators with mocks at test time I use the following technique:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;//protected method that will be overriden at test time to return "a mock" of PageExtractor&lt;br /&gt;protected PageExtractor getPageExtractor(PDDocument pdf,String outputFileName) {&lt;br /&gt;   return new PageExtractor(pdf, outputFileName);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This method will be overridden to return a mock while writing the testing code. This is one of the techniques to "inject" mocks.  ISender class is using a similar way. Depending on the burstToken it returns an EmailSender or FTPSender classses that I will mock at test time.&lt;br /&gt;&lt;br /&gt;Let's now go to the testing code to see how to use jMock.&lt;br /&gt;&lt;br /&gt;1.First thing you need when using this library is a context. I want to use jUnit4 and I want to mock classes not only interfaces.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;private Mockery context = new JUnit4Mockery() {&lt;br /&gt;{&lt;br /&gt;   setImposteriser(ClassImposteriser.INSTANCE);&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;2.After I have the context I can use it in order to set up my mocks.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;//setup - data&lt;br /&gt;  private final EmailSender mockEmailSender = (EmailSender) context.mock(EmailSender.class);&lt;br /&gt;  private final FtpSender mockFtpSender = (FtpSender) context.mock(FtpSender.class);&lt;br /&gt;  private final ExternalToolSender mockExternalToolSender = (ExternalToolSender)  context.mock(ExternalToolSender.class);&lt;br /&gt;  private final PageExtractor mockPageExtractor = (PageExtractor)  context.mock(PageExtractor.class);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3.Next step is to "inject the mocks" into the class that is under test in order to use them instead of real collaborator classes. I do this by "inner overriding" the protected methods that were creating the collaborator classes.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;  SimpleBurster burster = new SimpleBurster(true, "") {&lt;br /&gt;&lt;br /&gt;    protected PageExtractor getPageExtractor(final PDDocument pdf,final String  outputFileName)&lt;br /&gt;    {&lt;br /&gt;        return mockPageExtractor;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected ISender getSender(final String burstToken) {&lt;br /&gt;       if (EmailValidator.getInstance().isValid(burstToken)) {&lt;br /&gt;          return mockEmailSender;&lt;br /&gt;       } else if (GeneralUtilities.isValidFTPAddress(burstToken)) {&lt;br /&gt;          return mockFtpSender;&lt;br /&gt;       } else if (GeneralUtilities.isValidFileAddress(burstToken)) {&lt;br /&gt;          return mockExternalToolSender;&lt;br /&gt;    }&lt;br /&gt;    return null;&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;4.Expectations are coming now. These are the "heart" of the mocking. Here I describe the behavior of the mocks while running the test. If expectations are not met than the test is failing.&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;// expectations&lt;br /&gt;  context.checking(new Expectations() {&lt;br /&gt;  {&lt;br /&gt;    try {&lt;br /&gt;       exactly(2).of(mockPageExtractor).doExtract(with(any(Vector.class)));&lt;br /&gt;    }&lt;br /&gt;    catch (COSVisitorException e) {&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    one(mockEmailSender).attachFile(with(aNonNull(String.class)));&lt;br /&gt;    one(mockEmailSender).doSend();&lt;br /&gt;    never(mockFtpSender).doSend();&lt;br /&gt;    one(mockExternalToolSender).attachFile(with(aNonNull(String.class)));&lt;br /&gt;    one(mockExternalToolSender).doSend();&lt;br /&gt;  }&lt;br /&gt;  });&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;What behavior I described here? I expect that the method&lt;br /&gt;doExtract(Vector) will be called exactly 2 times on the PageExtractor. I am not&lt;br /&gt;interested exactly in with what parameters will be called. I expect that the method&lt;br /&gt;attachFile(String) will be once called for EmailSender with a non null String&lt;br /&gt;parameter. I expect that the extracted file is send once with doSend() using the&lt;br /&gt;EmailSender.I expect that this file will not be sent with FTP(never(mockFtpSender)).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. Next step is to call the method under test. The jMock framework will take care&lt;br /&gt;to throw an exception is an expected result is not met.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;//execute the code. jMock will check the expectations setted up previously.&lt;br /&gt;  burster.doBurst(Utilities.inputDocumentPath);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;6.Last step is to check with jUnit that the returned results are the correct ones. As this is out of the scope for jMock I will not present the code here.&lt;br /&gt;&lt;br /&gt;In your day to day work the "&lt;a href="http://www.jmock.org/cheat-sheet.html"&gt;jMock 2 Cheat Sheet&lt;/a&gt;" is everything you need in order to be productive.&lt;br /&gt;&lt;br /&gt;Finally we came to the end. My intention was to be clear and straightforward but I could not resist myself to put some theoretical sentences at the beginning of the post. I hope you got something from reading and there were not just useless words and paper wasted :-).&lt;br /&gt;&lt;br /&gt;Enjoy.&lt;br /&gt;&lt;br /&gt;Further resources:&lt;br /&gt;1. &lt;a href="http://www.amazon.com/gp/product/0321146530/105-3634338-4132464?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=0321146530"&gt;Test Driven Development: By Example&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-5607541534520657635?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=wc7pl95BkBc:srjmUPtv9Kk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/wc7pl95BkBc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/5607541534520657635/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=5607541534520657635" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5607541534520657635?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5607541534520657635?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/wc7pl95BkBc/tdd-part-4-practical-java-mocking.html" title="TDD Part 4 . Practical Java mocking tutorial using jMock" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/06/tdd-part-4-practical-java-mocking.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4HR344eSp7ImA9WxdQFUg.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-31641308113411208</id><published>2008-06-14T11:13:00.000-07:00</published><updated>2008-06-15T11:35:36.031-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-15T11:35:36.031-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Best Programming Language" /><title>Best Programming Language?</title><content type="html">Does this question seem familiar to you? You remember some fights with your friends on this topic? I remember for sure... But now after I wrote commercial code in some areas like Delphi, VB6, .Net, C++ and for the past 3 years in Java/J2EE I can say that this question is not a valid one. Maybe a question like "which is the best language for writing 3D shooter games/database driven applications/simple web application/complex enterprise solution" will be more accurate. Now after I have some working experience I will say something like "tell me what kind of application you need &lt;br /&gt;and from the list of languages I know I will choose the most appropriate one". Probably for most of the applications the chosen language will be Java and for the rest C/C++. My reason is very simple and straightforward and not an academically speech about how efficiently memory allocation is handled in each language. When I used to work in Delphi/VB/.Net and I was googling for libraries to get my job done simpler and faster, I was wasting days to find few options with prices like 450/900/1800USD. In 3 years of Java I don't remember one case in which I had less than 5 open source free great options of libraries to choose from. In fact in Java this was my biggest problem. Choosing the best free option... I was overwhelmed with so many good options for any library that I needed at any time. In C/C++ the situation is also good regarding this aspect but in Delphi/.Net/Visual Basic everything is with money (or at least 3 years ago when I switched to Java it was like this). Because of that I will bet my money on Java for many years that will come. What do you think? Do you agree with the &lt;a href="http://unspun.amazon.com/Best-Programming-Language/list/show/1045"&gt;Best Programming Language that is suggested here&lt;/a&gt;?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-31641308113411208?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=0UYyORXpBY0:c0x8VUzYnDY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/0UYyORXpBY0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/31641308113411208/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=31641308113411208" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/31641308113411208?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/31641308113411208?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/0UYyORXpBY0/best-programming-language.html" title="Best Programming Language?" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/06/best-programming-language.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMNQ3c4fCp7ImA9WxdRF0U.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-3084379366114710691</id><published>2008-06-06T13:07:00.000-07:00</published><updated>2008-06-06T13:18:12.934-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-06T13:18:12.934-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pdf bursting" /><category scheme="http://www.blogger.com/atom/ns#" term="documentburster" /><category scheme="http://www.blogger.com/atom/ns#" term="pdf splitting" /><category scheme="http://www.blogger.com/atom/ns#" term="report splitting" /><category scheme="http://www.blogger.com/atom/ns#" term="report bursting" /><category scheme="http://www.blogger.com/atom/ns#" term="burst" /><title>DocumentBurster - Java report bursting solution</title><content type="html">Question - What is &lt;a href="http://www.pdfburst.com/"&gt;DocumentBurster&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;Answer - DocumentBurster is a one-click batch PDF report bursting solution. The bursted documents can be delivered on a variety of destinations like email, ftp, fax, archive and many more.&lt;br /&gt;&lt;br /&gt;A new version DocumentBurster0.0.7 was just released. Please feel free to &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=213679"&gt;download it&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;DocumentBurster is released under an open source license and you can read more about it &lt;a href="http://www.pdfburst.com/questions.html"&gt;here...&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-3084379366114710691?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=vBQAfPJaWTw:40UJk3CuX_I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/vBQAfPJaWTw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/3084379366114710691/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=3084379366114710691" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/3084379366114710691?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/3084379366114710691?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/vBQAfPJaWTw/documentburster-java-report-bursting.html" title="DocumentBurster - Java report bursting solution" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/06/documentburster-java-report-bursting.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4FSH44cSp7ImA9WxdRFUU.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-3990249764505884135</id><published>2008-06-04T05:29:00.000-07:00</published><updated>2008-06-04T06:58:39.039-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-04T06:58:39.039-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="dependency hell" /><category scheme="http://www.blogger.com/atom/ns#" term="maven2 dependency management" /><title>Is automated dependency management some kind of "fata morgana"?</title><content type="html">From the &lt;a href="http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html"&gt;Maven site&lt;/a&gt; - "Dependency management is one of the features of Maven that is best known to users and is one of the areas where Maven excels".&lt;br /&gt;&lt;br /&gt;I see some issues with this approach. For example licensing issues ... Maven2 will start to happily download for us transitive dependencies...and after one year we will find that we are dependent on some "viral" OSS software. It will be too late...&lt;br /&gt;&lt;br /&gt;Another issue is with "dependency hell". Even for seasoned developers which are double checking everything exceptions like ClassNotFoundException and NoClassDefFoundException can become a nightmare in production environments. In java world where there are so many libraries which are interdependent, many of them have common dependencies but with different versions of the libraries...the dependency network can become big, difficult to maintain and over complex. For a simple program it is possible to have "automated dependency management" but for a complex one I have some doubts.&lt;br /&gt;&lt;br /&gt;And the last one is that people should know what they are including in their programs, dependencies should not be a "black box" for them just because an automated system resolved everything. Sooner or later a ClassNotFoundException will come and they will have to fix it.&lt;br /&gt;&lt;br /&gt;What do you think? Will this "dependency hell" problem ever be solved?&lt;br /&gt;&lt;br /&gt;This one is interesting to read ... &lt;a href="http://raibledesigns.com/rd/entry/building_a_better_maven_with"&gt;Building a Better Maven with Ant&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-3990249764505884135?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=DNALYTLxJ9U:bWfDpDPX04g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/DNALYTLxJ9U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/3990249764505884135/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=3990249764505884135" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/3990249764505884135?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/3990249764505884135?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/DNALYTLxJ9U/is-automated-dependency-management-some.html" title="Is automated dependency management some kind of &quot;fata morgana&quot;?" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/06/is-automated-dependency-management-some.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YMQXs_eCp7ImA9WxdXFkk.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-6475215638193390795</id><published>2008-06-02T04:24:00.000-07:00</published><updated>2008-06-28T01:19:40.540-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-28T01:19:40.540-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="test driven development tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="junit tutorial" /><title>TDD Part 3 . JUnit tutorial</title><content type="html">&lt;a href="http://www.junit.org/"&gt;JUnit&lt;/a&gt; is a unit testing framework for the Java programming language. It helps developers to easily write code that is supposed to test their own code. JUnit (and other &lt;a href="http://en.wikipedia.org/wiki/XUnit"&gt;xUnit testing frameworks&lt;/a&gt;) gain more popularity with the raise of Test Driven Development. The scope of this post is not to speak "theoretically" about the advantages of writing junits (which are many) but to show "hands on" kind of stuff. So let's begin...&lt;br /&gt;&lt;br /&gt;What means a "testing framework"? There are couple of things which are making the junit framework but the core of it is the &lt;a href="http://junit.sourceforge.net/javadoc_40/index.html"&gt;Assert class&lt;/a&gt; with all the assert* kind of methods.&lt;br /&gt;A usual assert method is something like&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;assertEquals(double expected,double actual,double delta)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;What is this method doing? It is obvious: it checks/asserts that two doubles are equal to within a positive delta. Most of the Assert class methods are in the same idea. Some other useful assert methods are assertFalse/True, assertNull/NotNull and assertSame/NotSame. Let's write our first JUnit test case. I took this example from this &lt;a href="http://www.jaredrichardson.net/articles/junit-tutorial.html"&gt;good JUnit entry tutorial&lt;/a&gt;.&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;public class Math {&lt;br /&gt;    static public int add(int a, int b) {&lt;br /&gt;    return a + b;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And the code that is testing our Math class is ... of course a JUnit test case.&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;import junit.framework.*;&lt;br /&gt;&lt;br /&gt;public class TestMath extends TestCase {&lt;br /&gt;&lt;br /&gt;public void testAdd() {&lt;br /&gt;    int num1 = 3;&lt;br /&gt;    int num2 = 2;&lt;br /&gt;    int total = 5;&lt;br /&gt;    int sum = 0;&lt;br /&gt;    sum = Math.add(num1, num2);&lt;br /&gt;    assertEquals(sum, total);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The code is so simple and self explanatory that trying to explain it I will just waste your time... :-)&lt;br /&gt;&lt;br /&gt;Let's try some other example. Let's assume we have a java function &lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;public static Vector parse(String text,&lt;br /&gt;        String openDelimiter, String closeDelimiter)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;this function takes as input a text string and returns a vector with all the strings between openDelimiter and closeDelimiter that were found in the initial text. Our scope is to test that this function is working properly. What we will do? Of course we will write some JUnits test cases that will give different inputs and will assert that the results are the expected ones. Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;import junit.framework.TestCase;&lt;br /&gt;import java.util.Vector;&lt;br /&gt;&lt;br /&gt;public class TestUtilities extends TestCase {&lt;br /&gt;&lt;br /&gt;  public void testParse() {&lt;br /&gt;  &lt;br /&gt;    Vector&lt;String&gt; parsed=Utils.parse("aaa{micky.mouse@yahoo.com}wewe","{", "}");&lt;br /&gt;    assertEquals(parsed.size(), 1);&lt;br /&gt;    assertEquals(parsed.get(0), "micky.mouse@yahoo.com");&lt;br /&gt;        &lt;br /&gt;    parsed=Utils.parse("aaa!micky.mouse@yahoo.com}wewewe","{", "}");&lt;br /&gt;    assertEquals(parsed.size(), 0);&lt;br /&gt;         &lt;br /&gt;    parsed=Utils.parse("aaa&amp;lt;testtag&amp;gt;micky.mouse@yahoo.com&amp;lt;/testtag&amp;gt;wewe",&lt;br /&gt;    "&amp;lt;testtag&amp;gt;", "&amp;lt;/testtag&amp;gt;");&lt;br /&gt;    assertEquals(parsed.size(), 1);&lt;br /&gt;    assertEquals(parsed.get(0), "micky.mouse@yahoo.com");&lt;br /&gt;        &lt;br /&gt;    parsed=Utils.parse("aaa{micky.mouse@yahoo.com}we{micky.mouse@yahoo.com}rw",&lt;br /&gt;    "{", "}");&lt;br /&gt;    assertEquals(parsed.size(), 2);&lt;br /&gt;    assertEquals(parsed.get(0), "micky.mouse@yahoo.com");&lt;br /&gt;    assertEquals(parsed.get(1), "micky.mouse@yahoo.com");&lt;br /&gt;&lt;br /&gt;    parsed=Utils.parse("aa{micky.mouse@yahoo.com}wew{duffy.duck@yahoo.com}rwwe",&lt;br /&gt;    "{", "}");&lt;br /&gt;    assertEquals(parsed.size(), 2);&lt;br /&gt;    assertEquals(parsed.get(0), "micky.mouse@yahoo.com");&lt;br /&gt;    assertEquals(parsed.get(1), "duffy.duck@yahoo.com");&lt;br /&gt;&lt;br /&gt;    parsed=Utils.parse("aaaa{micky.mouse@yahoo.comwewew{duffy.duck@yahoo.com}rwrwe",&lt;br /&gt;    "{", "}");&lt;br /&gt;    assertEquals(parsed.size(), 1);&lt;br /&gt;    assertEquals(parsed.get(0),"micky.mouse@yahoo.comwewew{duffy.duck@yahoo.com");&lt;br /&gt;    &lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There is no rocked science here. It is a simple function that is testing another function. What is to notice here is that sometimes the code to test can become bigger than the actual tested code. &lt;br /&gt;&lt;br /&gt;In the next part I will present &lt;a href="http://www.jmock.org/"&gt;jMock&lt;/a&gt;. jUnit without some kind of &lt;a href="http://en.wikipedia.org/wiki/Mock_object"&gt;mocking library&lt;/a&gt; is not going to help too much in real life. We will see in the next part why.&lt;br /&gt;&lt;br /&gt;Enjoy.&lt;br /&gt;&lt;br /&gt;Further resources:&lt;br /&gt;1. &lt;a href="http://www.amazon.com/gp/product/1932394230/105-3634338-4132464?ie=UTF8&amp;tag=documen-20&amp;linkCode=xm2&amp;camp=1789&amp;creativeASIN=1932394230"&gt;JUnit Recipes: Practical Methods for Programmer Testing&lt;/a&gt;&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/7769052816642004160-6475215638193390795?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=dLZm2XknNIQ:spuV7wLk0hI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/dLZm2XknNIQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/6475215638193390795/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=6475215638193390795" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/6475215638193390795?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/6475215638193390795?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/dLZm2XknNIQ/tdd-part-3-junit-tutorial.html" title="TDD Part 3 . JUnit tutorial" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/06/tdd-part-3-junit-tutorial.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4BRHs-eyp7ImA9WxdRFE0.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-1675975409574744428</id><published>2008-06-02T03:58:00.000-07:00</published><updated>2008-06-02T04:09:15.553-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-02T04:09:15.553-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pdf bursting" /><category scheme="http://www.blogger.com/atom/ns#" term="documentburster" /><category scheme="http://www.blogger.com/atom/ns#" term="pdf splitting" /><category scheme="http://www.blogger.com/atom/ns#" term="report splitting" /><category scheme="http://www.blogger.com/atom/ns#" term="report bursting" /><category scheme="http://www.blogger.com/atom/ns#" term="burst" /><title>New version of DocumentBurster was released</title><content type="html">A new version (0.0.6) of &lt;a href="http://www.pdfburst.com/"&gt;DocumentBurster&lt;/a&gt; was just released. The main addition with this release is better logging support by using the Apache Commons Logging library.&lt;br /&gt;&lt;br /&gt;DocumentBurster takes as input PDF reports and bursts them based on meta-data. Generated documents can be delivered on a variety of destinations like email, ftp, fax, archive and many more.&lt;br /&gt;&lt;br /&gt;You can download the latest version from&lt;br /&gt;&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=213679"&gt;DocumentBurster Download Page&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-1675975409574744428?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=-wEaCIB1hbw:zdSwF9kRlDI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/-wEaCIB1hbw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/1675975409574744428/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=1675975409574744428" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/1675975409574744428?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/1675975409574744428?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/-wEaCIB1hbw/new-version-of-documentburster-was.html" title="New version of DocumentBurster was released" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/06/new-version-of-documentburster-was.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcER3w_eip7ImA9WxdXFkk.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-8881143685464260170</id><published>2008-05-26T10:42:00.000-07:00</published><updated>2008-06-28T01:50:06.242-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-28T01:50:06.242-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="test driven development tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="apache ant tutorial" /><title>TDD Part 2 . Apache ANT tutorial</title><content type="html">&lt;a href="http://ant.apache.org/"&gt;Apache ANT&lt;/a&gt; describe itself as "a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles." Ant is widely used for building Java projects but I feel it is much more than that. For example it can be used for constructing a portable build system for a C/C++ project. (as make replacement). Simply said Ant is a scripting and automation tool based on XML.&lt;br /&gt;&lt;br /&gt;I understand TDD as a way of developing software in which Automation plays a very important role. Automation can be a suite of JUnits which will run with every build to verify that nothing is broken, or importing a big database dump for preparing a performance testing scenario, or automatically playing some GUI recorded scripts to make some functional testing or whatever. In all these scenarios ANT can help a lot.&lt;br /&gt;&lt;br /&gt;Enough with theory...let's get our hands dirty with some real stuff now.&lt;br /&gt;&lt;br /&gt;Starting with a good build system plays a very important role in every successful TDD project. Following is a picture presenting a classic ANT view of a build script in Eclipse IDE&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_9LparpuZ-eU/SDtEQ8jFbVI/AAAAAAAAAJo/nahziqW_Suw/s1600-h/ant1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_9LparpuZ-eU/SDtEQ8jFbVI/AAAAAAAAAJo/nahziqW_Suw/s320/ant1.JPG" alt="" id="BLOGGER_PHOTO_ID_5204828852278619474" border="0" /&gt;&lt;/a&gt;Each node represents an ANT target. This is a clear "unit of work" with a specific scope in the final build process. A target can depend on some other targets so it is very easy to define a complex order of execution of ant targets that will fit best each need. Ant scripts are written in xml files. By default the name of the xml file is build.xml. So let's take one by one each target and describe in detail.&lt;br /&gt;&lt;br /&gt;1.&lt;span style="font-weight: bold;"&gt;clean&lt;/span&gt;:&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;&amp;lt;target name="clean" description="Remove all generated files"&amp;gt;&lt;br /&gt;  &amp;lt;delete dir="${dest.dir}"/&amp;gt;&lt;br /&gt;  &amp;lt;delete defaultexcludes="false"&amp;gt;&lt;br /&gt;    &amp;lt;fileset dir="${src.test.dir}/resources/pdfTestFiles/outputBurstedFiles"/&amp;gt;&lt;br /&gt;  &amp;lt;/delete&amp;gt;&lt;br /&gt;  &amp;lt;delete defaultexcludes="false"&amp;gt;&lt;br /&gt;    &amp;lt;fileset dir="${src.test.dir}/resources/pdfTestFiles/outputSendedFiles"/&amp;gt;&lt;br /&gt;  &amp;lt;/delete&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I think the code is self explanatory. It deletes the output already compiled classes&lt;br /&gt;and it also deletes some output folders which are populated while playing the automated test suite.&lt;br /&gt;&lt;br /&gt;2.&lt;span style="font-weight: bold;"&gt;compile [default]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is the target which compiles the java source code. It is the default target from the build file which means that it is executed by default when no other target is specified. Here is the code:&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;&amp;lt;target name="compile" depends="init" description="Compile Java source files"&amp;gt;&lt;br /&gt;  &amp;lt;javac srcdir="${src.dir}" destdir="${dest.dir}/classes" debug="on"   classpathref="buildtime.classpath" deprecation="on" encoding="ISO-8859-1" /&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you see this target depends on the target "init". This means that "init" will be first executed when the "compile" target is called. So let's see the "init" target.&lt;br /&gt;&lt;br /&gt;3.&lt;span style="font-weight: bold;"&gt;init&lt;/span&gt;:&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;&amp;lt;target name="init"&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="${dest.dir}/classes"/&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="${dest.dir}/test-classes"/&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="${dest.dir}/jar"/&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="${dest.dir}/zip"/&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="${dest.dir}/junit-report"/&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The code is very simple and straightforward. It just creates the output folders that are needed by the compile target.&lt;br /&gt;&lt;br /&gt;4.&lt;span style="font-weight: bold;"&gt;compile.tests&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;This is the code which compiles the JUnit test cases. It is just a call to the &lt;a href="http://ant.apache.org/manual/CoreTasks/javac.html"&gt;java compiler with the Ant task&lt;/a&gt; and it depends on the simple "compile" to be called before. The junit test cases have as a dependency the main program classes therefore these should be compiled before.&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;&amp;lt;target name="compile.tests" depends="compile"&amp;gt;&lt;br /&gt;  &amp;lt;javac classpathref="testtime.classpath" destdir="${dest.dir}/test-classes"   srcdir="${src.test.dir}" debug="on" deprecation="on" encoding="ISO-8859-1"/&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;5.&lt;span style="font-weight: bold;"&gt;run.tests&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;This is the target which actually runs the JUnit tests. Of course it depends on compiling the tests so it has depends="compile.tests". Here is the code:&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;&amp;lt;target name="run.tests" depends="compile.tests"&amp;gt;&lt;br /&gt; &amp;lt;junit printsummary="yes" haltonfailure="yes"&amp;gt;&lt;br /&gt;  &amp;lt;classpath&amp;gt;&lt;br /&gt;   &amp;lt;path refid="testtime.classpath"/&amp;gt;&lt;br /&gt;   &amp;lt;pathelement path="${dest.dir}/test-classes"/&amp;gt;&lt;br /&gt;  &amp;lt;/classpath&amp;gt;&lt;br /&gt;  &amp;lt;batchtest haltonfailure="no" todir="${dest.dir}/junit-report"&amp;gt;&lt;br /&gt;   &amp;lt;formatter type="xml"/&amp;gt;&lt;br /&gt;   &amp;lt;fileset dir="${dest.dir}/test-classes"&amp;gt;&lt;br /&gt;     &amp;lt;exclude name="**/TestUtilities.class"/&amp;gt;&lt;br /&gt;     &amp;lt;exclude name="**/*$*.class"/&amp;gt;&lt;br /&gt;   &amp;lt;/fileset&amp;gt;&lt;br /&gt;  &amp;lt;/batchtest&amp;gt;&lt;br /&gt; &amp;lt;/junit&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So how this target is working? It is calling the &lt;a href="http://ant.apache.org/manual/OptionalTasks/junit.html"&gt;junit task&lt;/a&gt; for running the tests, it is setting the classpath to the testtime.classpath and it is giving as input "a batch" of already compiled tests which are in the "${dest.dir}/test-classes".&lt;br /&gt;&lt;br /&gt;6-7.&lt;span style="font-weight: bold;"&gt;make.jar&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;make.zip&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;These two targets are much related with packaging and distribution. make.jar as the name suggest is packaging the compiled classes as a single jar file. This target depends on the target "run.tests" which means that the jar is created only if all the JUnit test cases are passing successfully. Here is the code for "make.jar":&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;&amp;lt;target name="make.jar" depends="run.tests"&amp;gt;&lt;br /&gt; &amp;lt;jar destfile="${jar.file}"&amp;gt;&lt;br /&gt;   &amp;lt;fileset dir="${dest.dir}/classes"/&amp;gt;&lt;br /&gt;   &amp;lt;manifest&amp;gt;&lt;br /&gt;     &amp;lt;attribute name="Main-Class" value="burster.MainBurster"/&amp;gt;&lt;br /&gt;     &amp;lt;attribute name="Class-Path" value="lib/PDFBox-0.7.3.jar lib/oro-2.0.8.jar&lt;br /&gt;     lib/mail-1.4.1.jar lib/fontbox-0.1.0.jar lib/commons-validator-1.3.1.jar&lt;br /&gt;     lib/commons-net-1.4.1.jar lib/commons-email-1.1.jar lib/jta.jar&lt;br /&gt;     lib/commons-digester-1.7.jar&lt;br /&gt;     lib/commons-beanutils.jar lib/commons-logging.jar lib/commons-logging-api.jar&lt;br /&gt;     lib/commons-collections-3.1.jar lib/quartz-1.6.0.jar"/&amp;gt;&lt;br /&gt;   &amp;lt;/manifest&amp;gt;&lt;br /&gt; &amp;lt;/jar&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ant.apache.org/manual/CoreTasks/jar.html"&gt;Jar task&lt;/a&gt; is used for creating the output file. "Main-Class" and "Class-Path" are the "attributes" which are putted in the manifest file when defining the jar.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;make.zip&lt;/span&gt; - This is the target which takes the output DocumentBurster.jar, it copies also the lib files which are needed, the src files,some txt files like LICENSE.txt, README.txt, Prerequisites.txt and some other and is building the final zip files which will be downloaded by people. Here is the code:&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;&amp;lt;target name="make.zip" depends="make.jar"&amp;gt;&lt;br /&gt;  &amp;lt;delete includeemptydirs="true"&amp;gt;&lt;br /&gt;    &amp;lt;fileset dir="${dest.dir}/zip" includes="**/*"/&amp;gt;&lt;br /&gt;  &amp;lt;/delete&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="./tmp"/&amp;gt;&lt;br /&gt;  &amp;lt;copy todir="./tmp/bin/lib"&amp;gt;&lt;br /&gt;    &amp;lt;fileset dir="${runtime.lib.dir}"&amp;gt;&lt;br /&gt;    &amp;lt;/fileset&amp;gt;&lt;br /&gt;  &amp;lt;/copy&gt;&lt;br /&gt;  &amp;lt;copy todir="./tmp/src"&amp;gt;&lt;br /&gt;    &amp;lt;fileset dir="../DocumentBurster_client/src"&amp;gt;&lt;br /&gt;    &amp;lt;/fileset&amp;gt;&lt;br /&gt;  &amp;lt;/copy&amp;gt;&lt;br /&gt;  &amp;lt;copy file="${resources.dir}/config/settings.xml"  tofile="./tmp/bin/config/settings.xml"/&amp;gt;&lt;br /&gt;  &amp;lt;copy file="${resources.dir}/config/quartz-jobs.xml"  tofile="./tmp/bin/config/quartz-jobs.xml"/&amp;gt;&lt;br /&gt;  &amp;lt;copy file="${jar.file}" tofile="./tmp/bin/${project.name}.jar"/&amp;gt;&lt;br /&gt;  &amp;lt;copy file="${bat.file}" tofile="./tmp/bin/${project.name}.bat"/&amp;gt;&lt;br /&gt;  &amp;lt;copy file="${resources.dir}/txt_files/LICENSE.txt"  tofile="./tmp/LICENSE.txt"/&amp;gt;&lt;br /&gt;  &amp;lt;copy file="${resources.dir}/txt_files/README.txt"  tofile="./tmp/README.txt"/&amp;gt;&lt;br /&gt;  &amp;lt;copy file="${resources.dir}/txt_files/Prerequisites.txt" tofile="./tmp/Prerequisites.txt"/&amp;gt;&lt;br /&gt;  &amp;lt;copy file="../DocumentBurster_client/IDEs_proj_files/VS2005/DocumentBurster/DocumentBurster/Release/DocumentBurster.exe" tofile="./tmp/bin/DocumentBurster.exe"/&amp;gt;&lt;br /&gt;  &amp;lt;copy file="../DocumentBurster_client/src/resources/mondrian.ico"  tofile="./tmp/bin/images/mondrian.ico"/&amp;gt;&lt;br /&gt;  &amp;lt;copy file="../DocumentBurster_client/src/resources/DocumentBurster.exe.Manifest" tofile="./tmp/bin/DocumentBurster.exe.Manifest"/&amp;gt;&lt;br /&gt;  &amp;lt;zip destfile="${zip.file}" basedir="./tmp"/&amp;gt;&lt;br /&gt;  &amp;lt;delete dir="./tmp"/&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;8.&lt;span style="font-weight: bold;"&gt;test.gui.with.autoit&lt;/span&gt;. This is another target related with automated testing. "run.tests" were running only the JUnit test cases which were testing each java class in isolation. This is taking the redistributable zip file and runs and &lt;a href="http://www.hiddensoft.com/autoit3/"&gt;AutoIt&lt;/a&gt; GUI recorded script. This is more like a functional testing comparing with "run.tests" which was about unit testing. Here is the code:&lt;br /&gt;&lt;pre class="prettyprint" style="overflow: auto;"&gt;&lt;br /&gt;&amp;lt;target name="test.gui.with.autoit" depends="make.zip"&amp;gt;&lt;br /&gt; &amp;lt;unzip src="${zip.file}" dest="./tmp"/&amp;gt;&lt;br /&gt; &amp;lt;copy file="../DocumentBurster_client/IDEs_proj_files/AutoIt3/documentburster.au3" tofile="./tmp/bin/documentburster.au3"/&amp;gt;&lt;br /&gt; &amp;lt;copy file="${src.test.dir}/resources/pdfTestFiles/inputFiles/SimpleBurster.pdf" tofile="./tmp/SimpleBurster.pdf"/&amp;gt;&lt;br /&gt; &amp;lt;exec executable="C:\Program Files\AutoIt3\AutoIt3.exe"&amp;gt;&lt;br /&gt;  &amp;lt;arg value="./tmp/bin/documentburster.au3"/&amp;gt;&lt;br /&gt; &amp;lt;/exec&amp;gt;&lt;br /&gt; &amp;lt;delete dir="./tmp"/&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Most important thing to notice here is the use of the &lt;a href="http://ant.apache.org/manual/CoreTasks/exec.html"&gt;Exec Ant Task&lt;/a&gt; which is used to call an external program from ANT.&lt;br /&gt;&lt;br /&gt;Here I finished my "hands on" tutorial with ANT. I hope it was a useful piece of information that you will be using with success it in your own projects.&lt;br /&gt;&lt;br /&gt;Further resources:&lt;br /&gt;1. &lt;a href="http://www.amazon.com/gp/product/193239480X/105-3634338-4132464?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=193239480X"&gt;Ant in Action&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-8881143685464260170?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=fY-fNgka1NA:kDxTPxG5N_c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/fY-fNgka1NA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/8881143685464260170/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=8881143685464260170" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/8881143685464260170?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/8881143685464260170?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/fY-fNgka1NA/tdd-part-2-apache-ant-tutorial.html" title="TDD Part 2 . Apache ANT tutorial" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_9LparpuZ-eU/SDtEQ8jFbVI/AAAAAAAAAJo/nahziqW_Suw/s72-c/ant1.JPG" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/05/tdd-part-2-apache-ant-tutorial.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0INQnsyeCp7ImA9WxdSF04.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-703958325001928404</id><published>2008-05-25T03:49:00.000-07:00</published><updated>2008-05-25T11:19:53.590-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-25T11:19:53.590-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="test driven development tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="extreme programming tutorial" /><title>"Hands on" Test Driven Development tutorial. Part 1-Overview</title><content type="html">Hi everybody. I intend to start a tutorial series about test driven development and extreme programming. I will concentrate on the tools that we need in order to achieve the best results. Everything will be based on real pieces of code which are used in an open source project. The project is small enough in order to be easy to understand but it is not trivial so it does not have the "hello world" syndrome (you read it, you understand it, but you learn nothing from it).&lt;br /&gt;&lt;br /&gt;So here are the main topics that I will try to follow:&lt;br /&gt;&lt;br /&gt;1) Automate the build process. I will make a short &lt;a href="http://ant.apache.org/"&gt;Apache ANT&lt;/a&gt; Overview and a real "how to" ANT tutorial.&lt;br /&gt;2) Automate unit testing by writing &lt;a href="http://www.junit.org/"&gt;JUnit&lt;/a&gt; Test Cases. I will show real world JUnit examples.&lt;br /&gt;3) Just after starting to write JUnit test cases you realize that you need also something else. This is mocking which helps in testing each class in isolation by using some kind of mocks/stubs for the collaborative classes. I will make a short overview and “hands on” tutorial about &lt;a href="http://en.wikipedia.org/wiki/Mock_object"&gt;jMock&lt;/a&gt;.&lt;br /&gt;4) I will discuss a little bit about &lt;a href="http://en.wikipedia.org/wiki/Refactoring"&gt;re-factoring&lt;/a&gt; and the place it has in the full test driven development picture. &lt;br /&gt;5) Automate integration/functional testing using a “GUI scripting/recording” kind of tool. For web applications the options are &lt;a href="http://selenium.openqa.org/"&gt;Selenium&lt;/a&gt;, &lt;a href="http://webtest.canoo.com/webtest/manual/WebTestHome.html"&gt;Canoo Web Tests&lt;/a&gt;. My application has a desktop like GUI so I will present a tutorial about &lt;a href="http://www.autoitscript.com/autoit3/"&gt;AutoIt&lt;/a&gt; which is a very good GUI scripting tool for desktop applications.&lt;br /&gt;6) I will give some guidelines of how to automate as much as possible from performance testing or non function tests (NFT).&lt;br /&gt;7) I will show some application profiling tricks. I will show how to start quick using &lt;a href="http://www.ej-technologies.com/products/jprofiler/overview.html"&gt;jProfiler&lt;/a&gt; and how to automate the starting of your profiled application from an ANT build script. Maybe I will show also some Eclipse plug-in for profiling.&lt;br /&gt;8) How to correctly audit the quality of your project and source code/JUnit test cases by using a “software project management and comprehension tool” like &lt;a href="http://maven.apache.org/"&gt;Maven2&lt;/a&gt;. Maven2 can be used also like a replacement for build and deployment of applications instead for ANT but I prefer to use it more for its reporting capabilities and integration with code auditing tools. So in short I will present a real “hands on” Maven2 tutorial which will include &lt;a href="http://findbugs.sourceforge.net/"&gt;FindBugs&lt;/a&gt;, &lt;a href="http://cobertura.sourceforge.net/"&gt;Cobertura&lt;/a&gt;(code coverage tool), &lt;a href="http://jalopy.sourceforge.net/"&gt;Jalopy&lt;/a&gt;(code beautifier tool), &lt;a href="http://checkstyle.sourceforge.net/"&gt;CheckStyle&lt;/a&gt;, &lt;a href="http://pmd.sourceforge.net/"&gt;PMD&lt;/a&gt;(similar with FindBugs) and other stuff.&lt;br /&gt;&lt;br /&gt;Do you think there is some other important topic that should be covered in a Test Driven Development tutorial? I would like to hear from you  :-).&lt;br /&gt;&lt;br /&gt;Further resources:&lt;br /&gt;1. &lt;a href="http://www.amazon.com/gp/product/0596003870/105-3634338-4132464?ie=UTF8&amp;tag=documen-20&amp;linkCode=xm2&amp;camp=1789&amp;creativeASIN=0596003870"&gt;Java Extreme Programming Cookbook&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.amazon.com/gp/product/0321278658/105-3634338-4132464?ie=UTF8&amp;tag=documen-20&amp;linkCode=xm2&amp;camp=1789&amp;creativeASIN=0321278658"&gt;Extreme Programming Explained&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-703958325001928404?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=GhoicCuZaw0:One4wGS3HJg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/GhoicCuZaw0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/703958325001928404/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=703958325001928404" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/703958325001928404?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/703958325001928404?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/GhoicCuZaw0/hands-on-test-driven-development.html" title="&quot;Hands on&quot; Test Driven Development tutorial. Part 1-Overview" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/05/hands-on-test-driven-development.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEESH8zfCp7ImA9WxdTGEU.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-1030569395555038781</id><published>2008-05-15T13:10:00.000-07:00</published><updated>2008-05-15T13:16:49.184-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-15T13:16:49.184-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java portability" /><category scheme="http://www.blogger.com/atom/ns#" term="j2ee portability" /><title>Is Java really portable? Is J2EE really portable?</title><content type="html">Java was all the time marketed with “write once, run everywhere”. The same is true with J2EE. Hundreds of &lt;a href="http://jcp.org/en/home/index"&gt;standard specifications&lt;/a&gt; are published all the time in order to achieve the all around standardization and portability (JSRs). All the big names in the Java world like Sun, IBM, Oracle and BEA are aggressively claiming that they implement all the JSRs so the only logical result is that portability is a piece of cake in Java. But is this true? If somebody is writing a game with Java will this game run “just like that” on all the mobile platforms that have Java support? If one is writing a complex J2EE application, will this application run easily on all the major application servers? Currently I work with a medium-size EJB J2EE application which was initially deployed with Weblogic. Big money and time efforts were invested to deploy the same application on Websphere. Even bigger efforts are wasted currently to maintain and test the same application on the two platforms in parallel. Is this happening because the developers are bad and they don’t know how to write good J2EE applications? Or it is because Java and J2EE are not exactly what the big names are claiming it is? I want to know your opinion about this. Do you work with a big J2EE application which is easily deployed (without huge money wasted) on all the big application servers Weblogic, Websphere, JBoss, Oracle etc?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-1030569395555038781?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=ncGA4SVc8P0:5RIgJ002cEE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/ncGA4SVc8P0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/1030569395555038781/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=1030569395555038781" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/1030569395555038781?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/1030569395555038781?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/ncGA4SVc8P0/is-java-really-portable-is-j2ee-really.html" title="Is Java really portable? Is J2EE really portable?" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/05/is-java-really-portable-is-j2ee-really.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YFR3Y9eyp7ImA9WxdSEk8.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-6476250839982874174</id><published>2008-05-04T04:26:00.000-07:00</published><updated>2008-05-19T11:18:36.863-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-19T11:18:36.863-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java xml binding" /><category scheme="http://www.blogger.com/atom/ns#" term="xml binding tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="jaxb2 tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="jaxb2.0" /><title>Java Architecture for XML Binding - JAXB2 kick-off tutorial</title><content type="html">Java Architecture for XML Binding (JAXB) allows Java developers to map Java classes to XML representations. JAXB provides two main features: the ability to marshal Java objects into XML and the inverse, i.e. to unmarshal XML back into Java objects. &lt;a href="https://jaxb.dev.java.net/"&gt;JAXB2&lt;/a&gt; is a very good reference implementation of the specification.&lt;br /&gt;&lt;br /&gt;There are 2 main approaches to work with XML binding:&lt;br /&gt;&lt;br /&gt;a)start with a &lt;a href="http://www.w3.org/XML/Schema"&gt;XSD schema definition&lt;/a&gt; as input and generate a collection of Java classes from the given XML schema through the &lt;a href="http://java.sun.com/webservices/docs/2.0/jaxb/schemagen.html"&gt;schema compiler&lt;/a&gt;.&lt;br /&gt;b)start with writing the Java model classes, mark the classes with specific JAXB 2.0 annotations and compile the model classes using JAXB2 in the classpath.&lt;br /&gt;&lt;br /&gt;Here I will demonstrate the last &lt;span style=""&gt;approach&lt;/span&gt; as I find much easy for myself to think in "java classes" than to write a XSD schema definition file. The scope is to write the XML binding code for the following document:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow:auto"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;documentburster&amp;gt;&lt;br /&gt;&amp;lt;settings&amp;gt;&lt;br /&gt;&amp;lt;defaultfilename&amp;gt;defaultBurst&amp;lt;/defaultfilename&amp;gt;&lt;br /&gt;&amp;lt;emailserver&amp;gt;&lt;br /&gt;&amp;lt;host&amp;gt;your_email_server&amp;lt;/host&amp;gt;&lt;br /&gt;&amp;lt;port&amp;gt;your_email_port&amp;lt;/port&amp;gt;&lt;br /&gt;&amp;lt;userid&amp;gt;your_email_user_id&amp;lt;/userid&amp;gt;&lt;br /&gt;&amp;lt;userpassword&amp;gt;your_email_password&amp;lt;/userpassword&amp;gt;&lt;br /&gt;&amp;lt;usessl&amp;gt;false&amp;lt;/usessl&amp;gt;&lt;br /&gt;&amp;lt;usetls&amp;gt;false&amp;lt;/usetls&amp;gt;&lt;br /&gt;&amp;lt;debug&amp;gt;false&amp;lt;/debug&amp;gt;&lt;br /&gt;&amp;lt;keyfile/&amp;gt;&lt;br /&gt;&amp;lt;rootcertfile/&amp;gt;&lt;br /&gt;&amp;lt;servercertfile/&amp;gt;&lt;br /&gt;&amp;lt;emailaddressfrom&amp;gt;your_email_address&amp;lt;/emailaddressfrom&amp;gt;&lt;br /&gt;&amp;lt;emailaddressfromlabel&amp;gt;your_name&amp;lt;/emailaddressfromlabel&amp;gt;&lt;br /&gt;&amp;lt;/emailserver&amp;gt;&lt;br /&gt;&amp;lt;defaultemailmessage&amp;gt;&lt;br /&gt;&amp;lt;emailmessage&amp;gt;Default Message&amp;lt;/emailmessage&amp;gt;&lt;br /&gt;&amp;lt;emailsubject&amp;gt;Default Subject&amp;lt;/emailsubject&amp;gt;&lt;br /&gt;&amp;lt;/defaultemailmessage&amp;gt;&lt;br /&gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;&amp;lt;/documentburster&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;All the Java mapping classes are in package burster.settings.model;&lt;br /&gt;First step is to write the "documentburster" root class. Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow:auto"&gt;&lt;br /&gt;package burster.settings.model;&lt;br /&gt;import javax.xml.bind.annotation.XmlElement;&lt;br /&gt;import javax.xml.bind.annotation.XmlRootElement;&lt;br /&gt;&lt;br /&gt;@XmlRootElement(name="documentburster")&lt;br /&gt;public class DocumentBursterSettings {&lt;br /&gt;&lt;br /&gt; @XmlElement(name = "settings")&lt;br /&gt; public BursterSettings settings;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I think the code is self explanatory with &lt;a href="http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlRootElement.html"&gt;@XmlRootElement(name="documentburster")&lt;/a&gt; the most important thing to notice. &amp;lt;settings&amp;gt; is a child for the root &lt;documentburster&gt; so the &lt;a href="http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlElement.html"&gt;@XmlElement(name = "settings")&lt;/a&gt; annotation is used. The code for the class BursterSettings is:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow:auto"&gt;&lt;br /&gt;package burster.settings.model;&lt;br /&gt;&lt;br /&gt;import javax.xml.bind.annotation.XmlElement;&lt;br /&gt;&lt;br /&gt;public class BursterSettings {&lt;br /&gt; &lt;br /&gt; @XmlElement(name = "defaultfilename")&lt;br /&gt; public String defaultFileName;&lt;br /&gt;&lt;br /&gt; @XmlElement(name = "emailserver")&lt;br /&gt; public EmailServer emailServer;&lt;br /&gt;&lt;br /&gt; @XmlElement(name = "defaultemailmessage")&lt;br /&gt; public DefaultEmailMessage defaultEmailMessage;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;EmailServer and DefaultEmailMessage are classic plain java bean classes with getters and setters and without any annotation inside. Because of space issues I will show only the code for DefaultEmailMessage.java&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow:auto"&gt;&lt;br /&gt;package burster.settings.model;&lt;br /&gt;&lt;br /&gt;public class DefaultEmailMessage {&lt;br /&gt;&lt;br /&gt; private String emailsubject;&lt;br /&gt; private String emailmessage;&lt;br /&gt; &lt;br /&gt; public String getEmailmessage() {&lt;br /&gt;  return emailmessage;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void setEmailmessage(String emailmessage) {&lt;br /&gt;  this.emailmessage = emailmessage;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String getEmailsubject() {&lt;br /&gt;  return emailsubject;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void setEmailsubject(String emailsubject) {&lt;br /&gt;  this.emailsubject = emailsubject;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The code for EmailServer class is very simple as it is a plain java bean class with getters and setters.&lt;br /&gt;&lt;br /&gt;But where is the Unmarshaller code? Where is the code that actually reads/write into the XML file? The final piece of the code is the class Settings which is a "facade" for all my model XML binding classes. From my application I access all the XML binding through the Settings class and not through each model class &lt;/documentburster&gt;&lt;/settings&gt;&lt;span style=""&gt;individually&lt;/span&gt;&lt;settings&gt;&lt;documentburster&gt;. Here is the code for Settings.java:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint" style="overflow:auto"&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;&lt;br /&gt;import javax.xml.bind.JAXBContext;&lt;br /&gt;import javax.xml.bind.Unmarshaller;&lt;br /&gt;&lt;br /&gt;import burster.settings.model.BursterSettings;&lt;br /&gt;import burster.settings.model.DefaultEmailMessage;&lt;br /&gt;import burster.settings.model.DocumentBursterSettings;&lt;br /&gt;import burster.settings.model.EmailServer;&lt;br /&gt;&lt;br /&gt;public class Settings {&lt;br /&gt; private static Settings instance = new Settings();&lt;br /&gt;&lt;br /&gt; private DocumentBursterSettings docSettings;&lt;br /&gt; &lt;br /&gt; private Settings(String xmlSettingsFile) {&lt;br /&gt;loadSettings(&lt;/documentburster&gt;&lt;/settings&gt;xmlSettingsFile&lt;settings&gt;&lt;documentburster&gt;);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static Settings getInstance() {&lt;br /&gt;  return instance;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void loadSettings(String &lt;/documentburster&gt;&lt;/settings&gt;xmlSettingsFile&lt;settings&gt;&lt;documentburster&gt;)&lt;br /&gt; {&lt;br /&gt;  try {&lt;br /&gt;     JAXBContext jc = JAXBContext.newInstance(DocumentBursterSettings.class);&lt;br /&gt;        Unmarshaller u = jc.createUnmarshaller();&lt;br /&gt;    &lt;br /&gt;     docSettings = (DocumentBursterSettings)u.unmarshal(new File(&lt;/documentburster&gt;&lt;/settings&gt;xmlSettingsFile&lt;settings&gt;&lt;documentburster&gt;));&lt;br /&gt;     } catch(Exception e){&lt;br /&gt;        System.out.println("Settings.loadSettings: " + e);&lt;br /&gt;    }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; private BursterSettings getSettings() {&lt;br /&gt;  return docSettings.settings;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public EmailServer getEmailServer() {&lt;br /&gt;  return getSettings().emailServer;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public DefaultEmailMessage getDefaultEmailMessage() {&lt;br /&gt;  return getSettings().defaultEmailMessage;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String getDefaultFileName() {&lt;br /&gt;  return getSettings().defaultFileName;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In this post I experimented only with a small part of what JAXB2 is capable. By the way JAXB2 is included with Java SE6 but you can use it in earlier versions of Java if you download it from &lt;a href="https://jaxb.dev.java.net/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I would appreciate a comment if you feel you have your own noteworthy xml binding tips.&lt;br /&gt;&lt;br /&gt;Further resources:&lt;br /&gt;1)&lt;a href="http://www.pdfburst.com/"&gt;DocumentBurster project&lt;/a&gt;&lt;br /&gt;2)&lt;a href="http://www.devx.com/Java/Article/34069/0/page/1"&gt;Another Good JAXB2 tutorial&lt;/a&gt;&lt;br /&gt;3)&lt;a href="http://www.rpbourret.com/xml/XMLDataBinding.htm"&gt;XML Data Binding Resources&lt;/a&gt;&lt;/documentburster&gt;&lt;/settings&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-6476250839982874174?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=Tf_6BkrDxGA:ahbi9LZvaLU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/Tf_6BkrDxGA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/6476250839982874174/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=6476250839982874174" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/6476250839982874174?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/6476250839982874174?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/Tf_6BkrDxGA/java-architecture-for-xml-binding-jaxb2.html" title="Java Architecture for XML Binding - JAXB2 kick-off tutorial" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/05/java-architecture-for-xml-binding-jaxb2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YAQng7eip7ImA9WxZbFk8.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-2052976120461104973</id><published>2008-04-19T03:18:00.000-07:00</published><updated>2008-04-19T09:05:43.602-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-19T09:05:43.602-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="web development" /><category scheme="http://www.blogger.com/atom/ns#" term="EJB criticism" /><category scheme="http://www.blogger.com/atom/ns#" term="java enterprise development" /><title>Make Web and EJB development simple</title><content type="html">During the years &lt;a href="http://en.wikipedia.org/wiki/Enterprise_JavaBean#Rapid_adoption_followed_by_criticism%22"&gt;EJB got criticism&lt;/a&gt; with the main idea that it mostly introduces a lot of complexity without delivering many benefits.  I remember 3 years ago when I first came in touch with Java and J2EE. I was coming with Desktop &amp;amp; .Net kind of programming experience where everything was simple and straightforward. My first J2EE task was to create the simplest screen in the world with two textboxes and one lookup control. I started to dig into the existing application and to develop by finding similar stuff. Blindly I found myself adding stupid code that was not doing anything (home interface-this is what I was thinking at that time) many xml files that looked almost identical but with small differences one from each other (deployment descriptors), xsl files,jsp/javascript files etc and in the final I got around 20 source files for such&lt;br /&gt;a simple task. I was totally confused and I didn’t know what to believe. I was afraid to say that this is totally wrong as I was new and I was thinking that I don’t understand.&lt;br /&gt;&lt;br /&gt;After three years of working with J2EE/EJB2 I got some “best practices” experience that I want to share with you. I will not enumerate here all the “known EJB” limitations just for the sake of writing. I will speak only about the things I encountered in my experience and for which I invested some time of thinking for better alternatives. I will not say “don’t use EJB” - use lighter frameworks. I assume that you already considered very seriously the alternatives and you have strong reasons for using EJBs (either technical or political or marketing reasons).&lt;br /&gt;&lt;br /&gt;So my points will be:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1)Keep it as simple as possible&lt;/span&gt;. Question for anything…why it has to be so complicated?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2)Make a clear logic separation&lt;/span&gt; between the business code (APIs) and presentation code (WEB part – mostly JSPs/HTML/JS files). In practice it is a good to have also physical separation with two different building blocks one for business APIs and one for the WEB presentation part.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3)On the APIs side write only business code&lt;/span&gt;. Don’t write by yourself any deployment descriptor; don’t write any home interface or any boiler plate code. If you do so you will finish with 1000 “hand written” deployment descriptors files, 500 for Weblogic/500 for Websphere and with thousands or boiler plate source files on your source repository. Each upgrade of Weblogic or Websphere will be a nightmare. Use tools like &lt;a href="http://xdoclet.sourceforge.net/xdoclet/index.html"&gt;XDoclet&lt;/a&gt; in order to generate all this boiler plate code on build time.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4)Write your all business code with &lt;a href="http://en.wikipedia.org/wiki/POJO"&gt;POJOs&lt;/a&gt;&lt;/span&gt;, not directly in EJBs. Make EJB a “small detail” of your application and not a “deep inside” aspect. Make your business logic only “deployed” with EJB and not “written” with EJB. In order to achieve this one option can be to “decorate/facade” your POJOs with EJB capabilities at build time by generating some proxies that will be the real EJBs. If you will follow this rule you will be able to write JUnits for your business code much easily without needing an EJB container for running the tests. Another advantage is that you will be able to “easily deploy” the business with a lighter framework like Spring or EJB3 at a later point in time if you will decide to move on with newer technologies.&lt;br /&gt;&lt;br /&gt;5)This one is a continuation of the previous idea. &lt;span style="font-weight: bold;"&gt;Don’t use inside your business POJO’s imports like import javax.ejb.something&lt;/span&gt;. POJO means plain java and not J2EE. Try to keep aspects like transaction management and security outside your business code (maybe use declarative transaction management and security in deployment descriptors is an option for doing this?). Business POJOs should contain only your business code and nothing like framework/platform invasive stuff.&lt;br /&gt;&lt;br /&gt;6)&lt;span style="font-weight: bold;"&gt;Write &lt;a href="http://www.junit.org/"&gt;JUnits test cases&lt;/a&gt; during the development&lt;/span&gt;. Use a technique like &lt;a href="http://en.wikipedia.org/wiki/Dependency_injection"&gt;Dependeny injection&lt;/a&gt; in order to make your POJO business components clearly separated. This way you will be able to write tests easier by using &lt;a href="http://en.wikipedia.org/wiki/Mock_object"&gt;mocking&lt;/a&gt;. If you respected rules 4 and 5 you will be able to run the automated JUnit test cases fast (at build time) without the need to start any application server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;7)&lt;a href="http://en.wikipedia.org/wiki/Refactoring"&gt;Refactor&lt;/a&gt; your code all the time&lt;/span&gt;. JUnits test cases will help you in this direction by testing that existing functionality in not broken during the refactoring process.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;8)Don’t try to write you own infrastructure code&lt;/span&gt; (“home made” frameworks) for anything that is not related with your business. You will just loose time and energy that is better to be invested in business code. For example don’t write your own “in house” ORM framework. Better to invest your energy just in finding the solution that suits your needs from the well established open source market: &lt;a href="http://www.hibernate.org/"&gt;Hibernate&lt;/a&gt;, &lt;a href="http://ibatis.apache.org/"&gt;Apache iBatis&lt;/a&gt;, &lt;a href="http://cayenne.apache.org/"&gt;Apache Cayenne&lt;/a&gt; etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;9)Deploy as EJB only components with obvious business meaning&lt;/span&gt;. Don’t deploy as EJB stuff that should be helpers for example. In my current application during the time a mixture between business components and helper classes were both deployed as EJBs. This means more deployment descriptors, JNDI lookups for helper classes and so on.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;10)Don’t write EJB JNDI lookup calls inside your POJO APIs&lt;/span&gt;. If one business component needs services from another one than use POJO only calling conventions (normal java class that is using another simple java class). JNDI lookups should be only from Web part (the client) to the API business layer (the business server).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;11)Keep your Web presentation part as simple as possible&lt;/span&gt;. Don’t write any business logic inside JavaScript for example. Ideally your JSPs should do nothing more than drawing GUI stuff. I suggest using a framework like &lt;a href="http://struts.apache.org/2.x/index.html"&gt;Struts2 for the Web presentation part&lt;/a&gt;. Write as little as possible logic inside the Web part. Ideally the Struts2 action classes should contain nothing more than redirecting to a business API for making the business processing and retrieving information. Again … don’t write any kind of logic inside the presentation JSPs or in JavaScript. It is very good if you can fully eliminate Javascript “hand written” code from your application.&lt;br /&gt;&lt;br /&gt;12)If you need Ajax support then &lt;span style="font-weight: bold;"&gt;don’t try to make your own homegrown Ajax framework&lt;/span&gt;. Look for a well established option like &lt;a href="http://dojotoolkit.org/"&gt;Dojo&lt;/a&gt;, &lt;a href="http://prototypejs.org/"&gt;Prototype&lt;/a&gt;, and &lt;a href="http://code.google.com/webtoolkit/"&gt;GWT&lt;/a&gt; etc.&lt;br /&gt;&lt;br /&gt;13)This one is obvious….stay away from any vendor specific feature. Things like&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;import weblogic.bla.bla…&lt;/span&gt; should not appear in any part of your code. BEA and IBM are very friendly in helping us to import their classes but this will only make our application blocked with a particular vendor.&lt;br /&gt;&lt;br /&gt;14)Make your build and deployment scripts as simple/straightforward, small and generic as possible. Try to avoid as much as possible conditions like “if weblogic/websphere” in your build or deploy scripts.&lt;br /&gt;&lt;br /&gt;15)Configure correctly &lt;span style="font-weight: bold;"&gt;“hot deployment”&lt;/span&gt; for your application server. This will speed up the development and the debugging of your application.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;16)Use tools&lt;/span&gt; like &lt;a href="http://continuum.apache.org/"&gt;Continuum&lt;/a&gt;, &lt;a href="http://ant.apache.org/"&gt;Ant&lt;/a&gt;, &lt;a href="http://findbugs.sourceforge.net/"&gt;Findbugs&lt;/a&gt;, &lt;a href="http://pmd.sourceforge.net/"&gt;PMD&lt;/a&gt;, &lt;a href="http://maven.apache.org/"&gt;Maven2&lt;/a&gt;, &lt;a href="http://cobertura.sourceforge.net/"&gt;Cobertura&lt;/a&gt;, &lt;a href="http://checkstyle.sourceforge.net/"&gt;Checkstyle&lt;/a&gt; and &lt;a href="http://jalopy.sourceforge.net/"&gt;Jalopy&lt;/a&gt; extensively in your build process. All these tools should be part of build scripts and should not be optional if you expect quality code.&lt;br /&gt;&lt;br /&gt;So do you have some other “tricks” that can make the web and enterprise development simple and straightforward? I will be glad to hear from you what you think.&lt;br /&gt;&lt;br /&gt;Further Readings:&lt;br /&gt;-&lt;b class="sans"&gt;&lt;span id="btAsinTitle"&gt; &lt;a href="http://www.amazon.com/gp/product/0596005717/105-3634338-4132464?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=0596005717"&gt;Head First EJB&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/0764558315/105-3634338-4132464?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=0764558315"&gt;&lt;b class="sans"&gt;&lt;span id="btAsinTitle"&gt;Expert One-on-One J2EE Development without EJB&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-2052976120461104973?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=6bVfzXHAiSQ:DnhzDbk3ESk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/6bVfzXHAiSQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/2052976120461104973/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=2052976120461104973" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/2052976120461104973?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/2052976120461104973?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/6bVfzXHAiSQ/make-web-and-ejb-development-simple.html" title="Make Web and EJB development simple" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/04/make-web-and-ejb-development-simple.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8AR3k7fip7ImA9WxZbEEs.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-7769050570653911332</id><published>2008-04-06T04:47:00.000-07:00</published><updated>2008-04-12T22:34:06.706-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-12T22:34:06.706-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="documentburster" /><category scheme="http://www.blogger.com/atom/ns#" term="feedback" /><title>Give your DocumentBurster feedback</title><content type="html">Hello. Here is the place where you can give your feedback about &lt;a href="http://www.pdfburst.com/"&gt;DocumentBurster project&lt;/a&gt;. Feedback can be about suggesting a new feature for the program or describing a problem that you might have. I will be here to assist so please feel free to tell me what you think.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-7769050570653911332?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=pmTG6IeGclQ:yqWwKz4V1Fs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/pmTG6IeGclQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/7769050570653911332/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=7769050570653911332" title="11 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/7769050570653911332?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/7769050570653911332?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/pmTG6IeGclQ/give-your-documentburster-feedback.html" title="Give your DocumentBurster feedback" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>11</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/04/give-your-documentburster-feedback.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQCRns6cCp7ImA9WxdQFEo.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-8263673052684223800</id><published>2008-04-06T00:42:00.000-07:00</published><updated>2008-06-14T13:12:47.518-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-14T13:12:47.518-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="wxWidgets tutorial" /><title>Getting started with wxWidgets - Part5 - Hands on showcase with DocumentBurster</title><content type="html">&lt;span style=""&gt;Finally we are here. In this post I will show a “start to end” example of how to build a non trivial application using wxWidgets. This application will contain most of the elements which are enumerated in &lt;a href="http://docs.wxwidgets.org/stable/wx_roughguide.html#roughguide"&gt;“Writing a wxWidgets application: a rough guide”&lt;/a&gt;. &lt;a href="http://www.pdfburst.com/"&gt;DocumentBurster&lt;/a&gt; is the application that we will look inside in this real example. Please feel free to &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=213679"&gt;download the source code&lt;/a&gt; in order to study and understand better the concepts explained here.&lt;br /&gt;&lt;br /&gt;Some other things that I will show today are:&lt;br /&gt;&lt;br /&gt;- How to use &lt;a href="http://dmoulding.googlepages.com/vld"&gt;Visual Leak Detector&lt;/a&gt; in order to catch the memory leaks in the program.&lt;br /&gt;- How to use &lt;a href="https://svn.boost.org/svn/boost/trunk/boost/property_tree/"&gt;“Property Tree”&lt;/a&gt; library in order to easily read/write program settings in an xml file. Basically this is a very simple and convenient way to achieve XML binding in C++ programs. Property Tree is part of the &lt;a href="http://www.boost.org/"&gt;Boost C++ libraries&lt;/a&gt;.&lt;br /&gt;- How to asynchronously call an external program/process from wxWidgets and redirect the output of it to a console window.&lt;br /&gt;&lt;br /&gt;Here are few pictures of how the final program will look.&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_9LparpuZ-eU/R_iSNN1osNI/AAAAAAAAAAM/nIRFDXy0LVU/s1600-h/db1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_9LparpuZ-eU/R_iSNN1osNI/AAAAAAAAAAM/nIRFDXy0LVU/s320/db1.JPG" alt="" id="BLOGGER_PHOTO_ID_5186055726667706578" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_9LparpuZ-eU/R_iSNd1osOI/AAAAAAAAAAU/66bQnNDVlmY/s1600-h/db2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_9LparpuZ-eU/R_iSNd1osOI/AAAAAAAAAAU/66bQnNDVlmY/s320/db2.JPG" alt="" id="BLOGGER_PHOTO_ID_5186055730962673890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_9LparpuZ-eU/R_iSNt1osPI/AAAAAAAAAAc/D1hJmSgDTK4/s1600-h/db3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_9LparpuZ-eU/R_iSNt1osPI/AAAAAAAAAAc/D1hJmSgDTK4/s320/db3.JPG" alt="" id="BLOGGER_PHOTO_ID_5186055735257641202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_9LparpuZ-eU/R_iSNt1osQI/AAAAAAAAAAk/Tgfhvtlblc8/s1600-h/db4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_9LparpuZ-eU/R_iSNt1osQI/AAAAAAAAAAk/Tgfhvtlblc8/s320/db4.JPG" alt="" id="BLOGGER_PHOTO_ID_5186055735257641218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;So let's get in.&lt;br /&gt;&lt;br /&gt;Download and install &lt;a href="http://dmoulding.googlepages.com/vld"&gt;Visual Leak Detector&lt;/a&gt;. Assuming you are using Visual Studio as your IDE (I explained in a previous post how to set up VS IDE with wxWidgets) you need to go to Tools-Options-Project And Solutions - VC++ Directories and add the &lt;b&gt;Include Files + Library Files&lt;/b&gt; for your Visual Leak Detector installation. &lt;b&gt;#include &amp;lt;vld.h&amp;gt;&lt;/b&gt; is what you need to do in your &lt;b&gt;.h files&lt;/b&gt; when you want to trace memory leaks.&lt;br /&gt;&lt;br /&gt;Next step is to download &lt;a href="http://www.boost.org/"&gt;Boost C++ libraries&lt;/a&gt;. Here we will use only a very small part of Boost (&lt;a href="https://svn.boost.org/svn/boost/trunk/boost/property_tree/"&gt;Property Tree&lt;/a&gt;) but you should take a look to this great set of C++ libraries. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;span style=""&gt;&lt;a href="http://www.pdfburst.com/"&gt;DocumentBurster&lt;/a&gt; is following the structure of a usual wxWidgets application described in&lt;br /&gt;&lt;a href="http://docs.wxwidgets.org/stable/wx_roughguide.html#roughguide"&gt;“Writing a wxWidgets application: a rough guide”&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So the most important classes that you should trace into the source code are:&lt;br /&gt;&lt;br /&gt;1)&lt;b&gt;DocumentBursterApp&lt;/b&gt;. It is the point of entry into the program( it is like the main() function into a c/java program) and is extending as you might guess : &lt;a href="http://docs.wxwidgets.org/stable/wx_wxapp.html#wxapp"&gt;wxApp&lt;/a&gt;&lt;br /&gt;virtual bool OnInit() is a function which needs to be implemented so the code is:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;bool DocumentBursterApp::OnInit()&lt;br /&gt;{&lt;br /&gt; if (IsAnotherInstanceRunning()) return false;&lt;br /&gt; ShowMainWindow();&lt;br /&gt; return true;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I think the code is self explanatory.&lt;br /&gt;&lt;br /&gt;2)&lt;b&gt;MainFrm&lt;/b&gt;. This is the main window (subclass of &lt;a href="http://docs.wxwidgets.org/stable/wx_wxframe.html#wxframe"&gt;wxFrame&lt;/a&gt;) of the application and is created inside the DocumentBursterApp::ShowMainWindow.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;void DocumentBursterApp::ShowMainWindow()&lt;br /&gt;{&lt;br /&gt; MainFrm *mainFrame = new MainFrm(NULL);&lt;br /&gt; mainFrame-&gt;Show(true);&lt;br /&gt; SetTopWindow(mainFrame);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3)&lt;b&gt;OptionsDlg&lt;/b&gt;. This is the next important class of the program. It extends &lt;a href="http://docs.wxwidgets.org/stable/wx_wxdialog.html#wxdialog"&gt;wxDialog&lt;/a&gt;. This class keeps inside the code for the options screen that is a GUI front-end for entering the different settings of the program. This class is created inside the function&lt;br /&gt;&lt;p class="MsoNormal"&gt; &lt;b&gt;void MainFrm::OnOptions(wxCommandEvent&amp;amp; event)&lt;/b&gt;. What is important to point here is about the &lt;a href="http://docs.wxwidgets.org/stable/wx_eventhandlingoverview.html#eventhandlingoverview"&gt;&lt;b&gt;event handling mechanism&lt;/b&gt;&lt;/a&gt; in wxWidgets. Simply saying event handling is about responding to different actions that are happening into your program like user selecting a menu, clicking a button, showing a window, hiding a window and many other types of events.&lt;br /&gt;For example&lt;b&gt; OnOptions() &lt;/b&gt;function is called whenever the user is clicking the "Program Options" menu item from DocumentBursters main window&lt;b&gt;. &lt;/b&gt;In this function the Options screen is created with the following code&lt;b&gt;.&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;void MainFrm::OnOptions(wxCommandEvent&amp;amp; WXUNUSED(event))&lt;br /&gt;{&lt;br /&gt; if ( !mpOptionsDlg )&lt;br /&gt; {&lt;br /&gt;   mpOptionsDlg = new OptionsDlg(this);&lt;br /&gt; }&lt;br /&gt; mpOptionsDlg-&gt;Show(true);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;But how can we make the wxWidgets framework to call our functions when a specific event is happening in the system? In order for a window class to respond to events it needs to make a call to &lt;b&gt;DECLARE_EVENT_TABLE() &lt;/b&gt;in the &lt;b&gt;.h class declaration&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;class MainFrm : public wxFrame&lt;br /&gt;{&lt;br /&gt; private:&lt;br /&gt;  &lt;b&gt;DECLARE_EVENT_TABLE();&lt;/b&gt;&lt;br /&gt;  void OnExit(wxCommandEvent&amp;amp; event);&lt;br /&gt;  void OnAbout(wxCommandEvent&amp;amp; event);&lt;br /&gt;  void OnOptions(wxCommandEvent&amp;amp; event);&lt;br /&gt;  ....&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Inside the &lt;b&gt;.cpp class implementation&lt;/b&gt; following code is "linking" between events and functions that are called when events are happening.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt; &lt;b&gt;BEGIN_EVENT_TABLE(MainFrm,wxFrame)&lt;/b&gt;&lt;br /&gt; EVT_MENU(ID_MNU_EXIT, MainFrm::OnExit)&lt;br /&gt; EVT_MENU(ID_MNU_ABOUT_DOCUMENTBURSTER, MainFrm::OnAbout)&lt;br /&gt; &lt;b&gt;EVT_MENU(ID_MNU_DOCUMENTBURSTER_OPTIONS, MainFrm::OnOptions)&lt;/b&gt;&lt;br /&gt; EVT_CLOSE(MainFrm::OnClose)&lt;br /&gt; &lt;b&gt;END_EVENT_TABLE()&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you see each event has associated a constant which is declared in the .h file.&lt;br /&gt;&lt;br /&gt;4)&lt;b&gt;Settings&lt;/b&gt; is the next class that we will look. Here is the place where the XML binding is implemented. &lt;a href="https://svn.boost.org/svn/boost/trunk/boost/property_tree/"&gt;“Property Tree”&lt;/a&gt; library is used for reading and writing of program configurations into the config xml file. This library is part of &lt;a href="http://www.boost.org/"&gt;Boost C++ libraries&lt;/a&gt; which I advise you to take a look. Some methods of the class are:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt; &lt;br /&gt; wxString GetProperty(wxString path);&lt;br /&gt; void SetProperty(wxString path,wxString value);&lt;br /&gt;&lt;br /&gt; void Load();&lt;br /&gt; void ResetAllChanges();&lt;br /&gt; void Save();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Implementations of these functions are trivial and you can &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=213679"&gt;download the source code&lt;/a&gt; for detailed informations.&lt;br /&gt;&lt;br /&gt;5)How to &lt;b&gt;asynchronously call an external program&lt;/b&gt;/process from wxWidgets and redirect the output of it to a console window. &lt;b&gt;PipedProcess&lt;/b&gt; and &lt;b&gt;ConsoleFrm&lt;/b&gt; are the classes involved here. ConsoleFrm is extending &lt;a href="http://docs.wxwidgets.org/stable/wx_wxframe.html#wxframe"&gt;wxFrame&lt;/a&gt; and is the window that is showing the output from the executed process. PipedProcess is extending &lt;a href="http://docs.wxwidgets.org/2.8.6/wx_wxprocess.html"&gt;wxProcess&lt;/a&gt;. The code to execute the process is something like:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;void OptionsDlg::OnExecWithRedirect(wxCommandEvent&amp;amp; event)&lt;br /&gt;{&lt;br /&gt;  ...&lt;br /&gt;  ConsoleFrm* console = new ConsoleFrm(this);&lt;br /&gt;  console-&gt;Show(true);&lt;br /&gt;&lt;br /&gt;  PipedProcess *process = new PipedProcess(console, cmd);&lt;br /&gt;  if ( !wxExecute(cmd, wxEXEC_ASYNC, process) )&lt;br /&gt;  {&lt;br /&gt;    wxLogError(_T("Execution of '%s' failed."), cmd.c_str());&lt;br /&gt;    delete process;&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  {&lt;br /&gt;    console-&gt;AddAsyncProcess(process);&lt;br /&gt;    ...&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;With this post we finished the full wxWidgets tutorial. It was a five parts tutorial in which I tried to show the most important information that people will need to "get started" while keeping it simple enough to be digested in short time by beginners. I will be happy if you will tell me what I did well and what I can improve in order to make this tutorial better.&lt;br /&gt;&lt;br /&gt;Further Readings:&lt;br /&gt;- &lt;a href="http://www.wxwidgets.org/"&gt;Officiall wxWidgets site&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/0131473816/102-7067168-6612965?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=0131473816"&gt;Cross-Platform GUI Programming with wxWidgets&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/1932394621/102-7067168-6612965?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=1932394621"&gt;wxPython in Action&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy :-)&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/7769052816642004160-8263673052684223800?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=bjcu1Dwr0Xw:p3dyi4dXzpA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/bjcu1Dwr0Xw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/8263673052684223800/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=8263673052684223800" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/8263673052684223800?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/8263673052684223800?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/bjcu1Dwr0Xw/getting-started-with-wxwidgets-part5.html" title="Getting started with wxWidgets - Part5 - Hands on showcase with DocumentBurster" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_9LparpuZ-eU/R_iSNN1osNI/AAAAAAAAAAM/nIRFDXy0LVU/s72-c/db1.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/04/getting-started-with-wxwidgets-part5.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMFQ3wycCp7ImA9WxdQFEo.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-5719065260512171583</id><published>2008-04-01T10:14:00.000-07:00</published><updated>2008-06-14T13:13:32.298-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-14T13:13:32.298-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="wxWidgets tutorial" /><title>Getting started with wxWidgets - Part4 - Set up the environment</title><content type="html">In the previous posts I told you about wxWidgets only theoretical. Now time has come for some “hands on” stuff. For writing a wxWidgets application you need to write the business code in C++ but also to draw the GUI interface.&lt;br /&gt;&lt;br /&gt;In the current post I will show:&lt;br /&gt;&lt;br /&gt;1)&lt;span style="font-weight: bold;"&gt;How to make Microsoft Visual Studio “wxWidgets ready&lt;/span&gt;” so you can write&amp;amp;build your wxWidgets code.&lt;br /&gt;&lt;br /&gt;The easy way is to download&amp;amp;install &lt;a href="http://wxpack.sourceforge.net/"&gt;wxPack&lt;/a&gt;. Follow the wxPack setup and “magically” your Microsoft Visual Studio environment is configured for the latest version of wxWidgets. Behind the scene wxPack copied wxWidgets libraries in binary forms and configured for us all the complicated settings in the VS IDE.&lt;br /&gt;&lt;br /&gt;If you are beginner I advise to choose the easy way. The alternative to this is to download &amp;amp; build “by hand” wxWidgets and to set up everything in Visual Studio. &lt;a href="http://www.wxwidgets.org/wiki/index.php/MSVC_.NET_Setup_Guide"&gt;Here is a guide to how to do this&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;2)&lt;span style="font-weight: bold;"&gt;Choose a tool that will allow you to easily draw the screens&lt;/span&gt; by placing GUI controls in a drag and drop style (similar with Delphi RAD). Once you have your screens you can generate the GUI related C++ code(that you will copy&amp;amp;paste in Visual Studio) or export your GUI definitions as XRC files (Basically these are XML files that keep all the definitions of your GUI externally from the business code and which you can modify at run-time without re-building the application).&lt;br /&gt;&lt;br /&gt;In my day to day work I use &lt;a href="http://www.anthemion.co.uk/dialogblocks/"&gt;Anthemion DialogBlocks&lt;/a&gt;. I tried also &lt;a href="http://wxformbuilder.org/"&gt;wxFormBuilder&lt;/a&gt; and &lt;a href="http://wxglade.sourceforge.net/"&gt;wxGlade&lt;/a&gt; (which are free) but I was not able to use those productively because of some randomly problems that were appearing. With DialogBlocks I was able to do my work without a big learning curve. Maybe it is only a matter of getting used to a tool by I like DialogBlocks.&lt;br /&gt;&lt;br /&gt;Starting with next session I will show how to build a wxWidgets application from start to the end.&lt;br /&gt;&lt;br /&gt;Further Resources:&lt;br /&gt;- &lt;a href="http://www.wxwidgets.org/"&gt;Officiall wxWidgets site&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.codeblocks.org/"&gt;CodeBlock-Alternative to VS IDE for developing wxWidgets applications&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.wxwidgets.org/wiki/index.php/CodeBlocks_Setup_Guide"&gt;How to configure CodeBlocks for wxWidgets development&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.bloodshed.net/devcpp.html"&gt;DevC++ -Alternative to VS IDE for developing wxWidgets applications&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.wxwidgets.org/wiki/index.php/Dev-CPP_Setup_Guide"&gt;How to configure DevC++ for wxWidgets development&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://wxdsgn.sourceforge.net/"&gt;wxDev-C++ is an extension of Dev-C++ by Colin Laplace et. al.&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/0131473816/102-7067168-6612965?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=0131473816"&gt;Cross-Platform GUI Programming with wxWidgets&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/1932394621/102-7067168-6612965?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=1932394621"&gt;wxPython in Action&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So Enjoy :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-5719065260512171583?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=pQON9K7XjPU:fdwnLBSHUGs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/pQON9K7XjPU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/5719065260512171583/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=5719065260512171583" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5719065260512171583?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5719065260512171583?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/pQON9K7XjPU/getting-started-with-wxwidgets-part4.html" title="Getting started with wxWidgets - Part4 - Set up the environment" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/04/getting-started-with-wxwidgets-part4.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMARHg5fyp7ImA9WxdQFEo.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-737712157218994994</id><published>2008-03-30T13:05:00.000-07:00</published><updated>2008-06-14T13:14:05.627-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-14T13:14:05.627-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="wxWidgets tutorial" /><title>Getting started with wxWidgets - Part3 - Steps to write a simple application</title><content type="html">Here is a cookbook of how to write a simple application in wxWidgets. I will try to split this process in couple of simple to follow steps.&lt;br /&gt;&lt;br /&gt;1)First step is to derive a wxApp class and override wxApp::OnInit.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;#include "wx/app.h"&lt;br /&gt;&lt;br /&gt;class DocumentBursterApp : public wxApp&lt;br /&gt;{&lt;br /&gt; public:&lt;br /&gt;  virtual bool OnInit();&lt;br /&gt;  ...&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;2)An application must have a top-level wxFrame or wxDialog window. Each frame may contain one or more instances of classes such as wxPanel, wxSplitterWindow or other windows and controls.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;class MainFrm : public wxFrame&lt;br /&gt;{&lt;br /&gt;  ...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;bool DocumentBursterApp::OnInit()&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt; MainFrm *mainFrame = new MainFrm(NULL);&lt;br /&gt; mainFrame-&gt;Show(true);&lt;br /&gt; SetTopWindow(mainFrame);&lt;br /&gt; &lt;br /&gt; return true;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3)A frame can have a wxMenuBar, a wxToolBar, a status line, and a wxIcon for when the frame is iconized.&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;void MainFrm::CreateGUIControls(void)&lt;br /&gt;{&lt;br /&gt;   wxIcon ic_exe;&lt;br /&gt;   ic_exe.LoadFile(wxT("images/mondrian.ico"),wxBITMAP_TYPE_ICO);&lt;br /&gt;&lt;br /&gt;   SetIcon(ic_exe);&lt;br /&gt;   mpMenuMain =  new wxMenuBar();&lt;br /&gt;   ...&lt;br /&gt;&lt;br /&gt;   this-&gt;SetMenuBar(mpMenuMain);&lt;br /&gt;   ...&lt;br /&gt;   mpStatusMain = new wxStatusBar(this, ID_MPSTATUSMAIN);&lt;br /&gt;   ...&lt;br /&gt;   this-&gt;SetStatusBar(mpStatusMain);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;4)A wxPanel is used to place controls (classes derived from wxControl) which are used for user interaction. Examples of controls are wxButton, wxCheckBox, wxChoice, wxListBox, wxRadioBox, wxSlider.&lt;br /&gt;&lt;br /&gt;5)Instead of creating a dialog box and populating it with items, it is possible to choose one of the convenient common dialog classes, such as wxMessageDialog and wxFileDialog.&lt;br /&gt;&lt;br /&gt;6)You never draw directly onto a window - you use a device context (DC). wxDC is the base for wxClientDC, wxPaintDC, wxMemoryDC, wxPostScriptDC, wxMemoryDC, wxMetafileDC and wxPrinterDC. If your drawing functions have wxDC as a parameter, you can pass any of these DCs to the function, and thus use the same code to draw to several different devices. You can draw using the member functions of wxDC, such as wxDC::DrawLine and wxDC::DrawText. Control colour on a window (wxColour) with brushes (wxBrush) and pens (wxPen).&lt;br /&gt;&lt;br /&gt;7)To intercept events, you add a DECLARE_EVENT_TABLE macro to the window class declaration, and put a BEGIN_EVENT_TABLE ... END_EVENT_TABLE block in the implementation file. Between these macros, you add event macros which map the event (such as a mouse click) to a member function. These might override predefined event handlers such as for wxKeyEvent and wxMouseEvent.&lt;br /&gt;&lt;br /&gt;in OptionsDlg.h file...&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;class OptionsDlg: public wxDialog&lt;br /&gt;{   &lt;br /&gt;   &lt;b&gt;DECLARE_EVENT_TABLE();&lt;/b&gt;&lt;br /&gt;   ...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and in the OptionsDlg.cpp file...&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt; &lt;b&gt;BEGIN_EVENT_TABLE( OptionsDlg, wxDialog )&lt;/b&gt;&lt;br /&gt; EVT_BUTTON(ID_BTNCANCEL,  OptionsDlg::OnCancel)&lt;br /&gt; EVT_BUTTON  (ID_BTNSAVE,  OptionsDlg::OnSave)&lt;br /&gt; EVT_BUTTON  (ID_BTNPATH,  OptionsDlg::OnPdfPath)&lt;br /&gt; EVT_BUTTON  (ID_BTNRESET,  OptionsDlg::OnResetAll)&lt;br /&gt; EVT_BUTTON  (ID_BTNSCHEDULE,  OptionsDlg::OnExecWithRedirect)&lt;br /&gt; EVT_INIT_DIALOG(OptionsDlg::OnInitDialog)&lt;br /&gt; EVT_TREE_SEL_CHANGED(ID_TREEOPTIONS,OptionsDlg::OnOptionsTreeItemChanged)&lt;br /&gt; &lt;b&gt;END_EVENT_TABLE()&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;8)Most modern applications will have an on-line, hypertext help system; for this, you need wxHelp and the wxHelpController class to control wxHelp.&lt;br /&gt;&lt;br /&gt;9)GUI applications aren't all graphical wizardry. List and hash table needs are catered for by wxList and wxHashMap. You will undoubtedly need some platform-independent file functions, and you may find it handy to maintain and search a list of paths using wxPathList. There's a miscellany of operating system and other functions.&lt;br /&gt;&lt;br /&gt;You see. It is like a MFC guide :-).&lt;br /&gt;&lt;br /&gt;This was my simple introduction to wxWidgets. In the following sections I will show you in greater details how to write a wxWidgets application from start to end.&lt;br /&gt;&lt;br /&gt;Further Readings:&lt;br /&gt;- &lt;a href="http://www.wxwidgets.org/"&gt;Officiall wxWidgets site&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/0131473816/102-7067168-6612965?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=0131473816"&gt;Cross-Platform GUI Programming with wxWidgets&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/1932394621/102-7067168-6612965?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=1932394621"&gt;wxPython in Action&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-737712157218994994?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=g6uo8R8u6ZY:ZiBZq0LE9nk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/g6uo8R8u6ZY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/737712157218994994/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=737712157218994994" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/737712157218994994?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/737712157218994994?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/g6uo8R8u6ZY/getting-started-with-wxwidgets-part3.html" title="Getting started with wxWidgets - Part3 - Steps to write a simple application" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/03/getting-started-with-wxwidgets-part3.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQEQHsyeip7ImA9WxdQFEo.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-4814503780119667696</id><published>2008-03-30T00:26:00.000-07:00</published><updated>2008-06-14T13:11:41.592-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-14T13:11:41.592-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="wxWidgets tutorial" /><title>Getting started with wxWidgets - Part2 - Classes at a glance</title><content type="html">wxWidgets is a very extensive GUI application framework with many years of proved "production deployments". It has almost 4 mil downloads on sourceforge.net being one of the most active open source projects on this site.&lt;br /&gt;&lt;br /&gt;With wxWidgets you get a very big number of components/classes which are coming in the official package and which should be enough for most of the normal programming tasks. If you need more than there are also 3-rd party controls which are of course free. One of the most active wxWidgets component repositories (beside the standard one) is &lt;a href="http://wxcode.sourceforge.net/index.php"&gt;wxCode&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In this section I want to make a short overview of the most important classes in the package. So classes by category:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1)Managed windows&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wxTopLevelWindow,wxDialog,wxFrame,wxPropertySheetDialog,&lt;br /&gt;wxSplashScreen,wxTipWindow,wxWizard&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2)Miscellaneous windows&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wxPanel,wxScrolledWindow,wxGrid,wxSplitterWindow,&lt;br /&gt;wxStatusBar,wxToolBar,wxNotebook,wxListbook,&lt;br /&gt;wxChoicebook,wxTreebook,wxWizardPage,wxWizardPageSimple&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3)Common dialogs &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wxDialog,wxColourDialog,wxDirDialog,wxFileDialog,&lt;br /&gt;wxFindReplaceDialog,wxMultiChoiceDialog,wxSingleChoiceDialog,&lt;br /&gt;wxTextEntryDialog,wxPasswordEntryDialog,wxFontDialog,&lt;br /&gt;wxPageSetupDialog,wxPrintDialog,wxProgressDialog,&lt;br /&gt;wxMessageDialog,wxSymbolPickerDialog,&lt;br /&gt;wxRichTextFormattingDialog,wxWizard&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4)Controls&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wxAnimationCtrl,wxControl,wxButton,wxBitmapButton,&lt;br /&gt;wxBitmapComboBox,wxToggleButton,wxCalendarCtrl,wxCheckBox,&lt;br /&gt;wxCheckListBox,wxChoice,wxComboBox,wxComboCtrl,wxDataViewCtrl,&lt;br /&gt;wxGauge,wxGenericDirCtrl,wxHtmlListBox,wxSimpleHtmlListBox,&lt;br /&gt;wxStaticBox,wxListBox,wxListCtrl,wxListView,&lt;br /&gt;wxOwnerDrawnComboBox,wxRichTextCtrl,wxTextCtrl,wxTreeCtrl,&lt;br /&gt;wxScrollBar,wxSpinButton,wxSpinCtrl,wxStaticText,wxHyperlinkCtrl,&lt;br /&gt;wxStaticBitmap,wxRadioBox,wxRadioButton,wxSlider,wxVListBox&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5)Miscellaneous pickers&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wxColourPickerCtrl,wxDirPickerCtrl,wxFilePickerCtrl,&lt;br /&gt;wxFontPickerCtrl,wxDatePickerCtrl&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;6)Menus &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wxMenu,wxMenuBar,wxMenuItem&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;7)wxAUI - advanced user interface &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is a new set of classes for writing a customizable application interface with built-in docking, floatable panes and a flexible MDI-like interface. Further classes for custom notebooks with draggable tabs etc. are in progress. See also wxAUI overview.&lt;br /&gt;&lt;br /&gt;wxAuiManager,wxAuiNotebook,wxAuiPaneInfo,wxAuiDockArt,wxAuiTabArt&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;8)Window layout &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wxSizer,wxGridSizer,wxFlexGridSizer,wxGridBagSizer,&lt;br /&gt;wxBoxSizer,wxStaticBoxSizer&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;9)Events &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wxActivateEvent,wxCalendarEvent,wxCalculateLayoutEvent,&lt;br /&gt;wxChildFocusEvent,wxClipboardTextEvent,wxCloseEvent,&lt;br /&gt;wxCommandEvent,wxContextMenuEvent,wxDateEvent,wxDialUpEvent,&lt;br /&gt;wxDropFilesEvent,wxEraseEvent,wxEvent,wxFindDialogEvent,&lt;br /&gt;wxFocusEvent,wxKeyEvent,wxIconizeEvent,wxIdleEvent,&lt;br /&gt;wxInitDialogEvent,wxJoystickEvent,wxListEvent,wxMaximizeEvent,&lt;br /&gt;wxMenuEvent,wxMouseCaptureChangedEvent,wxMouseCaptureLostEvent,&lt;br /&gt;wxMouseEvent,wxMoveEvent,wxNotebookEvent,wxNotifyEvent,wxPaintEvent ,wxProcessEvent,wxQueryLayoutInfoEvent,wxRichTextEvent,&lt;br /&gt;wxScrollEvent,wxScrollWinEvent,wxSizeEvent,wxSocketEvent,&lt;br /&gt;wxSpinEvent,wxSplitterEvent,wxSysColourChangedEvent,&lt;br /&gt;wxTimerEvent,wxTreebookEvent,wxTreeEvent,wxUpdateUIEvent,&lt;br /&gt;wxWindowCreateEvent,wxWindowDestroyEvent,wxWizardEvent&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;10)Validators &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wxValidator,wxTextValidator,wxGenericValidator&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;11)Data structures &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wxCmdLineParser,wxDateSpan,wxDateTime,wxArray,wxArrayString,&lt;br /&gt;wxHashMap,wxHashSet,wxHashTable,wxList,wxLongLong,wxNode,wxObject,&lt;br /&gt;wxPathList,wxPoint,wxRect,wxRegEx,wxRegion,wxString,&lt;br /&gt;wxStringTokenizer,wxRealPoint,wxSize,wxTimeSpan,wxURI,wxVariant&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;12)Additional to these there are also classes for&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Device contexts&lt;br /&gt;Graphics device interface&lt;br /&gt;Run-time class information system&lt;br /&gt;Logging features&lt;br /&gt;Debugging features&lt;br /&gt;Networking classes&lt;br /&gt;Interprocess communication&lt;br /&gt;Document/view framework&lt;br /&gt;Printing framework&lt;br /&gt;Drag and drop and clipboard classes&lt;br /&gt;File related classes&lt;br /&gt;Stream classes&lt;br /&gt;Threading classes&lt;br /&gt;HTML classes&lt;br /&gt;Rich text classes&lt;br /&gt;Virtual file system classes&lt;br /&gt;XML classes&lt;br /&gt;XML-based resource system classes&lt;br /&gt;Online help&lt;br /&gt;Database classes&lt;br /&gt;Miscellaneous&lt;br /&gt;&lt;br /&gt;For a more comprehensive list of classes in wxWidgets you can check &lt;a href="http://docs.wxwidgets.org/stable/wx_classesbycat.html#classesbycat"&gt;official documentation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Further Readings:&lt;br /&gt;- &lt;a href="http://www.wxwidgets.org/"&gt;Officiall wxWidgets site&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/0131473816/102-7067168-6612965?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=0131473816"&gt;Cross-Platform GUI Programming with wxWidgets&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/1932394621/102-7067168-6612965?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=1932394621"&gt;wxPython in Action&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-4814503780119667696?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=Yo8WEZxdafA:xBNr2tSTgQ0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/Yo8WEZxdafA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/4814503780119667696/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=4814503780119667696" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/4814503780119667696?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/4814503780119667696?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/Yo8WEZxdafA/getting-started-with-wxwidgets-part2.html" title="Getting started with wxWidgets - Part2 - Classes at a glance" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/03/getting-started-with-wxwidgets-part2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4GQns8fyp7ImA9WxdQFEo.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-239786836049178665</id><published>2008-03-29T11:42:00.000-07:00</published><updated>2008-06-14T13:05:23.577-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-14T13:05:23.577-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="wxWidgets tutorial" /><title>Getting started with wxWidgets - Part 1 - Overview</title><content type="html">Do you know C++? Do you know how to write a program using MFC windows API? If your answer is yes it means you already have the skills to write a portable C++ application. WxWidgets is a cross API framework for creating C++ GUI applications. It's also extensive, free, open-source, and mature. Write your program once and then compile/link it with the targeted OS(wxlibs for windows, Mac OS etc) libraries and "voila" you have your program developed for Win32, Mac OS X, GTK+, X11, Motif, WinCE, and more  using one codebase. It is as simple at that.&lt;br /&gt;Before getting in touch with wxWidgets I had some windows MFC experience. This helped me a lot in being very comfortable with this library. I never had the feeling that is something new and I need to study before becoming productive.&lt;br /&gt;But why trouble yourself with a different C++ GUI API? Here are some reasons which I find valid and for which I recommend wxWidgets:&lt;br /&gt;-you will get more potential clients for your application as your program will be available on multiple platforms. The additional effort involved from writing a windows application with MFC and writing an all around windows/Mac/Linux/WinCE is insignificant.&lt;br /&gt;-In case you know MFC than you already have some wxWidgets knowledge.&lt;br /&gt;-Works with almost all popular C++ compilers and Python.&lt;br /&gt;-it has very good documentation.&lt;br /&gt;-it is a very mature library as it is around since almost 15 years. It also has a very active community.&lt;br /&gt;-it is completely free.&lt;br /&gt;-you can use Microsoft Visual Studio as your IDE of choice but you also have a lot of very good open source free IDEs like DevC++, CodeBlocks, Eclipse or Anthemion DialogBlocks.&lt;br /&gt;&lt;br /&gt;You are still not convinced? The wxWidgets library is implemented in C++, with bindings available for many commonly used programming languages, among them, Python (wxPython), Erlang (wxErlang), Haskell (wxHaskell), Lua (wxLua), Perl (wxPerl), Ruby (wxRuby), Smalltalk (wxSqueak), Java (wx4j) and even JavaScript (wxJavaScript)&lt;br /&gt;&lt;br /&gt;You are still not convinced? :-) In following sections I will try to give you more good points in using this great piece of software. At the end of this tutorial I will show a complete wxWidgets sample application which will help you to put all the pieces of the puzzle together and to "kick off" your wxWidgets development.&lt;br /&gt;&lt;br /&gt;Further Readings:&lt;br /&gt;- &lt;a href="http://www.wxwidgets.org/"&gt;Officiall wxWidgets site&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/0131473816/102-7067168-6612965?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=0131473816"&gt;Cross-Platform GUI Programming with wxWidgets&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.amazon.com/gp/product/1932394621/102-7067168-6612965?ie=UTF8&amp;amp;tag=documen-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=1932394621"&gt;wxPython in Action&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-239786836049178665?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=g2EILssXzjY:JuEOYofA-A0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/g2EILssXzjY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/239786836049178665/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=239786836049178665" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/239786836049178665?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/239786836049178665?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/g2EILssXzjY/getting-started-with-wxwidgets-part-1.html" title="Getting started with wxWidgets - Part 1 - Overview" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/03/getting-started-with-wxwidgets-part-1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYNSXw5cSp7ImA9WxZbFk8.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-5976296254804158667</id><published>2008-03-02T00:20:00.000-08:00</published><updated>2008-04-19T09:23:18.229-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-19T09:23:18.229-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pdf bursting" /><category scheme="http://www.blogger.com/atom/ns#" term="documentburster" /><category scheme="http://www.blogger.com/atom/ns#" term="pdf splitting" /><category scheme="http://www.blogger.com/atom/ns#" term="report splitting" /><category scheme="http://www.blogger.com/atom/ns#" term="report bursting" /><category scheme="http://www.blogger.com/atom/ns#" term="burst" /><title>New version of DocumentBurster is out</title><content type="html">A new version (0.0.3) of DocumentBurster was just released. The main addition with this release is a GUI interface that can be used to manipulate all the important settings of the program. The GUI can be used also to schedule the bursting jobs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Current features of the software are&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;• It is portable as it works on all versions of Windows and most of the UNIX systems.&lt;br /&gt;• It works by reading meta-data which is easily included in the document to indicate the splitting and delivery methods to be used.&lt;br /&gt;• It has out of the box delivery targets as email, ftp. Others like fax, archive and many more is easy to be added. Email is referring to any SMTP compatible server including gmail and yahoo.&lt;br /&gt;• It is easy to define your own custom delivery targets with the help of a plug-in architecture. This will handle the delivery of reports to any target that can be imagined.&lt;br /&gt;• Scheduling. It is easy to define simple or complex schedules for bursting.&lt;br /&gt;&lt;br /&gt;Next Features list will contain:&lt;br /&gt;&lt;br /&gt;• Make the program "network enabled". Multiple users will be able to burst reports based on specific permissions/roles that will be configurable.&lt;br /&gt;• Variables. There will be 1) Pre-defined System Variables and 2) User-defined Variables. Variables are blocks of information which may change from document to document, and can be used as data to be included in the delivery of documents.&lt;br /&gt;&lt;br /&gt;You can download and evaluate the latest version from&lt;br /&gt;&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=213679"&gt;DocumentBurster Download Page&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-5976296254804158667?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=LunS1mMqlFI:5waT_vjeySg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/LunS1mMqlFI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/5976296254804158667/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=5976296254804158667" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5976296254804158667?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5976296254804158667?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/LunS1mMqlFI/new-version-of-documentburster-is-out.html" title="New version of DocumentBurster is out" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/03/new-version-of-documentburster-is-out.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEBQH4-fip7ImA9WxZbFk8.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-2963266320944289221</id><published>2008-03-01T23:40:00.000-08:00</published><updated>2008-04-19T09:30:51.056-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-19T09:30:51.056-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="autoit" /><category scheme="http://www.blogger.com/atom/ns#" term="automate functional testing" /><category scheme="http://www.blogger.com/atom/ns#" term="GUI automation" /><title>Automate functional GUI testing using AutoIt</title><content type="html">Automation is very important when it comes about testing. Creating or recording a bunch of automated tests that can be performed again and again gives the confidence that what was working before is still working after the code was changed. Without automation somebody should stay and test everything manually after each code change. And with the next code change all the work will be lost which is very frustrating. Doing things without automation will take a lot of effort and you will still not be sure that the program is really working.&lt;br /&gt;&lt;br /&gt;One of the ways of doing automation is by recording GUI activities which can be played at a later point in time. For doing this I find myself very confident with &lt;a href="http://www.autoitscript.com/autoit3/"&gt;AutoIt v3&lt;/a&gt;. From the AutoIt homepage "&lt;span style="font-style: italic;"&gt;AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages&lt;/span&gt;".&lt;br /&gt;&lt;br /&gt;From my point of view AutoIt is a wonderful alternative to expensive commercial solutions like WinRunner.&lt;br /&gt;&lt;br /&gt;At a later point of time I will show a small tutorial about how to write a script for testing a GUI interface.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-2963266320944289221?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=itehuZPgsnc:DnZXxgPeprA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/itehuZPgsnc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/2963266320944289221/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=2963266320944289221" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/2963266320944289221?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/2963266320944289221?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/itehuZPgsnc/automate-functional-gui-testing-using.html" title="Automate functional GUI testing using AutoIt" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/03/automate-functional-gui-testing-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEAQX4zeCp7ImA9WxdQFEo.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-3530287638717347594</id><published>2008-03-01T11:36:00.000-08:00</published><updated>2008-06-14T13:17:20.080-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-14T13:17:20.080-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Innsbruck ski" /><title>Going Ski in Austria</title><content type="html">I just came from a vacation near Innsbruck, Austria. I enjoyed very much, it was relaxing and I also went to ski in the nearby. Schlick2000 Fulpmes is a large ski area which I find difficult for me as a beginner. On the other hand Stubaier Gletscher is a place with so many places for ski that both beginners and experienced will love. Top of Tirol (3300m) is the highest mountain around and the view is great. I enjoyed 10 wonderful days and I was lucky with sunny weather still the snow was great at the high points.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-3530287638717347594?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=UmsjSALorMQ:3ukkl4kRkrA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/UmsjSALorMQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/3530287638717347594/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=3530287638717347594" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/3530287638717347594?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/3530287638717347594?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/UmsjSALorMQ/going-ski-in-austria.html" title="Going Ski in Austria" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/03/going-ski-in-austria.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkACQnYzfyp7ImA9WxdQFEo.&quot;"><id>tag:blogger.com,1999:blog-7769052816642004160.post-5201136641999525138</id><published>2008-02-03T03:41:00.000-08:00</published><updated>2008-06-14T13:19:23.887-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-14T13:19:23.887-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Visual Leak Detector" /><category scheme="http://www.blogger.com/atom/ns#" term="VC++ debugging memory leaks" /><title>Debugging memory leaks in C++ programs</title><content type="html">I found a very simple and yet powerful tool for tracing memory leaks in C++ programs. It is free and it can be used as an alternative for costly and complicated to configure commercial memory tools. It is called Visual Leak Detector and you can download it from&lt;br /&gt;&lt;a href="http://dmoulding.googlepages.com/vld"&gt;VLD&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7769052816642004160-5201136641999525138?l=java-hobby.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/JavaHobby?a=x9ZOWFcXxwY:lzVYWhWZ10o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/JavaHobby?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JavaHobby/~4/x9ZOWFcXxwY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://java-hobby.blogspot.com/feeds/5201136641999525138/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7769052816642004160&amp;postID=5201136641999525138" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5201136641999525138?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7769052816642004160/posts/default/5201136641999525138?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JavaHobby/~3/x9ZOWFcXxwY/debugging-memory-leaks-in-c-programs.html" title="Debugging memory leaks in C++ programs" /><author><name>Virgil</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://java-hobby.blogspot.com/2008/02/debugging-memory-leaks-in-c-programs.html</feedburner:origLink></entry></feed>

