Package org.jpos.iso

Examples of org.jpos.iso.ISOField


        ((ISOTaggedField) c).setTag(tagField.getValue().toString());
        return consumed;
    }

    protected void unpackTag(ISOComponent c, InputStream in) throws ISOException, IOException {
        ISOField tagField = new ISOField((Integer) c.getKey());
        getTagPackager().unpack(tagField, in);
        ((ISOTaggedField) c).setTag(tagField.getValue().toString());
    }
View Full Code Here


    protected ISOFieldPackager getTagPackager() {
        return tagPackager;
    }

    protected byte[] packTag(ISOComponent c) throws ISOException {
        return getTagPackager().pack(new ISOField((Integer) c.getKey(), ((ISOTaggedField) c).getTag()));
    }
View Full Code Here

    protected byte[] packTag(ISOComponent c) throws ISOException {
        return getTagPackager().pack(new ISOField((Integer) c.getKey(), ((ISOTaggedField) c).getTag()));
    }

    protected int unpackTag(ISOComponent c, byte[] tagBytes, int offset) throws ISOException {
        ISOField tagField = new ISOField((Integer) c.getKey());
        int consumed = getTagPackager().unpack(tagField, tagBytes, offset);
        ((ISOTaggedField) c).setTag(tagField.getValue().toString());
        return consumed;
    }
View Full Code Here

        ((ISOTaggedField) c).setTag(tagField.getValue().toString());
        return consumed;
    }

    protected void unpackTag(ISOComponent c, InputStream in) throws ISOException, IOException {
        ISOField tagField = new ISOField((Integer) c.getKey());
        getTagPackager().unpack(tagField, in);
        ((ISOTaggedField) c).setTag(tagField.getValue().toString());
    }
View Full Code Here

            if (subFieldId == 0 && !((fld[subFieldId] instanceof TaggedFieldPackager))) {
                subFieldId = 1;
            }

            while (consumed < b.length) {
                ISOField tagField = new ISOField(subFieldId);
                tagPackager.unpack(tagField, b, consumed);
                String tag = tagField.getValue().toString();
                ISOFieldPackager fieldPackager = (ISOFieldPackager) packagerMap.get(tag);
                if (fieldPackager == null) {
                    fieldPackager = (ISOFieldPackager) packagerMap.get("default");
                }
                if (fieldPackager == null) {
View Full Code Here

    }
   
    public void testDoDeepCopyOfISOBinaryField() throws Exception {
        String fieldContent = "firstField";

        ISOField fieldWhichWillBeModified = new ISOField(8, fieldContent);
        ISOField fieldWhoseValueShouldNotChange = copier.doDeepCopy(fieldWhichWillBeModified);

        String updatedFieldContent = fieldContent + "a";
        fieldWhichWillBeModified.setFieldNumber(7);
        fieldWhichWillBeModified.setValue(updatedFieldContent);
       
        assertNotNull(fieldWhichWillBeModified);
        assertNotNull(fieldWhoseValueShouldNotChange);
        assertNotSame(fieldWhichWillBeModified, fieldWhoseValueShouldNotChange);
        assertEquals(updatedFieldContent, fieldWhichWillBeModified.getValue());
        assertEquals(fieldContent, fieldWhoseValueShouldNotChange.getValue());
        ISOComponentEqualityTester.assertNotEquals(fieldWhichWillBeModified, fieldWhoseValueShouldNotChange);
    }
View Full Code Here

* $Author: nsmith $
*/
class ISOFieldDeepCopier {

    public ISOField doDeepCopy(ISOField field) {
        return new ISOField(((Integer) field.getKey()).intValue(), (String) field.getValue());
    }
View Full Code Here

    @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

    @SuppressWarnings("unchecked")
    @Test
    public void testGetVErrors7() throws Throwable {
        VErrorParser vErrorParser = new VErrorParser();
        Vector result = vErrorParser.getVErrors(new ISOVField(new ISOField(100)));
        assertEquals("result.size()", 0, result.size());
    }
View Full Code Here

    }

    @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) {
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.