Monthly Archives: February 2006

JUnit release and state of TestNG

Two weeks ago JUnit has announced the new version. I was waiting for this release for quite a long time… but not because of the features of JUnit 4, because most of them (or all) have been available in TestNG a long time before. In a previous post I have done some comparisons of JUnit 4 features with TestNG features (and Cedric did it too: JUnit4 Overview). So, my waiting was not about the feature list, but rather to see the reactions of people in the testing space. And it looks like my expectations were meet. I just have a few links about reactions, and here there are:

More interesting posts about TestNG can be found here.

Enjoy your tests with TestNG!

category: , ,

Leave a comment

Filed under Uncategorized

Sharing IDEA project definition files

In a previous post I have tried to figure out how Idea project and modules definition files can be shared between team members considering etherogenous environments.
While I could find a few references in the Help, none of them is really describing how things should be done. I have mentioned how this can be achieved while working with Eclipse by using path variables. This same notion exists in Idea too, but I couldn’t figure out how can one can use it from the UI. But, the good news is that you can define variables to be used with modules, and also you can use variables while defining classpaths. I have figured out that by editting the .ipr file (project definition) and adding:

<macro name=”MAVEN_REPO” />

you will force your project to define this variable and than you can use it in both module paths and different classpaths just by specifying $MAVEN_REPO$/rest_of_path. The only thing left is to find out how you can do this without having to manually edit the .ipr and .iml files. Does anybody know the answer to this?

Disclaimer: this is the 3rd post in row about Idea and considering what may happen if Hani is picking you, I will just let everybody know that I am not associated and nor do I work for Eclipse or Idea.

category: , ,

1 Comment

Filed under Uncategorized

An Eclipse user in IDEA-land meets paths

If you haven’t followed the first part of this series, I will briefly restate here that the goal of these posts is not to start the long discussion about which IDE is better, but rather to raise some questions about things that remained unclear while playing with Idea.

Today the Eclipse user (n.b.: me) had to play with paths. And I am including here: source paths, output paths and classpaths.
First: source paths. In Eclipse I have to define the source folders under the current project directory. The only possibility to include in a project external source dirs is through linked directories. Idea allows providing more Content Roots for each module, and so you can include multiple source directories from different locations on the file system.
Output paths: Idea allows you to set only 2 output directories per module: the source output directory and the test output directory. Even if at the first glance this looks a little bit restrictive, things are not so bad cause for real big projects requiring multiple output folders you will however have to define a build system (Ant, Maven based) to really manage the project.
So far, everything went as expected. Unfortunately, the things weren’t as clear while trying to set the classpath. In a multi-module project, Idea introduces 3 types of classpaths: Global libraries, Project libraries and Module libraries. While at the first glance these look really good, I finally haven’t been able to achieve what I wanted.

And I think this is the moment for the first question: considering a project that is shared by a team of developers, and the project is built using jars from a MAVEN local repository (each developer may have the repository on a different location), how should I define the classpath so that the project/module definition can be shared? Or, what is the correct approach for achieving this with Idea. In Eclipse I am doing this using a variable pointing to MAVEN_REPO and than defining the classpath in terms of this variable (the classpath will look something like: MAVEN_REPO/log4j/jars/log4j-1.2.8.jar;MAVEN_REPO/lucene/jars/lucene-1.4.3.jar. Considering that each developer can define this variable to point to his repository than the team will be able to share the project definition file). Can this be achieved with Idea?

In Eclipse I can include a jar in my project classpath using one of the following solutions:

  • contained in the current project (the most usual way)
  • anywhere on the filesystem (not very usefully in a shared project)
  • extended variable (as shown above)
  • relative to another project (very usefully in a shared project: the classpath description is persisted in relative terms ignoring the real locations of the projects)

My final question for the 2nd day in the Idea-land would be: how can I achieve the 3rd and 4th scenarios in the above list, and also be assured that the project/module definition can be shared. I really hope to have some answers from expert Idea users, so that I will have a 3rd day in Idea-land. Thanks.

category: , ,


Filed under Uncategorized

An Eclipse user in IDEA-land

I am an Eclipse user for more than 3 years, but I find it interesting to have a look at the other approaches in the world of Java IDEs. This post is not meant to start once again the long and so useless discussion about which one is the best, but rather to ask questions about how to achieve some goals (and hopefully have some advanced users answer ’em [smile/]).

Since back in the days of Netbeans 3, I got used to define in my workspace projects that are related to my current work. For example, if my current work project is using WebWork than usually I will create a WebWork project. This will allow me to navigate through its sourcecode and also help me when debugging.

IntelliJ IDEA allows you to work with a project at a time. But it allows you to define more modules inside a project and as I found out groups of modules. And here is my first question:

Can I use modules to refere the external projects my current project is based on? Or in case this is a wrong approach from the perspective of IDEA than what is the way to define my project so that I can navigate the source code of the projects it depends on?

I will be very happy to hear how I can do this in the IDEA-way. Thanks in advance to everyone giving me hints.

Disclaimer: I have spent some time reading the IDEA help, but I haven’t found references to this question. The approach I am describing above it’s coming mainly from using the Eclipse workspace export plugin provided with IDEA.

Update: Scott posted the hint to succesfully see the dependency projects while debugging.

category: , ,


Filed under Uncategorized