java - Main class run with exception in thread error with JUnit -


i'm using crimson editor along command prompt console compiling , running programs. i've installed , new junit. currently, i'm following basic tutorial tutorialspoint.com , have followed steps setting classpath.

the link tutorial available here:

http://www.tutorialspoint.com/junit/junit_environment_setup.htm

from tutorial, there's ending part whereby asked create class files test junit. eventually, after compiling, tried run main class presented long series of errors hoping guys can me out here.

import org.junit.test; import static org.junit.assert.assertequals;  public class testjunit {    @test    public void testadd() {       string str= "junit working fine";       assertequals("junit working fine",str);    } } 

main class:

import org.junit.runner.junitcore; import org.junit.runner.result; import org.junit.runner.notification.failure;  public class testrunner {    public static void main(string[] args) {       result result = junitcore.runclasses(testjunit.class);       (failure failure : result.getfailures()) {          system.out.println(failure.tostring());       }       system.out.println(result.wassuccessful());    } }   

and screenshot of console displaying error:

enter image description here

try add hamcrest-core-1.3.jar classpath. download jar hamcrest site: https://code.google.com/p/hamcrest/

assert class of junit need hamcrest matchers.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -