Samhitha
Samhitha

Reputation: 51

Java - @Before and @test annotation

I am very new to Java programming. I have a unit test file to be run. It has annotations of @Before and @Test. I have tried to understand these concepts using available online resources.

When I am debugging my UnitTest.java file, only the @Before part gets executed. It does not reach @Test and the program fails saying:

NativeMethodAccessorImpl.Object(....) not available.

This does not happen when I run the unit tests (as opposed to debugging the unit tests). How do I go about solving this?

Upvotes: 5

Views: 37723

Answers (1)

Simon C
Simon C

Reputation: 2017

The @Before and @Test annotations are used to define unit tests for the Java JUnit testing framework. See http://junit.sourceforge.net/doc/cookbook/cookbook.htm for an introduction and examples of JUnit unit testing using these annotations.

Your problem is that your have mis-spelled the @Test annotation as @test.

Upvotes: 5

Related Questions