Search in sources :

Example 31 with ISOField

use of org.jpos.iso.ISOField in project jPOS by jpos.

the class VErrorParserTest method testGetVErrorsThrowsNullPointerException2.

@Test
public void testGetVErrorsThrowsNullPointerException2() throws Throwable {
    VErrorParser vErrorParser = new VErrorParser();
    ISOVField c = new ISOVField(new ISOField(), new ISOVError("testVErrorParserDescription"));
    c.addISOVError(null);
    try {
        vErrorParser.getVErrors(c);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : ISOField(org.jpos.iso.ISOField) ISOVError(org.jpos.iso.ISOVError) ISOVField(org.jpos.iso.ISOVField) Test(org.junit.Test)

Example 32 with ISOField

use of org.jpos.iso.ISOField in project jPOS by jpos.

the class CTCSubFieldPackagerTest method testPack1.

@Test
public void testPack1() throws Throwable {
    CTCSubFieldPackager cTCSubFieldPackager = new CTCSubFieldPackager();
    ISOFieldPackager[] fld = new ISOFieldPackager[1];
    cTCSubFieldPackager.setFieldPackager(fld);
    byte[] result = cTCSubFieldPackager.pack(new ISOField());
    assertEquals("result.length", 0, result.length);
}
Also used : ISOField(org.jpos.iso.ISOField) ISOFieldPackager(org.jpos.iso.ISOFieldPackager) Test(org.junit.Test)

Example 33 with ISOField

use of org.jpos.iso.ISOField in project jPOS by jpos.

the class CTCSubFieldPackagerTest method testUnpack.

@Test
public void testUnpack() throws Throwable {
    byte[] b = new byte[0];
    int result = new CTCSubFieldPackager().unpack(new ISOField(), b);
    assertEquals("result", 0, result);
}
Also used : ISOField(org.jpos.iso.ISOField) Test(org.junit.Test)

Example 34 with ISOField

use of org.jpos.iso.ISOField in project jPOS by jpos.

the class EuroSubFieldPackagerTest method testPack3.

@Test
public void testPack3() throws Throwable {
    EuroSubFieldPackager euroSubFieldPackager = new EuroSubFieldPackager();
    ISOFieldPackager[] fld = new ISOFieldPackager[1];
    euroSubFieldPackager.setFieldPackager(fld);
    byte[] result = euroSubFieldPackager.pack(new ISOField());
    assertEquals("result.length", 0, result.length);
}
Also used : ISOField(org.jpos.iso.ISOField) ISOFieldPackager(org.jpos.iso.ISOFieldPackager) Test(org.junit.Test)

Example 35 with ISOField

use of org.jpos.iso.ISOField in project jPOS by jpos.

the class ISOMsgFieldValidatingPackagerTest method testValidateWithNonISOMsgThrowsNullPointerException.

@Test
public void testValidateWithNonISOMsgThrowsNullPointerException() throws Throwable {
    try {
        new ISOMsgFieldValidatingPackager(new IFA_BINARY(100, "testISOMsgFieldValidatingPackagerDescription"), new ISOBaseValidatingPackager()).validate(new ISOField(100));
        fail("Expected ClassCastException to be thrown");
    } catch (NullPointerException ex) {
        assertEquals("ex.getClass()", NullPointerException.class, ex.getClass());
    }
}
Also used : IFA_BINARY(org.jpos.iso.IFA_BINARY) ISOField(org.jpos.iso.ISOField) Test(org.junit.Test)

Aggregations

ISOField (org.jpos.iso.ISOField)50 Test (org.junit.Test)18 ISOException (org.jpos.iso.ISOException)15 ISOTaggedField (org.jpos.tlv.ISOTaggedField)15 IFB_LLNUM (org.jpos.iso.IFB_LLNUM)6 IFE_LLNUM (org.jpos.iso.IFE_LLNUM)6 ISOMsg (org.jpos.iso.ISOMsg)6 ISOMultiFieldPackager (org.jpos.iso.packager.ISOMultiFieldPackager)6 ISOComponent (org.jpos.iso.ISOComponent)5 ISOFieldPackager (org.jpos.iso.ISOFieldPackager)5 ISOVField (org.jpos.iso.ISOVField)5 Vector (java.util.Vector)4 FileInputStream (java.io.FileInputStream)3 Map (java.util.Map)3 ISOBinaryField (org.jpos.iso.ISOBinaryField)3 ByteBuffer (java.nio.ByteBuffer)2 ISOVError (org.jpos.iso.ISOVError)2 GenericPackager (org.jpos.iso.packager.GenericPackager)2 GenericTagSequence (org.jpos.tlv.GenericTagSequence)2 LiteralTagValue (org.jpos.tlv.LiteralTagValue)2