@Test public void testInitServiceThrowsNullPointerException() throws Throwable { DailyTaskAdaptor dailyTaskAdaptor = new DailyTaskAdaptor(); try { dailyTaskAdaptor.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.iso.DailyTaskAdaptor.getServer()\" is null", ex.getMessage(), "ex.getMessage()"); } assertTrue(dailyTaskAdaptor.isModified(), "dailyTaskAdaptor.isModified()"); assertNull(dailyTaskAdaptor.task, "dailyTaskAdaptor.task"); } }
protected void initService () throws Exception { QFactory factory = getServer().getFactory(); Element e = getPersist (); task = (Runnable) factory.newInstance (e.getChildTextTrim ("class")); factory.setLogger (task, e); }
DailyTaskAdaptor extends QBeanSupport implements Runnable { protected void initService () throws Exception { QFactory factory = getServer().getFactory(); Element e = getPersist (); task = (Runnable) factory.newInstance (e.getChildTextTrim ("class")); factory.setLogger (task, e); } }
DailyTaskAdaptor extends QBeanSupport implements Runnable { protected void initService () throws Exception { QFactory factory = getServer().getFactory(); Element e = getPersist (); task = (Runnable) factory.newInstance (e.getChildTextTrim ("class")); factory.setLogger (task, e); } DailyTaskAdaptor(); }
DailyTaskAdaptor extends QBeanSupport implements Runnable { protected void initService () throws Exception { QFactory factory = getServer().getFactory(); Element e = getPersist (); task = (Runnable) factory.newInstance (e.getChildTextTrim ("class")); factory.setLogger (task, e); } DailyTaskAdaptor(); void run(); Date getWhen(); }
DailyTaskAdaptor extends QBeanSupport implements Runnable { protected void initService () throws Exception { QFactory factory = getServer().getFactory(); Element e = getPersist (); task = (Runnable) factory.newInstance (e.getChildTextTrim ("class")); factory.setLogger (task, e); } DailyTaskAdaptor(); void run(); Date getWhen();  }