Examples of ISOComponent


Examples of org.jpos.iso.ISOComponent

    @SuppressWarnings("unchecked")
    @Test
    public void testGetVErrors1() throws Throwable {
        VErrorParser vErrorParser = new VErrorParser();
        ISOVError FirstError = new ISOVError("testVErrorParserDescription");
        ISOComponent c = new ISOVField(new ISOField(), FirstError);
        Vector result = vErrorParser.getVErrors(c);
        assertEquals("result.size()", 1, result.size());
        assertSame("result.get(0)", FirstError, result.get(0));
    }
View Full Code Here

Examples of org.jpos.iso.ISOComponent

    @SuppressWarnings("unchecked")
    @Test
    public void testGetVErrors10() throws Throwable {
        VErrorParser vErrorParser = new VErrorParser();
        ISOComponent c = new ISOMsg("testVErrorParserMti");
        Vector result = vErrorParser.getVErrors(c);
        assertEquals("result.size()", 0, result.size());
    }
View Full Code Here

Examples of org.jpos.iso.ISOComponent

    @SuppressWarnings("unchecked")
    @Test
    public void testGetVErrors2() throws Throwable {
        VErrorParser vErrorParser = new VErrorParser();
        ISOVError FirstError = new ISOVError("testVErrorParserDescription", "testVErrorParserRejectCode");
        ISOComponent c = new ISOVMsg(new ISOMsg("testVErrorParserMti"), FirstError);
        Vector result = vErrorParser.getVErrors(c);
        assertEquals("result.size()", 1, result.size());
        assertSame("result.get(0)", FirstError, result.get(0));
    }
View Full Code Here

Examples of org.jpos.iso.ISOComponent

    @SuppressWarnings("unchecked")
    @Test
    public void testGetVErrors4() throws Throwable {
        VErrorParser vErrorParser = new VErrorParser();
        ISOComponent c = new ISOMsg();
        Vector result = vErrorParser.getVErrors(c);
        assertEquals("(ISOMsg) c.getMaxField()", 0, ((ISOMsg) c).getMaxField());
        assertEquals("result.size()", 0, result.size());
    }
View Full Code Here

Examples of org.jpos.iso.ISOComponent

    @SuppressWarnings("unchecked")
    @Test
    public void testGetVErrors8() throws Throwable {
        VErrorParser vErrorParser = new VErrorParser();
        ISOVError FirstError = new ISOVError("testVErrorParserDescription");
        ISOComponent c = new ISOVMsg(new ISOMsg(), FirstError);
        Vector result = vErrorParser.getVErrors(c);
        assertEquals("result.size()", 1, result.size());
        assertSame("result.get(0)", FirstError, result.get(0));
    }
View Full Code Here

Examples of org.jpos.iso.ISOComponent

    }

    @Test
    public void testUnpackThrowsArrayIndexOutOfBoundsException() throws Throwable {
        byte[] b = new byte[0];
        ISOComponent c = new ISOMsg();
        try {
            new Base1_BITMAP126().unpack(c, b, 100);
            fail("Expected ArrayIndexOutOfBoundsException to be thrown");
        } catch (ArrayIndexOutOfBoundsException ex) {
            assertEquals("ex.getMessage()", "100", ex.getMessage());
View Full Code Here

Examples of org.jpos.iso.ISOComponent

    }

    @Test
    public void testUnpackThrowsNullPointerException() throws Throwable {
        Base1_BITMAP126 base1_BITMAP126 = new Base1_BITMAP126(100, "testBase1_BITMAP126Description");
        ISOComponent c = new ISOBinaryField(100);
        try {
            base1_BITMAP126.unpack(c, (byte[]) null, 100);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
View Full Code Here

Examples of org.jpos.iso.ISOComponent

        }
    }

    @Test
    public void testValidateThrowsISOVException1() throws Throwable {
        ISOComponent m = new ISOVMsg(new ISOMsg());
        try {
            new MSGTEST(true).validate(m);
            fail("Expected ISOVException to be thrown");
        } catch (ISOVException ex) {
            assertEquals("ex.getMessage()", "Error on msg. ", ex.getMessage());
View Full Code Here

Examples of org.jpos.iso.ISOComponent

public class ISOVException1Test {

    @Test
    public void testConstructor() throws Throwable {
        ISOComponent errComponent = new ISOMsg("testISOVExceptionMti");
        ISOVException iSOVException = new ISOVException("testISOVExceptionDescription", errComponent);
        assertSame("iSOVException.errComponent", errComponent, iSOVException.errComponent);
        assertEquals("iSOVException.getMessage()", "testISOVExceptionDescription", iSOVException.getMessage());
        assertFalse("iSOVException.treated", iSOVException.treated);
        assertNull("iSOVException.getNested()", iSOVException.getNested());
View Full Code Here

Examples of org.jpos.iso.ISOComponent

    public int unpack ( ISOComponent m, byte[] b ) throws ISOException {
        LogEvent evt = new LogEvent ( this, "unpack" );
        int consumed = 0;
        for ( int i=0; consumed < b.length ; i++ ) {
            ISOComponent c = fld[i].createComponent( i );
            consumed += fld[i].unpack ( c, b, consumed );
            if ( logger != null )       {
                evt.addMessage ("<unpack fld=\"" + i
                                +"\" packager=\""
                                +fld[i].getClass().getName()+ "\">");
                evt.addMessage ("  <value>"
                                +c.getValue().toString()
                                + "</value>");
                evt.addMessage ("</unpack>");
            }
            m.set(c);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.