Sergeonclear

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, March 24, 2008

Code Generator

Posted on 9:52 PM by Unknown
Tiny drops of water makes a mighty ocean.

So here is my first few drops ;)

I just started off with a project in source forge. Though its life cycle is going at a snail's pace, i hope to get it done sometime. The project link is http://sourceforge.net/projects/lifegen/

Here is the plan for this simple code generator for web application development(used freemind software for planning this).




More to come soon....
Read More
Posted in | No comments

Thursday, March 20, 2008

Cobertura- junit coverage tool

Posted on 12:40 AM by Unknown

First, you need to add a task definition to the build.xml file. This top-level taskdef element specifies that the cobertura.jar file is in the current working directory:

<taskdef classpath="cobertura.jar" resource="tasks.properties" />

For eclipse IDE, you need to add the cobertura.jar, junit.jar in the
global path of Ant through Eclipse--} preferences--} Ant --} Global entry.

Next, you need a cobertura-instrument task that adds the logging code to the already compiled class files. The todir attribute instructs where to put the instrumented classes. The fileset child element specifies which .class files to instrument:

<target name="instrument">

<cobertura-instrument todir="target/instrumented-classes">
<fileset dir="target/classes">
<include name="**/*.class"/>
</fileset>
</cobertura-instrument>
</target>

You run the tests with the same type of Ant task that normally runs the test suite. The only differences are that the instrumented classes need to appear in the classpath before the original classes, and you need to add the Cobertura JAR file to the classpath:

<target name="cover-test" depends="instrument">
<mkdir dir="${testreportdir}" />
<junit dir="./" failureproperty="test.failure" printSummary="yes"
fork="true" haltonerror="true">
<formatter type="plain" usefile="false"/>
<!-- Normally you can create this task by copying your existing JUnit
target, changing its name, and adding these next two lines.
You may need to change the locations to point to wherever
you've put the cobertura.jar file and the instrumented classes. -->
<classpath location="cobertura.jar"/>

<classpath location="target/instrumented-classes"/>
<classpath>
<fileset dir="${libdir}">
<include name="*.jar" />
</fileset>
<pathelement path="${testclassesdir}" />

<pathelement path="${classesdir}" />
</classpath>
<batchtest todir="${testreportdir}">
<fileset dir="src/java/test">
<include name="**/*Test.java" />
<include name="org/jaxen/javabean/*Test.java" />

</fileset>
</batchtest>
</junit>
</target>>

The Jaxen project uses JUnit as its test framework, but Cobertura is framework agnostic. It works equally well with TestNG, Artima SuiteRunner, HTTPUnit, or the home-brewed system you cooked up in your basement.

Finally, the cobertura-report task generates the HTML files you saw at the beginning of the article:

<target name="coverage-report" depends="cover-test">
<cobertura-report srcdir="src/java/main" destdir="cobertura"/>
</target>

The srcdir attribute specifies where the original .java source code files reside. The destdir attribute names the directory where Cobertura should place the output HTML.

Once you've added similar tasks to your own Ant build file, you generate a coverage report by typing:

% ant instrument
% ant cover-test
% ant coverage-report

Read More
Posted in Cobertura- junit coverage tool | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Cobertura- junit coverage tool
    First, you need to add a task definition to the build.xml file. This top-level taskdef element specifies that the cobertura.jar file is i...
  • Texter - An auto text expander
    I just cant imagine how many times I would have typed the same sentence again and again... Texter to the rescue.... thanks to  Adam Pash !! ...
  • setting up a static ip with SKY broadband
    Setting up a static ip on SKY broadband log into the router Navigate to LAN IP SET UP under advanced settings. Click add under address reser...
  • Troubleshooting Oracle connections related problem
    /* Display the number of sessions created for this db connection */ select username,schemaname, osuser,machine, terminal, program, type, mod...
  • Xpath
    XPath uses path expressions to select nodes or node-sets in an XML document. It contains a library of standard functions and is a major elem...
  • Textpad tricks
    Textpad tricks Find and replace Input : 66 Urology & Nephrology 737 Spermatogenesis Replace : the bold text in the above input Find Patt...
  • Oracle fix for schema table prefix and running scripts from sql developer
    In oracle it appears like a NON_OWNER user though granted access(select, insert, delete, update) to tables created by OWNER of the table ca...
  • SCRUM
    A mind map : http://www.mp3monster.org/new/techie/MindMaps/SCRUM.shtml
  • External Javascript from Java Servlets
    Copied from http://myappsecurity.blogspot.com/2007/01 Like to thank anurag for the content. /breaking-same-origin-barrier-of.html External ...
  • Spring method interceptors
    An excellent feature of spring AOP http://www.javalobby.org/java/forums/t44746.html Excellent podcast spanning from spring framework, AJAX t...

