This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

testing a private method with JUnit / Coverlipse

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am testing the method:

And since it is private, used call hierarchy to find out that public void setConsoleAppending(boolean append, int outputType) calls this method.

Now in

if (!isSameOutputType(outputType, currentCA)) {
getLog4jLogger().removeAppender(name);

and if I make isSameOutputType(outputType, currentCA)) false, I can verify that :

the Appender is removed.

Now:
In order to make isSameOutPutType() false,
I force the return be false in:

String currCAOutputType = currentCA.getTarget();
return currCAOutputType.equals(ConsoleAppender.SYSTEM_OUT)

Here is my test method:


But, somehow, I am not getting the method isSameOutPutType() covered by coverlipse.

Could anyone please give me a hint?

Thanks,
-Kamal.
 
Skool. Stay in. Smartness. Tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic