Realizing tests in JUnit when EJB are involucred

0

In many cases when you are testing java software that you develop, you must do some unit testing using famous testing framework such as JUnit or TestNG. This testing process allowed you to do a great testing cases and automatic all the process but there is some problems when your program includes non-standard Java SE classes. This is the cases when you use EJB.

The EJB artifacts are Java components that in the modern times (forget about the 2.1 version!!) support dependency injection. So, when the EJB container is in execution, it has the goal to instance the EJB and all its dependencies and give to us an “completed object” when all the dependencies set, but you don’t have any EJB container when you are running your JUnit test, so what you can do? Ok, there is a free software library which can help us with that. The name of the project is the following: Ejb3Unit, and you can get it by these URL: http://ejb3unit.sourceforge.net/.

(more…)

First approach to JMX with sample code

2

In this post I want to introduce JMX, a “new” (it’s not very very new, as it becomes a part of the JEE 5.0 standard, but it is very unknown) technology in the Java World. The main goal of the JMX technology is provide a simple, standard way of managing resources such as applications, devices, and services. Because the JMX technology is dynamic, you can use it to monitor and manage resources as they are created, installed and implemented. You can also use the JMX technology to monitor and manage the Java Virtual Machine (Java VM).

You can use this technology to measure resources of your Java project, such as, number of threads alive, memory consumption and every thing you want to measure, and you can use the JConsole to get an interaction with the kind of resources. (more…)

Using JiBX extras inside the JiBX Eclipse Plugin

4

JiBX is a Java library that allows you to convert Java objets into a XML files that provides a great performance in comparation with other Java libraries such as XStream.

The main difference between JiBX and the other Java libraries is that JiBX modifies the class files generated by the javac compiler and it adds some bytecodes which contains some methods that are used when you do the convertions between class file and xml file.

(more…)

Go to Top