Examples of ISOBinaryField


Examples of org.jpos.iso.ISOBinaryField

            for (TagValue tagValue : tagValueList) {
                Object value = tagValue.getValue();
                if (value != null) {
                    ISOComponent subField;
                    if (value instanceof byte[]) {
                        subField = new ISOBinaryField(fieldNumber + maxField + 1, (byte[]) value);
                    } else if (value instanceof String) {
                        subField = new ISOField(fieldNumber + maxField + 1, (String) value);
                    } else if (value instanceof TagSequence) {
                        TagSequence subSequence = (TagSequence) tagValue;
                        subField = new ISOMsg(fieldNumber + maxField + 1);
View Full Code Here

Examples of org.jpos.iso.ISOBinaryField

                unpackedValue = asciiInterpreter.uninterpret(tlvData, 0, uninterpretLength);
                value = new ISOField(subFieldNumber, unpackedValue);
                break;
            case BINARY:
            case PROPRIETARY:
                value = new ISOBinaryField(subFieldNumber, tlvData);
                break;
            case CONSTRUCTED:
                value = new ISOMsg(subFieldNumber);
                unpack(value, tlvData, true);
                break;
View Full Code Here

Examples of org.jpos.iso.ISOBinaryField

   
    public void testDoDeepCopyOfISOBinaryFieldWhenArrayContentChanges() throws Exception {
        byte[] fieldContentToBeUpdated = new byte[] {0x12, 0x34, 0x56, 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0};
        byte[] originalFieldContent = ArrayUtils.clone(fieldContentToBeUpdated);
       
        ISOBinaryField fieldWhichWillBeModified = new ISOBinaryField(42, fieldContentToBeUpdated);
        ISOBinaryField fieldWhoseValueShouldNotChange = (ISOBinaryField) copier.doDeepCopy(fieldWhichWillBeModified);
       
        fieldContentToBeUpdated[5] = 0x00;
        fieldWhichWillBeModified.setFieldNumber(41);
       
        assertNotNull(fieldWhichWillBeModified);
        assertNotNull(fieldWhoseValueShouldNotChange);
        assertNotSame(fieldWhichWillBeModified, fieldWhoseValueShouldNotChange);
        assertTrue(Arrays.equals(originalFieldContent, (byte[]) fieldWhoseValueShouldNotChange.getValue()));
        assertTrue(Arrays.equals(fieldContentToBeUpdated, (byte[]) fieldWhichWillBeModified.getValue()));
        ISOBinaryFieldEqualityTester.assertNotEquals(fieldWhichWillBeModified, fieldWhoseValueShouldNotChange);
    }
View Full Code Here

Examples of org.jpos.iso.ISOBinaryField

   
    public void testDoDeepCopyOfISOBinaryFieldWhenFieldContentChanges() throws Exception {
        byte[] originalFieldContent = new byte[] {0x12, 0x34, 0x56, 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0};
        byte[] newFieldContent = new byte[] {0x11, 0x33, 0x55, 0x77, (byte) 0x99, (byte) 0xBB, (byte) 0xDD, (byte) 0xFF};
       
        ISOBinaryField fieldWhichWillBeModified = new ISOBinaryField(42, originalFieldContent);
        ISOBinaryField fieldWhoseValueShouldNotChange = (ISOBinaryField) copier.doDeepCopy(fieldWhichWillBeModified);
       
        fieldWhichWillBeModified.setValue(newFieldContent);
        fieldWhichWillBeModified.setFieldNumber(41);
       
        assertNotNull(fieldWhichWillBeModified);
        assertNotNull(fieldWhoseValueShouldNotChange);
        assertNotSame(fieldWhichWillBeModified, fieldWhoseValueShouldNotChange);
        assertTrue(Arrays.equals(originalFieldContent, (byte[]) fieldWhoseValueShouldNotChange.getValue()));
        assertTrue(Arrays.equals(newFieldContent, (byte[]) fieldWhichWillBeModified.getValue()));
        ISOBinaryFieldEqualityTester.assertNotEquals(fieldWhichWillBeModified, fieldWhoseValueShouldNotChange);
    }
View Full Code Here

Examples of org.jpos.iso.ISOBinaryField

    ISOBinaryFieldDeepCopier() {
    }
   
    public ISOBinaryField doDeepCopy(ISOBinaryField field) {
        return new ISOBinaryField(((Integer) field.getKey()).intValue(), ArrayUtils.clone((byte[]) field.getValue()));
    }
View Full Code Here

Examples of org.jpos.iso.ISOBinaryField

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

Examples of org.jpos.iso.ISOBinaryField

    }

    @Test
    public void testPackThrowsNullPointerException() throws Throwable {
        try {
            new Base1_BITMAP126(100, "testBase1_BITMAP126Description").pack(new ISOBinaryField());
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
        }
    }
View Full Code Here

Examples of org.jpos.iso.ISOBinaryField

    }

    @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.ISOBinaryField

    }

    @Test
    public void testValidateThrowsISOException() throws Throwable {
        try {
            new MSGTEST(true).validate(new ISOBinaryField());
            fail("Expected ISOException to be thrown");
        } catch (ISOException ex) {
            assertEquals("ex.getMessage()", "Can't call validate on non Composite", ex.getMessage());
            assertNull("ex.getNested()", ex.getNested());
        }
View Full Code Here

Examples of org.jpos.iso.ISOBinaryField

    }

    @Test
    public void testPackThrowsISOException1() throws Throwable {
        try {
            new CTCSubFieldPackager().pack(new ISOBinaryField(100));
            fail("Expected ISOException to be thrown");
        } catch (ISOException ex) {
            assertEquals("ex.getMessage()", "null: null", ex.getMessage());
            assertNull("ex.getNested().getMessage()", ex.getNested().getMessage());
        }
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.