junit and entity bean syntax

When using IntelliJ I can't compile junit and persistance bean syntax that include declarations like:

public static Test suite() {
TestSuite suite= new TestSuite("All JUnit Tests");
@TESTS@
}

or

import javax.ejb.Stateless;

@Stateless
public class HelloWorldBean implements HelloWorld {}


but when I use Eclipse or just build it with ant and the javac compiler I don't have any problems and I know that it is correct syntax. Does IntelliJ need a plugin or be of a certain type of project to recognize this syntax?

3 comments
Comment actions Permalink

Huh, what is "@TESTS@"? Just a dummy placeholder for some actual code?
Or am I missing something here?
In fact Idea can compile and run JUnit tests no matter if they use entity annotations.
But just saying "I can't compile" does not give much hints to what may be wrong.

Please disclose what actually happens when you try to compile.

Sean Yergensen wrote:

When using IntelliJ I can't compile junit and persistance bean syntax that include declarations like:

public static Test suite() {
TestSuite suite= new TestSuite("All JUnit Tests");
@TESTS@
}

or

import javax.ejb.Stateless;

@Stateless
public class HelloWorldBean implements HelloWorld {}


but when I use Eclipse or just build it with ant and the javac compiler I don't have any problems and I know that it is correct syntax. Does IntelliJ need a plugin or be of a certain type of project to recognize this syntax?

0
Comment actions Permalink

@TESTS@ looks liek an simple placeholder which is filled in your
ant-scripts during copy the files. So you can directly run it
in IDEA. Instead execute your ant-script first (whatever target
it may be). It probably creates the filled files in an temporary
folder.

Sean Yergensen schrieb:

When using IntelliJ I can't compile junit and persistance bean syntax that include declarations like:

public static Test suite() {
TestSuite suite= new TestSuite("All JUnit Tests");
@TESTS@
}

or

import javax.ejb.Stateless;

@Stateless
public class HelloWorldBean implements HelloWorld {}


but when I use Eclipse or just build it with ant and the javac compiler I don't have any problems and I know that it is correct syntax. Does IntelliJ need a plugin or be of a certain type of project to recognize this syntax?

0
Comment actions Permalink

When I IntelliJ to make the project it gives me an illegal character: \64. That is obvious because of the @ the way it is. I thought maybe it was a place holder of some sort for a variable as well and so I didn't pay attention to it, but then I did an assignment using entity annotations that make in Eclipse just fine. Maybe what I need is an explanation on what is really happening with these annotations and how to make IntelliJ recognize that however it is being used is actually correct. Try the simple example I gave with a Stateless java bean and see if IntelliJ gives you an error with the @Stateless syntax as it is.

0

Please sign in to leave a comment.