Log4jLoggerResource implements SingletonRestResource { @GET @Produces(MediaType.TEXT_PLAIN) @Path("/change/to/all/{loggerName}") public String changeToAll(@PathParam("loggerName") final String loggerName) { Logger.getLogger(loggerName).setLevel(Level.ALL); return getLevel(loggerName); }  @GET @Produces(MediaType.TEXT_PLAIN) @Path("/get/level/{loggerName}") String getLevel(@PathParam("loggerName") final String loggerName); @GET @Produces(MediaType.TEXT_PLAIN) @Path("/change/to/all/{loggerName}") String changeToAll(@PathParam("loggerName") final String loggerName); @GET @Produces(MediaType.TEXT_PLAIN) @Path("/change/to/debug/{loggerName}") String changeToDebug(@PathParam("loggerName") final String loggerName); @GET @Produces(MediaType.TEXT_PLAIN) @Path("/change/to/error/{loggerName}") String changeToError(@PathParam("loggerName") final String loggerName); @GET @Produces(MediaType.TEXT_PLAIN) @Path("/change/to/fatal/{loggerName}") String changeToFatal(@PathParam("loggerName") final String loggerName); @GET @Produces(MediaType.TEXT_PLAIN) @Path("/change/to/info/{loggerName}") String changeToInfo(@PathParam("loggerName") final String loggerName); @GET @Produces(MediaType.TEXT_PLAIN) @Path("/change/to/off/{loggerName}") String changeToOff(@PathParam("loggerName") final String loggerName); @GET @Produces(MediaType.TEXT_PLAIN) @Path("/change/to/trace/{loggerName}") String changeToTrace(@PathParam("loggerName") final String loggerName); @GET @Produces(MediaType.TEXT_PLAIN) @Path("/change/to/warn/{loggerName}") String changeToWarn(@PathParam("loggerName") final String loggerName);  }
@Test public void testChangeToAll() { assertThat(log4jResource.changeToAll(loggerName), is("ALL")); }