Package org.jpos.iso

Examples of org.jpos.iso.ISOField


    }

    @Test
    public void testGetVErrorsThrowsNullPointerException3() throws Throwable {
        VErrorParser vErrorParser = new VErrorParser();
        ISOVField c = new ISOVField(new ISOField(100, "testVErrorParserv"));
        c.addISOVError(null);
        try {
            vErrorParser.getVErrors(c);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
View Full Code Here


    @Test
    public void testValidateThrowsClassCastException() throws Throwable {
        TEST0100 tEST0100 = new TEST0100();
        try {
            tEST0100.validate(new ISOField());
            fail("Expected ClassCastException to be thrown");
        } catch (ClassCastException ex) {
            assertEquals("ex.getClass()", ClassCastException.class, ex.getClass());
        }
    }
View Full Code Here

    public byte[] pack ( ISOComponent c ) throws ISOException {
        try     {
            Map tab = c.getChildren();
            StringBuilder sb = new StringBuilder();
            for ( int i = 0; i < fld.length; i++ ) {
                ISOField f = (ISOField) tab.get (i);
                if ( f != null ) {
                    sb.append ( new String( fld[i].pack( f ) ) );
                }
            }
            return sb.toString().getBytes();
View Full Code Here

    public ISOComponent validate( ISOComponent c ) throws org.jpos.iso.ISOException {
        LogEvent evt = new LogEvent( this, "validate" );
        try {
            Map tab = c.getChildren();
            for ( int i = 0; i < fldVld.length; i++ ) {
                ISOField f = (ISOField) tab.get (i);
                if ( f != null )
                    c.set( fldVld[i].validate( f ) );
            }
            return c;
        } catch ( ISOVException ex ) {
View Full Code Here

    }

    @Test
    public void testValidateThrowsNullPOinterException1() throws Throwable {
        try {
            new ISOBaseValidatingPackager().validate(new ISOField(100, "testISOBaseValidatingPackagerv"));
            fail("Expected ClassCastException to be thrown");
        } catch (NullPointerException ex) {
            assertEquals("ex.getClass()", NullPointerException.class, ex.getClass());
        }
    }
View Full Code Here

        tagValueSequence.add(new LiteralTagValue("12", "A"));

        ISOMsg field64 = new ISOMsg(64);

        field64.set(new ISOField(0, "R"));

        tagValueSequence.writeTo(field64);

        msg.set(field64);
View Full Code Here

        tagValueSequence.add(new LiteralTagValue("0012", "19960930000000"));
        tagValueSequence.add(new LiteralTagValue("0165", "M"));
        tagValueSequence.add(new LiteralTagValue("0023", "CT2"));

        ISOMsg field63 = new ISOMsg(63);
        field63.set(new ISOField(0, "M"));
        tagValueSequence.writeTo(field63);

        msg.set(field63);

        msg.recalcBitMap();
View Full Code Here

    @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);
    }
View Full Code Here

    }

    @Test
    public void testUnpack() throws Throwable {
        byte[] b = new byte[0];
        int result = new CTCSubFieldPackager().unpack(new ISOField(), b);
        assertEquals("result", 0, result);
    }
View Full Code Here

        ISOFieldPackager[] fld = new ISOFieldPackager[6];
        fld[0] = new IFA_LLLLCHAR(100, "testCTCSubFieldPackagerDescription");
        cTCSubFieldPackager.setFieldPackager(fld);
        byte[] b = new byte[4];
        try {
            cTCSubFieldPackager.unpack(new ISOField(), b);
            fail("Expected ISOException to be thrown");
        } catch (ISOException ex) {
            assertEquals("ex.getMessage()", "org.jpos.iso.IFA_LLLLCHAR: Problem unpacking field 0", ex.getMessage());
            assertNull("ex.getNested().getMessage()", ex.getNested().getMessage());
        }
View Full Code Here

TOP

Related Classes of org.jpos.iso.ISOField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.