Findings of eclipse with testng

First of all I’ve always used JUnit and not TestNG. This post is not blaming on anything. It’s just pointing out the little stuff I had to do to make my eclipse works with TestNG.

  1. Install TestNG from eclipse marketplace and restart
  2. The @Test annotation has to be on it’s own line of the plugin won’t pick it up
  3. In assertEquals() (and I’m expecting all the others) expected vs actual values are actually exchanged
  4. You have to configure the Output Folder of eclipse to go under $project/target/target-classes or eclipse won’t pick it up.

That’s it for now.

 

weekly links 2011-06

Hackers penetrated Nasdaq’s network

Why go with RichFaces

Android Google Maps Tutorial

Using Java 6 processors in Eclipse

Next level of Don’t Repeat Yourself(DRY) principle

Java FX 2.0 – The Installation, Doc and Launch Experience – A Smoke Test

Linux vulnerable to Windows-style autorun exploits and fixed.

Dependency Injection Performance in Java EE 6: Dependent (easy) vs ApplicationScoped (“optimized”)

weekly links 2010-48

It’s been a long time I’m not posting but just changed job and relocated abroad, so no time for the blog.

SocialAuth – Java Library for seamless authentication for oAuth and OpenID providers

Eclipse Makes Available New Release of Eclipse Virgo

Using «Federated Login for Google Account Users» in your application

Introducing CQ 5.4, an early sneak-peek.

The way we write software these days

Why Java is being used for high-performance computing

Goodbye SOAP – Welcome JSON REST

Being bad to your customers is bad for business

Oracle’s Reply to Google’s Answer with Counterclaims

A Closer Look at JUnit Categories

Weekly Links 2010-41

Ok this week I didn’t have much time for reading the net, however here are some interesting links

5 things you didn’t know about … Apache Maven

La libertà non ha prezzo: come liberarsi di GMail (Italian)

Announcing Amino, a new UI toolkit for Desktop Java

Oracle and IBM Collaborate to Accelerate Java Innovation Through OpenJDK

Oracle’s strategy is now clear

IBM and Oracle to Collaborate on OpenJDK

Peace breaks out?!?

Maven Dependecy JAR Configuration

Use JavaFX to quickly create applications

How free is the OpenJDK?

Mockito – Pros, Cons, and Best Practices

Weekly links 2010-38

REST application programming

Writing your first active energy manager application using REST

Sending delayed JMS Messages

The fastest ways to open editors in Eclipse using the keyboard

Swing 2.0 is Coming

The biggest announcement – and the biggest surprise for many – of JavaOne 2010 was certainly Oracle’s new plans for JavaFX 2.0… or, should we say, Swing 2.0?

JBoss, eclipse and port bindings

please close the door

via Flickr by Aeioux

Starting JBoss (5.1.x) from eclipse (3.5.x) it could happen that you get an exception like the following:

15:26:51,530 ERROR [Naming] Could not start on port 1099
java.net.BindException: Address already in use: JVM_Bind
 at java.net.PlainSocketImpl.socketBind(Native Method)
 at java.net.PlainSocketImpl.bind(Unknown Source)
 at java.net.ServerSocket.bind(Unknown Source)
 at java.net.ServerSocket.<init>(Unknown Source)
 at javax.net.DefaultServerSocketFactory.createServerSocket(Unknown Source)
 at org.jnp.server.Main.initBootstrapListener(Main.java:480)
 at org.jnp.server.Main.start(Main.java:427)
 ...

It’s because you have a port already in use. In this case it the port used for Naming service. While changing port from the eclipse editor didn’t work, you can (after stopping the server), open the file

$JBOSS_HOME/server/$PROFILE/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml

search for the desired port (in this case 1099) and then change it to a new value (in my case 1199 was free).

<!-- Naming Service -->
 <bean>
 <property name="serviceName">jboss:service=Naming</property>
 <property name="bindingName">Port</property>
 <property name="port">1199</property>
 <property name="description">The listening socket for the Naming service</property>
 </bean>

save and start the server.

Debian, eclipse and exit code 127

Just after installing eclipse from lenny repository, it crashed me up with the error JVM terminated. Exit code=127. After a bit of searching and watching at what a console execution told me, I tried execute eclipse from command line with a simple java -jar /usr/lib/eclipse/startup.jar. Well, in this way it starts up successfully without any problem. Then I tried again a startup from gnome menu and everything worked fine.

Now there is still the failing about integrated browser and the fact that eclipse shipped with lenny is the very obsolete 3.2.

[eclipse-svn] branching, tagging and merging

branching, tagging and merging are foundamental concepts of the SVN operativity. For their means I redirect you to the Chapter 4 in the SVN book.

Here we will discuss the merging operativity. The case presented is the one in which I would like to merge (align) the latest fixes/development in the trunk in a specific branch (say 2.2).

What I like to do is download a new project, as said in the preceding post, but pointing to the desired branch instead of the trunk. Then when asked, specify a different project name, in order to avoid naming conflicts.

When done, on the root of the branch project, select with a right click the Team->Merge.

Now in the URL field specify the url of the source from which you would like to take the latest version. Then in the Start Revision specify the version from which you would like to start search for editing and in Stop Revision specify the version to stop for searches. Generally the last one is the number beside the trunk project in the repository (if you want to align to the latest version). Here is how the form should end up after compilation.

Before proceeding I prefer take a quick preview with the suitable button. When assured that everything is ok, click on the OK button and wait for the end of the process.

When process complete it should be safe to give a Commit of everything but maybe it’s better to give a full recompile and a full test 🙂

[eclipse-svn] start contributing an existing project

For this issue, we take my project edivad-suite as the project you would like to contribute.

The main configuration of the SVN plugin should work, however if you would like to change your settings, you coudl do it by the Window->Preferences->Team->SVN (for example the SVN Connector)..

For starting contributing you will have to do a check out (in SVN slang) of the project. To do so in eclipse, you will have to select File->New->Project->Project From SVN [step 1]. In the form that appear, specify the url and user/pass if needed and proceed with next [step 2].

If it appear an error (for example after clicking the browse buttont) that it’s not possible to access the repository, maybe you could be behind a proxy that need authentication. You have to store credential informations in the eclipse networt settings (Window->Preferences->General->Network Connection), since the SNV plugin wont ask you for it.

Then in the next screen, using the browse button, selecte the resource needed (in this example the leaf in trunk) and with the finish button start download the sources [step 3, step 4].

After a bit of thinking eclipse will prompt you something how to download the project. Sice we are starting a new one, let’s use the default provided. Here you can change for example the project name that will be created in your workbench [step 5]. Use the next to proceed.

Here you can specify (if needed) a different location of the sources outside the workspace [step 6]. Use the finish to end the process.

Now everything should be done and you should have your project ready for contributing.

I’ve found a little fault (?). If I try to create (download) the project on a FAT filesystem (my usb pendrive), the whole process ask me for some file for authenticating via SSL. Maybe something fail to write something else, I don’t know. The fastest workaround I’ve found is to download the project in the normal workspace (that on work is on C:\… and is a NTFS) . Then copy the directory project into the pendrive, remove the project (via eclipse) from the workspace (deleting content on FS) and then import an existing project into workspace that points to the pendrive.