Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Any good examples of using @Before instead of setup

 
Tony Evans
Ranch Hand
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In all the examples I have seen its just

@Before
public void setUp(){
}

But just using @Before resualts in a comple error, its expecting a value after before. Its not the test that needs to be carried out or the method the test is testing.
 
Tony Evans
Ranch Hand
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found the problem was using import org.aspectj.lang.annotation.Before.

instead of import org.junit.Before;

If anyone knows of any good tutorials on using the import org.aspectj.lang.annotation.Before. can you link it here thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are examples in the AspectJ documentation; the value is a pointcut expression, and the annotated method is what'll be run.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic