@Test public void testConstructor3() throws Throwable { ConfigurationException configurationException = new ConfigurationException(); assertNull("configurationException.getNested()", configurationException.getNested()); }
@Test public void testSetConfigurationThrowsConfigurationException() throws Throwable { FilterLogListener filterLogListener = new FilterLogListener(new PrintStream(new ByteArrayOutputStream())); Configuration cfg = new SubConfiguration(); try { filterLogListener.setConfiguration(cfg); fail("Expected ConfigurationException to be thrown"); } catch (ConfigurationException ex) { assertEquals("ex.getMessage()", "java.lang.NullPointerException", ex.getMessage()); assertNull("ex.getNested().getMessage()", ex.getNested().getMessage()); assertEquals("filterLogListener.getPriority()", "info", filterLogListener.getPriority()); } }
@Test public void testConstructor2() throws Throwable { ConfigurationException configurationException = new ConfigurationException("testConfigurationExceptionDetail"); assertEquals("configurationException.getMessage()", "testConfigurationExceptionDetail", configurationException.getMessage()); assertNull("configurationException.getNested()", configurationException.getNested()); }
@Test public void testConstructor1() throws Throwable { Throwable nested = new ConfigurationException(); ConfigurationException configurationException = new ConfigurationException(nested); assertEquals("configurationException.getMessage()", "org.jpos.core.ConfigurationException", configurationException.getMessage()); assertSame("configurationException.getNested()", nested, configurationException.getNested()); }
@Test public void testConstructor() throws Throwable { Throwable nested = new ConfigurationException(); ConfigurationException configurationException = new ConfigurationException("testConfigurationExceptionDetail", nested); assertEquals("configurationException.getMessage()", "testConfigurationExceptionDetail", configurationException.getMessage()); assertSame("configurationException.getNested()", nested, configurationException.getNested()); }
@Test public void testGetObjectThrowsConfigurationException() throws Throwable { Configuration cfg = new SubConfiguration(); SubConfiguration subConfiguration = new SubConfiguration(cfg, "testSubConfigurationPrefix"); try { subConfiguration.getObject("testSubConfigurationPropertyName"); fail("Expected ConfigurationException to be thrown"); } catch (ConfigurationException ex) { assertEquals("ex.getMessage()", "Error trying to create an object from property testSubConfigurationPrefixtestSubConfigurationPropertyName", ex.getMessage()); assertNull("ex.getNested().getMessage()", ex.getNested().getMessage()); assertSame("subConfiguration.cfg", cfg, subConfiguration.cfg); } }
@Test public void testSetConfigurationThrowsConfigurationException() throws Throwable { String[] args = new String[0]; try { new QFactory(null, new Q2(args)).setConfiguration(new BSHTransactionParticipant(), null); fail("Expected ConfigurationException to be thrown"); } catch (ConfigurationException ex) { assertEquals("ex.getMessage()", "org.jpos.core.ConfigurationException (java.lang.NullPointerException)", ex.getMessage()); assertNull("ex.getNested().getMessage()", ex.getNested().getMessage()); } }
@Test public void testSetConfigurationThrowsConfigurationException1() throws Throwable { BSHTransactionParticipant bSHTransactionParticipant = new BSHTransactionParticipant(); try { bSHTransactionParticipant.setConfiguration(null); fail("Expected ConfigurationException to be thrown"); } catch (ConfigurationException ex) { assertNull("ex.getMessage()", ex.getMessage()); assertNull("ex.getNested().getMessage()", ex.getNested().getMessage()); assertNull("bSHTransactionParticipant.prepareForAbortMethod", bSHTransactionParticipant.prepareForAbortMethod); assertNull("bSHTransactionParticipant.abortMethod", bSHTransactionParticipant.abortMethod); assertNull("bSHTransactionParticipant.commitMethod", bSHTransactionParticipant.commitMethod); assertNull("bSHTransactionParticipant.prepareMethod", bSHTransactionParticipant.prepareMethod); assertFalse("bSHTransactionParticipant.trace", bSHTransactionParticipant.trace); } } }
@Test public void testSetConfigurationThrowsConfigurationException() throws Throwable { BSHGroupSelector bSHGroupSelector = new BSHGroupSelector(); try { bSHGroupSelector.setConfiguration(null); fail("Expected ConfigurationException to be thrown"); } catch (ConfigurationException ex) { assertNull("ex.getMessage()", ex.getMessage()); assertNull("ex.getNested().getMessage()", ex.getNested().getMessage()); assertNull("bSHGroupSelector.prepareForAbortMethod", bSHGroupSelector.prepareForAbortMethod); assertNull("bSHGroupSelector.selectMethod", bSHGroupSelector.selectMethod); assertNull("bSHGroupSelector.commitMethod", bSHGroupSelector.commitMethod); assertNull("bSHGroupSelector.abortMethod", bSHGroupSelector.abortMethod); assertNull("bSHGroupSelector.prepareMethod", bSHGroupSelector.prepareMethod); assertFalse("bSHGroupSelector.trace", bSHGroupSelector.trace); } } }
@Ignore ("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( "ex.getMessage()", "org.jpos.iso.ISOException: java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl (java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl)", ex.getMessage()); assertEquals("ex.getNested().getMessage()", "java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl", ex.getNested().getMessage()); assertEquals("(GenericValidatingPackager) genericValidatingPackager.getLogger().getName()", "", genericPackager.getLogger().getName()); assertEquals("(GenericValidatingPackager) genericValidatingPackager.getRealm()", "", genericPackager.getRealm()); } }
@Test public void testInitServiceThrowsConfigurationException() throws Throwable { Configuration cfg = new SimpleConfiguration(); transactionManager.setConfiguration(cfg); try { transactionManager.initService(); fail("Expected ConfigurationException to be thrown"); } catch (ConfigurationException ex) { assertEquals("ex.getMessage()", "queue property not specified", ex.getMessage()); assertNull("ex.getNested()", ex.getNested()); assertNull("transactionManager.queue", transactionManager.queue); assertSame("transactionManager.getConfiguration()", cfg, transactionManager.getConfiguration()); assertEquals("transactionManager.tail", 0L, transactionManager.tail); assertTrue("transactionManager.isModified()", transactionManager.isModified()); assertNull("transactionManager.sp", transactionManager.sp); assertNull("transactionManager.psp", transactionManager.psp); assertEquals("transactionManager.head", 0L, transactionManager.head); assertNull("transactionManager.groups", transactionManager.groups); assertNull("transactionManager.tailLock", transactionManager.tailLock); } }