TestDox and IntelliJ IDEA 9

I really missed TestDox plugin for IDEA. There is no official version as of now for IDEA 9.0

I tried to install latest available version but its not compatible. I played around with plugin.xml by removing until-build=”IU-93.94″, it got enabled but then threw following exception,

Caused by: java.lang.NumberFormatException: For input string: "IU-93.94"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
	at java.lang.Integer.parseInt(Integer.java:449)
	at java.lang.Integer.parseInt(Integer.java:499)
	at org.codehaus.testdox.intellij.IntelliJApiFactory.<init>(IntelliJApiFactory.java:24)

I had patched the IntelliJApiFactory and updated .class file in the testdox-plugin-1.1.12-diana.jar. I am using it for some time and my usage is limited to navigate between class and its test. Not seeing any exceptions but overall IDEA 9.x plugin api are changed a lot and using a patched plugin might crash IDEA.

But for those who can’t live without it, can download it here. Extract it to your IDEA plugins directory.

More



Maven, dbdeploy, HSQLDB without Ant

Believe me, integrating Maven and dbdeploy is a pain using Ant. For some weird reasons, dbdeploy ant task was causing maven build to crash.

So tried to integrate dbdeploy with maven without ant on my Snow Leopard -

Click to continue reading “Maven, dbdeploy, HSQLDB without Ant”

More



Integrating Spring and EHCache

Using Spring Modules and EHCache, one can transparently cache method results. Spring Modules uses a proxy which intercepts call to the method of bean; consults the cache to check if method was called with same parameters before, if so will return cached result.

EHCache is the actual provider of caching solution and Spring Module handles method interception and result storing in cache.

Click to continue reading “Integrating Spring and EHCache”

More



Jetty Remote Debugging using IntelliJ IDEA

Recently wanted to remotely debug Jetty instance, which was using mvn jetty:run.

Using following MAVEN_OPTS worked for me -

$ export MAVEN_OPTS=”-Xms256m -Xmx512m -agentlib:jdwp=transport=dt_socket,address=7848,server=y,suspend=n”

After setting above executed -

mvn jetty:run

Then configured IDEA Remote Server by connecting to server on above configured port 7848


More



JSF Validations

Using JSF Standard Built-in Validations
JSF provides built-in support for validations of input component tags. You can supply it a attribute required=”true” which will check if a value is supplied or not. There are built-in validators which you can nest in all JSF input tags.

Click to continue reading “JSF Validations”

More



Ant Input and Passwords

Ant input task does not has a feature which will allow not to echo what user inputs, a necessity in case you are prompting for a password. As per the ant input task documentation

A regular complaint about this task is that it echoes characters to the console, this is a critical security defect, we must fix it immediately, etc, etc. We know it leaves something to be desired, but the problem is Java, not Ant. There is nothing we can do to stop the console echoing.

Click to continue reading “Ant Input and Passwords”

More



Killing Java Process from Ant in Windows

I wanted to write a ant script for one of the environment, which would perform following tasks in order which will be repeated
1. Take Latest Code
2. Compile
3. Create WAR
4. Undeploy currently installed WAR from tomcat
5. Stop the tomcat
6. Copy the WAR to tomcat webapps folder
7. Start the tomcat

Click to continue reading “Killing Java Process from Ant in Windows”

More



iBATIS and Hibernate Features

Recently evaluated Hibernate and iBATIS, there were some good points listed at this thread which I have summarized below with some of my thoughts -

  1. iBATIS maps Java Objects to the results of SQL Queries, where as Hibernate maps Java Objects directly to database tables.
  2. iBATIS is a “Sql Mapping” implementation of ORM, whereas Hibernate is traditional Object-Relational Mapping.
  3. Hibernate automatically generates all the SQL for you and the cache invalidation can be more fine grained. iBATIS is more flexible. You have control over exactly how the SQL queries are written.
  4. Use Hibernate if you have mostly standard queries(CRUD, Find by Criteria, etc.) and if you are designing your object model first, then a relational model to support the object model.If you are working with a legacy system or a schema designed by a DBA, iBATIS often makes a better choice.
  5. All of the SQL statements used by iBATIS can be stored in XML files outside of Java code, so DBA can easily review them.
  6. Also compared to Hibernate, iBATIS is more flexible, has a shorter learning curve, but can take more time to develop and maintain, since you have to write all your queries and if your object model changes you have to go through all your queries and make sure to make all the necessary changes to reflect the changes in your object model.
  7. The performance of Hibernate while working with large data sets[complex joins] is not optimal.
  8. Hibernate is great when you control the data model, and you let Hibernate do most of the work in the persisting of objects.
  9. Unless your existing model is lightweight, adding Hibernate to it is possible, just usually not trivial.
  10. Once Hibernate is setup and SQL tuned, productivity gains are very big.
  11. iBATIS, will need good DBA or good SQL Developers for SQL tune-ups.
  12. iBATIS can be fine-grained optimization for eg. I have a table, this table has a few or dozens of fields, I need to update one of a field, iBATIS is very simple to implement a sql UPDATE using WHERE but with Hibernate, default will update all fields. Though with Hibernate you can control to update only updated fields but that you will have to configure.
  13. Similar with select queries where I can choose few columns instead of *, with Hibernate you will get object with all columns. Same applies when I want to update a row in table, with Hibernate I will have to first load that object and then save, two sqls whereas with iBATIS, it would be a single update sql. These are considerations for a interactive database where improving performances is important.
  14. iBATIS, SQL maps allow SQL to be fully customized for a specific database. However, these maps do not provide an abstraction from the specific features of the target database.

More



Sun opens Java

Sun Microsystems Inc. of Santa Clara, Calif., has released the source code to its widely used Java programming language.The company will post the source code to various pieces of Java over the nextfew months, according to Sun CEO Jonathan Schwartz, who announced the releasetoday. Available immediately, on the Java.net site, is the code for the JavaPlatform Standard Edition-which has over 6 million lines of code-and the JavaPlatform Micro Edition for embedded systems.
Today this project contains two significant components of the JDK:

The remainder of the open-source JDK will be available in the first halfof 2007. At that time this project will host the source code for thecomplete JDK except for a few components that Sun does not have the right topublish in source form under the GPL; pre-built binaries will be provided forthose components.

Visit

More



Google Web Toolkit

Google Web Toolkit (GWT) is a Java development framework that lets
you escape the matrix of technologies that make writing AJAX
applications so difficult and error prone. With GWT, you can develop
and debug AJAX applications in the Java language using the Java
development tools of your choice. When you deploy your application to
production, the GWT compiler to translates your Java application to
browser-compliant JavaScript and HTML.

Here’s the GWT development cycle:

  1. Use your favorite Java IDE to write and
    debug an application in the Java language, using as many (or as few)
    GWT libraries as you find useful.
  2. Use GWT’s
    Java-to-JavaScript compiler to distill your application into a set of
    JavaScript and HTML files that you can serve with any web server.
  3. Confirm that your application works in each browser that you want to support, which usually takes no additional work.

Visit

More



Next