I want to use ErrorCollector
class in jUnit but not able to import its required class.
I want to import org.junit.rule.*
but instead of that i get option for importing import sun.org.mozilla.javascript.internal.ast.ErrorCollector
. I do not understand what is happening. I do not get any option for importing Rule class, I tried to type import org.junit.rule
but its not imported successfully.
Please help or explain me what is going on?
Thanks.
package testcases;
import junit.framework.Assert;
import org.junit.Test;
//import sun.org.mozilla.javascript.internal.ast.ErrorCollector;
public class understandingAssertion {
@Rule
public ErrorCollector er = new ErrorCollector();
@Test
public void countFriendTest() {
int actual_fr = 100; //Selenium
int expected_Fr =10;
/*
if (actual_fr == expected_Fr) {
System.out.println("Pass");
} else {
System.out.println("Fail");
}
*/
System.out.println("A");
try
{
Assert.assertEquals(expected_Fr, actual_fr);
}
catch(Throwable e)
{
System.out.println("Error encountered");
}
}
}