### Question:
GenericPackager extends ISOBasePackager implements Configurable { public void setConfiguration (Configuration cfg) throws ConfigurationException { filename = cfg.get("packager-config", null); if (filename == null) throw new ConfigurationException("packager-config property cannot be null"); try { String loggerName = cfg.get("packager-logger"); if (loggerName != null) setLogger(Logger.getLogger (loggerName), cfg.get ("packager-realm")); logFieldName= cfg.getBoolean("packager-log-fieldname", logFieldName); readFile(filename); } catch (ISOException e) { throw new ConfigurationException(e.getMessage(), e.fillInStackTrace()); } } GenericPackager();  GenericPackager(String filename);  GenericPackager(InputStream input); void setConfiguration(Configuration cfg); void readFile(String filename); void readFile(InputStream input); @Override void setLogger(Logger logger, String realm); @Override String getDescription();  }### Answer:
@Disabled("test failing") @Test public void testSetConfigurationThrowsConfigurationException() throws Throwable { GenericPackager genericPackager = new GenericPackager(); Configuration cfg = new SimpleConfiguration(); try { genericPackager.setConfiguration(cfg); fail("Expected ConfigurationException to be thrown"); } catch (ConfigurationException ex) { assertEquals( "org.jpos.iso.ISOException: java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl (java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl)", ex.getMessage(), "ex.getMessage()"); assertEquals("java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl", ex.getNested().getMessage(), "ex.getNested().getMessage()"); assertEquals("", genericPackager.getLogger().getName(), "(GenericValidatingPackager) genericValidatingPackager.getLogger().getName()"); assertEquals("", genericPackager.getRealm(), "(GenericValidatingPackager) genericValidatingPackager.getRealm()"); } }
@Test public void testSetConfigurationThrowsNullPointerException() throws Throwable { GenericPackager genericSubFieldPackager = new GenericSubFieldPackager(); Configuration cfg = new SubConfiguration(); try { genericSubFieldPackager.setConfiguration(cfg); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.jpos.core.Configuration.get(String, String)\" because \"this.cfg\" is null", ex.getMessage(), "ex.getMessage()"); } assertNull(genericSubFieldPackager.getLogger(), "(GenericSubFieldPackager) genericSubFieldPackager.getLogger()"); assertNull(genericSubFieldPackager.getRealm(), "(GenericSubFieldPackager) genericSubFieldPackager.getRealm()"); } }