java - JUnit NoClassDefFoundError on org.junit.Assert itself -


i following error when running code: (colormatrix getarray() returns float[])

74 public void testhueshift() { 75     colormatrix cm1 = new colormatrix(); 76     colormatrix cm2 = hueshift(0f); 77     assertarrayequals(cm1.getarray(), cm2.getarray(), 0f); 78 } 

the error:

 ----- begin exception -----  java.lang.noclassdeffounderror: org.junit.assert     @ com.common.lib.test.colorfilterfactorytest.testhueshift(colorfilterfactorytest.java:77)     @ java.lang.reflect.method.invokenative(native method)     @ java.lang.reflect.method.invoke(method.java:511)     @ junit.framework.testcase.runtest(testcase.java:154)     @ junit.framework.testcase.runbare(testcase.java:127)     @ junit.framework.testresult$1.protect(testresult.java:106)     @ junit.framework.testresult.runprotected(testresult.java:124)     @ junit.framework.testresult.run(testresult.java:109)     @ junit.framework.testcase.run(testcase.java:118)     @ android.test.androidtestrunner.runtest(androidtestrunner.java:169)     @ android.test.androidtestrunner.runtest(androidtestrunner.java:154)     @ android.test.instrumentationtestrunner.onstart(instrumentationtestrunner.java:545)     @ android.app.instrumentation$instrumentationthread.run(instrumentation.java:1551)  ----- end exception ----- 

but project build path has it:

enter image description here

edit
test class classpath enter image description here

this class under test (it library project) enter image description here

the stack trace contains hint solution: contains junit.framework.testcase (so class on classpath) later, can't find org.junit.assert.

this looks if have junit 3.8 on classpath when running test junit 4 when compile them.

find out how unit test runner builds classpath , fix there.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -