use of org.jpos.util.Logger in project jPOS by jpos.
the class JCESecurityModuleTest method testConstructorThrowsNullPointerException2.
@Test
public void testConstructorThrowsNullPointerException2() throws Throwable {
Configuration cfg = new SubConfiguration();
try {
new JCESecurityModule(cfg, new Logger(), "testJCESecurityModuleRealm");
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.util.Logger in project jPOS by jpos.
the class JCESecurityModuleTest method testConstructorThrowsConfigurationException1.
@Test
public void testConstructorThrowsConfigurationException1() throws Throwable {
Configuration cfg = new SimpleConfiguration();
try {
new JCESecurityModule(cfg, new Logger(), "testJCESecurityModuleRealm");
fail("Expected ConfigurationException to be thrown");
} catch (ConfigurationException ex) {
// expected
}
}
use of org.jpos.util.Logger in project jPOS by jpos.
the class Base1SubFieldPackagerTest method testUnpack.
@Test
public void testUnpack() throws Throwable {
Base1SubFieldPackager base1SubFieldPackager = new Base1SubFieldPackager();
ISOFieldPackager[] fld = new ISOFieldPackager[3];
base1SubFieldPackager.setFieldPackager(fld);
base1SubFieldPackager.setLogger(new Logger(), "testBase1SubFieldPackagerRealm");
byte[] b = new byte[0];
int result = base1SubFieldPackager.unpack(new ISOMsg(100), b);
assertEquals("result", 0, result);
}
use of org.jpos.util.Logger in project jPOS by jpos.
the class EuroPackagerTest method testSetLogger.
@Test
public void testSetLogger() throws Throwable {
EuroPackager euroPackager = new EuroPackager();
Logger logger = Logger.getLogger("testEuroPackagerName");
euroPackager.setLogger(logger, "testEuroPackagerRealm");
assertSame("euroPackager.getLogger()", logger, euroPackager.getLogger());
assertNotNull("euroPackager.f48Packager", euroPackager.f48Packager);
assertEquals("euroPackager.getRealm()", "testEuroPackagerRealm", euroPackager.getRealm());
}
use of org.jpos.util.Logger in project jPOS by jpos.
the class GenericSubFieldPackagerTest method testUnpackThrowsISOException8.
@Test
public void testUnpackThrowsISOException8() throws Throwable {
ISOFieldPackager[] fld = new ISOFieldPackager[2];
fld[1] = new IFA_LLLLCHAR();
GenericSubFieldPackager genericSubFieldPackager = new GenericSubFieldPackager();
genericSubFieldPackager.setFieldPackager(fld);
genericSubFieldPackager.setLogger(new Logger(), "testGenericSubFieldPackagerRealm");
byte[] b = new byte[5];
try {
genericSubFieldPackager.unpack(new ISOMsg(), b);
fail("Expected ISOException to be thrown");
} catch (ISOException ex) {
assertEquals("ex.getMessage()", "org.jpos.iso.IFA_LLLLCHAR: Problem unpacking field -1", ex.getMessage());
assertNull("ex.getNested().getMessage()", ex.getNested().getMessage());
}
}
Aggregations