: org.junit.runner.notification.RunNotifier.testAborted error

2,028 views
Skip to first unread message

venu gopal

unread,
May 16, 2012, 4:13:54 AM5/16/12
to Ehcache Spring Annotations
Hi,

When i m running the Spring ControllerTest

getting fallowing error :


java.lang.NoSuchMethodError:
org.junit.runner.notification.RunNotifier.testAborted(Lorg/junit/
runner/Description;Ljava/lang/Throwable;)V
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:
155)


How to resolve ....
org.junit.runner.notification.RunNotifier.

Antony Siagian

unread,
May 16, 2012, 4:38:55 AM5/16/12
to ehcache-sprin...@googlegroups.com
Could you list all method in your class?
As i know, you require a method inside your class which prefix name is begin with test.
Sou you need to make a method like testController()
--
Regard's


Antony Siagian
-e antony...@gmail.com
-m +628 13 11 14 3200
Jakarta, Indonesia
"Man's mind is like a store of idolatry and superstition; so much so that if a man believes his own mind it is certain that he will forsake God and forge some idol in his own brain"

venu gopala reddy G

unread,
May 18, 2012, 1:08:32 AM5/18/12
to Ehcache Spring Annotations
@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations={"file:web/WEB-INF/application-
context.xml","file:web/WEB-INF/dispatcher-servlet.xml"})

@ContextConfiguration(locations={"file:D:/ABC/src/main/webapp/WEB-INF/
xyz-servlet.xml",
"file:D:/ABC/src/main/webapp/WEB-INF/xyzrest-servlet.xml"})



public class TestNGXController {

@Inject
private ApplicationContext applicationContext;

private MockHttpServletRequest request;
private MockHttpServletResponse response;
private HandlerAdapter handlerAdapter;
private XController controller;




@Test
public void setUp() {
request = new MockHttpServletRequest();
response = new MockHttpServletResponse();
handlerAdapter =
applicationContext.getBean(HandlerAdapter.class);
// I could get the controller from the context here
controller = new XController();
}

@Test
public void testgoLoginPage() throws Exception {


request.setAttribute("login", "0");

final org.springframework.web.servlet.ModelAndView mav =
handlerAdapter.handle(request, response, controller);
assertViewName(mav, null);
assertAndReturnModelAttributeOfType(mav, "login", null);


}

@Test
public void testgoHomePage(){

org.springframework.web.servlet.ModelAndView mav =null;

request.setAttribute("success1", "1");
request.setAttribute("success", "1");

try {
mav = handlerAdapter.handle(request, response, controller);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

assertViewName(mav, null);
assertAndReturnModelAttributeOfType(mav, "home",null);
}


Thanks &Regards,
Venu Gopala Reddy.


On May 16, 1:38 pm, Antony Siagian <antonysiag...@gmail.com> wrote:
> Could you list all method in your class?
> As i know, you require a method inside your class which prefix name is
> begin with test.
> Sou you need to make a method like testController()
>
>
>
>
>
> On Wed, May 16, 2012 at 3:13 PM, venu gopal <venuinfo.j...@gmail.com> wrote:
> > Hi,
>
> > When i m running the Spring ControllerTest
>
> > getting fallowing error :
>
> > java.lang.NoSuchMethodError:
> > org.junit.runner.notification.RunNotifier.testAborted(Lorg/junit/
> > runner/Description;Ljava/lang/Throwable;)V
> >        at
>
> > org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestM­ethod(SpringJUnit4ClassRunner.java:
> > 155)
>
> > How to resolve ....
> > org.junit.runner.notification.RunNotifier.
>
> --
> Regard's
>
> Antony Siagian
> -e antonysiag...@gmail.com
> -m +628 13 11 14 3200
> Jakarta, Indonesia
> "Man's mind is like a store of idolatry and superstition; so much so that
> if a man believes his own mind it is certain that he will forsake God and
> forge some idol in his own brain"- Hide quoted text -
>
> - Show quoted text -

Eric Dalquist

unread,
May 18, 2012, 1:33:53 AM5/18/12
to ehcache-sprin...@googlegroups.com
What does this have to do with the Ehcache Spring Annotations project?
Reply all
Reply to author
Forward
0 new messages