@Test public void testInitServiceThrowsNullPointerException1() throws Throwable { SMAdaptor sMAdaptor = new SMAdaptor(); try { sMAdaptor.initService(); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.jpos.q2.Q2.getFactory()\" because the return value of \"org.jpos.q2.security.SMAdaptor.getServer()\" is null", ex.getMessage(), "ex.getMessage()"); } assertNull(sMAdaptor.sm, "sMAdaptor.sm"); assertFalse(sMAdaptor.isModified(), "sMAdaptor.isModified()"); } }
protected void initService () throws Exception { Element e = getPersist (); QFactory factory = getServer().getFactory(); sm = (SMAdapter) factory.newInstance (getImpl ()); factory.setLogger (sm, e); factory.setConfiguration (sm, e); }
SMAdaptor extends QBeanSupport implements SMAdaptorMBean { protected void initService () throws Exception { Element e = getPersist (); QFactory factory = getServer().getFactory(); sm = (SMAdapter) factory.newInstance (getImpl ()); factory.setLogger (sm, e); factory.setConfiguration (sm, e); } }
SMAdaptor extends QBeanSupport implements SMAdaptorMBean { protected void initService () throws Exception { Element e = getPersist (); QFactory factory = getServer().getFactory(); sm = (SMAdapter) factory.newInstance (getImpl ()); factory.setLogger (sm, e); factory.setConfiguration (sm, e); } SMAdaptor(); }
SMAdaptor extends QBeanSupport implements SMAdaptorMBean { protected void initService () throws Exception { Element e = getPersist (); QFactory factory = getServer().getFactory(); sm = (SMAdapter) factory.newInstance (getImpl ()); factory.setLogger (sm, e); factory.setConfiguration (sm, e); } SMAdaptor(); void setImpl(String clazz); String getImpl(); }
SMAdaptor extends QBeanSupport implements SMAdaptorMBean { protected void initService () throws Exception { Element e = getPersist (); QFactory factory = getServer().getFactory(); sm = (SMAdapter) factory.newInstance (getImpl ()); factory.setLogger (sm, e); factory.setConfiguration (sm, e); } SMAdaptor(); void setImpl(String clazz); String getImpl();  }