ICANWIN Posted January 4, 2014 Report Share Posted January 4, 2014 i have one question Lets say there is a class Class A { void doesSomething (HttpRequest req , HttpResponse res, Map<String, Object> model) { doeswhatever(req,res,model); some business logic which throws servlet exception } } Here i am over riding the method and catching the exception for flow to continue Class B extends A{ @Override void doesSomething (HttpRequest req , HttpResponse res, Map<String, Object> model) { try{ super.doeswhatever(req,res,model); }catch( ServletException ex){ logger.warn(" doing nothing here just logging the statement"); } } } Now my main task is to write test case using Junit and make the test pass for the exception block in B Void testThrowServletException () { private final HttpRequest req = null private final HttpResponse res= null private final Map<String, Object> model = mock(Map.class) ; ------------> Using Mockito new B().doeswhatever(req,res,model); Here i need to assert for the logger .warn statement in catch block for Servlet exception and pass the test New to Junit and mockito and dont know how to assert for log statement...pls help } ltt Link to comment Share on other sites More sharing options...
ICANWIN Posted January 5, 2014 Report Share Posted January 5, 2014 CITI#H@ CITI#H@ CITI#H@ Link to comment Share on other sites More sharing options...
king420 Posted January 5, 2014 Report Share Posted January 5, 2014 Jailer mayya post something related to OIF, OAM and SSO it will be good to learn Link to comment Share on other sites More sharing options...
innovative Posted January 5, 2014 Report Share Posted January 5, 2014 ltt CITI#H@ CITI#H@ CITI#H@ no idea of mockit .. help .. ltt Link to comment Share on other sites More sharing options...
innovative Posted January 5, 2014 Report Share Posted January 5, 2014 Jailer mayya post something related to OIF, OAM and SSO it will be good to learn SSO ? single sign on ? Link to comment Share on other sites More sharing options...
cherlapalli_jailer Posted January 9, 2014 Report Share Posted January 9, 2014 ltt pl post java doubts here and more over there r u can find enough solutions also Link to comment Share on other sites More sharing options...
cherlapalli_jailer Posted January 9, 2014 Report Share Posted January 9, 2014 Jailer mayya post something related to OIF, OAM and SSO it will be good to learn i agree but most of them are tools driven if in our project we are using i think we can easily adopt let us come to conclusion and will start with OIM Link to comment Share on other sites More sharing options...
Idly Vishwanatham Posted January 9, 2014 Report Share Posted January 9, 2014 ltt pl post java doubts here and more over there r u can find enough solutions also Thanks Link to comment Share on other sites More sharing options...
cherlapalli_jailer Posted January 9, 2014 Report Share Posted January 9, 2014 Bezawada_Bablu, on 09 Jan 2014 - 07:20 AM, said: deeniki threarefrence ,thread local ,atomic integer ivi use chesi cheyyali anadu nakem ardam kala as i am begginer tarvatha ma architect ae rasukunadu code lot of ways to do do u still need it ? or its done? When i did i dd it independently llike servlet writes log to a file using Log4J JSP read and displays on the web( mainly errors/ warnings etc) Link to comment Share on other sites More sharing options...
fake_Bezawada Posted January 9, 2014 Report Share Posted January 9, 2014 bhayyiah kottaga Xforms orbeon ani okati chestuna kudirithe chudandi adhi chala bavundhi to handle rest calls in front end 1 Link to comment Share on other sites More sharing options...
cherlapalli_jailer Posted January 9, 2014 Report Share Posted January 9, 2014 @benz sare will try who ever is the user servlet writes to one log file only? based on ur question i got a doubt..do u need to show the logs differently for different users? Link to comment Share on other sites More sharing options...
fake_Bezawada Posted January 9, 2014 Report Share Posted January 9, 2014 Bezawada_Bablu, on 09 Jan 2014 - 07:20 AM, said: lot of ways to do do u still need it ? or its done? When i did i dd it independently llike servlet writes log to a file using Log4J JSP read and displays on the web( mainly errors/ warnings etc) i mailed you a test mail kali ga vunapudu do that code snippet and give me anna Link to comment Share on other sites More sharing options...
cherlapalli_jailer Posted January 9, 2014 Report Share Posted January 9, 2014 bhayyiah kottaga Xforms orbeon ani okati chestuna kudirithe chudandi adhi chala bavundhi to handle rest calls in front end oh thx let me have a look Link to comment Share on other sites More sharing options...
cherlapalli_jailer Posted January 9, 2014 Report Share Posted January 9, 2014 i mailed you a test mail kali ga vunapudu do that code snippet and give me anna sure Link to comment Share on other sites More sharing options...
fake_Bezawada Posted January 9, 2014 Report Share Posted January 9, 2014 @benz sare will try who ever is the user servlet writes to one log file only? based on ur question i got a doubt..do u need to show the logs differently for different users? exactly if in url i called /Servlet1- indhulo log.info("welcome user") and user two invokes /Servlet2-indhulo info.error("something is wrong") on right hand side we will have a button to display logs i should get my log welcome user user two should get something is wrong Link to comment Share on other sites More sharing options...
Recommended Posts