Categories

  • AJAX javascript
  • All about UK Visa HSMP VS H1
  • All about UK Visa HSMP VS H1 hsmp assistance
  • amazon
  • android apps ship control radio hindi
  • Apache 2.x setup Quick guide for Linux
  • apache commons configurator usage
  • apache commons usage
  • arsenals for developers
  • article
  • Batch script to load developer environment
  • Blind folded chess
  • Castor castor convert dtd to xsd
  • cloud comparision price
  • cloud comparison blog
  • cloud computing monthly price
  • cloud usage
  • Cobertura- junit coverage tool
  • Code generators
  • cron jobs expressions
  • cruisecontrol cruise control
  • debugging eclipse tips
  • developer tools
  • document library
  • easy mock jmock vs mocking java tdd
  • External Javascript from Java Servlets
  • fedora 9 lenovo 3000 n200 windows xp dual boot problem
  • Fire fox plugins and tweaks
  • Free PHP hosting
  • gods debris the religion war scott adams dilbert
  • google app engine
  • gwt javascript
  • hibernate second level cache
  • i18n locale localization internationalization spring liferay portlet locale
  • ibatis sybase mapping
  • image gallery
  • iphone apps bri8 apple
  • iphone shsh 3gs ipsw downgrade ifaith tinyumbrella ios5.1.1 to ios5.0
  • java
  • java JDBC
  • javascript junit testing
  • Javascript trouble shooting tool
  • Jboss overview
  • jmeter load testing custom java sampler javasamplerclient xml test
  • JNDI test JSP page
  • Joomla CMS
  • JProfiler setup jprofiler on linux
  • jquery IE AJAX issues
  • jquery spring AJAX
  • keyboard music java typing soothing notes auto suggest
  • liferay kids version
  • liferay web 2.0 java/j2ee
  • linux - the difference between hard and soft links
  • linux mysql
  • linux mysql setup quick start
  • Linux ssh autologin with putty
  • LINUX usefuls
  • linux)
  • LinuxPerformance Tuning(apache
  • log4j setup useful
  • lucene solr
  • mac m701 android skype not working crash
  • maven
  • maven cut reduce build time
  • microsoft ODBC oracle dll connection issues
  • Mobile Ad Services (adwhirl)
  • opsourcecloud
  • oracle connect by hierarchy
  • oracle table previlege
  • Oracle thin vs OCI(type II/thick) drivers
  • pdf 2 text
  • Pega PRPC
  • php
  • rackspacecloud
  • Rewrite rules in apache and IIS
  • scaffold
  • setting up a static ip on SKY broadband
  • setup quick start
  • Single Sign on - OpenSSO with Liferay
  • smart gwt
  • smtp email test mock server james
  • SMTP MAIL telnet windows
  • Software tools mind map freemind j2ee tools
  • Speed typing tips.
  • Spring + Hibernate Usefuls BaseDAOHibernate
  • Spring annotations with spring-mock not working 2.0 2.5.6
  • spring jndi datasource lookup
  • Spring portlet mvc and spring servlet mvc validation
  • Spyware trojan and virus removal tools
  • struts magic
  • SVN/ Subversion Tips and traps
  • tabbed ms dos console cygwin console
  • Texter - An auto text expander autotyper
  • Textpad tricks
  • The art of debugging
  • tomcat
  • Tomcat Exploded war - cut deployment time
  • Tomcat on linux tips
  • Tomcat on linux tips commands
  • TypeIt4Me
  • Typinator
  • Useful Eclipse Plugins
  • Useful Eclipse Plugins eclipse shortcuts keys
  • Useful tools
  • web content
  • xcode cocos2d iphone box2d
  • xpath xml xquery

Blog Archive

  • ►  2013 (19)
    • ►  August (17)
    • ►  July (1)
    • ►  January (1)
  • ►  2012 (7)
    • ►  August (1)
    • ►  June (4)
    • ►  April (2)
  • ►  2011 (20)
    • ►  November (1)
    • ►  October (1)
    • ►  August (1)
    • ►  July (3)
    • ►  June (1)
    • ►  April (2)
    • ►  March (4)
    • ►  February (1)
    • ►  January (6)
  • ►  2010 (27)
    • ►  December (3)
    • ►  July (2)
    • ►  May (3)
    • ►  April (2)
    • ►  March (5)
    • ►  February (10)
    • ►  January (2)
  • ►  2009 (32)
    • ►  December (5)
    • ►  November (2)
    • ►  September (3)
    • ►  August (6)
    • ►  June (4)
    • ►  May (4)
    • ►  April (3)
    • ►  March (2)
    • ►  February (3)
  • ▼  2008 (28)
    • ►  December (1)
    • ►  October (2)
    • ►  September (2)
    • ►  August (4)
    • ►  July (7)
    • ►  June (1)
    • ►  April (2)
    • ▼  March (2)
      • Code Generator
      • Cobertura- junit coverage tool
    • ►  February (2)
    • ►  January (5)
  • ►  2007 (24)
    • ►  December (3)
    • ►  November (2)
    • ►  October (6)
    • ►  September (1)
    • ►  August (3)
    • ►  July (8)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile