@Test public void activated() { final ServerServlet serverServlet = new ServerServlet(); serverServlet.init(new ServletConfig() { @Override public String getServletName() { return null; } @Override public ServletContext getServletContext() { return null; } @Override public String getInitParameter(final String name) { return "activated".equals(name) ? Boolean.toString(activated) : null; } @Override public Enumeration<String> getInitParameterNames() { return null; } }); assertEquals(activated == null || activated, Reflections.get(serverServlet, "activated")); }
public void init(ServletConfig config) { ejbServer = SystemInstance.get().getComponent(EjbServer.class); final String activatedStr = config.getInitParameter(ACTIVATED_INIT_PARAM); if (activatedStr != null) { activated = Boolean.parseBoolean(activatedStr); } else { activated = Boolean.parseBoolean(System.getProperty(getClass().getName() + '.' + ACTIVATED_INIT_PARAM, "true")); } }
ServerServlet extends HttpServlet { public void init(ServletConfig config) { ejbServer = SystemInstance.get().getComponent(EjbServer.class); final String activatedStr = config.getInitParameter(ACTIVATED_INIT_PARAM); if (activatedStr != null) { activated = Boolean.parseBoolean(activatedStr); } else { activated = Boolean.parseBoolean(System.getProperty(getClass().getName() + '.' + ACTIVATED_INIT_PARAM, "true")); } } }
ServerServlet extends HttpServlet { public void init(ServletConfig config) { ejbServer = SystemInstance.get().getComponent(EjbServer.class); final String activatedStr = config.getInitParameter(ACTIVATED_INIT_PARAM); if (activatedStr != null) { activated = Boolean.parseBoolean(activatedStr); } else { activated = Boolean.parseBoolean(System.getProperty(getClass().getName() + '.' + ACTIVATED_INIT_PARAM, "true")); } }  }
ServerServlet extends HttpServlet { public void init(ServletConfig config) { ejbServer = SystemInstance.get().getComponent(EjbServer.class); final String activatedStr = config.getInitParameter(ACTIVATED_INIT_PARAM); if (activatedStr != null) { activated = Boolean.parseBoolean(activatedStr); } else { activated = Boolean.parseBoolean(System.getProperty(getClass().getName() + '.' + ACTIVATED_INIT_PARAM, "true")); } }  void init(ServletConfig config); }
ServerServlet extends HttpServlet { public void init(ServletConfig config) { ejbServer = SystemInstance.get().getComponent(EjbServer.class); final String activatedStr = config.getInitParameter(ACTIVATED_INIT_PARAM); if (activatedStr != null) { activated = Boolean.parseBoolean(activatedStr); } else { activated = Boolean.parseBoolean(System.getProperty(getClass().getName() + '.' + ACTIVATED_INIT_PARAM, "true")); } }  void init(ServletConfig config);  }