Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

annotation before is missing value for the attribute value

I normally don't experience problem with JUnit annotation. But somehow today, with my new install of Netbeans 7.2, I am experiencing the following error when I use the @Before annotation:

annotation before is missing value for the attribute value

Does anyone know how to fix this?


UPDATE

I am writing a mavenized web-app. For the TestCase, when I try to import org.junit.Before the program instead imports org.aspectj.lang.annotation.Before

like image 290
kasavbere Avatar asked Sep 25 '12 02:09

kasavbere


People also ask

What is the annotation used to define attributes for an element?

We can also explicitly specify the attributes in a @Test annotation. Test attributes are the test specific, and they are specified at the right next to the @Test annotation.

What is @value used for?

@Value is a Java annotation that is used at the field or method/constructor parameter level and it indicates a default value for the affected argument. It is commonly used for injecting values into configuration variables - which we will show and explain in the next part of the article.


1 Answers

Are you still getting the same error even after adding junit dependency in pom.xml?

Check to see that you are importing the right library i.e.

import org.junit.Before;

instead of

import org.aspectj.lang.annotation.Before;
like image 189
ssbh Avatar answered Sep 24 '22 01:09

ssbh